找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 3735|回复: 2

不懂就问-官方最新鸡屎版页面修改

[复制链接]
本帖最后由 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页面:
知道或者之后弄懂了请告诉我一下 谢谢!!!
  1. 'use strict';
  2. 'require form';

  3. return L.view.extend({
  4.         render: function() {
  5.                 var m, s, o;
  6.                
  7.                 m = new form.Map('sfe', _('Turbo ACC Acceleration Settings'),
  8.                         _('Opensource Qualcomm Shortcut FE driver (Fast Path)'));

  9.                 s = m.section(form.TypedSection, 'sfe', _(''));
  10.                 s.anonymous = true;

  11.                 o = s.option(form.Flag, 'enabled', _('Enable SFE Fast Path'),
  12.                         _('Enable Fast Path offloading for connections. (decrease cpu load / increase routing throughput)'));
  13.                 o.default = '0';
  14.                 o.rmempty = false;

  15.                 o = s.option(form.Flag, 'wifi', _('Bridge Acceleration'),
  16.                         _('Enable Bridge Acceleration (may be functional conflict with bridge-mode virtual** Server)'));
  17.                 o.default = '0';
  18.                 o.rmempty = false;
  19.                 o.depends('enabled', '1');

  20.                 o = s.option(form.Flag, 'ipv6', _('IPv6 Acceleration'),
  21.                         _('Enable IPv6 Acceleration'));
  22.                 o.default = '0';
  23.                 o.rmempty = false;
  24.                 o.depends('enabled', '1');

  25.                 o = s.option(form.Flag, 'bbr', _('Enable BBR'),
  26.                         _('Bottleneck Bandwidth and Round-trip propagation time (BBR)'));
  27.                 o.default = '0';
  28.                 o.rmempty = false;

  29.                 o = s.option(form.Flag, 'dns', _('DNS Acceleration'),
  30.                         _('Enable DNS Cache Acceleration and anti ISP DNS pollution'));
  31.                 o.default = '0';
  32.                 o.rmempty = false;

  33.                 o = s.option(form.Value, 'port', _('DNS port'),
  34.                         _('DNS cached service port'));
  35.                 o.default = '5333'
  36.                 o.depends('dns', '1');

  37.                 o = s.option(form.Value, 'bind_port', _('WEB port'),
  38.                         _('WEB service port'));
  39.                 o.default = '3000'
  40.                 o.depends('dnscache_enable', '2');

  41.                 o = s.option(form.ListValue, 'adg_install', _('Starting mode'),
  42.                         _('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)'));
  43.                 o.value('1', _('Use configuration'));
  44.                 o.value('2', _('New installation'));
  45.                 o.depends('dnscache_enable', '2');

  46.                 o = s.option(form.Value, 'auth_name', _('Username'),
  47.                         _('AdGuardHome username'));
  48.                 o.default = 'admin'
  49.                 o.depends('adg_install', '1');

  50.                 o = s.option(form.Value, 'auth_pass', _('Password'),
  51.                         _('AdGuardHome username'));
  52.                 o.default = 'password'
  53.                 o.password = 'true'
  54.                 o.depends('adg_install', '1');

  55.                 o = s.option(form.ListValue, 'dnscache_enable', _('Resolve Dns Mode'));
  56.                 o.value('1', _('Use Pdnsd query and cache'));
  57.                 o.value('2', _('Use AdGuardHome query and cache'));
  58.                 o.default = '1'
  59.                 o.depends('dns', '1');

  60.                 o = s.option(form.Value, 'dns_server', _('Upsteam DNS Server'),
  61.                         _('Muitiple DNS server can saperate with \',\''));
  62.                 o.default = '114.114.114.114,114.114.115.115'
  63.                 o.depends('dnscache_enable', '1');

  64.                 return m.render();
  65.         },
  66. });
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
你的所有特长就是鸡屎?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

看的头疼哦
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-30 08:02

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表