Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<script id="executors-summary-template" type="text/html">
<h4 style="clear: left; display: inline-block;">Summary</h4>
<h4 class="title-table">Summary</h4>
<div class="container-fluid">
<div class="container-fluid">
<table id="summary-execs-table" class="table table-striped compact">
Expand Down Expand Up @@ -64,7 +64,7 @@ <h4 style="clear: left; display: inline-block;">Summary</h4>
</table>
</div>
</div>
<h4 style="clear: left; display: inline-block;">Executors</h4>
<h4 class="title-table">Executors</h4>
<div class="container-fluid">
<div class="container-fluid">
<table id="active-executors-table" class="table table-striped compact">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,46 +53,6 @@ $(document).ajaxStart(function () {
$.blockUI({message: '<h3>Loading Executors Page...</h3>'});
});

function createTemplateURI(appId) {
var words = document.baseURI.split('/');
var ind = words.indexOf("proxy");
if (ind > 0) {
var baseURI = words.slice(0, ind + 1).join('/') + '/' + appId + '/static/executorspage-template.html';
return baseURI;
}
ind = words.indexOf("history");
if(ind > 0) {
var baseURI = words.slice(0, ind).join('/') + '/static/executorspage-template.html';
return baseURI;
}
return location.origin + "/static/executorspage-template.html";
}

function getStandAloneppId(cb) {
var words = document.baseURI.split('/');
var ind = words.indexOf("proxy");
if (ind > 0) {
var appId = words[ind + 1];
cb(appId);
return;
}
ind = words.indexOf("history");
if (ind > 0) {
var appId = words[ind + 1];
cb(appId);
return;
}
//Looks like Web UI is running in standalone mode
//Let's get application-id using REST End Point
$.getJSON(location.origin + "/api/v1/applications", function(response, status, jqXHR) {
if (response && response.length > 0) {
var appId = response[0].id
cb(appId);
return;
}
});
}

function createRESTEndPoint(appId) {
var words = document.baseURI.split('/');
var ind = words.indexOf("proxy");
Expand All @@ -115,16 +75,6 @@ function createRESTEndPoint(appId) {
return location.origin + "/api/v1/applications/" + appId + "/allexecutors";
}

function formatLogsCells(execLogs, type) {
if (type !== 'display') return Object.keys(execLogs);
if (!execLogs) return;
var result = '';
$.each(execLogs, function (logName, logUrl) {
result += '<div><a href=' + logUrl + '>' + logName + '</a></div>'
});
return result;
}

function logsExist(execs) {
return execs.some(function(exec) {
return !($.isEmptyObject(exec["executorLogs"]));
Expand Down Expand Up @@ -172,15 +122,11 @@ function totalDurationColor(totalGCTime, totalDuration) {
}

$(document).ready(function () {
$.extend($.fn.dataTable.defaults, {
stateSave: true,
lengthMenu: [[20, 40, 60, 100, -1], [20, 40, 60, 100, "All"]],
pageLength: 20
});
setDataTableDefaults();

executorsSummary = $("#active-executors");

getStandAloneppId(function (appId) {
getStandAloneAppId(function (appId) {

var endPoint = createRESTEndPoint(appId);
$.getJSON(endPoint, function (response, status, jqXHR) {
Expand Down Expand Up @@ -402,7 +348,7 @@ $(document).ready(function () {
};

var data = {executors: response, "execSummary": [activeSummary, deadSummary, totalSummary]};
$.get(createTemplateURI(appId), function (template) {
$.get(createTemplateURI(appId, "executorspage"), function (template) {

executorsSummary.append(Mustache.render($(template).filter("#executors-summary-template").html(), data));
var selector = "#active-executors-table";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ function makeIdNumeric(id) {
return resl;
}

function formatDate(date) {
if (date <= 0) return "-";
else return date.split(".")[0].replace("T", " ");
}

function getParameterByName(name, searchString) {
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(searchString);
Expand Down
Loading