initial commit of C++ back end and react front end

This commit is contained in:
rjwats@gmail.com
2018-02-26 00:11:31 +00:00
commit 63a639eb22
87 changed files with 14975 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import * as Highlight from '../constants/Highlight';
export const NTP_TIME_NOT_SET = 0;
export const NTP_TIME_NEEDS_SYNC = 1;
export const NTP_TIME_SET = 2;
export const isSynchronized = ntpStatus => ntpStatus && (ntpStatus.status === NTP_TIME_NEEDS_SYNC || ntpStatus.status === NTP_TIME_SET);
export const ntpStatusHighlight = ntpStatus => {
switch (ntpStatus.status){
case NTP_TIME_SET:
return Highlight.SUCCESS;
case NTP_TIME_NEEDS_SYNC:
return Highlight.WARN;
case NTP_TIME_NOT_SET:
default:
return Highlight.ERROR;
}
}
export const ntpStatus = ntpStatus => {
switch (ntpStatus.status){
case NTP_TIME_SET:
return "Synchronized";
case NTP_TIME_NEEDS_SYNC:
return "Synchronization required";
case NTP_TIME_NOT_SET:
return "Time not set"
default:
return "Unknown";
}
}