💄 Updating the UI and style files.

This commit is contained in:
WispX
2020-03-18 22:20:30 +08:00
parent 544149637f
commit 8ee4598a9c
5 changed files with 6 additions and 52 deletions
+1 -37
View File
@@ -24,47 +24,11 @@ class Initialize
$banIp = $this->getConfig('ban_ip');
if ($banIp) {
$ips = explode(',', str_replace('', ',', $banIp));
if ($this->banIp($request->ip(), $ips)) {
if (in_array($request->ip(), $ips)) {
throw new HttpResponseException(Response::code(403));
}
}
return $next($request);
}
/**
* 拦截某个IP, 支持通配符
*
* @param string $ip
* @param array $ips
* @return bool
*/
private function banIp(string $ip, array $ips)
{
$parts = explode('.', $ip); // 分段当前 IP
$ban = false;
foreach ($ips as $item) {
// 如果直接匹配到
if ($item === $ip) {
$ban = true;
continue;
}
if (strpos($item, '*') !== false) {
$array = explode('.', $item);
$check = true;
for ($i = 0; $i < count($array); $i++) {
if ($array[$i] !== '*' && $array[$i] !== $parts[$i]) {
$check = false;
break;
}
}
if ($check) {
$ban = true;
break;
}
}
}
return $ban;
}
}
@@ -176,6 +176,10 @@ class System extends Base
Db::rollback();
$upgrade->rmdir($upgrade->getWorkspace());
$this->error($e->getMessage());
} catch (\HttpException $e) {
Db::rollback();
$upgrade->rmdir($upgrade->getWorkspace());
$this->error($e->getMessage());
} catch (\Throwable $e) {
Db::rollback();
$upgrade->rmdir($upgrade->getWorkspace());
-7
View File
@@ -587,13 +587,6 @@ body.mdui-theme-layout-dark .markdown-body .highlight pre,
body.mdui-theme-layout-dark .markdown-body pre {
background-color: #585858;
}
body.mdui-theme-layout-dark .markdown-body .highlight pre code,
body.mdui-theme-layout-dark .markdown-body pre code {
color: #ececec;
}
body.mdui-theme-layout-dark .markdown-body p code {
background-color: rgba(255, 255, 255, 0.13);
}
body.mdui-theme-layout-dark .markdown-body table tr {
background-color: #4c4c4c;
}
File diff suppressed because one or more lines are too long
-7
View File
@@ -700,13 +700,6 @@ body.mdui-theme-layout-dark {
.highlight pre, pre {
background-color: #585858;
code {
color: #ececec;
}
}
p code {
background-color: rgba(255, 255, 255, 0.13);
}
table {