Remove Lua dependency from LuCI integration
This commit is contained in:
1 parent
bdd16d3c22
commit
d049e272ec
9 files changed
+338
-236
No files matched your search
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
'require view';
|
||||
'require fs';
|
||||
'require ui';
|
||||
|
||||
return view.extend({
|
||||
load: function() {
|
||||
return fs.read('/etc/owrt-full-backup/web.key').catch(function() {
|
||||
return '';
|
||||
});
|
||||
},
|
||||
|
||||
render: function(key) {
|
||||
key = (key || '').trim();
|
||||
|
||||
if (!key) {
|
||||
return E('div', { 'class': 'cbi-map' }, [
|
||||
E('h2', {}, _('OpenWrt Full Backup')),
|
||||
E('div', { 'class': 'alert-message warning' }, [
|
||||
_('Веб-ключ не найден. Переустанови модуль командой install.sh.')
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
var url = '/cgi-bin/owrt-full-backup?key=' + encodeURIComponent(key);
|
||||
|
||||
window.setTimeout(function() {
|
||||
window.location.replace(url);
|
||||
}, 100);
|
||||
|
||||
return E('div', { 'class': 'cbi-map' }, [
|
||||
E('h2', {}, _('OpenWrt Full Backup')),
|
||||
E('p', {}, _('Открываю веб-панель полного бэкапа...')),
|
||||
E('p', {}, [
|
||||
E('a', { 'class': 'btn cbi-button cbi-button-apply', 'href': url }, _('Открыть панель'))
|
||||
])
|
||||
]);
|
||||
},
|
||||
|
||||
handleSaveApply: null,
|
||||
handleSave: null,
|
||||
handleReset: null
|
||||
});
|
||||
Reference in new issue
Block a user