HPCCPlatformOpsWidget.js 4.4 KB

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