Skip to content

Commit

Permalink
Changed dashboard size and visualizations distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
gorco committed Sep 13, 2016
1 parent 15ee897 commit 7d3d32b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 40 deletions.
10 changes: 6 additions & 4 deletions app/public/js/controllers/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ angular.module('myApp', [
$http.post(CONSTANTS.PROXY + '/kibana/visualization/session/' + $scope.selectedGame._id + '/' + visualizationId + '/' + $scope.testIndex, {})
.success(function(data) {
panels.push('{\"id\":\"' + visualizationId + '_' + $scope.testIndex + '\",\"type\":\"visualization\",\"panelIndex\":' + numPan + ',' +
'\"size_x\":3,\"size_y\":2,\"col\":1,\"row\":' + numPan + '}');
'\"size_x\":6,\"size_y\":4,\"col\":'+(1+(numPan-1%2))+',\"row\":' + (numPan+1/2) + '}');
uiStates['P-' + numPan] = {vis: {legendOpen: false}};
numPan++;

Expand All @@ -651,16 +651,18 @@ angular.module('myApp', [
optionsJSON: '{"darkTheme":false}',
uiStateJSON: JSON.stringify(uiStates),
version: 1,
timeRestore: false,
timeRestore: true,
timeTo: "now",
timeFrom: "now-1h",
kibanaSavedObjectMeta: {
searchSourceJSON: '{"filter":[{"query":{"query_string":{"query":"*","analyze_wildcard":true}}}]}'
}
};
$http.post(CONSTANTS.PROXY + '/kibana/dashboard/session/' + $scope.testIndex, dashboard)
.success(function(data) {
var url = CONSTANTS.KIBANA + '/app/kibana#/dashboard/dashboard_' +
$scope.testIndex + '?embed=true_g=(refreshInterval:' +
'(display:Off,pause:!f,value:0),time:(from:now-5y,mode:quick,to:now))';
$scope.testIndex + "?embed=true_g=(refreshInterval:(display:'5%20seconds'," +
"pause:!f,section:1,value:5000),time:(from:now-1h,mode:quick,to:now))";
if (url.startsWith('localhost')) {
url = 'http://' + url;
}
Expand Down
7 changes: 5 additions & 2 deletions app/public/js/controllers/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ angular.module('classApp', ['ngStorage', 'services'])
{}).success(function(result) {
panels.push('{\"id\":\"' + visualizationId + '_' + session._id +
'\",\"type\":\"visualization\",\"panelIndex\":' + numPan + ',' +
'\"size_x\":3,\"size_y\":2,\"col\":1,\"row\":' + numPan + '}');
'\"size_x\":6,\"size_y\":4,\"col\":'+(1+(numPan-1%2))+',\"row\":' +
(numPan+1/2) + '}');
uiStates['P-' + numPan] = {vis: {legendOpen: false}};
numPan++;

Expand All @@ -80,7 +81,9 @@ angular.module('classApp', ['ngStorage', 'services'])
optionsJSON: '{"darkTheme":false}',
uiStateJSON: JSON.stringify(uiStates),
version: 1,
timeRestore: false,
timeRestore: true,
timeTo: "now",
timeFrom: "now-1h",
kibanaSavedObjectMeta: {
searchSourceJSON: '{"filter":[{"query":{"query_string":{"query":"*","analyze_wildcard":true}}}]}'
}
Expand Down
4 changes: 2 additions & 2 deletions app/public/js/controllers/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ angular.module('sessionApp', ['myApp', 'ngStorage', 'services'])

$scope.dashboardLink = function() {
var url = CONSTANTS.KIBANA + '/app/kibana#/dashboard/dashboard_' +
QueryParams.getQueryParam('session') + '?embed=true_g=(refreshInterval:' +
'(display:Off,pause:!f,value:0),time:(from:now-5y,mode:quick,to:now))';
QueryParams.getQueryParam('session') + "?embed=true_g=(refreshInterval:(display:'5%20seconds'," +
"pause:!f,section:1,value:5000),time:(from:now-1h,mode:quick,to:now))";
if (url.startsWith('localhost')) {
url = 'http://' + url;
}
Expand Down
33 changes: 1 addition & 32 deletions app/views/data/realtime/realtime.jade
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,5 @@ link(rel="stylesheet", href="css/realtime.css")
#warnings.tab-pane.col-xs-12
.row(ng-repeat="i in player.warnings") {{ version.warnings[i].message }}
.row(ng-show="!player")
iframe.no-border(src = "{{dashboardLink()}}" height="600" width="800")
.row(ng-show="!player")
ul.nav.nav-tabs(role="tablist")
li.col-xs-6.active.tab-button
a(href="#all" data-toggle="tab") All
li.col-xs-6.tab-button
a(href="#players" data-toggle="tab") Players ({{ results.length }})
.row.tab-content(ng-show="!player")
#all.tab-pane.active.col-xs-12
.row.titles
.col-xs-6 Progress
.col-xs-6 Score
.row
#progress.col-xs-4.col-xs-offset-1
#score.col-xs-4.col-xs-offset-2
p Warnings
ul
li(ng-repeat="warning in agg.warnings") {{ warning.count }} - {{ warning.message }}
p Alerts
ul
li(ng-repeat="alert in agg.alerts") {{ alert.count }} - {{ alert.message }}
#players.tab-pane.col-xs-12
.row.player-result(ng-repeat="result in results | orderBy:alertScore:true" reports)
.col-xs-6.no-padding(ng-click="viewPlayer(result)")
svg(viewBox="0 0 200 100")
text(dominant-baseline="middle" x="15" y="20" style="fill: black") {{ result.name }}
circle(cx="25" cy="60" r="5" fill="red")
text(dominant-baseline="middle" x="35" y="60" style="fill: black") {{ result.alerts.length }}
circle(cx="75" cy="60" r="5" fill="orange")
text(dominant-baseline="middle" x="85" y="60" style="fill: black") {{ result.warnings.length }}
.col-xs-3.progress-marker.no-padding
.col-xs-3.score-marker.no-padding
iframe.no-border(src = "{{dashboardLink()}}" height="800px" width="100%")
include scripts

0 comments on commit 7d3d32b

Please sign in to comment.