Skip to content

Commit

Permalink
1.42.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Nov 9, 2016
1 parent 31207fc commit b56e43a
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 63 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.42.0 (11/10/2016)

## Features

- Analytics / Dashboard Analytics pages: Most charts now reflect data for the selected time-range

- Stoplight Widget: Add tooltip option

# 1.41.0 (10/27/2016)

## Features
Expand Down
4 changes: 2 additions & 2 deletions cyclotron-site/app/partials/analytics.jade
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
span.more(ng-click='toggleLimit("topDashboardsLimit")', ng-show='topDashboardsLimit == largeLimit')
i.fa.fa-minus-square-o
| less
h2 Most Visited Dashboards
h2 Most Visited Dashboards (All-Time)
table.table(ts-wrapper)
thead
tr
Expand Down Expand Up @@ -159,7 +159,7 @@

.row
.col-md-4.col-sm-6
h2 Data Sources Used
h2 Data Sources Used
div.c3chart(data='dataSourcesPie', options='dataSourceTypesOptions')
.col-md-4.col-sm-6
h2 Widgets Used
Expand Down
10 changes: 5 additions & 5 deletions cyclotron-site/app/partials/dashboardAnalytics.jade
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

.row
.col-sm-8
h2 Data Sources (All-Time)
h2 Data Sources
table.table(ts-wrapper)
thead
tr
Expand All @@ -74,7 +74,7 @@
td {{ dataSource.avgDuration | numeraljs:'0.0' }}

.col-sm-4
h2 Top Unique Visitors (All-Time)
h2 Top Unique Visitors
table.table(ts-wrapper)
thead
tr
Expand All @@ -87,11 +87,11 @@

.row
.col-sm-4
h2 Browser Usage (All-Time)
h2 Browser Usage
div.c3chart(data='browsers', options='browserOptions')
.col-sm-4
h2 Widgets Viewed (All-Time)
h2 Widgets Viewed
div.c3chart(data='widgets', options='widgetOptions')
.col-sm-4
h2 Views Per Page (All-Time)
h2 Views Per Page
div.c3chart(data='viewsPerPage', options='viewsPerPageOptions')
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cyclotronServices.factory 'commonConfigService', ->

exports = {

version: '1.41.0'
version: '1.42.0'

logging:
enableDebug: false
Expand Down Expand Up @@ -3558,6 +3558,15 @@ cyclotronServices.factory 'commonConfigService', ->
placeholder: 'Rule Expression'
inlineJs: true
order: 1
tooltip:
label: 'Tooltip'
description: 'Sets the tooltip of the stoplight.'
placeholder: 'Tooltip'
type: 'string'
inlineJs: true
required: false
defaultHidden: true
order: 12
filters:
label: 'Filters'
description: "Optional, but if provided, specifies name-value pairs used to filter the data source's result set. This has no effect if the dataSource property is not set.\nOnly the first row of the data source is used to get data, so this property can be used to narrow down on the correct row"
Expand Down
40 changes: 20 additions & 20 deletions cyclotron-site/app/scripts/mgmt/controller.analytics.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,29 @@ cyclotronApp.controller 'AnalyticsController', ($scope, $uibModal, analyticsServ
# Analytics over time
$scope.loadLifetimeData = ->

analyticsService.getTopDashboards().then (dashboards) ->
$scope.topDashboards = dashboards

analyticsService.getStatistics().then (statistics) ->
$scope.statistics = statistics

analyticsService.getUniqueVisitors().then (visitors) ->
# Analytics relative to a startDate
$scope.loadTimeseriesData = ->
timeSpan = $scope.selectedTimespan.split('_')
if timeSpan.length == 1 then timeSpan.unshift 1
startDate = moment().subtract(timeSpan[0], timeSpan[1])

analyticsService.getPageViewsOverTime(null, startDate).then (pageViews) ->
$scope.pageViews = pageViews

analyticsService.getVisitsOverTime(null, startDate).then (visits) ->
$scope.visits = visits

analyticsService.getUniqueVisitors(null, startDate).then (visitors) ->
$scope.uniqueVisitorCount = visitors.length
$scope.uniqueVisitors = visitors

analyticsService.getBrowsers().then (browsers) ->
analyticsService.getBrowsers(null, startDate).then (browsers) ->
$scope.browsers = browsers

# Pie chart
Expand All @@ -91,7 +106,7 @@ cyclotronApp.controller 'AnalyticsController', ($scope, $uibModal, analyticsServ

$scope.browsersPie = [reducedBrowsers]

analyticsService.getDataSourcesByType().then (dataSourcesByType) ->
analyticsService.getDataSourcesByType(null, startDate).then (dataSourcesByType) ->
$scope.dataSourcesByType = dataSourcesByType

$scope.dataSourceTypesOptions.data.keys = { value: _.pluck dataSourcesByType, 'dataSourceType' }
Expand All @@ -102,7 +117,7 @@ cyclotronApp.controller 'AnalyticsController', ($scope, $uibModal, analyticsServ

$scope.dataSourcesPie = [reducedTypes]

analyticsService.getWidgets().then (widgets) ->
analyticsService.getWidgets(null, startDate).then (widgets) ->
widgets = _.reject widgets, (widget) -> _.isEmpty(widget.widget)
$scope.widgets = widgets

Expand All @@ -114,24 +129,9 @@ cyclotronApp.controller 'AnalyticsController', ($scope, $uibModal, analyticsServ

$scope.widgetsPie = [reducedWidgets]

analyticsService.getTopDashboards().then (dashboards) ->
$scope.topDashboards = dashboards

analyticsService.getDataSourcesByName().then (dataSources) ->
analyticsService.getDataSourcesByName(null, startDate).then (dataSources) ->
$scope.dataSources = dataSources

# Analytics relative to a startDate
$scope.loadTimeseriesData = ->
timeSpan = $scope.selectedTimespan.split('_')
if timeSpan.length == 1 then timeSpan.unshift 1
startDate = moment().subtract(timeSpan[0], timeSpan[1])

analyticsService.getPageViewsOverTime(null, startDate).then (pageViews) ->
$scope.pageViews = pageViews

analyticsService.getVisitsOverTime(null, startDate).then (visits) ->
$scope.visits = visits

# Initialize
$scope.loadLifetimeData()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, anal
$scope.toggleVisitors = ->
$scope.showVisitors = not $scope.showVisitors

# Analytics over the lifetime of the dashboard
$scope.loadLifetimeData = ->
# Analytics relative to a startDate
$scope.loadTimeseriesData = ->
return unless dashboard.visits > 0

analyticsService.getUniqueVisitors($scope.dashboardId).then (visitors) ->
timeSpan = $scope.selectedTimespan.split('_')
if timeSpan.length == 1 then timeSpan.unshift 1
startDate = moment().subtract(timeSpan[0], timeSpan[1])

analyticsService.getUniqueVisitors($scope.dashboardId, startDate).then (visitors) ->
$scope.uniqueVisitorCount = visitors.length
$scope.uniqueVisitors = visitors

analyticsService.getBrowsers($scope.dashboardId).then (browsers) ->
analyticsService.getBrowsers($scope.dashboardId, startDate).then (browsers) ->
$scope.browserOptions.data.keys = { value: _.pluck browsers, 'nameVersion' }
reducedBrowsers = _.reduce browsers, (result, browser) ->
result[browser.nameVersion] = browser.pageViews
Expand All @@ -81,7 +85,7 @@ cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, anal

$scope.browsers = [reducedBrowsers]

analyticsService.getWidgets($scope.dashboardId).then (widgets) ->
analyticsService.getWidgets($scope.dashboardId, startDate).then (widgets) ->
$scope.widgetOptions.data.keys = { value: _.pluck widgets, 'widget' }
reducedWidgets = _.reduce widgets, (result, widget) ->
result[widget.widget] = widget.widgetViews
Expand All @@ -90,34 +94,24 @@ cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, anal

$scope.widgets = [reducedWidgets]

analyticsService.getDataSourcesByName($scope.dashboardId).then (dataSources) ->
analyticsService.getDataSourcesByName($scope.dashboardId, startDate).then (dataSources) ->
$scope.dataSources = dataSources

analyticsService.getPageViewsPerPage($scope.dashboardId).then (viewsPerPage) ->
analyticsService.getPageViewsPerPage($scope.dashboardId, startDate).then (viewsPerPage) ->
categories = []

_.each viewsPerPage, (page) ->
categories.push('Page ' + (page.page + 1))
$scope.viewsPerPage = viewsPerPage
$scope.viewsPerPageOptions.axis.x.categories = categories

# Analytics relative to a startDate
$scope.loadTimeseriesData = ->
return unless dashboard.visits > 0

timeSpan = $scope.selectedTimespan.split('_')
if timeSpan.length == 1 then timeSpan.unshift 1
startDate = moment().subtract(timeSpan[0], timeSpan[1])

analyticsService.getPageViewsOverTime($scope.dashboardId, startDate).then (pageViews) ->
$scope.pageViews = pageViews

analyticsService.getVisitsOverTime($scope.dashboardId, startDate).then (visits) ->
$scope.visits = visits

# Initialize
$scope.loadLifetimeData()

dashboardService.getRevision dashboard.name, 1, (rev) ->
$scope.rev1 = rev
$scope.createdDate = moment(rev.date).format('MM/DD HH:mm:ss')
Expand Down
6 changes: 4 additions & 2 deletions cyclotron-site/app/widgets/stoplight/stoplight.jade
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

.stoplight-widget(ng-controller='StoplightWidget')
h1.title(ng-if='::widget.title') {{ widgetTitle() }}

Expand All @@ -7,12 +8,13 @@
.widget-nodata(ng-if='widgetContext.nodata && !isLoading()')
.fa.fa-exclamation-triangle
span {{ widgetContext.nodata }}
.trafficlight(ng-if='!widgetContext.loading && !widgetContext.dataSourceError', active-color='activeColor', ng-class='{transparent: widgetContext.nodata}')

.trafficlight(ng-if='!widgetContext.loading && !widgetContext.dataSourceError', active-color='activeColor', ng-class='{transparent: widgetContext.nodata}', title='{{ tooltip }}')
.protector
.protector
.protector
.trafficlight-inner
.light.red
.light.yellow
.light.green

6 changes: 4 additions & 2 deletions cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ cyclotronApp.controller 'StoplightWidget', ($scope, dashboardService, dataServic
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?


$scope.tooltip = _.compile($scope.widget.tooltip, row)

if rules.red?
red = _.compile(rules.red, row)
if red == true then return $scope.activeColor = 'red'
Expand All @@ -37,7 +39,7 @@ cyclotronApp.controller 'StoplightWidget', ($scope, dashboardService, dataServic
return

$scope.activeColor = null

$scope.reload = ->
$scope.dataSource.execute(true)

Expand Down
2 changes: 1 addition & 1 deletion cyclotron-site/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cyclotron-site",
"description": "Cyclotron: website",
"version": "1.41.0",
"version": "1.42.0",
"author": "Dave Bauman <[email protected]>",
"license": "MIT",
"private": true,
Expand Down
12 changes: 0 additions & 12 deletions cyclotron-svc/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,6 @@ if (config.analytics && config.analytics.enable == true) {
}
}

/* Initialize SSL root CAs */
var cas = require('ssl-root-cas/latest')
.inject();

/* Optional: Load Additional Trusted Certificate Authorities */
if (_.isArray(config.trustedCa) && !_.isEmpty(config.trustedCa)) {
for (ca of config.trustedCa) {
console.log('Loading trusted CA: ' + ca);
cas.addFile(ca);
}
}

/* Initialize SSL root CAs */
var cas = require('ssl-root-cas/latest')
.inject();
Expand Down
10 changes: 10 additions & 0 deletions cyclotron-svc/examples/example-stoplight.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,54 @@
"noscroll": true,
"widget": "html"
}, {
"dataSource": "datasource_0",
"gridHeight": 2.5,
"gridWidth": 1,
"rules": {
"green": "${true}",
"red": "${false}",
"yellow": "${false}"
},
"sortBy": [],
"title": "Stoplight with Title",
"tooltip": "grossbookingvalue:#{grossbookingvalue}",
"widget": "stoplight"
}, {
"dataSource": "datasource_0",
"gridHeight": 3.5,
"gridWidth": 1,
"layout": {},
"rules": {
"green": "${true /* Else */}",
"red": "${#{roomnightcount} >= 150}",
"yellow": "${#{roomnightcount} >= 100}"
},
"title": "Random Stoplight",
"tooltip": "roomnightcount:#{roomnightcount}",
"widget": "stoplight"
}, {
"gridHeight": 1,
"gridWidth": 1,
"rules": {
"red": "${true}"
},
"tooltip": "Time To Stop",
"widget": "stoplight"
}, {
"gridHeight": 1,
"gridWidth": 1,
"rules": {
"yellow": "${true}"
},
"tooltip": "Time To Get Ready",
"widget": "stoplight"
}, {
"gridHeight": 1,
"gridWidth": 1,
"rules": {
"green": "${true}"
},
"tooltip": "Time To Run",
"widget": "stoplight"
}, {
"dataSource": "datasource_0",
Expand All @@ -74,5 +82,7 @@
"widget": "stoplight"
}]
}],
"parameters": [],
"scripts": [],
"theme": "light"
}
2 changes: 1 addition & 1 deletion cyclotron-svc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cyclotron-svc",
"description": "Cyclotron: REST API",
"version": "1.41.0",
"version": "1.42.0",
"author": "Dave Bauman <[email protected]>",
"license": "MIT",
"private": true,
Expand Down

0 comments on commit b56e43a

Please sign in to comment.