blob: 2b1214cc01fbb1fcbe2b6ce5f2de4fcdb6ecc8f5 [file] [log] [blame]
<!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">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Storm UI</title>
<link href="/css/bootstrap-3.3.1.min.css" rel="stylesheet" type="text/css">
<link href="/css/jquery.dataTables.1.10.4.min.css" rel="stylesheet" type="text/css">
<link href="/css/dataTables.bootstrap.css" rel="stylesheet" type="text/css">
<link href="/css/jsonFormatter.min.css" rel="stylesheet" type="text/css">
<link href="/css/style.css" rel="stylesheet" type="text/css">
<script src="/js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/js/jquery.dataTables.1.10.4.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-3.3.1.min.js" type="text/javascript"></script>
<script src="/js/jquery.blockUI.min.js" type="text/javascript"></script>
<script src="/js/jsonFormatter.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>
<script src="/js/dataTables.bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-11">
<h1><a href="/">Storm UI</a></h1>
</div>
<div id="ui-user" class="col-md-1"></div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Topology summary</h2>
<div id="topology-summary"></div>
</div>
</div>
<div class="row">
<div id="topology-actions" class="col-md-12"></div>
</div>
<div class="row">
<div id="topology-stats" class="col-md-12"></div>
</div>
<div class="row">
<div id="spout-stats" class="col-md-12"></div>
</div>
<div class="row">
<div id="bolt-stats" class="col-md-12"></div>
</div>
<div class="row">
<div id="topology-visualization" class="col-md-12"></div>
</div>
<div class="row">
<div id="topology-configuration" class="col-md-12"></div>
</div>
<div class="row">
<div class="col-md-12">
<p id="toggle-switch" style="display: block;" class="js-only"></p>
</div>
</div>
<div class="row">
<div id="json-response-error" class="col-md-12"></div>
</div>
</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 tableStateKey = ":".concat(topologyId);
var window = $.url("?window");
var sys = $.cookies.get("sys") || "false";
var url = "/api/v1/topology/"+topologyId+"?sys="+sys;
if(window) url += "&window="+window;
$.extend( $.fn.dataTable.defaults, {
stateSave: true,
stateSaveCallback: function (oSettings, oData) {
sessionStorage.setItem( oSettings.sTableId.concat(tableStateKey), JSON.stringify(oData) );
},
stateLoadCallback: function (oSettings) {
return JSON.parse( sessionStorage.getItem(oSettings.sTableId.concat(tableStateKey)) );
},
lengthMenu: [[20,40,60,100,-1], [20, 40, 60, 100, "All"]],
pageLength: 20
});
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 uiUser = $("#ui-user");
$.get("/templates/user-template.html", function(template) {
uiUser.append(Mustache.render($(template).filter("#user-template").html(),response));
$('#ui-user [data-toggle="tooltip"]').tooltip();
});
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"],response["debug"],response["samplingPct"]);
$.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));
//window, emitted, transferred, complete latency, acked, failed
$("#topology-stats-table").DataTable({
paging: false,
info: false,
searching: false,
columnDefs: [
{type: "num", targets: [1, 2, 3, 4, 5]},
{type: "time-str", targets: [0]}
]
});
spoutStats.append(Mustache.render($(template).filter("#spout-stats-template").html(),response));
//id, executors, tasks, emitted, transferred, complete latency, acked, failed, Last error
dtAutoPage("#spout-stats-table", {
columnDefs: [
{type: "num", targets: [1, 2, 3, 4, 5, 6, 7]}
]
});
boltStats.append(Mustache.render($(template).filter("#bolt-stats-template").html(),response));
//id, executors, tasks, emitted, transferred, capacity, execute latency, executed, process latency, acked, failed, last error
dtAutoPage("#bolt-stats-table", {
columnDefs: [
{type: "num", targets: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
]
});
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 td').jsonFormatter()
//key, value
dtAutoPage("#topology-configuration-table", {});
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";
}
}
var errorTime = document.getElementsByClassName("errorTime");
for (i=0; i < errorTime.length; i++)
{
if((errorTime[i].id))
{
var a = new Date(parseInt(errorTime[i].id));
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat'];
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var hour = a.getHours();
var min = a.getMinutes();
var sec = a.getSeconds();
var day = days[a.getDay()];
if (hour < 10) {hour = "0"+hour;}
if (min < 10) {min = "0"+min;}
if (sec < 10) {sec = "0"+sec;}
var time = day + ', '+date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;
errorTime[i].innerHTML = time;
var sec_num = parseInt(errorTime[i].title, 10);
var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
var seconds = sec_num - (hours * 3600) - (minutes * 60);
if (hours < 10) {hours = "0"+hours;}
if (minutes < 10) {minutes = "0"+minutes;}
if (seconds < 10) {seconds = "0"+seconds;}
var time = hours+':'+minutes+':'+seconds;
errorTime[i].title = "Elapsed Time Since Error: " + time;
}
}
$('#topology-summary [data-toggle="tooltip"]').tooltip();
$('#topology-stats [data-toggle="tooltip"]').tooltip();
$('#spout-stats [data-toggle="tooltip"]').tooltip();
$('#bolt-stats [data-toggle="tooltip"]').tooltip();
$('#topology-configuration [data-toggle="tooltip"]').tooltip();
$('#topology-actions [data-toggle="tooltip"]').tooltip();
$('#topology-visualization [data-toggle="tooltip"]').tooltip();
});
});
});
</script>
</html>