2018-02-26 00:11:31 +00:00
|
|
|
import * as Highlight from '../constants/Highlight';
|
|
|
|
|
2020-01-20 11:14:46 +00:00
|
|
|
export const NTP_INACTIVE = 0;
|
|
|
|
export const NTP_ACTIVE = 1;
|
2018-02-26 00:11:31 +00:00
|
|
|
|
2020-01-20 11:14:46 +00:00
|
|
|
export const isNtpActive = ntpStatus => ntpStatus && ntpStatus.status === NTP_ACTIVE;
|
2018-02-26 00:11:31 +00:00
|
|
|
|
|
|
|
export const ntpStatusHighlight = ntpStatus => {
|
2020-01-20 11:14:46 +00:00
|
|
|
switch (ntpStatus.status) {
|
|
|
|
case NTP_INACTIVE:
|
|
|
|
return Highlight.IDLE;
|
|
|
|
case NTP_ACTIVE:
|
2018-02-26 00:11:31 +00:00
|
|
|
return Highlight.SUCCESS;
|
|
|
|
default:
|
|
|
|
return Highlight.ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const ntpStatus = ntpStatus => {
|
2020-01-20 11:14:46 +00:00
|
|
|
switch (ntpStatus.status) {
|
|
|
|
case NTP_INACTIVE:
|
|
|
|
return "Inactive";
|
|
|
|
case NTP_ACTIVE:
|
|
|
|
return "Active";
|
2018-02-26 00:11:31 +00:00
|
|
|
default:
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
}
|