formrule.cgi.svn-base

来自「嵌入式无线路由系统openwrt的web配置工具」· SVN-BASE 代码 · 共 68 行

SVN-BASE
68
字号
#!/usr/bin/haserl# Copyright (C) 2008 OpenRB.comcontent-type: text/html(function(){  var moduleId = 'firewall_formrule';  var elems = FlashSYS.getCache( moduleId );  var formOptions = <? /lib/flashsys/modules/firewall/formrule.lua ?>;  if (!elems) {    var window = FlashSYS.newWindow({      id: moduleId,      title: $TR( moduleId ),      width: 280,      height: 290,      padding: 5,      canReload: false,      type: 'modal'    });    var form = new FlashSYS.Form(window.contentEl, {      trPrefix: 'firewall_rule_',      module: moduleId,      saveModule: 'firewall',      saveAction: 'saverule',      reload: 'firewall',      submitEl: window.footerEl,      elements: [        { 'type': 'select', 'name': 'target', values: ['ACCEPT', 'REJECT', 'DROP', 'FORWARD'],          blocks: {            def: {'rule': 1, 'redirect': 0},            change: {              'ACCEPT': {'rule': 1, 'redirect': 0},              'REJECT': {'rule': 1, 'redirect': 0},              'DROP': {'rule': 1, 'redirect': 0},              'FORWARD': {'rule': 0, 'redirect': 1}            }          }         },        { 'type': 'select', 'name': 'src', values: formOptions.zones },        { 'type': 'text', 'name': 'src_ip' },        { 'type': 'text', 'name': 'src_port' },        { 'type': 'select', 'name': 'dest', values: formOptions.zones },        { 'type': 'text', 'name': 'dest_ip' },        { 'type': 'blockStart', 'name': 'redirect' },          { 'type': 'text', 'name': 'src_dport' },          { 'type': 'text', 'name': 'dest_dport' },        'blockEnd',        { 'type': 'blockStart', 'name': 'rule' },          { 'type': 'text', 'name': 'dest_port' },        'blockEnd',        { 'type': 'select', 'name': 'proto', values: [['', $TR('both')], ['tcp', 'TCP'], ['udp', 'UDP']] }      ],      addChange: true,      changeModule: 'firewall',      changeAction: 'restart',      changeNoId: true    });    elems = FlashSYS.setCache( moduleId, {      window: window,      form: form    });  }  elems.form.loadValues(formOptions.values, formOptions.params);})();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?