@goodandready/dsh-subscriptions 0.4.4 → 0.4.6
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/README.md +1 -1
- package/lib/index.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -153,7 +153,7 @@ From the chat, without opening Settings:
|
|
|
153
153
|
|
|
154
154
|
## /subscriptions page
|
|
155
155
|
|
|
156
|
-
A localhost-only summary page at `/subscriptions` lists every account slot,
|
|
156
|
+
A localhost-only summary page at `/dsh-subscriptions/subscriptions` lists every account slot,
|
|
157
157
|
connection status, usage percent, remaining quota and reset time across all
|
|
158
158
|
providers. Requests from non-loopback hosts get 403.
|
|
159
159
|
|
package/lib/index.js
CHANGED
|
@@ -871,7 +871,7 @@ export function apply(ctx, config) {
|
|
|
871
871
|
// #50: сводная страница /subscriptions (localhost-only).
|
|
872
872
|
ctx.effect(() => ctx.webServer.register({
|
|
873
873
|
kind: 'exact',
|
|
874
|
-
path: '/subscriptions',
|
|
874
|
+
path: '/dsh-subscriptions/subscriptions',
|
|
875
875
|
handler: async (req, res) => {
|
|
876
876
|
if (req.method !== 'GET') {
|
|
877
877
|
writeJson(res, 405, { ok: false, error: { code: 'method', message: 'GET only' } })
|
|
@@ -898,10 +898,10 @@ export function apply(ctx, config) {
|
|
|
898
898
|
const reset = a.quota && a.quota.resetAt ? new Date(a.quota.resetAt).toLocaleString() : ''
|
|
899
899
|
const status = a.validationUrl ? 'verify' : (a.cooldownUntil && a.cooldownUntil > Date.now() ? 'cooldown' : (a.configured ? 'ok' : 'none'))
|
|
900
900
|
return '<tr><td>' + escapeHtml(a.provider) + '</td><td>' + (a.index||1) + '</td>' +
|
|
901
|
-
'<td>' +
|
|
901
|
+
'<td>' + escapeHtml(a.label || a.email || '') + '</td><td>' + status + '</td>' +
|
|
902
902
|
'<td>' + (pct != null ? Math.round(pct) + '%' : '—') + '</td>' +
|
|
903
903
|
'<td>' + (rem != null ? (rem + (lim != null ? '/' + lim : '')) : '—') + '</td>' +
|
|
904
|
-
'<td>' +
|
|
904
|
+
'<td>' + escapeHtml(reset) + '</td><td>' + escapeHtml(a.refreshError || '') + '</td></tr>'
|
|
905
905
|
})
|
|
906
906
|
const body = rows.length
|
|
907
907
|
? '<div class="grid">' + rows.join('') + '</div>'
|
package/package.json
CHANGED