mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-13 20:08:05 +08:00
🍓 Sync 2026-11-12 02:30:31
This commit is contained in:
1 parent
2bb7c60602
commit
3af4c76cd6
25 files changed
+59
-2628
No files matched your search
@@ -2,7 +2,6 @@
|
||||
'use strict';
|
||||
'require form';
|
||||
'require uci';
|
||||
'require ui';
|
||||
'require view';
|
||||
|
||||
return view.extend({
|
||||
@@ -147,22 +146,5 @@ return view.extend({
|
||||
o.description = _('Maximum open file descriptors. 16384 is plenty for a home router and bounds a connection flood.');
|
||||
|
||||
return m.render();
|
||||
},
|
||||
|
||||
handleSaveApply: function (ev, mode) {
|
||||
/*
|
||||
* Applying the UCI delta emits a config.change event; the init
|
||||
* script's procd reload trigger restarts the service with the new
|
||||
* values. Restarting here as well would stop and start it twice.
|
||||
*/
|
||||
return this.handleSave(ev).then(function () {
|
||||
return uci.apply();
|
||||
}).then(function () {
|
||||
ui.addNotification(null, E('p', {},
|
||||
_('Settings applied. The service is restarting.')), 'info');
|
||||
}).catch(function (err) {
|
||||
ui.addNotification(null, E('p', {},
|
||||
_('The configuration was not applied: %s').format(err)), 'danger');
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
var LOG_PATH = '/var/log/v2raya/v2raya.log';
|
||||
var MAX_LINES = 500;
|
||||
var POLL_INTERVAL = 5;
|
||||
|
||||
return view.extend({
|
||||
render: function () {
|
||||
@@ -56,13 +57,13 @@ return view.extend({
|
||||
});
|
||||
|
||||
refresh();
|
||||
poll.add(refresh, 5);
|
||||
poll.add(refresh, POLL_INTERVAL);
|
||||
|
||||
return E('div', { class: 'cbi-map' }, [
|
||||
E('h2', {}, _('v2rayA log')),
|
||||
E('div', { class: 'cbi-map-descr' },
|
||||
_('Showing the last %d lines of %s. Refreshes every %d seconds.')
|
||||
.format(MAX_LINES, LOG_PATH, L.env.pollinterval || 5)),
|
||||
.format(MAX_LINES, LOG_PATH, POLL_INTERVAL)),
|
||||
E('div', { class: 'cbi-section' }, [
|
||||
logEl,
|
||||
E('div', { style: 'margin-top:8px' }, [ refreshBtn, ' ', clearBtn ])
|
||||
|
||||
@@ -126,14 +126,10 @@ function startService(button) {
|
||||
uci.set('v2raya', 'config', 'enabled', '1');
|
||||
|
||||
return L.resolveDefault(uci.save(), null).then(function () {
|
||||
return runAction('start', button);
|
||||
}).then(function () {
|
||||
/*
|
||||
* Persist enabled=1 so the service also starts after a reboot.
|
||||
* The resulting config.change event may cause one more restart;
|
||||
* that is expected after an apply and the page polls the state.
|
||||
*/
|
||||
/* Commit before starting: the init script reads enabled from UCI. */
|
||||
return L.resolveDefault(uci.apply(), null);
|
||||
}).then(function () {
|
||||
return runAction('start', button);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -231,7 +227,7 @@ return view.extend({
|
||||
return E('div', { class: 'cbi-map' }, [
|
||||
E('h2', {}, _('v2rayA')),
|
||||
E('div', { class: 'cbi-map-descr' }, [
|
||||
_('A web client for its own Xray-based core, with transparent proxy support.'),
|
||||
_('A web client for its bundled v2raya_core, with transparent proxy support.'),
|
||||
' ',
|
||||
E('a', { href: weburl, target: '_blank', rel: 'noreferrer noopener' }, weburl)
|
||||
]),
|
||||
|
||||
Reference in new issue
Block a user