Implement NodeBalancers
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user