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
Branches
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()){ ...@@ -108,13 +108,20 @@ if (!$oR->isEnabled()){
$sTable=''; $sTable='';
foreach($aHosts as $sHost => $aCfg){ 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'].'">' $sTdFirst='<tr class="cfgtype-'.$aCfg['type'].'">'
.'<td>' .'<td>'
.'<span style="display: none">'.$sHost.'</span>' .'<span style="display: none">'.$sHost.'</span>'
.$aIco['type_'.$aCfg['type']] .$aIco['type_'.$aCfg['type']] . " $sHost"
.' <a href="?url=http://'.$sHost.'/' .'<span style="float: right;">'
.($aCfg['ip']===$sMyIp ? '?debugredirect=1' : '' ) .' <a href="?url=http'.$sUrlpart.'" title="click to test http://'.$sHost.'/" onclick="showInOverlay(this); return false;">http</a> '
.'" title="click to test http://'.$sHost.'/" onclick="showInOverlay(this); return false;">'.$sHost.'</a></td>' .($bHttpOnly ? '' : '<a href="?url=https'.$sUrlpart.'" title="click to test https://'.$sHost.'/" onclick="showInOverlay(this); return false;">https</a>')
.'</span>'
.'</td>'
.'<td>' .'<td>'
.($aCfg['ip'] .($aCfg['ip']
? ($aCfg['ip']===$sMyIp ? ($aCfg['ip']===$sMyIp
...@@ -144,9 +151,13 @@ if (!$oR->isEnabled()){ ...@@ -144,9 +151,13 @@ if (!$oR->isEnabled()){
$sTable.=$sTdFirst $sTable.=$sTdFirst
.'<td class="type-'.$sType.'">'.$sType.'</td>' .'<td class="type-'.$sType.'">'.$sType.'</td>'
.'<td class="type-'.$sType.'">' .'<td class="type-'.$sType.'">'
. $sFrom
.($sType == 'direct' .($sType == 'direct'
? '<a href="?url=http://'.$sHost.$sFrom.'" title="click to test http://'.$sHost.'/'.$sFrom.'" onclick="showInOverlay(this); return false;">'.$sFrom.'</a>' ? '<span style="float: right;">'
: $sFrom . '<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>'
.'<td class="http-'.$aTo['code'].'">'.$aTo['code'].'</td>' .'<td class="http-'.$aTo['code'].'">'.$aTo['code'].'</td>'
...@@ -245,12 +256,12 @@ if (!$oR->isEnabled()){ ...@@ -245,12 +256,12 @@ if (!$oR->isEnabled()){
; ;
$sErrors = $sErrors $sErrors = $sErrors
? '<h2>'.$aIco['h2_err'].' Found errors</h2>' ? '<!-- <h2>'.$aIco['h2_err'].' Found errors</h2> -->'
.'<div class="content">' // .'<div class="content">'
.'<ol class="error">' .'<ol class="error">'
.$sErrors .$sErrors
.'</ol>' .'</ol>'
.'</div>' // .'</div>'
: '' : ''
; ;
...@@ -270,7 +281,7 @@ if (!$oR->isEnabled()){ ...@@ -270,7 +281,7 @@ if (!$oR->isEnabled()){
<link rel="stylesheet" href="main.css"> <link rel="stylesheet" href="main.css">
</head> </head>
<body> <body>
<h1><?php echo $aIco['h1']?> <a href="?">Redirects :: admin</a></h1> <h1><a href="?"> Redirects :: admin</a></h1>
<?php echo $sErrors . $sHtml; ?> <?php echo $sErrors . $sHtml; ?>
<div id="divoverlay" class="overlay" onclick="this.style.display='none';"></div> <div id="divoverlay" class="overlay" onclick="this.style.display='none';"></div>
......
a{color:royalblue;} 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;} body {
h1 a{color:#234; text-decoration: none;} background: linear-gradient(-10deg, #ddd, #fff, #ddd, #e5e5e5) fixed;
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;} 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%} 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);} 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, ...@@ -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;} tr:hover{background: #f4f0f8 !important;}
footer{background:rgba(0,0,0,0.03); margin-top: 4em; text-align: right;padding: 1em;} footer{background:rgba(0,0,0,0.03); margin-top: 4em; text-align: right;padding: 1em;}
.content{margin: 0 1em;} .content{margin: 0 1em; background: #fff; margin: 0 3em; padding: 1em;}
.legend{background: #fff; padding: 1em;} .legend{background: none; border: 1px dashed; padding: 1em;}
.error{background: #fcc; padding: 0.2em 1.5em;} .error{background: #fbb; padding: 0.2em 1.5em;}
.warning{color:#651; background:#fec; padding: 0.2em 1em;} .warning{color:#651; background:#fec; padding: 0.2em 1em;}
.cfgtype-alias{color:#89a;} .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