Added core version display

This commit is contained in:
Sam Latsin 2026-10-11 02:33:14 +03:00
parent 9034c13b41
commit 8e5223f386
2 changed files with 8 additions and 0 deletions

View File

@ -216,6 +216,11 @@ return view.extend({
row('nikki', st.running ? [ 'работает — ', row('nikki', st.running ? [ 'работает — ',
E('a', { 'href': dash, 'target': '_blank', 'rel': 'noreferrer' }, 'открыть дашборд') ] E('a', { 'href': dash, 'target': '_blank', 'rel': 'noreferrer' }, 'открыть дашборд') ]
: E('strong', 'остановлен')), : E('strong', 'остановлен')),
row('Ядро mihomo', [ st.core_version || 'не найдено',
/-ts\d+$/.test(st.core_version || '') ? ' — сборка kit с правкой для Tailscale' : '',
st.core_wanted && st.core_version != st.core_wanted
? [ ' — ', E('strong', { 'style': 'color:#c00' }, 'kit ждёт ' + st.core_wanted), ': нажми «Починить» в «Обслуживании»' ]
: '' ]),
row('Версия kit', [ st.kit_version || 'неизвестна (появится после «Обновить kit»)', ' ', updState ]), row('Версия kit', [ st.kit_version || 'неизвестна (появится после «Обновить kit»)', ' ', updState ]),
row('Профиль', [ select, ' ', row('Профиль', [ select, ' ',
this.button('Включить', 'apply', 'use', function() { return select.value; }) ]) this.button('Включить', 'apply', 'use', function() { return select.value; }) ])

View File

@ -70,6 +70,9 @@ m_status() {
json_add_boolean tailscale "$(b test "$(envval TAILSCALE "$prof")" = 1)" json_add_boolean tailscale "$(b test "$(envval TAILSCALE "$prof")" = 1)"
json_add_boolean ts_logged_in "$(b grep -q _current-profile "$NIKKI_DIR/run/tailscale/tailscaled.state")" json_add_boolean ts_logged_in "$(b grep -q _current-profile "$NIKKI_DIR/run/tailscale/tailscaled.state")"
json_add_string kit_version "$(cat "$NIKKI_DIR/kit/VERSION" 2>/dev/null)" json_add_string kit_version "$(cat "$NIKKI_DIR/kit/VERSION" 2>/dev/null)"
# installed core vs the one the kit pins (MIHOMO_VERSION default in mihomo-kit.sh)
json_add_string core_version "$(mihomo -v 2>/dev/null | awk '{print $3; exit}')"
json_add_string core_wanted "$(sed -n 's/^: "${MIHOMO_VERSION:=\(.*\)}"$/\1/p' "$NIKKI_DIR/kit/router/mihomo-kit.sh" 2>/dev/null)"
json_add_boolean auto_update "$(b grep -q 'mihomo-kit.sh auto-update' /etc/crontabs/root)" json_add_boolean auto_update "$(b grep -q 'mihomo-kit.sh auto-update' /etc/crontabs/root)"
# phone config (MOBILE=1): /mihomo-kit/<token>.yaml served by uhttpd # phone config (MOBILE=1): /mihomo-kit/<token>.yaml served by uhttpd
mob=$(ls /www/mihomo-kit/*.yaml 2>/dev/null | head -n 1) mob=$(ls /www/mihomo-kit/*.yaml 2>/dev/null | head -n 1)