aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/nms-map-handlers.js
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.gondul.gathering.org>2019-01-02 19:59:05 +0100
committerKristian Lyngstol <kly@kly.gondul.gathering.org>2019-01-02 19:59:05 +0100
commitb9645417b0922d1be7cef02f3c9e4a22859877a3 (patch)
tree596daa98b145bcc781f445ef5987a0f77fcd22e5 /web/js/nms-map-handlers.js
parent6a90ad14ce6ab18d82bab57349036998a7caac8f (diff)
Tweak general look
Diffstat (limited to 'web/js/nms-map-handlers.js')
-rw-r--r--web/js/nms-map-handlers.js54
1 files changed, 28 insertions, 26 deletions
diff --git a/web/js/nms-map-handlers.js b/web/js/nms-map-handlers.js
index 6632e9f..e266012 100644
--- a/web/js/nms-map-handlers.js
+++ b/web/js/nms-map-handlers.js
@@ -160,32 +160,34 @@ function uplinkInfo(sw)
ret.data[0].description = "Uplinks (live/configured)";
if (nmsData.switches.switches[sw].subnet4 == undefined ||
nmsData.switches.switches[sw].subnet4 == null) {
- if (tagged(sw,'3up')) {
- known_t = 3;
- } else if (tagged(sw,'2up')) {
- known_t = 2;
- } else if (tagged(sw, '1up')) {
- known_t = 1;
- } else if (tagged(sw,'4up')) {
- known_t = 4;
- }
- if (known_t != t) {
- ret.data[0].value += "(Overridden: " + known_t + ")";
- }
-
- if (u == known_t) {
- ret.score = 0;
- ret.why = "All uplinks up";
- } else if (u == 1) {
- ret.score = 800;
- ret.why = "Only 1 of " + known_t + " uplinks alive";
- } else if (u < known_t) {
- ret.score = 450;
- ret.why = u + " of " + known_t + " uplinks alive";
- } else if (u > known_t) {
- ret.score = 350;
- ret.why = u + " of " + known_t + " uplinks alive";
- }
+ if (tagged(sw,'3up')) {
+ known_t = 3;
+ } else if (tagged(sw,'2up')) {
+ known_t = 2;
+ } else if (tagged(sw, '1up')) {
+ known_t = 1;
+ } else if (tagged(sw,'4up')) {
+ known_t = 4;
+ }
+ if (known_t != t) {
+ ret.data[0].value += "(Overridden: " + known_t + ")";
+ }
+ if (u == known_t) {
+ ret.score = 0;
+ ret.why = "All uplinks up";
+ } else if (u == 1) {
+ ret.score = 800;
+ ret.why = "Only 1 of " + known_t + " uplinks alive";
+ } else if (u < known_t && !(t >= 10 && u <5)) {
+ ret.score = 450;
+ ret.why = u + " of " + known_t + " uplinks alive";
+ } else if (u > known_t) {
+ ret.score = 350;
+ ret.why = u + " of " + known_t + " uplinks alive";
+ } else if (u < known_t && (t >= 10 && u < 5)) {
+ ret.score = 150;
+ ret.why = u + " of " + known_t + " uplinks alive (huge diff suggests WIP - downgrading)";
+ }
}
}
if (testTree(nmsData,['switchstate','switches',sw,'clients','total'])) {