Skip to content
Snippets Groups Projects
Commit bba8be47 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update admin ui (WIP)

parent 063c3278
No related branches found
No related tags found
1 merge request!6OP#7728 Redirect Tool anpassen https://projects.iml.unibe.ch/work_packages/77287728 handle http and https redirects
......@@ -108,13 +108,20 @@ if (!$oR->isEnabled()){
$sTable='';
foreach($aHosts as $sHost => $aCfg){
$bHttpOnly=isset($aCfg['redirects']['httponly']) && $aCfg['redirects']['httponly'];
$sUrlpart='://'.$sHost.'/'
.($aCfg['ip']===$sMyIp ? '?debugredirect=1' : '' )
;
$sTdFirst='<tr class="cfgtype-'.$aCfg['type'].'">'
.'<td>'
.'<span style="display: none">'.$sHost.'</span>'
.$aIco['type_'.$aCfg['type']]
.' <a href="?url=http://'.$sHost.'/'
.($aCfg['ip']===$sMyIp ? '?debugredirect=1' : '' )
.'" title="click to test http://'.$sHost.'/" onclick="showInOverlay(this); return false;">'.$sHost.'</a></td>'
.$aIco['type_'.$aCfg['type']] . " $sHost"
.'<span style="float: right;">'
.' <a href="?url=http'.$sUrlpart.'" title="click to test http://'.$sHost.'/" onclick="showInOverlay(this); return false;">http</a> '
.($bHttpOnly ? '' : '<a href="?url=https'.$sUrlpart.'" title="click to test https://'.$sHost.'/" onclick="showInOverlay(this); return false;">https</a>')
.'</span>'
.'</td>'
.'<td>'
.($aCfg['ip']
? ($aCfg['ip']===$sMyIp
......@@ -144,9 +151,13 @@ if (!$oR->isEnabled()){
$sTable.=$sTdFirst
.'<td class="type-'.$sType.'">'.$sType.'</td>'
.'<td class="type-'.$sType.'">'
. $sFrom
.($sType == 'direct'
? '<a href="?url=http://'.$sHost.$sFrom.'" title="click to test http://'.$sHost.'/'.$sFrom.'" onclick="showInOverlay(this); return false;">'.$sFrom.'</a>'
: $sFrom
? '<span style="float: right;">'
. '<a href="?url=http://'.$sHost.$sFrom.'" title="click to test http://'.$sHost.'/'.$sFrom.'" onclick="showInOverlay(this); return false;">http</a> '
. '<a href="?url=https://'.$sHost.$sFrom.'" title="click to test http://'.$sHost.'/'.$sFrom.'" onclick="showInOverlay(this); return false;">https</a> '
.'</span>'
: ''
)
.'</td>'
.'<td class="http-'.$aTo['code'].'">'.$aTo['code'].'</td>'
......@@ -245,12 +256,12 @@ if (!$oR->isEnabled()){
;
$sErrors = $sErrors
? '<h2>'.$aIco['h2_err'].' Found errors</h2>'
.'<div class="content">'
? '<!-- <h2>'.$aIco['h2_err'].' Found errors</h2> -->'
// .'<div class="content">'
.'<ol class="error">'
.$sErrors
.'</ol>'
.'</div>'
// .'</div>'
: ''
;
......@@ -270,7 +281,7 @@ if (!$oR->isEnabled()){
<link rel="stylesheet" href="main.css">
</head>
<body>
<h1><?php echo $aIco['h1']?> <a href="?">Redirects :: admin</a></h1>
<h1><a href="?"> Redirects :: admin</a></h1>
<?php echo $sErrors . $sHtml; ?>
<div id="divoverlay" class="overlay" onclick="this.style.display='none';"></div>
......
a{color:royalblue;}
body{background: #f8f8f8; color: #234; font-family: arial; margin: 0;}
h1{background:rgba(0,0,0,0.05); margin: 0 0 1em;; padding: 0.5em;}
h1 a{color:#234; text-decoration: none;}
h2{background: #d0e0e8; color:#458; margin: 1em 0 0.5em; border-top: 2px solid #fff; border-left: 5px solid #fff; border-top-left-radius: 0.5em; padding: 0.5em; margin: 0 0 1em;}
body {
background: linear-gradient(-10deg, #ddd, #fff, #ddd, #e5e5e5) fixed;
color: #335;
font-size: 1.2em;
font-family: arial;
margin: 0;
padding: 0;
height: 100%,;
}
h1{margin: 0 0 1em;; padding: 0;}
h1 a{background: linear-gradient(0deg, #000, #234, #222); color: #e55; text-decoration: none;border-bottom: 5px solid #6aa; display: block; padding: 0.5em;}
h2{background: #dee; color:#458; margin: 1em 0 0.5em; border-top: 2px solid #fff; border-left: 5px solid #fff; border-top-left-radius: 0.5em; padding: 0.5em; margin: 0 0 1em;}
h3{color:#ccc; font-size: 250%}
pre{background: rgba(0,0,0,0.02);padding: 0.3em 1em; border: 1px solid rgba(0,0,0,0.1); margin: 2em 0 3em;; border-bottom: 2px solid rgba(0,0,0,0.2);}
......@@ -10,9 +21,9 @@ pre{background: rgba(0,0,0,0.02);padding: 0.3em 1em; border: 1px solid rgba(0,0,
tr:hover{background: #f4f0f8 !important;}
footer{background:rgba(0,0,0,0.03); margin-top: 4em; text-align: right;padding: 1em;}
.content{margin: 0 1em;}
.legend{background: #fff; padding: 1em;}
.error{background: #fcc; padding: 0.2em 1.5em;}
.content{margin: 0 1em; background: #fff; margin: 0 3em; padding: 1em;}
.legend{background: none; border: 1px dashed; padding: 1em;}
.error{background: #fbb; padding: 0.2em 1.5em;}
.warning{color:#651; background:#fec; padding: 0.2em 1em;}
.cfgtype-alias{color:#89a;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment