1
0
Fork 0

scss-linted files and started clusterserver dashboard ng

This commit is contained in:
scottashton 2014-04-16 17:03:24 +02:00
parent d0b06f66e4
commit f1bf4e427b
20 changed files with 117 additions and 89 deletions

View File

@ -69,6 +69,7 @@ arangoDatabase, btoa, _*/
initialize: function () { initialize: function () {
var self = this; var self = this;
this.dygraphConfig = window.dygraphConfig; this.dygraphConfig = window.dygraphConfig;
window.modalView = new window.ModalView();
this.initial = this.planScenario; this.initial = this.planScenario;
this.isCheckingUser = false; this.isCheckingUser = false;
this.bind('all', function(trigger, args) { this.bind('all', function(trigger, args) {
@ -164,23 +165,10 @@ arangoDatabase, btoa, _*/
return; return;
} }
var statisticsDescriptionCollection = new window.StatisticsDescriptionCollection();
statisticsDescriptionCollection.fetch({
async: false,
beforeSend: this.addAuth.bind(this)
});
var statisticsCollection = new window.StatisticsCollection();
if (this.dashboardView) {
this.dashboardView.stopUpdating();
}
this.dashboardView = null;
server.addAuth = this.addAuth.bind(this); server.addAuth = this.addAuth.bind(this);
this.dashboardView = new window.ServerDashboardView({ this.dashboardView = new window.ServerDashboardView({
collection: statisticsCollection, dygraphConfig: window.newDygraphConfig,
description: statisticsDescriptionCollection, serverToShow : this.serverToShow
documentStore: new window.arangoDocuments(),
server : server,
dygraphConfig : this.dygraphConfig
}); });
this.dashboardView.render(); this.dashboardView.render();
} }

View File

@ -5,8 +5,7 @@
(function() { (function() {
"use strict"; "use strict";
window.ServerDashboardView = window.dashboardView.extend({ window.ServerDashboardView = window.newDashboardView.extend({
el: "#dbServerModal",
modal : true, modal : true,
hide: function() { hide: function() {
@ -15,9 +14,26 @@
}, },
render: function() { render: function() {
window.dashboardView.prototype.render.bind(this)(); var self = this;
$(this.el).modal("show"); window.modalView.hideFooter = true;
$(this.el).on("hidden", this.hide.bind(this)); window.modalView.show(
"newDashboardView.ejs",
"",
undefined,
undefined,
undefined,
this.events
);
window.newDashboardView.prototype.render.bind(this)(true);
window.modalView.hideFooter = false;
$('#modal-dialog').on('hidden', function () {
self.hide();
});
$('.modal-body').css({"max-height": "90%" });
$('#modal-dialog').toggleClass("modalChartDetail", true);
} }
}); });

View File

@ -540,7 +540,7 @@
var serv = {}; var serv = {};
var cur; var cur;
var coord; var coord;
$("#modalPlaceholder").html(this.modalDummy.render({})); $("#waitModalLayer").remove();
var ip_port = tar.attr("id"); var ip_port = tar.attr("id");
ip_port = ip_port.replace(/\-/g,'.'); ip_port = ip_port.replace(/\-/g,'.');
ip_port = ip_port.replace(/\_/g,':'); ip_port = ip_port.replace(/\_/g,':');

View File

@ -77,10 +77,10 @@
y: { y: {
labelsKMG2: false, labelsKMG2: false,
axisLabelFormatter: function (y) { axisLabelFormatter: function (y) {
return y.toPrecision(2) + "%"; return parseFloat(y.toPrecision(3) * 100) + "%";
}, },
valueFormatter: function (y) { valueFormatter: function (y) {
return y.toPrecision(2) + "%"; return parseFloat(y.toPrecision(3) * 100) + "%";
} }
} }
} }

View File

@ -253,31 +253,6 @@
this.dashboardView.render(); this.dashboardView.render();
}, },
/*
dashboard: function () {
this.naviView.selectMenuItem('dashboard-menu');
if (this.statisticsDescriptionCollection === undefined) {
this.statisticsDescriptionCollection = new window.StatisticsDescriptionCollection();
this.statisticsDescriptionCollection.fetch({
async: false
});
}
if (this.statistics === undefined) {
this.statisticsCollection = new window.StatisticsCollection();
}
if (this.dashboardView === undefined) {
this.dashboardView = new dashboardView({
collection: this.statisticsCollection,
description: this.statisticsDescriptionCollection,
documentStore: window.arangoDocumentsStore,
dygraphConfig: window.dygraphConfig
});
}
this.dashboardView.render();
},
*/
graph: function () { graph: function () {
var self = this; var self = this;
window.arangoCollectionsStore.fetch({ window.arangoCollectionsStore.fetch({

View File

@ -139,7 +139,7 @@
initialize: function () { initialize: function () {
this.dygraphConfig = this.options.dygraphConfig; this.dygraphConfig = this.options.dygraphConfig;
this.server = this.options.serverToShow;
}, },
updateCharts: function () { updateCharts: function () {
@ -234,7 +234,6 @@
Object.keys(this.barCharts).forEach(function (a) { Object.keys(this.barCharts).forEach(function (a) {
self.history[a] = self.mergeBarChartData(self.barCharts[a], newData); self.history[a] = self.mergeBarChartData(self.barCharts[a], newData);
}); });
console.log(newData.residentSizePercent, newData.residentSize);
self.history.residentSizeChart = self.history.residentSizeChart =
[ [
{ {
@ -313,7 +312,9 @@
url += "&filter=" + this.dygraphConfig.mapStatToFigure[figure].join(); url += "&filter=" + this.dygraphConfig.mapStatToFigure[figure].join();
this.alreadyCalledDetailChart.push(figure); this.alreadyCalledDetailChart.push(figure);
} }
console.log(url); if (this.server) {
url += "&server=" + this.server.target;
}
$.ajax( $.ajax(
url, url,
{async: false} {async: false}
@ -476,12 +477,10 @@
}, },
stopUpdating: function () { stopUpdating: function () {
console.log("stoping any update");
this.isUpdating = false; this.isUpdating = false;
}, },
startUpdating: function () { startUpdating: function () {
console.log("starting update");
var self = this; var self = this;
if (self.isUpdating) { if (self.isUpdating) {
return; return;
@ -490,10 +489,8 @@
self.timer = window.setInterval(function () { self.timer = window.setInterval(function () {
self.getStatistics(); self.getStatistics();
if (self.isUpdating === false) { if (self.isUpdating === false) {
console.log("no chart rendering");
return; return;
} }
console.log("chart rendering");
self.updateCharts(); self.updateCharts();
}, },
self.interval self.interval
@ -514,8 +511,10 @@
template: templateEngine.createTemplate("newDashboardView.ejs"), template: templateEngine.createTemplate("newDashboardView.ejs"),
render: function () { render: function (modalView) {
$(this.el).html(this.template.render()); if (!modalView) {
$(this.el).html(this.template.render());
}
this.getStatistics(); this.getStatistics();
this.prepareDygraphs(); this.prepareDygraphs();
this.prepareD3Charts(); this.prepareD3Charts();

View File

@ -117,8 +117,8 @@
.modalChartDetail { .modalChartDetail {
height: 500px; height: 500px;
position: fixed;
padding-left: 10px; padding-left: 10px;
position: fixed;
width: 90%; width: 90%;
} }

View File

@ -4,8 +4,8 @@ $dashboard-padding: 28px;
%dashboard-chart-box { %dashboard-chart-box {
@extend %pull-left; @extend %pull-left;
border-left: 1px solid $c-black; border-left: 1px solid $c-black;
cursor: pointer;
margin-left: -1px; margin-left: -1px;
cursor:pointer;
&:first-child { &:first-child {
border-left: 0; border-left: 0;
@ -16,6 +16,7 @@ $dashboard-padding: 28px;
.detailChart { .detailChart {
@extend %pull-left; @extend %pull-left;
} }
.dashboard-interior-chart { .dashboard-interior-chart {
@extend %pull-left; @extend %pull-left;
height: $dashboard-height - $dashboard-padding; height: $dashboard-height - $dashboard-padding;
@ -26,6 +27,14 @@ $dashboard-padding: 28px;
@extend %pull-left; @extend %pull-left;
height: $dashboard-height; height: $dashboard-height;
padding-top: $dashboard-padding; padding-top: $dashboard-padding;
}
.modal-body {
.dashboard-large-chart {
width: 66.66666666%;
}
} }
.dashboard-medium-chart { .dashboard-medium-chart {
@ -35,6 +44,12 @@ $dashboard-padding: 28px;
padding-top: $dashboard-padding; padding-top: $dashboard-padding;
} }
.modal-body {
.dashboard-medium-chart {
width: 66.666666666%;
}
}
.dashboard-small-chart { .dashboard-small-chart {
@extend %dashboard-chart-box; @extend %dashboard-chart-box;
@extend %pull-left; @extend %pull-left;
@ -42,34 +57,48 @@ $dashboard-padding: 28px;
padding-top: $dashboard-padding; padding-top: $dashboard-padding;
} }
.modal-body {
.dashboard-small-chart {
width: 33.33333333%;
}
}
.dashboard-tendency-chart { .dashboard-tendency-chart {
@extend %dashboard-chart-box; @extend %dashboard-chart-box;
@extend %pull-left; @extend %pull-left;
height: $dashboard-height + $dashboard-padding; height: $dashboard-height + $dashboard-padding;
} }
.modal-body {
.dashboard-tendency-chart {
width: 33.33333%;
}
}
.dashboard-legend { .dashboard-legend {
@extend %pull-left; @extend %pull-left;
height: $dashboard-height; height: $dashboard-height;
width: $legend-width; width: $legend-width;
.dashboard-legend-inner { .dashboard-legend-inner {
padding-top: 20px;
padding-left: 20px; padding-left: 20px;
padding-top: 20px;
} }
} }
.dashboard-detailLegend { .dashboard-detailLegend {
@extend %pull-left; @extend %pull-left;
height: $dashboard-height; height: $dashboard-height;
width: $legend-width;
position: fixed;
left: 90%; left: 90%;
position: fixed;
top: 40%; top: 40%;
width: $legend-width;
.dashboard-legend-inner { .dashboard-legend-inner {
padding-top: 20px;
padding-left: 20px; padding-left: 20px;
padding-top: 20px;
} }
} }
@ -140,8 +169,8 @@ $dashboard-padding: 28px;
@extend %dashboard-chart-box; @extend %dashboard-chart-box;
font-size: 25px; font-size: 25px;
height: ($dashboard-height + $dashboard-padding) / 2 - 36px - 36px - 2px; height: ($dashboard-height + $dashboard-padding) / 2 - 36px - 36px - 2px;
top: 15%;
text-align: center; text-align: center;
top: 15%;
width: 50%; width: 50%;
} }
@ -156,7 +185,8 @@ $dashboard-padding: 28px;
.dashboard-figure { .dashboard-figure {
@extend %pull-left; @extend %pull-left;
margin-bottom: 10%; margin-bottom: 10%;
margin-top: 7%;
margin-left: 19%; margin-left: 19%;
margin-top: 7%;
text-align: center; text-align: center;
} }

View File

@ -2753,9 +2753,10 @@ div.breadcrumb a.disabledBread {
opacity: .4; } opacity: .4; }
.modalChartDetail { .modalChartDetail {
height: 570px; height: 500px;
margin-left: 0; padding-left: 10px;
width: 70%; } position: fixed;
width: 90%; }
.modal { .modal {
border-radius: 0 !important; } border-radius: 0 !important; }

View File

@ -2734,8 +2734,8 @@ div.breadcrumb a.disabledBread {
.modalChartDetail { .modalChartDetail {
height: 500px; height: 500px;
position: fixed;
padding-left: 10px; padding-left: 10px;
position: fixed;
width: 90%; } width: 90%; }
.modal { .modal {
@ -3007,8 +3007,8 @@ pre.gv-object-view {
.dashboard-large-chart, .dashboard-medium-chart, .dashboard-small-chart, .dashboard-tendency-chart, .dashboard-subtitle-bar, .dashboard-tendency { .dashboard-large-chart, .dashboard-medium-chart, .dashboard-small-chart, .dashboard-tendency-chart, .dashboard-subtitle-bar, .dashboard-tendency {
border-left: 1px solid black; border-left: 1px solid black;
margin-left: -1px; cursor: pointer;
cursor: pointer; } margin-left: -1px; }
.dashboard-large-chart:first-child, .dashboard-medium-chart:first-child, .dashboard-small-chart:first-child, .dashboard-tendency-chart:first-child, .dashboard-subtitle-bar:first-child, .dashboard-tendency:first-child { .dashboard-large-chart:first-child, .dashboard-medium-chart:first-child, .dashboard-small-chart:first-child, .dashboard-tendency-chart:first-child, .dashboard-subtitle-bar:first-child, .dashboard-tendency:first-child {
border-left: 0; border-left: 0;
margin-left: 0; } margin-left: 0; }
@ -3020,33 +3020,45 @@ pre.gv-object-view {
height: 250px; height: 250px;
padding-top: 28px; } padding-top: 28px; }
.modal-body .dashboard-large-chart {
width: 66.66666666%; }
.dashboard-medium-chart { .dashboard-medium-chart {
height: 250px; height: 250px;
padding-top: 28px; } padding-top: 28px; }
.modal-body .dashboard-medium-chart {
width: 66.666666666%; }
.dashboard-small-chart { .dashboard-small-chart {
height: 250px; height: 250px;
padding-top: 28px; } padding-top: 28px; }
.modal-body .dashboard-small-chart {
width: 33.33333333%; }
.dashboard-tendency-chart { .dashboard-tendency-chart {
height: 278px; } height: 278px; }
.modal-body .dashboard-tendency-chart {
width: 33.33333%; }
.dashboard-legend { .dashboard-legend {
height: 250px; height: 250px;
width: 200px; } width: 200px; }
.dashboard-legend .dashboard-legend-inner { .dashboard-legend .dashboard-legend-inner {
padding-top: 20px; padding-left: 20px;
padding-left: 20px; } padding-top: 20px; }
.dashboard-detailLegend { .dashboard-detailLegend {
height: 250px; height: 250px;
width: 200px;
position: fixed;
left: 90%; left: 90%;
top: 40%; } position: fixed;
top: 40%;
width: 200px; }
.dashboard-detailLegend .dashboard-legend-inner { .dashboard-detailLegend .dashboard-legend-inner {
padding-top: 20px; padding-left: 20px;
padding-left: 20px; } padding-top: 20px; }
.dashboard-half-height-legend { .dashboard-half-height-legend {
height: 125px; height: 125px;
@ -3095,8 +3107,8 @@ pre.gv-object-view {
.dashboard-tendency { .dashboard-tendency {
font-size: 25px; font-size: 25px;
height: 65px; height: 65px;
top: 15%;
text-align: center; text-align: center;
top: 15%;
width: 50%; } width: 50%; }
.dashboard-row { .dashboard-row {
@ -3107,8 +3119,8 @@ pre.gv-object-view {
.dashboard-figure { .dashboard-figure {
margin-bottom: 10%; margin-bottom: 10%;
margin-top: 7%;
margin-left: 19%; margin-left: 19%;
margin-top: 7%;
text-align: center; } text-align: center; }
.dashboardModal { .dashboardModal {

View File

@ -245,6 +245,9 @@
"clusterFrontend/html/head.html.part", "clusterFrontend/html/head.html.part",
"frontend/js/templates/footerView.ejs", "frontend/js/templates/footerView.ejs",
"frontend/js/templates/dashboardView.ejs", "frontend/js/templates/dashboardView.ejs",
"frontend/js/templates/newDashboardView.ejs",
"frontend/js/templates/modalBase.ejs",
"frontend/js/templates/modalGraph.ejs",
"frontend/js/templates/dashboardDistributed.ejs", "frontend/js/templates/dashboardDistributed.ejs",
"frontend/js/templates/dashboardHttpGroup.ejs", "frontend/js/templates/dashboardHttpGroup.ejs",
"frontend/js/templates/lineChartDetailView.ejs", "frontend/js/templates/lineChartDetailView.ejs",
@ -275,7 +278,10 @@
"frontend/js/arango/templateEngine.js", "frontend/js/arango/templateEngine.js",
"frontend/js/views/footerView.js", "frontend/js/views/footerView.js",
"frontend/js/views/dashboardView.js", "frontend/js/views/dashboardView.js",
"frontend/js/views/newDashboardView.js",
"frontend/js/views/modalView.js",
"frontend/js/config/dygraphConfig.js", "frontend/js/config/dygraphConfig.js",
"frontend/js/config/newDygraphConfig.js",
"frontend/js/collections/arangoStatisticsDescriptionCollection.js", "frontend/js/collections/arangoStatisticsDescriptionCollection.js",
"clusterFrontend/js/views/**", "clusterFrontend/js/views/**",
"clusterFrontend/js/routers/**" "clusterFrontend/js/routers/**"

View File

@ -824,6 +824,7 @@ function computeStatisticsSeries (start, attrs) {
controller.get("full", function (req, res) { controller.get("full", function (req, res) {
var start = req.params("start"); var start = req.params("start");
var filter = req.params("filter"); var filter = req.params("filter");
var server = req.params("server");
var attrs = null; var attrs = null;
if (start !== null && start !== undefined) { if (start !== null && start !== undefined) {