From 854e03fb1459f0c6534bc483e5f7de388d057fcc Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 7 Nov 2026 23:48:55 +0800 Subject: [PATCH] Added update button to main page --- luci/mihomo-kit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/luci/mihomo-kit.js b/luci/mihomo-kit.js index ec527c0..cc1c6bc 100644 --- a/luci/mihomo-kit.js +++ b/luci/mihomo-kit.js @@ -225,6 +225,8 @@ return view.extend({ select.value = st.profile; // mihomo serves its external-ui at /ui; metacubexd/zashboard take the API from the query var updState = E('em', 'проверяю обновления…'); + // shown only next to "есть обновление"; the same command as on «Система» + var updBtn = this.button('Обновить', 'apply', 'update', null, 'Скачать свежий kit и пересобрать профили?'); callUpdateCheck().then(function(u) { if (u.error) return dom.content(updState, '— не удалось проверить обновления: ' + u.error); @@ -232,7 +234,7 @@ return view.extend({ if (u.installed && u.installed.indexOf(u.latest) == 0) return dom.content(updState, '— актуальная'); dom.content(updState, [ '— ', E('strong', 'есть обновление: '), link(u.commit, u.latest), ' ' + (u.message || '') ] - .concat(u.compare ? [ ' (', link(u.compare, 'что изменилось'), ')' ] : [])); + .concat(u.compare ? [ ' (', link(u.compare, 'что изменилось'), ')' ] : []).concat([ ' ', updBtn ])); }).catch(function(e) { dom.content(updState, '— не удалось проверить обновления: ' + e); }); var host = window.location.hostname; var dash = 'http://' + host + ':' + st.api_port + '/ui/?hostname=' + encodeURIComponent(host) +