Main.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. //MWF.xDesktop.requireApp("Deployment", "Actions.RestActions", null, false);
  2. MWF.xDesktop.requireApp("Setting", "Actions.RestActions", null, false);
  3. MWF.xApplication.Setting.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": "1280",
  11. "height": "660",
  12. "title": MWF.xApplication.Setting.LP.title
  13. },
  14. onQueryLoad: function(){
  15. this.lp = MWF.xApplication.Setting.LP;
  16. this.actions = new MWF.xApplication.Setting.Actions.RestActions();
  17. },
  18. loadApplication: function(callback){
  19. this.serverAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  20. this.applicationAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  21. this.resourceAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  22. this.mobileAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  23. MWF.require("MWF.widget.Tab", function(){
  24. this.tab = new MWF.widget.Tab(this.content, {"style": "administrator"});
  25. this.tab.load();
  26. this.serverPage = this.tab.addTab(this.serverAreaNode, this.lp.tab_Server, false);
  27. this.applicationPage = this.tab.addTab(this.applicationAreaNode, this.lp.tab_Application, false);
  28. this.resourcePage = this.tab.addTab(this.resourceAreaNode, this.lp.tab_Resource, false);
  29. this.mobilePage = this.tab.addTab(this.mobileAreaNode, this.lp.tab_Mobile, false);
  30. this.serverPage.addEvent("postShow", function(){
  31. if (!this.serversExplorer) this.serversExplorer = new MWF.xApplication.Setting.ServersExplorer(this);
  32. }.bind(this));
  33. this.applicationPage.addEvent("postShow", function(){
  34. if (!this.applicationExplorer) this.applicationExplorer = new MWF.xApplication.Setting.ApplicationsExplorer(this);
  35. }.bind(this));
  36. this.resourcePage.addEvent("postShow", function(){
  37. if (!this.resourceExplorer) this.resourceExplorer = new MWF.xApplication.Setting.ResourceExplorer(this);
  38. }.bind(this));
  39. this.mobilePage.addEvent("postShow", function(){
  40. if (!this.mobileExplorer) this.mobileExplorer = new MWF.xApplication.Setting.MobileExplorer(this);
  41. }.bind(this));
  42. this.serverPage.showIm();
  43. //this.loadServers();
  44. this.setContentHeight();
  45. this.addEvent("resize", function(){this.setContentHeight();}.bind(this));
  46. }.bind(this));
  47. //MWF.xDesktop.requireApp("Setting", "ApplicationServers", function(){
  48. // this.applicationServerList = new MWF.xApplication.Setting.ApplicationServers(this);
  49. //}.bind(this));
  50. //this.loadApplicationServers();
  51. },
  52. loadTitle: function(){
  53. this.titleBar = new Element("div", {"styles": this.css.titleBar}).inject(this.content);
  54. this.taskTitleTextNode = new Element("div", {"styles": this.css.titleTextNode,"text": this.lp.title}).inject(this.titleBar);
  55. },
  56. setContentHeight: function(node){
  57. var size = this.content.getSize();
  58. //var titleSize = this.titleBar.getSize();
  59. var tabSize = this.tab.tabNodeContainer.getSize();
  60. //var height = size.y-tabSize.y-titleSize.y;
  61. var height = size.y-tabSize.y;
  62. this.tab.pages.each(function(page){
  63. page.contentNodeArea.setStyles({"height": ""+height+"px", "overflow": "auto"})
  64. });
  65. //this.appDeploymentContent.setStyle("height", height);
  66. }
  67. });
  68. MWF.xApplication.Setting.ServersExplorer = new Class({
  69. Implements: [Events],
  70. initialize: function(app){
  71. this.app = app;
  72. this.container = this.app.serverAreaNode;
  73. this.css = this.app.css;
  74. this.naviItems = [];
  75. this.load();
  76. },
  77. load: function(){
  78. this.naviAreaNode = new Element("div", {"styles": this.css.serverNaviAreaNode}).inject(this.container);
  79. this.naviNode = new Element("div", {"styles": this.css.serverNaviNode}).inject(this.naviAreaNode);
  80. this.contentAreaNode = new Element("div", {"styles": this.css.serverContentAreaNode}).inject(this.container);
  81. this.loadNavi();
  82. },
  83. loadNavi: function(){
  84. var json = this.getNaviJson();
  85. json.each(function(navi){
  86. this.naviItems.push(this.createNaviItem(navi));
  87. }.bind(this));
  88. this.naviItems[0].click();
  89. },
  90. createNaviItem: function(navi){
  91. var naviItemNode = new Element("div", {"styles": this.css.naviItemNode}).inject(this.naviNode);
  92. //var naviItemIconNode = new Element("div", {"styles": this.css.naviItemIconNode}).inject(naviItemNode);
  93. naviItemNode.setStyle("background-image", "url(/x_component_Setting/$Main/default/icon/"+navi.icon+".png)")
  94. //var naviItemTextNode = new Element("div", {"styles": this.css.naviItemTextNode}).inject(naviItemNode);
  95. naviItemNode.set("text", navi.text);
  96. naviItemNode.store("navi", navi);
  97. var _self = this;
  98. naviItemNode.addEvent("click", function(){
  99. _self.setNavi(this);
  100. });
  101. return naviItemNode;
  102. },
  103. setNavi: function(item){
  104. var navi = item.retrieve("navi");
  105. this.naviItems.each(function(node){
  106. var itemNavi = node.retrieve("navi");
  107. var content = node.retrieve("content", null);
  108. if (content) content.destroy();
  109. node.eliminate("content");
  110. node.setStyles(this.css.naviItemNode);
  111. node.setStyle("background-image", "url(/x_component_Setting/$Main/default/icon/"+itemNavi.icon+".png)");
  112. }.bind(this));
  113. item.setStyles(this.css.naviItemNode_current);
  114. item.setStyle("background-image", "url(/x_component_Setting/$Main/default/icon/"+navi.icon+"_current.png)");
  115. if (this[navi.action]) this[navi.action](item);
  116. },
  117. loadApplicationServers: function(item){
  118. this.applicationServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.contentAreaNode);
  119. MWF.xDesktop.requireApp("Setting", "servers.ApplicationServers", function(){
  120. this.applicationServerList = new MWF.xApplication.Setting.servers.ApplicationServers(this);
  121. item.store("content", this.applicationServerList);
  122. }.bind(this));
  123. },
  124. loadDataServers: function(item){
  125. this.dataServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.contentAreaNode);
  126. MWF.xDesktop.requireApp("Setting", "servers.DataServers", function(){
  127. this.dataServerList = new MWF.xApplication.Setting.servers.DataServers(this);
  128. item.store("content", this.dataServerList);
  129. }.bind(this));
  130. },
  131. loadStorageServers: function(item){
  132. this.storageServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.contentAreaNode);
  133. MWF.xDesktop.requireApp("Setting", "servers.StorageServers", function(){
  134. this.storageServerList = new MWF.xApplication.Setting.servers.StorageServers(this);
  135. item.store("content", this.storageServerList);
  136. }.bind(this));
  137. },
  138. loadWebServers: function(item){
  139. this.webServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.contentAreaNode);
  140. MWF.xDesktop.requireApp("Setting", "servers.WebServers", function(){
  141. this.webServerList = new MWF.xApplication.Setting.servers.WebServers(this);
  142. item.store("content", this.webServerList);
  143. }.bind(this));
  144. },
  145. loadCenterServer: function(item){
  146. this.centerServerContent = new Element("div", {"styles": this.css.applicationServerContent}).inject(this.contentAreaNode);
  147. MWF.xDesktop.requireApp("Setting", "servers.CenterServer", function(){
  148. this.centerServerList = new MWF.xApplication.Setting.servers.CenterServer(this);
  149. item.store("content", this.centerServerList);
  150. }.bind(this));
  151. },
  152. getNaviJson: function(){
  153. return [
  154. {
  155. "text": this.app.lp.tab_centerServer,
  156. "icon": "center",
  157. "action": "loadCenterServer"
  158. },
  159. {
  160. "text": this.app.lp.tab_ApplicationServer,
  161. "icon": "application",
  162. "action": "loadApplicationServers"
  163. },
  164. {
  165. "text": this.app.lp.tab_WebServer,
  166. "icon": "web",
  167. "action": "loadWebServers"
  168. },
  169. {
  170. "text": this.app.lp.tab_DataServer,
  171. "icon": "data",
  172. "action": "loadDataServers"
  173. },
  174. {
  175. "text": this.app.lp.tab_StorageServer,
  176. "icon": "storage",
  177. "action": "loadStorageServers"
  178. }
  179. ];
  180. }
  181. });
  182. MWF.xApplication.Setting.ApplicationsExplorer = new Class({
  183. Extends: MWF.xApplication.Setting.ServersExplorer,
  184. initialize: function(app){
  185. this.app = app;
  186. this.container = this.app.applicationAreaNode;
  187. this.css = this.app.css;
  188. this.naviItems = [];
  189. this.load();
  190. },
  191. getNaviJson: function(){
  192. return [
  193. {
  194. "text": "Applications",
  195. "icon": "app",
  196. "action": "loadApplications"
  197. },
  198. {
  199. "text": "Datas",
  200. "icon": "data",
  201. "action": "loadDatas"
  202. },
  203. //{
  204. // "text": "DataMappings",
  205. // "icon": "data",
  206. // "action": "loadDataMappings"
  207. //},
  208. {
  209. "text": "Storages",
  210. "icon": "storage",
  211. "action": "loadStorages"
  212. }
  213. //{
  214. // "text": "StorageMappings",
  215. // "icon": "storage",
  216. // "action": "loadStorageMappings"
  217. //}
  218. ];
  219. },
  220. loadApplications: function(item){
  221. this.applicationsContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  222. MWF.xDesktop.requireApp("Setting", "applications.Applications", function(){
  223. this.applicationList = new MWF.xApplication.Setting.applications.Applications(this);
  224. item.store("content", this.applicationList);
  225. }.bind(this));
  226. },
  227. loadDatas: function(item){
  228. this.datasContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  229. MWF.xDesktop.requireApp("Setting", "applications.Datas", function(){
  230. this.dataList = new MWF.xApplication.Setting.applications.Datas(this);
  231. item.store("content", this.dataList);
  232. }.bind(this));
  233. },
  234. loadStorages: function(item){
  235. this.storagesContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  236. MWF.xDesktop.requireApp("Setting", "applications.Storages", function(){
  237. this.storageList = new MWF.xApplication.Setting.applications.Storages(this);
  238. item.store("content", this.storageList);
  239. }.bind(this));
  240. },
  241. });
  242. MWF.xApplication.Setting.ResourceExplorer = new Class({
  243. Extends: MWF.xApplication.Setting.ServersExplorer,
  244. initialize: function(app){
  245. this.app = app;
  246. this.container = this.app.resourceAreaNode;
  247. this.css = this.app.css;
  248. this.naviItems = [];
  249. this.load();
  250. },
  251. getNaviJson: function(){
  252. return [
  253. {
  254. "text": "Administrator",
  255. "icon": "admin",
  256. "action": "loadAdministrator"
  257. },
  258. {
  259. "text": "Collect",
  260. "icon": "collect",
  261. "action": "loadCollect"
  262. },
  263. {
  264. "text": "OpenMeeting",
  265. "icon": "openmeeting",
  266. "action": "loadOpenMeeting"
  267. },
  268. {
  269. "text": "Password",
  270. "icon": "password",
  271. "action": "loadPassword"
  272. },
  273. {
  274. "text": "Person",
  275. "icon": "person",
  276. "action": "loadPerson"
  277. },
  278. {
  279. "text": "SSO",
  280. "icon": "sso",
  281. "action": "loadSSO"
  282. },
  283. {
  284. "text": "WorkTime",
  285. "icon": "time",
  286. "action": "loadWorkTime"
  287. }
  288. ];
  289. },
  290. loadAdministrator: function(item){
  291. this.adminContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  292. MWF.xDesktop.requireApp("Setting", "resource.Administrator", function(){
  293. this.adminConfig = new MWF.xApplication.Setting.resource.Administrator(this);
  294. item.store("content", this.adminConfig);
  295. }.bind(this));
  296. },
  297. loadCollect: function(item){
  298. this.collectContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  299. MWF.xDesktop.requireApp("Setting", "resource.Collect", function(){
  300. this.collectConfig = new MWF.xApplication.Setting.resource.Collect(this);
  301. item.store("content", this.collectConfig);
  302. }.bind(this));
  303. },
  304. loadOpenMeeting: function(item){
  305. this.openmeetingContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  306. MWF.xDesktop.requireApp("Setting", "resource.Openmeeting", function(){
  307. this.openmeetingConfig = new MWF.xApplication.Setting.resource.Openmeeting(this);
  308. item.store("content", this.openmeetingConfig);
  309. }.bind(this));
  310. },
  311. loadPassword: function(item){
  312. this.passwordContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  313. MWF.xDesktop.requireApp("Setting", "resource.Password", function(){
  314. this.passwordConfig = new MWF.xApplication.Setting.resource.Password(this);
  315. item.store("content", this.passwordConfig);
  316. }.bind(this));
  317. },
  318. loadPerson: function(item){
  319. this.personContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  320. MWF.xDesktop.requireApp("Setting", "resource.Person", function(){
  321. this.personConfig = new MWF.xApplication.Setting.resource.Person(this);
  322. item.store("content", this.personConfig);
  323. }.bind(this));
  324. },
  325. loadSSO: function(item){
  326. this.ssoContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  327. MWF.xDesktop.requireApp("Setting", "resource.SSO", function(){
  328. this.ssoConfig = new MWF.xApplication.Setting.resource.SSO(this);
  329. item.store("content", this.ssoConfig);
  330. }.bind(this));
  331. },
  332. loadWorkTime: function(item){
  333. this.worktimeContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  334. MWF.xDesktop.requireApp("Setting", "resource.Worktime", function(){
  335. this.worktimeConfig = new MWF.xApplication.Setting.resource.Worktime(this);
  336. item.store("content", this.worktimeConfig);
  337. }.bind(this));
  338. },
  339. });
  340. MWF.xApplication.Setting.MobileExplorer = new Class({
  341. Extends: MWF.xApplication.Setting.ServersExplorer,
  342. initialize: function(app){
  343. this.app = app;
  344. this.container = this.app.mobileAreaNode;
  345. this.css = this.app.css;
  346. this.naviItems = [];
  347. this.load();
  348. },
  349. getNaviJson: function(){
  350. return [
  351. {
  352. "text": this.app.lp.mobileSetting1,
  353. "icon": "online",
  354. "action": "checkOnlineSetting"
  355. },
  356. {
  357. "text": this.app.lp.mobileSetting2,
  358. "icon": "account",
  359. "action": "accountSetting"
  360. },
  361. {
  362. "text": this.app.lp.mobileSetting3,
  363. "icon": "application",
  364. "action": "serverSetting"
  365. }
  366. ];
  367. },
  368. checkOnlineSetting: function(item){
  369. this.checkOnlineContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  370. MWF.xDesktop.requireApp("Setting", "mobile.CheckOnline", function(){
  371. this.checkOnline = new MWF.xApplication.Setting.mobile.CheckOnline(this);
  372. item.store("content", this.checkOnline);
  373. }.bind(this));
  374. },
  375. accountSetting: function(item){
  376. this.accountContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  377. MWF.xDesktop.requireApp("Setting", "mobile.Account", function(){
  378. this.account = new MWF.xApplication.Setting.mobile.Account(this);
  379. item.store("content", this.account);
  380. }.bind(this));
  381. },
  382. serverSetting: function(item){
  383. this.serverSettingContent = new Element("div", {"styles": this.css.applicationsContent}).inject(this.contentAreaNode);
  384. MWF.xDesktop.requireApp("Setting", "mobile.ServerSetting", function(){
  385. this.server = new MWF.xApplication.Setting.mobile.ServerSetting(this);
  386. item.store("content", this.server);
  387. }.bind(this));
  388. },
  389. });