diff --git a/luci/mihomo-kit.js b/luci/mihomo-kit.js index ded5318..d5822aa 100644 --- a/luci/mihomo-kit.js +++ b/luci/mihomo-kit.js @@ -216,6 +216,11 @@ return view.extend({ row('nikki', st.running ? [ 'работает — ', E('a', { 'href': dash, 'target': '_blank', 'rel': 'noreferrer' }, 'открыть дашборд') ] : 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('Профиль', [ select, ' ', this.button('Включить', 'apply', 'use', function() { return select.value; }) ]) diff --git a/luci/rpcd.sh b/luci/rpcd.sh index 0c2e05c..8b11f21 100644 --- a/luci/rpcd.sh +++ b/luci/rpcd.sh @@ -70,6 +70,9 @@ m_status() { 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_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)" # phone config (MOBILE=1): /mihomo-kit/.yaml served by uhttpd mob=$(ls /www/mihomo-kit/*.yaml 2>/dev/null | head -n 1)