Implement NodeBalancers

This commit is contained in:
2024-08-08 19:46:58 -04:00
parent 35e9d259f5
commit 709a220e1b
22 changed files with 2585 additions and 23 deletions
+19 -1
View File
@@ -448,6 +448,24 @@ function apiPut(endpoint, data, callback)
xmlhttp.send(JSON.stringify(data));
}
// Convert an unqualified count into a string with an SI prefix (i.e. bytes to MB/GB/etc)
function countSI(count)
{
var prefix = "KMGTPEZY";
var unit = "";
for (var i = 0; i < prefix.length; i++) {
if (count >= 1024) {
count /= 1024;
unit = prefix.charAt(i);
} else {
break;
}
}
return count.toFixed(2) + " " + unit;
}
// Callback for user info API call
function displayUser(response)
{
@@ -864,4 +882,4 @@ function translateKernel(slug, element)
apiGet("/linode/kernels/" + slug, callback, null);
}
export { settings, elements, regionNames, countryContinents, apiDelete, apiGet, apiPost, apiPut, drawSeries, md5, migrateETA, oauthPost, oauthScopes, objPut, parseParams, setupHeader, eventTitles, timeString, translateKernel };
export { settings, elements, regionNames, countryContinents, apiDelete, apiGet, apiPost, apiPut, countSI, drawSeries, md5, migrateETA, oauthPost, oauthScopes, objPut, parseParams, setupHeader, eventTitles, timeString, translateKernel };