MWF.xDesktop.requireApp("Setting", "servers.DataServers", null, false); MWF.xApplication.Setting.servers = MWF.xApplication.Setting.servers || {}; MWF.xApplication.Setting.servers.WebServers = new Class({ Extends: MWF.xApplication.Setting.servers.DataServers, Implements: [Options, Events], initialize: function(explorer){ this.explorer = explorer; this.app = this.explorer.app; this.actions = this.app.actions; this.css = this.app.css; this.servers = []; this.content = this.explorer.webServerContent; this.page = this.app.serverPage; this.load(); }, load: function(){ this.actions.listWebServer(function(json){ json.data.each(function(serverJson){ this.servers.push(new MWF.xApplication.Setting.servers.WebServer(this, serverJson)); }.bind(this)); this.createAddAction(); this.setServerAreaWidthFun = this.setServerAreaWidth.bind(this); this.addEvent("resize", this.setServerAreaWidthFun); this.addEvent("resize", function(){this.setWebServerAreaWidth();}.bind(this)); }.bind(this)); }, createServer: function(){ var server = { "list": this, "app": this.app, "json": { "contextList": [], "planList": [] }, "node": this.createServerAction, "name": "", "reload": function(){ this.list.servers.push(new MWF.xApplication.Setting.servers.WebServer(this.list, this.json)); } } var doc = new MWF.xApplication.Setting.servers.WebServer.Document(server); } }); MWF.xApplication.Setting.servers.WebServer = new Class({ Extends: MWF.xApplication.Setting.servers.DataServer, Implements: [Events], initialize: function(list, json){ this.list = list this.app = this.list.app; this.json = json; this.container = this.list.content; this.css = this.app.css; this.name = this.json.name; this.load(); }, setServerText: function(){ this.nameNode.set("text", (this.json.name || "")); this.hostNode.set("text", (this.json.host || "")+" : "+(this.json.port || "")); this.adminNode.set("text", (this.json.username || "")); this.messageNode.set("text", (this.json.message || "")); }, open: function(){ new MWF.xApplication.Setting.servers.WebServer.Document(this); }, reload: function(){ this.app.actions.getWebServer(this.json.name, function(json){ this.name = this.json.name; this.json = json.data; this.nameNode.set("text", this.json.name); this.hostNode.set("text", this.json.host+" : "+this.json.port); this.adminNode.set("text", this.json.username); this.messageNode.set("text", this.json.message); }.bind(this)); } }); MWF.xApplication.Setting.servers.WebServer.Document = new Class({ Extends: MWF.xApplication.Setting.servers.DataServer.Document, Implements: [Events], createBaseInfo: function(){ this.inforAreaNode = new Element("div", {"styles": this.css.applicationServerDocumentInforAreaNode}).inject(this.node); this.inforNode = new Element("div", {"styles": this.css.dataServerDocumentInforNode}).inject(this.inforAreaNode); var html = "
| name | |
| order | |
| host | |
| port | |
| username | |
| password | |
| proxyHost | |
| proxyPort |