提交 1dea0aee 编写于 作者: S st

[系统设置]增加资源部署、增加服务部署

上级 81f1e98f
......@@ -4,6 +4,9 @@ MWF.xDesktop.requireApp("Setting", "SettingMobile", null, false);
MWF.xDesktop.requireApp("Setting", "SettingLoginUI", null, false);
MWF.xDesktop.requireApp("Setting", "SettingIndexUI", null, false);
MWF.xDesktop.requireApp("Setting", "SettingModuleUI", null, false);
MWF.xDesktop.requireApp("Setting", "SettingModuleService", null, false);
MWF.xDesktop.requireApp("Setting", "SettingModuleResource", null, false);
MWF.xApplication.Setting.Main = new Class({
Extends: MWF.xApplication.Common.Main,
......@@ -27,6 +30,8 @@ MWF.xApplication.Setting.Main = new Class({
this.uiAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
this.mobileAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
this.disposeAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
// this.serverAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
// this.applicationAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
// this.resourceAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
......@@ -41,6 +46,8 @@ MWF.xApplication.Setting.Main = new Class({
this.uiPage = this.tab.addTab(this.uiAreaNode, this.lp.tab_ui, false);
this.mobilePage = this.tab.addTab(this.mobileAreaNode, this.lp.tab_mobile, false);
this.disposePage = this.tab.addTab(this.disposeAreaNode, this.lp.tab_dispose, false);
this.basePage.addEvent("postShow", function(){
if (!this.baseExplorer) this.baseExplorer = new MWF.xApplication.Setting.BaseExplorer(this, this.baseAreaNode);
}.bind(this));
......@@ -53,6 +60,11 @@ MWF.xApplication.Setting.Main = new Class({
if (!this.mobileExplorer) this.mobileExplorer = new MWF.xApplication.Setting.MobileExplorer(this, this.mobileAreaNode);
}.bind(this));
this.disposePage.addEvent("postShow", function(){
if (!this.disposeExplorer) this.disposeExplorer = new MWF.xApplication.Setting.DisposeExplorer(this, this.disposeAreaNode);
}.bind(this));
// this.serverPage = this.tab.addTab(this.serverAreaNode, this.lp.tab_Server, false);
// this.applicationPage = this.tab.addTab(this.applicationAreaNode, this.lp.tab_Application, false);
// this.resourcePage = this.tab.addTab(this.resourceAreaNode, this.lp.tab_Resource, false);
......@@ -201,6 +213,7 @@ MWF.xApplication.Setting.BaseExplorer = new Class({
this.naviItems.each(function(node){
var itemNavi = node.retrieve("navi");
var content = node.retrieve("content", null);
if (content) content.destroy();
node.eliminate("content");
node.setStyles(this.css.naviItemNode);
......@@ -272,8 +285,6 @@ MWF.xApplication.Setting.BaseExplorer = new Class({
}
});
MWF.xApplication.Setting.MobileExplorer = new Class({
Extends: MWF.xApplication.Setting.BaseExplorer,
initialize: function(app, content){
......@@ -363,8 +374,6 @@ MWF.xApplication.Setting.MobileExplorer = new Class({
}
}
});
MWF.xApplication.Setting.UIExplorer = new Class({
Extends: MWF.xApplication.Setting.BaseExplorer,
initialize: function(app, content){
......@@ -379,11 +388,6 @@ MWF.xApplication.Setting.UIExplorer = new Class({
getNaviJson: function(){
return [
{
"text": this.app.lp.tab_ui_module,
"icon": "module",
"action": "loadUIModuleSetting"
},
{
"text": this.app.lp.tab_ui_index,
"icon": "index",
......@@ -412,14 +416,60 @@ MWF.xApplication.Setting.UIExplorer = new Class({
this.uiIndexSetting = new MWF.xApplication.Setting.UIIndexDocument(this, this.contentAreaNode);
item.store("content", this.uiIndexSetting);
}
}
});
MWF.xApplication.Setting.DisposeExplorer = new Class({
Extends: MWF.xApplication.Setting.BaseExplorer,
initialize: function(app, content){
this.app = app;
this.lp = this.app.lp;
this.container = content;
this.actions = this.app.actions;
this.css = this.app.css;
this.naviItems = [];
this.load();
},
getNaviJson: function(){
return [
{
"text": this.app.lp.tab_ui_module,
"icon": "module",
"action": "loadUIModuleSetting"
},
{
"text": this.app.lp.tab_ui_resource,
"icon": "resource",
"action": "loadResourceModuleSetting"
},
{
"text": this.app.lp.tab_ui_service,
"icon": "service",
"action": "loadServiceModuleSetting"
}
];
},
getData: function(){
},
loadUIModuleSetting: function(item){
if (MWF.AC.isAdministrator()) {
this.uiModuleSetting = new MWF.xApplication.Setting.UIModuleDocument(this, this.contentAreaNode);
item.store("content", this.uiModuleSetting);
}
},
loadServiceModuleSetting: function(item){
if (MWF.AC.isAdministrator()) {
this.serviceModuleSetting = new MWF.xApplication.Setting.ServiceModuleDocument(this, this.contentAreaNode);
item.store("content", this.serviceModuleSetting);
}
},
loadResourceModuleSetting: function(item){
if (MWF.AC.isAdministrator()) {
this.resourceModuleSetting = new MWF.xApplication.Setting.ResourceModuleDocument(this, this.contentAreaNode);
item.store("content", this.resourceModuleSetting);
}
}
});
......@@ -428,5 +478,3 @@ MWF.xApplication.Setting.UIExplorer = new Class({
MWF.xApplication.Setting.ResourceModuleDocument = new Class({
Extends: MWF.xApplication.Setting.Document,
load: function(){
this.node = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.contentAreaNode);
this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
this.titleName.set("text", this.lp.ui_moduleSetting_resource);
this.uploadTitleNode = new Element("div",{"styles":this.css.explorerContentItemTitleNode}).inject(this.contentAreaNode);
this.uploadTitleNode.set("text",this.lp.resource_upload);
this.uploadFileNode = new Element("input",{"type":"file","styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.isReplaceTitleNode = new Element("div",{"styles":this.css.explorerContentItemTitleNode}).inject(this.contentAreaNode);
this.isReplaceTitleNode.set("text",this.lp.resource_replace);
this.isReplaceDescNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.isReplaceDescNode.set("text",this.lp.resource_replaceDesc);
this.isReplaceNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.isReplaceSelectNode = new Element("select").inject(this.isReplaceNode);
new Element("option",{"value":false,"text":this.lp.resource_replace_yes}).inject(this.isReplaceSelectNode);
new Element("option",{"value":true,"text":this.lp.resource_replace_no}).inject(this.isReplaceSelectNode);
this.filePathTitleNode = new Element("div",{"styles":this.css.explorerContentItemTitleNode}).inject(this.contentAreaNode);
this.filePathTitleNode.set("text",this.lp.resource_filePath);
this.filePathDescNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.filePathDescNode.set("text",this.lp.resource_filePathDesc);
this.filePathNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.filePathInputNode = new Element("input").inject(this.filePathNode);
this.submitNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.submitBtnNode = new Element("button",{"styles":this.css.explorerContentButtonNode,"text":this.lp.ok}).inject(this.submitNode);
this.submitNode.setStyle("margin-top","40px");
this.submitBtnNode.addEvent("click",function () {
var files = this.uploadFileNode.files;
if (files.length) {
var file = files[0];
var asNew = this.isReplaceSelectNode.get("value")
var formData = new FormData();
formData.append("file", file);
formData.append("fileName", file.name);
formData.append("filePath", this.filePathInputNode.get("value"));
o2.Actions.load("x_program_center").ModuleAction.dispatchResource(asNew, formData, null, function (json){
this.app.notice(this.lp.resource_success, "success", this.appContentNode);
}.bind(this),false);
}
}.bind(this))
}
});
MWF.xApplication.Setting.ServiceModuleDocument = new Class({
Extends: MWF.xApplication.Setting.Document,
load: function(){
this.node = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.contentAreaNode);
this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
this.titleName.set("text", this.lp.ui_moduleSetting_service);
this.uploadTitleNode = new Element("div",{"styles":this.css.explorerContentItemTitleNode}).inject(this.contentAreaNode);
this.uploadTitleNode.set("text",this.lp.resource_upload);
this.uploadFileNode = new Element("input",{"type":"file","styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.ctlTitleNode = new Element("div",{"styles":this.css.explorerContentItemTitleNode}).inject(this.contentAreaNode);
this.ctlTitleNode.set("text",this.lp.service_ctl);
this.ctlNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.ctlSelectNode = new Element("select").inject(this.ctlNode);
new Element("option",{"value":"customJar","text":"customJar"}).inject(this.ctlSelectNode);
new Element("option",{"value":"customWar","text":"customWar"}).inject(this.ctlSelectNode);
new Element("option",{"value":"storeJar","text":"storeJar"}).inject(this.ctlSelectNode);
new Element("option",{"value":"storeWar","text":"storeWar"}).inject(this.ctlSelectNode);
this.nodeTitleNode = new Element("div",{"styles":this.css.explorerContentItemTitleNode}).inject(this.contentAreaNode);
this.nodeTitleNode.set("text",this.lp.service_node);
this.serverNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.nodeSelectNode = new Element("select").inject(this.serverNode);
new Element("option", {
"value": "*",
"text": this.lp.service_allNode
}).inject(this.nodeSelectNode);
o2.Actions.load("x_program_center").CommandAction.getNodeInfoList(
function( json ){
var nodeList = json.data.nodeList;
nodeList.each(function (node) {
new Element("option", {
"value": node.node.nodeAgentPort,
"text": node.nodeAddress
}).inject(this.nodeSelectNode);
}.bind(this));
}.bind(this),null, false
);
this.submitNode = new Element("div",{"styles":this.css.explorerContentInputInforNode}).inject(this.contentAreaNode);
this.submitBtnNode = new Element("button",{"styles":this.css.explorerContentButtonNode,"text":this.lp.ok}).inject(this.submitNode);
this.submitNode.setStyle("margin-top","40px");
this.submitBtnNode.addEvent("click",function () {
var files = this.uploadFileNode.files;
if (files.length) {
var file = files[0];
var nodePort = this.nodeSelectNode.getElement("option:selected").get("value");
var nodeName = this.nodeSelectNode.getElement("option:selected").get("text");
if(nodePort==="*") nodeName = "*";
var formData = new FormData();
formData.append("file", file);
formData.append("fileName", file.name);
formData.append("ctl", this.ctlSelectNode.get("value"));
formData.append("nodeName", nodeName);
formData.append("nodePort", nodePort);
o2.Actions.load("x_program_center").CommandAction.upload(formData,null,function (json){
this.app.notice(this.lp.service_success, "success", this.appContentNode);
}.bind(this),null,false);
}
}.bind(this))
}
});
......@@ -5,6 +5,7 @@ MWF.xApplication.Setting.LP = {
"tab_base": "基础配置",
"tab_ui": "界面配置",
"tab_mobile": "移动办公配置",
"tab_dispose": "系统部署",
"tab_name": "系统名称配置",
"tab_user": "系统用户配置",
"tab_login": "系统登录配置",
......@@ -17,7 +18,8 @@ MWF.xApplication.Setting.LP = {
"tab_ui_login": "登录页样式",
"tab_ui_index": "主页样式",
"tab_ui_module": "模块部署",
"tab_ui_resource": "资源部署",
"tab_ui_service": "服务部署",
"base_nameSetting": "配置您的系统名称",
......@@ -194,6 +196,23 @@ MWF.xApplication.Setting.LP = {
"ui_module_modules_infor": "",
"ui_module_modules_Action": "部署模块",
"ui_moduleSetting_resource": "web端资源部署",
"ui_moduleSetting_service": "服务部署",
"resource_upload":"资源选择",
"resource_replace":"是否覆盖",
"resource_replaceDesc":"覆盖类型:‘是’删除原文件然后上传,‘否’覆盖原文件",
"resource_replace_yes":"",
"resource_replace_no":"",
"resource_filePath":"存放目录",
"resource_filePathDesc":"zip文件可以为空,其他不能为空path:/xxx/xxx",
"resource_success":"部署成功",
"service_ctl":"命令名称",
"service_node":"服务器节点",
"service_allNode":"全部节点",
"service_success":"部署成功,app应用会自动重启,请稍候操作,大概一分钟。。",
"on": "",
"off": "",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册