Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 17, 2013 22:47
Show Gist options
  • Save sandrinodimattia/6025231 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/6025231 to your computer and use it in GitHub Desktop.
Windows Azure Portal - Custom Javascript bookmarklet
$.post('/MonetaryCredit', function(data) {
var table = $('<table />')
.attr('style', 'border: 1px solid black; border-collapse: collapse; width: 100%')
.append($('<thead />').attr('style', 'font-weight: bold')
.append($('<td>Subscription</td><td>TotalCredit</td><td>Remaining Credit</td><td>Burn Rate</td><td>Might Run Out</td>')));
$.each(data, function(idx, sub) {
if (sub.MonetaryCreditInfo != null) {
table.append($('<tr />')
.attr('style', 'border: 1px solid black;')
.append($('<td />').text(sub.SubscriptionName))
.append($('<td />').text(sub.MonetaryCreditInfo.RemainingCreditDisplay))
.append($('<td />').text(sub.MonetaryCreditInfo.TotalCreditDisplay))
.append($('<td />').text(sub.MonetaryCreditInfo.BurnRateDisplay))
.append($('<td />').text(sub.MightRunOut)));
}
});
$('<div title="My Subscriptions - Credit" />')
.append(table)
.dialog({width: 600,height:250});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment