| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <html><head> |
| <meta charset="UTF-8"> |
| <title>Storm UI</title> |
| <link href="/css/bootstrap-1.4.0.css" rel="stylesheet" type="text/css"> |
| <link href="/css/style.css" rel="stylesheet" type="text/css"> |
| <script src="/js/jquery-1.6.2.min.js" type="text/javascript"></script> |
| <script src="/js/jquery.tablesorter.min.js" type="text/javascript"></script> |
| <script src="/js/jquery.cookies.2.2.0.min.js" type="text/javascript"></script> |
| <script src="/js/jquery.mustache.js" type="text/javascript"></script> |
| <script src="/js/url.min.js" type="text/javascript"></script> |
| <script src="/js/bootstrap-twipsy.js" type="text/javascript"></script> |
| <script src="/js/jquery.blockUI.min.js" type="text/javascript"></script> |
| <script src="/js/script.js" type="text/javascript"></script> |
| <script src="/js/visualization.js" type="text/javascript"></script> |
| <script src="/js/arbor.js" type="text/javascript"></script> |
| <script src="/js/arbor-graphics.js" type="text/javascript"></script> |
| </head> |
| <body> |
| <h1><a href="/">Storm UI</a></h1> |
| <h2>Topology summary</h2> |
| <div id="topology-summary"> |
| </div> |
| <div id="topology-actions"> |
| <h2 class="js-only">Topology actions</h2> |
| <p id="topology-actions" class="js-only"> |
| </p> |
| </div> |
| <div id="topology-stats"></div> |
| <div id="spout-stats"> |
| </div> |
| <div id="bolt-stats"> |
| </div> |
| <div id="topology-visualization"> |
| </div> |
| <div id="topology-configuration"> |
| </div> |
| <p id="toggle-switch" style="display: block;" class="js-only"></p> |
| <div id="json-response-error"> |
| </div> |
| </body> |
| <script> |
| $(document).ajaxStop($.unblockUI); |
| $(document).ajaxStart(function(){ |
| if ($("#topology-visualization").children().size() == 0) { |
| $.blockUI({ message: '<img src="images/spinner.gif" /> <h3>Loading topology summary...</h3>'}); |
| } |
| }); |
| $(document).ready(function() { |
| var topologyId = $.url("?id"); |
| var window = $.url("?window"); |
| var sys = $.cookies.get("sys") || "false"; |
| var url = "/api/v1/topology/"+topologyId+"?sys="+sys; |
| if(window) url += "&window="+window; |
| renderToggleSys($("#toggle-switch")); |
| $.ajaxSetup({ |
| "error":function(jqXHR,textStatus,response) { |
| var errorJson = jQuery.parseJSON(jqXHR.responseText); |
| $.get("/templates/json-error-template.html", function(template) { |
| $("#json-response-error").append(Mustache.render($(template).filter("#json-error-template").html(),errorJson)); |
| }); |
| } |
| }); |
| |
| $.getJSON(url,function(response,status,jqXHR) { |
| var topologySummary = $("#topology-summary"); |
| var topologyStats = $("#topology-stats"); |
| var spoutStats = $("#spout-stats"); |
| var boltStats = $("#bolt-stats"); |
| var config = $("#topology-configuration"); |
| var topologyActions = $("#topology-actions"); |
| var topologyVisualization = $("#topology-visualization") |
| var formattedConfig = formatConfigData(response["configuration"]); |
| var buttonJsonData = topologyActionJson(response["id"],response["encodedId"],response["name"],response["status"],response["msgTimeout"]); |
| $.get("/templates/topology-page-template.html", function(template) { |
| topologySummary.append(Mustache.render($(template).filter("#topology-summary-template").html(),response)); |
| topologyActions.append(Mustache.render($(template).filter("#topology-actions-template").html(),buttonJsonData)); |
| topologyStats.append(Mustache.render($(template).filter("#topology-stats-template").html(),response)); |
| if(response["topologyStats"].length > 0) { |
| $("#topology-stats-table").tablesorter({ sortList: [[0,0]], headers: {0: { sorter: "stormtimestr"}}}); |
| } |
| spoutStats.append(Mustache.render($(template).filter("#spout-stats-template").html(),response)); |
| if(response["spouts"].length > 0) { |
| $("#spout-stats-table").tablesorter({sortList: [[0,0]], headers:{}}); |
| } |
| boltStats.append(Mustache.render($(template).filter("#bolt-stats-template").html(),response)); |
| if(response["bolts"].length > 0) { |
| $("#bolt-stats-table").tablesorter({sortList: [[0,0]], headers:{}}); |
| } |
| |
| topologyVisualization.append(Mustache.render($(template).filter("#topology-visualization-template").html(), response)); |
| $("#show-hide-visualization").click(function () { show_visualization(null) }); |
| |
| config.append(Mustache.render($(template).filter("#topology-configuration-template").html(),formattedConfig)); |
| $("#topology-configuration-table").tablesorter({ sortList: [[0,0]], headers: {}}); |
| |
| var errorCells = document.getElementsByClassName("errorSpan"); |
| for (i =0; i < errorCells.length; i++) |
| { |
| var timeLapsedInSecs = errorCells[i].id; |
| if (parseInt(timeLapsedInSecs) < 1800) { |
| errorCells[i].style.color = "#9d261d"; |
| errorCells[i].style.borderBottomColor = "#9d261d"; |
| } |
| } |
| }); |
| }); |
| }); |
| </script> |
| </html> |