Lish now uses API slug names

This commit is contained in:
L. Bradley LaBoon 2023-04-04 16:16:06 -04:00
parent ac999c9704
commit bd9a85a068

View File

@ -44,24 +44,6 @@ import { settings, elements, apiGet, parseParams, setupHeader } from "/global.js
data.linode = {};
data.netInfo = {};
// LISH uses different DC names than the API uses, so we need to translate them
data.lishDCs = {
"us-central": "dallas",
"us-west": "fremont",
"us-southeast": "atlanta",
"us-east": "newark",
"us-east-1b": "cjj2",
"eu-west": "london",
"ap-south": "singapore",
"eu-central": "frankfurt",
"ap-northeast": "shg1",
"ap-northeast-1a": "shg1",
"ca-central": "tor1",
"ap-west": "mum1",
"ap-southeast": "syd1",
"philadelphia": "phl1"
};
// Static references to UI elements
var ui = {};
ui.ipFailover = {};
@ -113,8 +95,8 @@ import { settings, elements, apiGet, parseParams, setupHeader } from "/global.js
apiGet("/regions/" + data.linode.region, displayResolvers, null);
// Update the LISH link
ui.lishLink.href = ui.lishLink.href.replace("lish-", "lish-" + data.lishDCs[data.linode.region]);
ui.lishLink.innerHTML = ui.lishLink.innerHTML.replace("lish-", "lish-" + data.lishDCs[data.linode.region]);
ui.lishLink.href = ui.lishLink.href.replace("lish-", "lish-" + data.linode.region);
ui.lishLink.innerHTML = ui.lishLink.innerHTML.replace("lish-", "lish-" + data.linode.region);
ui.lishLink.innerHTML += " " + data.linode.label;
};