v46.1-ui-mt76: Argon theme + hardened WG tunnel + Link Health dashboard
基于 v46 正式版(mt76)只恢复 UI 层: - luci-theme-argon 2.4.3: local-background-wins 登录页 + bg1.jpg fallback - luci-app-argon-config: 去 ui.changes.apply, ACL mutator 移 write - luci-app-wgtunnel: rpcd ucode 后端(get/status/prepare/apply/rollback/reconnect), JSONMap 前端, 60s 一次性 token, 快照回滚, 无全局 network ACL - luci-app-tr3000-status: 只读 rpcd ucode + 5s 轮询仪表盘 - tools/: audit_ui_packages.py + install_preview.sh + rollback_watchdog.sh - docs/: 开发经历与翻车记录 + 固件哈希记录 固件本体(含烤入 WG 私钥/PSK)不入 git, 仅 K 盘保存. kernel 成员与 v46 byte-identical; 尚未刷机.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI for Argon theme configuration
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:=+luci-theme-argon
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
+219
@@ -0,0 +1,219 @@
|
||||
'use strict';
|
||||
'require form';
|
||||
'require fs';
|
||||
'require rpc';
|
||||
'require uci';
|
||||
'require ui';
|
||||
'require view';
|
||||
|
||||
const callSystemInfo = rpc.declare({
|
||||
object: 'system',
|
||||
method: 'info'
|
||||
});
|
||||
|
||||
const callRemoveArgon = rpc.declare({
|
||||
object: 'luci.argon',
|
||||
method: 'remove',
|
||||
params: ['filename'],
|
||||
expect: { '': {} }
|
||||
});
|
||||
|
||||
const callRenameArgon = rpc.declare({
|
||||
object: 'luci.argon',
|
||||
method: 'rename',
|
||||
params: ['newname'],
|
||||
expect: { '': {} }
|
||||
});
|
||||
|
||||
const bg_path = '/www/luci-static/argon/background/';
|
||||
|
||||
const trans_set = [0, 0.1, 0.2, 0.3, 0.4,
|
||||
0.5, 0.6, 0.7, 0.8, 0.9, 1 ];
|
||||
|
||||
return view.extend({
|
||||
load() {
|
||||
return Promise.all([
|
||||
uci.load('argon'),
|
||||
L.resolveDefault(callSystemInfo(), { root: { avail: 0 } }),
|
||||
L.resolveDefault(fs.list(bg_path), [])
|
||||
]);
|
||||
},
|
||||
|
||||
render(data) {
|
||||
let m, s, o;
|
||||
|
||||
m = new form.Map('argon', _('Argon theme configuration'),
|
||||
_('Here you can set the blur and transparency of the login page of argon theme, and manage the background pictures and videos. Chrome is recommended.'));
|
||||
|
||||
s = m.section(form.TypedSection, 'global', _('Theme configuration'));
|
||||
s.addremove = false;
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(form.ListValue, 'online_wallpaper', _('Wallpaper source'));
|
||||
o.value('none', _('Built-in'));
|
||||
o.value('bing', _('Bing'));
|
||||
o.value('ghser', _('GHSer'));
|
||||
o.value('unsplash', _('Unsplash'));
|
||||
o.value('wallhaven', _('Wallhaven'));
|
||||
o.default = 'bing';
|
||||
o.forcewrite = true;
|
||||
o.rmempty = false;
|
||||
o.cfgvalue = function(section_id) {
|
||||
let value = uci.get(data[0], section_id, 'online_wallpaper') || 'bing';
|
||||
return value.split('_')[0];
|
||||
}
|
||||
o.write = function(section_id, value) {
|
||||
let collection_id = this.section.formvalue(section_id, 'collection_id');
|
||||
if (collection_id && (value === 'unsplash' || value === 'wallhaven')) {
|
||||
value = value + '_' + collection_id;
|
||||
}
|
||||
uci.set(data[0], section_id, 'online_wallpaper', value);
|
||||
}
|
||||
|
||||
o = s.option(form.Value, 'collection_id', _('Collection ID'), _('Collection ID for Unsplash or Wallhaven.'));
|
||||
o.datatype = 'uinteger';
|
||||
o.depends('online_wallpaper', 'unsplash');
|
||||
o.depends('online_wallpaper', 'wallhaven');
|
||||
o.cfgvalue = function(section_id) {
|
||||
let value = uci.get(data[0], section_id, 'online_wallpaper');
|
||||
if (!value || !value.includes('_'))
|
||||
return '';
|
||||
|
||||
return value.split('_')[1];
|
||||
}
|
||||
o.write = function() { };
|
||||
|
||||
o = s.option(form.Value, 'use_api_key', _('API key'), _('Specify API key for Unsplash or Wallhaven.'));
|
||||
o.depends('online_wallpaper', 'unsplash');
|
||||
o.depends('online_wallpaper', 'wallhaven');
|
||||
|
||||
o = s.option(form.Flag, 'use_exact_resolution', _('Use exact resolution'), _('Use exact resolution or at least 1080P for Wallhaven.'));
|
||||
o.default = o.enabled;
|
||||
o.depends('online_wallpaper', 'wallhaven');
|
||||
|
||||
o = s.option(form.ListValue, 'mode', _('Theme mode'));
|
||||
o.value('normal', _('Follow system'));
|
||||
o.value('light', _('Light mode'));
|
||||
o.value('dark', _('Dark mode'));
|
||||
o.default = 'normal';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'primary', _('[Light mode] Primary Color'), _('A HEX color (default: #5e72e4).'))
|
||||
o.default = '#5e72e4';
|
||||
o.rmempty = false;
|
||||
o.validate = function(section_id, value) {
|
||||
if (section_id)
|
||||
return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(value) ||
|
||||
_('Expecting: %s').format(_('valid HEX color value'));
|
||||
return true;
|
||||
}
|
||||
|
||||
o = s.option(form.ListValue, 'transparency', _('[Light mode] Transparency'),
|
||||
_('0 transparent - 1 opaque (suggest: transparent: 0 or translucent preset: 0.5).'));
|
||||
for (let i of trans_set)
|
||||
o.value(i);
|
||||
o.default = '0.5';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'blur', _('[Light mode] Frosted Glass Radius'),
|
||||
_('Larger value will more blurred (suggest: clear: 1 or blur preset: 10).'));
|
||||
o.datatype = 'ufloat';
|
||||
o.default = '10';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'dark_primary', _('[Dark mode] Primary Color'),
|
||||
_('A HEX Color (default: #483d8b).'))
|
||||
o.default = '#483d8b';
|
||||
o.rmempty = false;
|
||||
o.validate = function(section_id, value) {
|
||||
if (section_id)
|
||||
return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(value) ||
|
||||
_('Expecting: %s').format(_('valid HEX color value'));
|
||||
return true;
|
||||
}
|
||||
|
||||
o = s.option(form.ListValue, 'transparency_dark', _('[Dark mode] Transparency'),
|
||||
_('0 transparent - 1 opaque (suggest: black translucent preset: 0.5).'));
|
||||
for (let i of trans_set)
|
||||
o.value(i);
|
||||
o.default = '0.5';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'blur_dark', _('[Dark mode] Frosted Glass Radius'),
|
||||
_('Larger value will more blurred (suggest: clear: 1 or blur preset: 10).'))
|
||||
o.datatype = 'ufloat';
|
||||
o.default = '10';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Button, '_save', _('Save settings'));
|
||||
o.inputstyle = 'apply';
|
||||
o.inputtitle = _('Save current settings');
|
||||
o.onclick = function() {
|
||||
return this.map.save(null, true);
|
||||
}
|
||||
|
||||
s = m.section(form.TypedSection, null, _('Upload background (available space: %1024.2mB)')
|
||||
.format(data[1].root.avail * 1024),
|
||||
_('You can upload files such as gif/jpg/mp4/png/webm/webp files, to change the login page background.'));
|
||||
s.addremove = false;
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(form.Button, '_upload_bg', _('Upload background'),
|
||||
_('Files will be uploaded to <code>%s</code>.').format(bg_path));
|
||||
o.inputstyle = 'action';
|
||||
o.inputtitle = _('Upload...');
|
||||
o.onclick = function(ev, section_id) {
|
||||
let file = '/tmp/argon_background.tmp';
|
||||
return ui.uploadFile(file, ev.target).then(function(res) {
|
||||
return L.resolveDefault(callRenameArgon(res.name), {}).then(function(ret) {
|
||||
if (ret.result === 0)
|
||||
return location.reload();
|
||||
else {
|
||||
ui.addNotification(null, E('p', _('Failed to upload file: %s.').format(res.name)));
|
||||
return L.resolveDefault(fs.remove(file), {});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(function(e) { ui.addNotification(null, E('p', e.message)); });
|
||||
};
|
||||
o.modalonly = true;
|
||||
|
||||
s = m.section(form.TableSection);
|
||||
s.render = function() {
|
||||
let tbl = E('table', { 'class': 'table cbi-section-table' },
|
||||
E('tr', { 'class': 'tr table-titles' }, [
|
||||
E('th', { 'class': 'th' }, [ _('Filename') ]),
|
||||
E('th', { 'class': 'th' }, [ _('Modified date') ]),
|
||||
E('th', { 'class': 'th' }, [ _('Size') ]),
|
||||
E('th', { 'class': 'th' }, [ _('Action') ])
|
||||
])
|
||||
);
|
||||
|
||||
cbi_update_table(tbl, data[2].map(L.bind(function(file) {
|
||||
return [
|
||||
file.name,
|
||||
new Date(file.mtime * 1000).toLocaleString(),
|
||||
String.format('%1024.2mB', file.size),
|
||||
E('button', {
|
||||
'class': 'btn cbi-button cbi-button-remove',
|
||||
'click': ui.createHandlerFn(this, function() {
|
||||
return L.resolveDefault(callRemoveArgon(file.name), {})
|
||||
.then(function() { return location.reload(); });
|
||||
})
|
||||
}, [ _('Delete') ])
|
||||
];
|
||||
}, this)), E('em', _('No files found.')));
|
||||
|
||||
return E('div', { 'class': 'cbi-map', 'id': 'cbi-filelist' }, [
|
||||
E('h3', _('Background file list')),
|
||||
tbl
|
||||
]);
|
||||
};
|
||||
|
||||
return m.render();
|
||||
},
|
||||
|
||||
handleSaveApply: null,
|
||||
handleSave: null,
|
||||
handleReset: null
|
||||
});
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:136
|
||||
msgid "0 transparent - 1 opaque (suggest: black translucent preset: 0.5)."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:112
|
||||
msgid ""
|
||||
"0 transparent - 1 opaque (suggest: transparent: 0 or translucent preset: "
|
||||
"0.5)."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:125
|
||||
msgid "A HEX Color (default: #483d8b)."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:101
|
||||
msgid "A HEX color (default: #5e72e4)."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:86
|
||||
msgid "API key"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:189
|
||||
msgid "Action"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/root/usr/share/luci/menu.d/luci-app-argon-config.json:3
|
||||
msgid "Argon Config"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:45
|
||||
msgid "Argon theme configuration"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:209
|
||||
msgid "Background file list"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:54
|
||||
msgid "Bing"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:53
|
||||
msgid "Built-in"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:73
|
||||
msgid "Collection ID"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:73
|
||||
msgid "Collection ID for Unsplash or Wallhaven."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:97
|
||||
msgid "Dark mode"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:204
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:107
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:131
|
||||
msgid "Expecting: %s"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:173
|
||||
msgid "Failed to upload file: %s."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:186
|
||||
msgid "Filename"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:163
|
||||
msgid "Files will be uploaded to <code>%s</code>."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:95
|
||||
msgid "Follow system"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:55
|
||||
msgid "GHSer"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/root/usr/share/rpcd/acl.d/luci-app-argon-config.json:3
|
||||
msgid "Grant UCI access for luci-app-argon-config"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:46
|
||||
msgid ""
|
||||
"Here you can set the blur and transparency of the login page of argon theme, "
|
||||
"and manage the background pictures and videos. Chrome is recommended."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:119
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:143
|
||||
msgid "Larger value will more blurred (suggest: clear: 1 or blur preset: 10)."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:96
|
||||
msgid "Light mode"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:187
|
||||
msgid "Modified date"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:206
|
||||
msgid "No files found."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:150
|
||||
msgid "Save current settings"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:148
|
||||
msgid "Save settings"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:188
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:86
|
||||
msgid "Specify API key for Unsplash or Wallhaven."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:48
|
||||
msgid "Theme configuration"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:94
|
||||
msgid "Theme mode"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:56
|
||||
msgid "Unsplash"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:162
|
||||
msgid "Upload background"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:156
|
||||
msgid "Upload background (available space: %1024.2mB)"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:165
|
||||
msgid "Upload..."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:90
|
||||
msgid "Use exact resolution"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:90
|
||||
msgid "Use exact resolution or at least 1080P for Wallhaven."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:57
|
||||
msgid "Wallhaven"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:52
|
||||
msgid "Wallpaper source"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:158
|
||||
msgid ""
|
||||
"You can upload files such as gif/jpg/mp4/png/webm/webp files, to change the "
|
||||
"login page background."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:142
|
||||
msgid "[Dark mode] Frosted Glass Radius"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:124
|
||||
msgid "[Dark mode] Primary Color"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:135
|
||||
msgid "[Dark mode] Transparency"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:118
|
||||
msgid "[Light mode] Frosted Glass Radius"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:101
|
||||
msgid "[Light mode] Primary Color"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:111
|
||||
msgid "[Light mode] Transparency"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:107
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:131
|
||||
msgid "valid HEX color value"
|
||||
msgstr ""
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: dingpengyu <jerrykuku@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:136
|
||||
msgid "0 transparent - 1 opaque (suggest: black translucent preset: 0.5)."
|
||||
msgstr "0 最透明 - 1 不透明(建议:黑色半透明 0.5)"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:112
|
||||
msgid ""
|
||||
"0 transparent - 1 opaque (suggest: transparent: 0 or translucent preset: "
|
||||
"0.5)."
|
||||
msgstr "0 最透明 - 1 不透明(建议: 透明 0 或 半透明预设 0.5)。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:125
|
||||
msgid "A HEX Color (default: #483d8b)."
|
||||
msgstr "十六进制颜色值(预设为:#483d8b)。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:101
|
||||
msgid "A HEX color (default: #5e72e4)."
|
||||
msgstr "十六进制颜色值(预设为:#5e72e4)。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:86
|
||||
msgid "API key"
|
||||
msgstr "API 密钥"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:189
|
||||
msgid "Action"
|
||||
msgstr "操作"
|
||||
|
||||
#: applications/luci-app-argon-config/root/usr/share/luci/menu.d/luci-app-argon-config.json:3
|
||||
msgid "Argon Config"
|
||||
msgstr "Argon 主题设置"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:45
|
||||
msgid "Argon theme configuration"
|
||||
msgstr "Argon 主题设置"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:209
|
||||
msgid "Background file list"
|
||||
msgstr "背景文件列表"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:54
|
||||
msgid "Bing"
|
||||
msgstr "Bing"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:53
|
||||
msgid "Built-in"
|
||||
msgstr "内建"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:73
|
||||
msgid "Collection ID"
|
||||
msgstr "分类 ID"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:73
|
||||
msgid "Collection ID for Unsplash or Wallhaven."
|
||||
msgstr "为 Unsplash 或 Wallhaven 指定分类 ID"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:97
|
||||
msgid "Dark mode"
|
||||
msgstr "暗黑模式"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:204
|
||||
msgid "Delete"
|
||||
msgstr "删除"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:107
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:131
|
||||
msgid "Expecting: %s"
|
||||
msgstr "请输入:%s"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:173
|
||||
msgid "Failed to upload file: %s."
|
||||
msgstr "上传文件失败:%s。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:186
|
||||
msgid "Filename"
|
||||
msgstr "文件名"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:163
|
||||
msgid "Files will be uploaded to <code>%s</code>."
|
||||
msgstr "文件将被上传至<code>%s</code>。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:95
|
||||
msgid "Follow system"
|
||||
msgstr "跟随系统"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:55
|
||||
msgid "GHSer"
|
||||
msgstr "GHSer"
|
||||
|
||||
#: applications/luci-app-argon-config/root/usr/share/rpcd/acl.d/luci-app-argon-config.json:3
|
||||
msgid "Grant UCI access for luci-app-argon-config"
|
||||
msgstr "授予 luci-app-argon-config 访问 UCI 配置的权限"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:46
|
||||
msgid ""
|
||||
"Here you can set the blur and transparency of the login page of argon theme, "
|
||||
"and manage the background pictures and videos. Chrome is recommended."
|
||||
msgstr ""
|
||||
"在这里你可以设置argon 主题的登录页面的模糊和透明度,并管理背景图片与视频。推"
|
||||
"荐使用 Chrome。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:119
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:143
|
||||
msgid "Larger value will more blurred (suggest: clear: 1 or blur preset: 10)."
|
||||
msgstr "值越大越模糊(建议:清透 1 或 模糊预设 10)"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:96
|
||||
msgid "Light mode"
|
||||
msgstr "亮色模式"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:187
|
||||
msgid "Modified date"
|
||||
msgstr "修改时间"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:206
|
||||
msgid "No files found."
|
||||
msgstr "没有找到文件。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:150
|
||||
msgid "Save current settings"
|
||||
msgstr "保存当前设置"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:148
|
||||
msgid "Save settings"
|
||||
msgstr "保存设置"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:188
|
||||
msgid "Size"
|
||||
msgstr "大小"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:86
|
||||
msgid "Specify API key for Unsplash or Wallhaven."
|
||||
msgstr "为 Unsplash 或 Wallhaven 指定 API 密钥。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:48
|
||||
msgid "Theme configuration"
|
||||
msgstr "主题配置"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:94
|
||||
msgid "Theme mode"
|
||||
msgstr "主题模式"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:56
|
||||
msgid "Unsplash"
|
||||
msgstr "Unsplash"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:162
|
||||
msgid "Upload background"
|
||||
msgstr "上传背景"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:156
|
||||
msgid "Upload background (available space: %1024.2mB)"
|
||||
msgstr "上传背景(可用空间:%1024.2mB)"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:165
|
||||
msgid "Upload..."
|
||||
msgstr "上传..."
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:90
|
||||
msgid "Use exact resolution"
|
||||
msgstr "精确匹配分辨率"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:90
|
||||
msgid "Use exact resolution or at least 1080P for Wallhaven."
|
||||
msgstr "精确匹配 1080P 分辨率或至少 1080P 分辨率(Wallhaven)。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:57
|
||||
msgid "Wallhaven"
|
||||
msgstr "Wallhaven"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:52
|
||||
msgid "Wallpaper source"
|
||||
msgstr "壁纸来源"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:158
|
||||
msgid ""
|
||||
"You can upload files such as gif/jpg/mp4/png/webm/webp files, to change the "
|
||||
"login page background."
|
||||
msgstr ""
|
||||
"你可以上传 gif/jpg/mp4/png/webm/webp 等格式的文件,以创建自己喜欢的登录界面。"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:142
|
||||
msgid "[Dark mode] Frosted Glass Radius"
|
||||
msgstr "[暗色模式] 毛玻璃模糊半径"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:124
|
||||
msgid "[Dark mode] Primary Color"
|
||||
msgstr "[暗色模式] 主色调"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:135
|
||||
msgid "[Dark mode] Transparency"
|
||||
msgstr "[暗色模式] 透明度"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:118
|
||||
msgid "[Light mode] Frosted Glass Radius"
|
||||
msgstr "[亮色模式] 毛玻璃模糊半径"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:101
|
||||
msgid "[Light mode] Primary Color"
|
||||
msgstr "[亮色模式] 主色调"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:111
|
||||
msgid "[Light mode] Transparency"
|
||||
msgstr "[亮色模式] 透明度"
|
||||
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:107
|
||||
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:131
|
||||
msgid "valid HEX color value"
|
||||
msgstr "有效十六进制颜色值"
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
config global
|
||||
option primary '#5e72e4'
|
||||
option dark_primary '#483d8b'
|
||||
option blur '0'
|
||||
option blur_dark '0'
|
||||
option transparency '0.3'
|
||||
option transparency_dark '0.3'
|
||||
option mode 'normal'
|
||||
option online_wallpaper 'bing'
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
bing_background="$(uci -q get "argon.@global[0].bing_background")"
|
||||
[ -n "$bing_background" ] || exit 0
|
||||
|
||||
if [ "$bing_background" = "1" ]; then
|
||||
uci -q set "argon.@global[0].online_wallpaper"="bing"
|
||||
else
|
||||
uci -q set "argon.@global[0].online_wallpaper"="none"
|
||||
fi
|
||||
uci -q delete "argon.@global[0].bing_background"
|
||||
uci -q commit "argon"
|
||||
|
||||
exit 0
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
readonly bg_path="/www/luci-static/argon/background"
|
||||
readonly tmp_path="/tmp/argon_background.tmp"
|
||||
readonly max_size=5242880
|
||||
readonly builtin_bg="bg1.jpg"
|
||||
|
||||
valid_name() {
|
||||
local name="$1" ext
|
||||
[ -n "$name" ] || return 1
|
||||
[ "$name" = "${name##*/}" ] || return 1
|
||||
[ "$name" = "${name##*\\}" ] || return 1
|
||||
[ "$name" = "${name#.*}" ] || return 1
|
||||
case "$name" in *..*|*[!A-Za-z0-9_.-]*) return 1 ;; esac
|
||||
ext="${name##*.}"
|
||||
[ "$ext" != "$name" ] || return 1
|
||||
case "$(echo "$ext" | tr 'A-Z' 'a-z')" in jpg|jpeg|png|gif|webp|mp4|webm|ogg) return 0 ;; esac
|
||||
return 1
|
||||
}
|
||||
|
||||
json_result() {
|
||||
json_init
|
||||
json_add_int "result" "$1"
|
||||
json_dump
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"list")
|
||||
json_init
|
||||
json_add_object "remove"
|
||||
json_add_string "filename" "filename"
|
||||
json_close_object
|
||||
json_add_object "rename"
|
||||
json_add_string "newname" "filename"
|
||||
json_close_object
|
||||
json_dump
|
||||
json_cleanup
|
||||
;;
|
||||
"call")
|
||||
case "$2" in
|
||||
"remove")
|
||||
read -r input
|
||||
json_load "$input"
|
||||
json_get_var filename "filename"
|
||||
json_cleanup
|
||||
|
||||
if ! valid_name "$filename" || [ "$filename" = "$builtin_bg" ] || [ -L "$bg_path/$filename" ]; then
|
||||
json_result 255
|
||||
exit 255
|
||||
fi
|
||||
|
||||
rm -f -- "$bg_path/$filename"
|
||||
json_result 0
|
||||
;;
|
||||
"rename")
|
||||
read -r input
|
||||
json_load "$input"
|
||||
json_get_var newname "newname"
|
||||
json_cleanup
|
||||
|
||||
if ! valid_name "$newname" || [ "$newname" = "$builtin_bg" ] || [ -L "$tmp_path" ] || [ ! -f "$tmp_path" ]; then
|
||||
json_result 255
|
||||
exit 255
|
||||
fi
|
||||
|
||||
size="$(wc -c < "$tmp_path" 2>/dev/null)" || size=0
|
||||
case "$size" in *[!0-9]*|'') size=0 ;; esac
|
||||
if [ "$size" -le 0 ] || [ "$size" -gt "$max_size" ]; then
|
||||
rm -f -- "$tmp_path"
|
||||
json_result 254
|
||||
exit 254
|
||||
fi
|
||||
|
||||
mkdir -p -- "$bg_path"
|
||||
target="$bg_path/$newname"
|
||||
if [ -e "$target" ] || [ -L "$target" ]; then
|
||||
json_result 253
|
||||
exit 253
|
||||
fi
|
||||
if (set -C; umask 022; cat "$tmp_path" > "$target") 2>/dev/null; then
|
||||
if chmod 0644 "$target" && rm -f -- "$tmp_path"; then
|
||||
json_result 0
|
||||
else
|
||||
rm -f -- "$target"
|
||||
json_result 1
|
||||
fi
|
||||
else
|
||||
json_result 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"admin/system/argon-config": {
|
||||
"title": "Argon Config",
|
||||
"order": 90,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "argon-config"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-argon-config" ],
|
||||
"uci": { "argon": true }
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"luci-app-argon-config": {
|
||||
"description": "Grant UCI access for luci-app-argon-config",
|
||||
"read": {
|
||||
"file": {
|
||||
"/www/luci-static/argon/background/*": [ "list" ]
|
||||
},
|
||||
"ubus": {
|
||||
"system": [ "info" ]
|
||||
},
|
||||
"uci": [ "argon" ]
|
||||
},
|
||||
"write": {
|
||||
"file": {
|
||||
"/tmp/argon_background.tmp": [ "write" ]
|
||||
},
|
||||
"ubus": {
|
||||
"luci.argon": [ "remove", "rename" ]
|
||||
},
|
||||
"uci": [ "argon" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user