Sha256: 72924cc9d07513b1d79f9c032329e917618980732c537305b084f7ee4a3d3d62
Contents?: true
Size: 1.55 KB
Versions: 18
Compression:
Stored size: 1.55 KB
Contents
/** * @ngdoc service * @name Bastion.content-hosts.service:ContentHostsHelper * * @description * Helper service that contains functionality common amongst content hosts. */ angular.module('Bastion.content-hosts').service('ContentHostsHelper', function () { this.convertMemToGB = function (memoryValue) { if (angular.isString(memoryValue)) { memoryValue = memoryValue.toLowerCase(); if (_.includes(memoryValue, "gb")) { memoryValue = memoryValue.replace("gb", "").trim(); return memoryValue; } memoryValue = parseInt(memoryValue); } memoryValue = (memoryValue / 1048576).toFixed(2); return memoryValue; }; this.getHostStatusIcon = function (globalStatus) { var icons; var colors = { 0: 'green', 1: 'yellow', 2: 'red' }; globalStatus = colors[globalStatus] || "red"; icons = { 'green': globalStatus + ' host-status pficon pficon-ok status-ok', 'yellow': globalStatus + ' host-status pficon pficon-info status-warn', 'red': globalStatus + ' host-status pficon pficon-error-circle-o status-error' }; return icons[globalStatus]; }; this.rebootRequired = function(traces) { return traces.some(function(trace) { return trace.reboot_required; }); }; } );
Version data entries
18 entries across 18 versions & 1 rubygems