HPCCPlatformOpsWidget.js 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*##############################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################## */
  16. define([
  17. "dojo/_base/declare",
  18. "dojo/_base/lang",
  19. "dojo/i18n",
  20. "dojo/i18n!./nls/hpcc",
  21. "dijit/registry",
  22. "hpcc/_TabContainerWidget",
  23. "hpcc/DiskUsageWidget",
  24. "hpcc/ESPRequest",
  25. "dojo/text!../templates/HPCCPlatformOpsWidget.html",
  26. "hpcc/UserQueryWidget",
  27. "dijit/layout/BorderContainer",
  28. "dijit/layout/TabContainer",
  29. "dijit/layout/ContentPane"
  30. ], function (declare, lang, i18n, nlsHPCC,
  31. registry,
  32. _TabContainerWidget, DiskUsageWidget, ESPRequest,
  33. template) {
  34. return declare("HPCCPlatformOpsWidget", [_TabContainerWidget], {
  35. templateString: template,
  36. baseClass: "HPCCPlatformOpsWidget",
  37. i18n: nlsHPCC,
  38. postCreate: function (args) {
  39. this.inherited(arguments);
  40. },
  41. startup: function (args) {
  42. this.inherited(arguments);
  43. },
  44. getTitle: function () {
  45. return this.i18n.title_HPCCPlatformOps;
  46. },
  47. // Hitched actions ---
  48. // Implementation ---
  49. init: function (params) {
  50. if (this.inherited(arguments))
  51. return;
  52. this.initTab();
  53. },
  54. initTab: function () {
  55. var currSel = this.getSelectedChild();
  56. if (currSel && !currSel.initalized) {
  57. if (currSel.id === this.id + "_Resources") {
  58. currSel.set("content", dojo.create("iframe", {
  59. src: "/esp/files/stub.htm?Widget=IFrameWidget&src=" + encodeURIComponent(ESPRequest.getBaseURL("WsSMC") + "/BrowseResources"),
  60. style: "border: 0; width: 100%; height: 100%"
  61. }));
  62. } else if (currSel.id === this.id + "_TargetClusters") {
  63. currSel.set("content", dojo.create("iframe", {
  64. src: "/esp/files/stub.htm?Widget=IFrameWidget&src=" + encodeURIComponent(ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT"),
  65. style: "border: 0; width: 100%; height: 100%"
  66. }));
  67. } else if (currSel.id === this.id + "_ClusterProcesses") {
  68. currSel.set("content", dojo.create("iframe", {
  69. src: "/esp/files/stub.htm?Widget=IFrameWidget&src=" + encodeURIComponent(ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT"),
  70. style: "border: 0; width: 100%; height: 100%"
  71. }));
  72. } else if (currSel.id === this.id + "_SystemServers") {
  73. currSel.set("content", dojo.create("iframe", {
  74. src: "/esp/files/stub.htm?Widget=IFrameWidget&src=" + encodeURIComponent(ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES"),
  75. style: "border: 0; width: 100%; height: 100%"
  76. }));
  77. } else if (currSel.init) {
  78. currSel.init({});
  79. }
  80. currSel.initalized = true;
  81. }
  82. }
  83. });
  84. });