main.cgi

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

CGI
51
字号
#!/usr/bin/haserl# Copyright (C) 2008 OpenRB.comcontent-type: text/html(function(){  var moduleId = 'test';  var elems = FlashSYS.getCache(moduleId);  if (!elems) {    var window = FlashSYS.newWindow({      id: moduleId,      title: $TR( moduleId ),      width: 400,      height: 225,      padding: 5    });    FlashSYS.Control.addButton(window.footerEl, {      'params': { 'module': moduleId, 'action': 'form' },      'cls': 'Add'    });    var table = new FlashSYS.Table(window.contentEl, {      params: { 'module': moduleId, 'action': 'form' },      trPrefix: 'test_',      tableHead: {        'name':   { width: 60 },        'value':  { width: 30 },        'delete': { width: 10, blank: true, confirm: 'del_confirm', params: { module: moduleId, action: 'delete', reload: moduleId } }      }    });    elems = FlashSYS.setCache(moduleId, {      window: window,      table: table    });  }  var tableValues = {}, tableData = <? /lib/flashsys/modules/test/main.lua ?>, delIcon = { cls: 'Icon Delete' };  if ($type(tableData) != 'array') {    return;  }  for (var i = 0, j = tableData.length; i < j; i++) {    var rowData = tableData[ i ];    tableValues[ rowData['.name'] ] = [ rowData.name, rowData.value, delIcon ];  }  elems.table.loadValues(tableValues);})();

⌨️ 快捷键说明

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