@goodandready/dsh-subscriptions 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +13 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -300,7 +300,19 @@ window.__ModuleLoader__.load({
|
|
|
300
300
|
React.createElement('a', { href: account.validationUrl, target: '_blank', rel: 'noopener noreferrer' }, t('verifyLink')),
|
|
301
301
|
t('verifySuffix'),
|
|
302
302
|
) : null,
|
|
303
|
-
(function(){
|
|
303
|
+
(function(){
|
|
304
|
+
var q=account.quota, up=account.usagePercent, a=[];
|
|
305
|
+
if(q){
|
|
306
|
+
if(q.remaining!=null&&q.limit!=null)a.push(q.remaining+'/'+q.limit);
|
|
307
|
+
else if(q.remaining!=null)a.push(String(q.remaining));
|
|
308
|
+
if(q.usedPercent!=null)a.push(Math.round(q.usedPercent)+'%');
|
|
309
|
+
if(q.resetAt){var d=new Date(q.resetAt);a.push(d.toLocaleTimeString())}
|
|
310
|
+
if(q.measuredAt){var m=Math.round((Date.now()-q.measuredAt)/60000);a.push(m<1?'<1m':m+'m')}
|
|
311
|
+
}
|
|
312
|
+
if(up!=null&&!q)a.push(Math.round(up)+'%');
|
|
313
|
+
if(!a.length)return null;
|
|
314
|
+
return React.createElement('span',{className:'dsub-sub'},t('quota')+' '+a.join(' \u00b7 '));
|
|
315
|
+
})(),
|
|
304
316
|
|
|
305
317
|
account.paidTierName ? React.createElement('span', { className: 'dsub-sub' }, t('plan') + ': ' + account.paidTierName) : null,
|
|
306
318
|
account.ref ? React.createElement('span', { className: 'dsub-sub' }, t('storedAs') + ' ' + account.ref) : null,
|
package/package.json
CHANGED