mirror of https://github.com/kenzok8/small.git
update 2025-01-18 00:15:09
This commit is contained in:
parent
09a2824d0a
commit
7d84c46ba7
|
@ -1,6 +1,6 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Copyright (C) 2024 Anya Lin <hukk1996@gmail.com>
|
||||
# Copyright (C) 2024-2025 Anya Lin <hukk1996@gmail.com>
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ return view.extend({
|
|||
|
||||
s = m.section(form.TypedSection);
|
||||
s.render = function () {
|
||||
poll.add(function () {
|
||||
poll.add(function() {
|
||||
return hm.getServiceStatus('mihomo-c').then((isRunning) => {
|
||||
hm.updateStatus(document.getElementById('_client_bar'), isRunning ? { dashboard_repo: dashboard_repo } : false, 'mihomo-c', true);
|
||||
});
|
||||
|
|
|
@ -14,10 +14,10 @@ return view.extend({
|
|||
handleSave(ev) {
|
||||
let value = (document.querySelector('textarea').value || '').trim().replace(/\r\n/g, '\n') + '\n';
|
||||
|
||||
return hm.writeFile('templates', 'hosts.yaml', value).then(function(rc) {
|
||||
return hm.writeFile('templates', 'hosts.yaml', value).then((rc) => {
|
||||
document.querySelector('textarea').value = value;
|
||||
ui.addNotification(null, E('p', _('Contents have been saved.')), 'info');
|
||||
}).catch(function(e) {
|
||||
}).catch((e) => {
|
||||
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e)));
|
||||
});
|
||||
},
|
||||
|
|
|
@ -42,13 +42,13 @@ function getRuntimeLog(name, filename) {
|
|||
let log;
|
||||
poll.add(L.bind(function() {
|
||||
return fs.read_direct(String.format('%s/%s.log', hm_dir, filename), 'text')
|
||||
.then(function(res) {
|
||||
.then((res) => {
|
||||
log = E('pre', { 'wrap': 'pre' }, [
|
||||
res.trim() || _('Log is empty.')
|
||||
]);
|
||||
|
||||
dom.content(log_textarea, log);
|
||||
}).catch(function(err) {
|
||||
}).catch((err) => {
|
||||
if (err.toString().includes('NotFoundError'))
|
||||
log = E('pre', { 'wrap': 'pre' }, [
|
||||
_('Log file does not exist.')
|
||||
|
|
|
@ -162,7 +162,7 @@ return view.extend({
|
|||
.then(L.bind(this.map.load, this.map))
|
||||
.then(L.bind(this.map.reset, this.map))
|
||||
.then(L.ui.hideModal)
|
||||
.catch(function() {});
|
||||
.catch(() => {});
|
||||
} else {
|
||||
return ui.hideModal();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ return view.extend({
|
|||
|
||||
s = m.section(form.TypedSection);
|
||||
s.render = function () {
|
||||
poll.add(function () {
|
||||
poll.add(function() {
|
||||
return hm.getServiceStatus('mihomo-s').then((isRunning) => {
|
||||
hm.updateStatus(document.getElementById('_server_bar'), isRunning ? { dashboard_repo: dashboard_repo } : false, 'mihomo-s', true);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue