HPCCPlatformOpsWidget.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. "dijit/registry",
  19. "hpcc/_TabContainerWidget",
  20. "hpcc/ESPRequest",
  21. "dojo/text!../templates/HPCCPlatformOpsWidget.html",
  22. "dijit/layout/BorderContainer",
  23. "dijit/layout/TabContainer",
  24. "dijit/layout/ContentPane"
  25. ], function (declare,
  26. registry,
  27. _TabContainerWidget, ESPRequest,
  28. template) {
  29. return declare("HPCCPlatformOpsWidget", [_TabContainerWidget], {
  30. templateString: template,
  31. baseClass: "HPCCPlatformOpsWidget",
  32. postCreate: function (args) {
  33. this.inherited(arguments);
  34. },
  35. startup: function (args) {
  36. this.inherited(arguments);
  37. },
  38. getTitle: function () {
  39. return "HPCC Platform - Operations";
  40. },
  41. // Hitched actions ---
  42. // Implementation ---
  43. init: function (params) {
  44. if (this.inherited(arguments))
  45. return;
  46. this.initTab();
  47. },
  48. initTab: function () {
  49. var currSel = this.getSelectedChild();
  50. if (currSel && !currSel.initalized) {
  51. if (currSel.id === this.id + "_Resources") {
  52. currSel.set("content", dojo.create("iframe", {
  53. src: ESPRequest.getBaseURL("WsSMC") + "/BrowseResources",
  54. style: "border: 0; width: 100%; height: 100%"
  55. }));
  56. } else if (currSel.id === this.id + "_Users") {
  57. currSel.set("content", dojo.create("iframe", {
  58. src: ESPRequest.getBaseURL("ws_access") + "/Users",
  59. style: "border: 0; width: 100%; height: 100%"
  60. }));
  61. } else if (currSel.id === this.id + "_Groups") {
  62. currSel.set("content", dojo.create("iframe", {
  63. src: ESPRequest.getBaseURL("ws_access") + "/Groups",
  64. style: "border: 0; width: 100%; height: 100%"
  65. }));
  66. } else if (currSel.id === this.id + "_Permissions") {
  67. currSel.set("content", dojo.create("iframe", {
  68. src: ESPRequest.getBaseURL("ws_access") + "/Permissions",
  69. style: "border: 0; width: 100%; height: 100%"
  70. }));
  71. } else if (currSel.id === this.id + "_TargetClusters") {
  72. currSel.set("content", dojo.create("iframe", {
  73. src: ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT",
  74. style: "border: 0; width: 100%; height: 100%"
  75. }));
  76. } else if (currSel.id === this.id + "_ClusterProcesses") {
  77. currSel.set("content", dojo.create("iframe", {
  78. src: ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT",
  79. style: "border: 0; width: 100%; height: 100%"
  80. }));
  81. } else if (currSel.id === this.id + "_SystemServers") {
  82. currSel.set("content", dojo.create("iframe", {
  83. src: ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES",
  84. style: "border: 0; width: 100%; height: 100%"
  85. }));
  86. } else if (currSel.init) {
  87. currSel.init(currSel.params);
  88. }
  89. currSel.initalized = true;
  90. }
  91. }
  92. });
  93. });