|
本帖最后由 401626436 于 2019-12-1 15:27 编辑
https://www.right.com.cn/forum/thread-1365324-1-1.html
OPENWRT官方最新版源的页面采用了javascript鸡屎来写,所以原本可以按部就班的东西就“将在外 君命有所不授”了!
于是为了了解鸡屎写法,就开始用抄代码的方式将现有luci应用重写,所以有了这一问!
前言:
会修改或写luci应用的网友应该都知道!
打个比方:[ m:append(Template("sfe/status")) 可以将位于/usr/lib/lua/luci/view/sfe/status.htm嵌入lua页面 ]
可以用于显示工作状态信息之类的东西
问题:
1.如何在鸡屎里嵌入能用的h5代码
2.如何将m:append(Template("sfe/status"))放进鸡屎里
能实现其中一个就好(报错的通通不要)
改好的鸡屎版sfe页面:
知道或者之后弄懂了请告诉我一下 谢谢!!!
- 'use strict';
- 'require form';
- return L.view.extend({
- render: function() {
- var m, s, o;
-
- m = new form.Map('sfe', _('Turbo ACC Acceleration Settings'),
- _('Opensource Qualcomm Shortcut FE driver (Fast Path)'));
- s = m.section(form.TypedSection, 'sfe', _(''));
- s.anonymous = true;
- o = s.option(form.Flag, 'enabled', _('Enable SFE Fast Path'),
- _('Enable Fast Path offloading for connections. (decrease cpu load / increase routing throughput)'));
- o.default = '0';
- o.rmempty = false;
- o = s.option(form.Flag, 'wifi', _('Bridge Acceleration'),
- _('Enable Bridge Acceleration (may be functional conflict with bridge-mode virtual** Server)'));
- o.default = '0';
- o.rmempty = false;
- o.depends('enabled', '1');
- o = s.option(form.Flag, 'ipv6', _('IPv6 Acceleration'),
- _('Enable IPv6 Acceleration'));
- o.default = '0';
- o.rmempty = false;
- o.depends('enabled', '1');
- o = s.option(form.Flag, 'bbr', _('Enable BBR'),
- _('Bottleneck Bandwidth and Round-trip propagation time (BBR)'));
- o.default = '0';
- o.rmempty = false;
- o = s.option(form.Flag, 'dns', _('DNS Acceleration'),
- _('Enable DNS Cache Acceleration and anti ISP DNS pollution'));
- o.default = '0';
- o.rmempty = false;
- o = s.option(form.Value, 'port', _('DNS port'),
- _('DNS cached service port'));
- o.default = '5333'
- o.depends('dns', '1');
- o = s.option(form.Value, 'bind_port', _('WEB port'),
- _('WEB service port'));
- o.default = '3000'
- o.depends('dnscache_enable', '2');
- o = s.option(form.ListValue, 'adg_install', _('Starting mode'),
- _('Suitable for obsessive-compulsive disorder (you need to manually set the WEB listening port and DNS port to be consistent with this page in the new installation)'));
- o.value('1', _('Use configuration'));
- o.value('2', _('New installation'));
- o.depends('dnscache_enable', '2');
- o = s.option(form.Value, 'auth_name', _('Username'),
- _('AdGuardHome username'));
- o.default = 'admin'
- o.depends('adg_install', '1');
- o = s.option(form.Value, 'auth_pass', _('Password'),
- _('AdGuardHome username'));
- o.default = 'password'
- o.password = 'true'
- o.depends('adg_install', '1');
- o = s.option(form.ListValue, 'dnscache_enable', _('Resolve Dns Mode'));
- o.value('1', _('Use Pdnsd query and cache'));
- o.value('2', _('Use AdGuardHome query and cache'));
- o.default = '1'
- o.depends('dns', '1');
- o = s.option(form.Value, 'dns_server', _('Upsteam DNS Server'),
- _('Muitiple DNS server can saperate with \',\''));
- o.default = '114.114.114.114,114.114.115.115'
- o.depends('dnscache_enable', '1');
- return m.render();
- },
- });
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|