diff --git a/admin/index.html b/admin/index.html index 2163532..fe419bb 100644 --- a/admin/index.html +++ b/admin/index.html @@ -38,6 +38,14 @@ color: lightgrey; } + .monitoring-state-online { + color: green; + } + + .monitoring-state-offline { + color: red; + } + .vpn-key-set, .coords-set { color: green; } diff --git a/admin/js/main.js b/admin/js/main.js index 3e3c296..4928cf3 100644 --- a/admin/js/main.js +++ b/admin/js/main.js @@ -133,7 +133,17 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest if (!monitoringState) { return; } - return; + + switch (monitoringState.values.state) { + case 'ONLINE': + return 'monitoring-state-online'; + + case 'OFFLINE': + return 'monitoring-state-offline'; + + default: + return; + } } var monitoringStates = nga.entity('monitoring').label('Monitoring'); @@ -147,15 +157,15 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest .batchActions([]) .exportFields([]) .fields([ - nga.field('id').cssClasses(monitoringStateClasses()), - nga.field('mac').cssClasses(monitoringStateClasses()), - nga.field('state').cssClasses(monitoringStateClasses()), - nga.field('last_seen').map(formatMoment).cssClasses(monitoringStateClasses()), - nga.field('import_timestamp').map(formatMoment).cssClasses(monitoringStateClasses()), - nga.field('last_status_mail_type').cssClasses(monitoringStateClasses()), - nga.field('last_status_mail_sent').map(formatMoment).cssClasses(monitoringStateClasses()), - nga.field('created_at').map(formatMoment).cssClasses(monitoringStateClasses()), - nga.field('modified_at').map(formatMoment).cssClasses(monitoringStateClasses()) + nga.field('id').cssClasses(monitoringStateClasses), + nga.field('mac').cssClasses(monitoringStateClasses), + nga.field('state').cssClasses(monitoringStateClasses), + nga.field('last_seen').map(formatMoment).cssClasses(monitoringStateClasses), + nga.field('import_timestamp').label('Imported').map(formatMoment).cssClasses(monitoringStateClasses), + nga.field('last_status_mail_type').cssClasses(monitoringStateClasses), + nga.field('last_status_mail_sent').map(formatMoment).cssClasses(monitoringStateClasses), + nga.field('created_at').map(formatMoment).cssClasses(monitoringStateClasses), + nga.field('modified_at').map(formatMoment).cssClasses(monitoringStateClasses) ]) .filters([ nga.field('q')