Main_bak.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //MWF.xDesktop.requireApp("Deployment", "Actions.RestActions", null, false);
  2. //MWF.xDesktop.requireApp("Servers", "Actions.RestActions", null, false);
  3. MWF.xApplication.Servers.Main = new Class({
  4. Extends: MWF.xApplication.Common.Main,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "name": "Setting",
  9. "icon": "icon.png",
  10. "width": "1200",
  11. "height": "660",
  12. "title": MWF.xApplication.Servers.LP.title
  13. },
  14. onQueryLoad: function(){
  15. this.lp = MWF.xApplication.Servers.LP;
  16. this.actions = new MWF.xApplication.Servers.Actions.RestActions();
  17. },
  18. loadApplication: function(callback){
  19. this.loadTitle();
  20. this.applicationServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.content);
  21. this.applicationServerContentArea = new Element("div", {"styles": this.css.applicationServerContentArea}).inject(this.applicationServerContent);
  22. this.dataServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.content);
  23. this.dataServerContentArea = new Element("div", {"styles": this.css.applicationServerContentArea}).inject(this.dataServerContent);
  24. this.storageServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.content);
  25. this.storageServerContentArea = new Element("div", {"styles": this.css.applicationServerContentArea}).inject(this.storageServerContent);
  26. this.webServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.content);
  27. this.webServerContentArea = new Element("div", {"styles": this.css.applicationServerContentArea}).inject(this.webServerContent);
  28. //this.componentsContent = new Element("div", {"styles": this.css.componentsContent}).inject(this.appDeploymentContent);
  29. MWF.require("MWF.widget.Tab", function(){
  30. this.tab = new MWF.widget.Tab(this.content, {"style": "processlayout"});
  31. this.tab.load();
  32. this.appPage = this.tab.addTab(this.applicationServerContent, this.lp.tab_ApplicationServer, false);
  33. this.dataPage = this.tab.addTab(this.dataServerContent, this.lp.tab_DataServer, false);
  34. this.dataPage.addEvent("postShow", function(){
  35. if (!this.dataServerList){
  36. MWF.xDesktop.requireApp("Servers", "DataServers", function(){
  37. this.dataServerList = new MWF.xApplication.Servers.DataServers(this);
  38. }.bind(this));
  39. }
  40. }.bind(this));
  41. this.storagePage = this.tab.addTab(this.storageServerContent, this.lp.tab_StorageServer, false);
  42. this.storagePage.addEvent("postShow", function(){
  43. if (!this.storageServerList){
  44. MWF.xDesktop.requireApp("Servers", "StorageServers", function(){
  45. this.storageServerList = new MWF.xApplication.Servers.StorageServers(this);
  46. }.bind(this));
  47. }
  48. }.bind(this));
  49. this.webPage = this.tab.addTab(this.webServerContent, this.lp.tab_WebServer, false);
  50. this.webPage.addEvent("postShow", function(){
  51. if (!this.webServerList){
  52. MWF.xDesktop.requireApp("Servers", "WebServers", function(){
  53. this.webServerList = new MWF.xApplication.Servers.WebServers(this);
  54. }.bind(this));
  55. }
  56. }.bind(this));
  57. this.appPage.showIm();
  58. this.setContentHeight();
  59. this.addEvent("resize", function(){this.setContentHeight();}.bind(this));
  60. }.bind(this));
  61. MWF.xDesktop.requireApp("Servers", "ApplicationServers", function(){
  62. this.applicationServerList = new MWF.xApplication.Servers.ApplicationServers(this);
  63. }.bind(this));
  64. //this.loadApplicationServers();
  65. },
  66. loadTitle: function(){
  67. this.titleBar = new Element("div", {"styles": this.css.titleBar}).inject(this.content);
  68. this.taskTitleTextNode = new Element("div", {"styles": this.css.titleTextNode,"text": this.lp.title}).inject(this.titleBar);
  69. },
  70. setContentHeight: function(node){
  71. var size = this.content.getSize();
  72. var titleSize = this.titleBar.getSize();
  73. var tabSize = this.tab.tabNodeContainer.getSize();
  74. var height = size.y-tabSize.y-titleSize.y;
  75. this.tab.pages.each(function(page){
  76. page.contentNodeArea.setStyles({"height": ""+height+"px", "overflow": "auto"})
  77. });
  78. //this.appDeploymentContent.setStyle("height", height);
  79. }
  80. });