Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { tooltip: messages } = Messages.node;
const now = Date.now();
const since = (now - tstamp) / 1000
const rows = [
messages.lastUpdated(since),
messages.hostname(this.hostname()),
messages.version(this.version()),
messages.containers(this.containers()),
];
const classes = ['light'];
let icon;
const tooltip = `<div class="tooltip-inner align-left info-tooltip">${rows.join('<br>')}</div>`
if (since > Skep.thresholds.global.timeout.danger) {
icon = Icon.AlertCircle;
classes.push('error');
} else if (since > Skep.thresholds.global.timeout.warning) {
icon = Icon.AlertCircle;
classes.push('warning');
} else {
icon = Icon.Power;
}
const props = {
className: classes.join(' '),
size: '1em',
'data-original-title': tooltip,
'data-html': 'true',
'data-toggle': 'tooltip',
};