mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-26 20:52:52 +08:00
Create vantage.patch
This commit is contained in:
1 parent
9dadc67f8b
commit
cd02438797
1 file changed
+73
@@ -0,0 +1,73 @@
|
||||
--- a/luci-theme-vantage/ucode/template/themes/vantage/header.ut
|
||||
+++ b/luci-theme-vantage/ucode/template/themes/vantage/header.ut
|
||||
--- a/luci-theme-vantage/ucode/template/themes/vantage/header.ut
|
||||
+++ b/luci-theme-vantage/ucode/template/themes/vantage/header.ut
|
||||
@@ -12,6 +12,8 @@
|
||||
const authed = !!ctx.authsession;
|
||||
const page_title = (authed && dispatched?.title) ? striptags(_(dispatched.title)) : 'LuCI';
|
||||
const lang = entityencode(dispatcher.lang ?? 'en', true);
|
||||
+ const boardinfo = ubus.call("system", "board");
|
||||
+ const hostname = striptags(boardinfo?.hostname ?? '?');
|
||||
-%}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ lang }}" data-darkmode="true">
|
||||
@@ -22,8 +24,8 @@
|
||||
<title>{{ entityencode(page_title, true) }} · LuCI</title>
|
||||
<script>
|
||||
(function (r) {
|
||||
- var p = 'auto', rail = '';
|
||||
- try { p = localStorage.getItem('vantage.theme') || 'auto'; rail = localStorage.getItem('vantage.rail') || ''; } catch (e) {}
|
||||
+ var p = 'auto', rail = 'pinned';
|
||||
+ try { p = localStorage.getItem('vantage.theme') || 'auto'; rail = localStorage.getItem('vantage.rail') || 'pinned'; } catch (e) {}
|
||||
var dark = (p === 'dark') || (p !== 'light' && !!(window.matchMedia && matchMedia('(prefers-color-scheme: dark)').matches));
|
||||
r.setAttribute('data-darkmode', dark ? 'true' : 'false');
|
||||
r.setAttribute('data-theme', p);
|
||||
@@ -46,8 +48,15 @@
|
||||
{% if (authed): %}
|
||||
<nav class="vt-rail" id="vt-rail" aria-label="{{ entityencode(_('Main navigation'), true) }}">
|
||||
<a class="vt-brand" href="{{ dispatcher.build_url('admin') }}" aria-label="{{ entityencode(_('Home'), true) }}">
|
||||
- <svg viewBox="0 0 32 32" width="32" height="32" aria-hidden="true"><rect x="1" y="1" width="30" height="30" rx="7" class="vt-brand-tile"/><path d="M9 10.5 16 22" class="vt-brand-l"/><path d="M16 22 23 10.5" class="vt-brand-r"/><circle cx="23" cy="10.5" r="1.9" class="vt-brand-dot"/></svg>
|
||||
- <span class="vt-brand-word">Vantage</span>
|
||||
+ <svg viewBox="0 0 32 32" width="32" height="32" aria-hidden="true">
|
||||
+ <rect x="1" y="1" width="30" height="30" rx="7" class="vt-brand-tile"></rect>
|
||||
+ <path d="M10 10.5 10 21.5" class="vt-brand-l"></path>
|
||||
+ <path d="M10 16 21.5 10.5" class="vt-brand-r"></path>
|
||||
+ <path d="M10 16 21.5 21.5" class="vt-brand-r"></path>
|
||||
+ <circle cx="21.5" cy="10.5" r="1.9" class="vt-brand-dot"></circle>
|
||||
+ <circle cx="21.5" cy="21.5" r="1.9" class="vt-brand-dot"></circle>
|
||||
+ </svg>
|
||||
+ <span class="vt-brand-word">{{ hostname }}</span>
|
||||
</a>
|
||||
<ul class="vt-rail-list" id="vt-rail-list"></ul>
|
||||
<div class="vt-rail-foot">
|
||||
|
||||
--- a/luci-theme-vantage/ucode/template/themes/vantage/sysauth.ut
|
||||
+++ b/luci-theme-vantage/ucode/template/themes/vantage/sysauth.ut
|
||||
@@ -12,6 +12,8 @@
|
||||
if (type(tls) == 'string')
|
||||
tls = split(tls, /\s+/);
|
||||
const tls_ports = uniq(filter(map(tls, e => +(match(e, /\d+$/)?.[0] ?? 0)), p => (p > 0 && p <= 65535)));
|
||||
+ const boardinfo = ubus.call("system", "board");
|
||||
+ const hostname = striptags(boardinfo?.hostname ?? '?');
|
||||
-%}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ entityencode(dispatcher.lang ?? 'en', true) }}" data-darkmode="true">
|
||||
@@ -37,9 +39,16 @@
|
||||
<main class="vt-login">
|
||||
<div class="vt-login-card">
|
||||
<div class="vt-login-head">
|
||||
- <svg class="vt-login-mark" viewBox="0 0 32 32" width="44" height="44" aria-hidden="true"><rect x="1" y="1" width="30" height="30" rx="7" class="vt-brand-tile"/><path d="M9 10.5 16 22" class="vt-brand-l"/><path d="M16 22 23 10.5" class="vt-brand-r"/><circle cx="23" cy="10.5" r="1.9" class="vt-brand-dot"/></svg>
|
||||
+ <svg class="vt-login-mark" viewBox="0 0 32 32" width="44" height="44" aria-hidden="true">
|
||||
+ <rect x="1" y="1" width="30" height="30" rx="7" class="vt-brand-tile"></rect>
|
||||
+ <path d="M10 10.5 10 21.5" class="vt-brand-l"></path>
|
||||
+ <path d="M10 16 21.5 10.5" class="vt-brand-r"></path>
|
||||
+ <path d="M10 16 21.5 21.5" class="vt-brand-r"></path>
|
||||
+ <circle cx="21.5" cy="10.5" r="1.9" class="vt-brand-dot"></circle>
|
||||
+ <circle cx="21.5" cy="21.5" r="1.9" class="vt-brand-dot"></circle>
|
||||
+ </svg>
|
||||
<div>
|
||||
- <h1 class="vt-login-title">Vantage</h1>
|
||||
+ <h1 class="vt-login-title">{{ hostname }}</h1>
|
||||
<p class="vt-login-sub"><span class="vt-live-dot" aria-hidden="true"></span>{{ entityencode(_('Authorization Required'), true) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user