From ffacf741daedee0d66392dc3586ed58b6e7aa9fd Mon Sep 17 00:00:00 2001 From: martbost Date: Wed, 16 Sep 2026 08:19:33 -0500 Subject: [PATCH] Extend run / visits top-up: budget = charged + this buy (release parked credits); featured row shows days left Hugh extended his featured link and his balance fell 1,133 -> 0: the row still carried the 1,400 parked by the old add-credits button, and reactivating it reserved that budget again. Both flat paths now set budget to spent + accrued + cost. Featured Run column shows "N of M days left" (Hugh: "says 14 but it's actually 7") and "M days done" after the run. Co-Authored-By: Claude Fable 5.1 --- ads.js | Bin 93952 -> 94524 bytes public/assets/my.js | 9 ++++++++- public/my.html | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ads.js b/ads.js index 15a656b347aa9981d084d06f80b9abc5ccae5472..27ecd1890ed39e7d024ba5fbbb94dd081bfdc964 100644 GIT binary patch delta 643 zcma))KW@}O6vj10nrsC^X=t7zS=xx*#NI>^SrjBvQF4Xn@mqToYsQ*+vu348$q8su zxC=+1K}y3JB2GYoxBw@Bw>AbL8eEOupZUJ;H@^9@^Xco(%|~^XTpt}l9*dF~&Y`W4 zp~3*DIbvOJASbe*EA%B5@C>*zLB=;rK)V6$sW2R%L4PT2W2H~vT?_f9Kf1cu1^Gl{ zAB$pK*q05i0KE*KP)!)9n1Q7=dGIv%6v(gT!nP9e?UfDcOX-L!vqq-Soh0f_GWFOV zhK4M|)fJ=%;;%2E);`L5U%Y>psK=APQjT$ggBAKQ6}@G$!8m&euV6*UQPTBccuS=f zD(sp@YO#T63-P+OHbnd=#BkVEec1-Kp%&17*fJRpDZCzP=z7?CjorWgG6D8{nH z7K$R#x>$>)0gp_%KqFGX5{3Wtbu6nHEYij4JUyFdr%TAOMoXF?n`OtxFn;`1bq7UibNln%sW)vDZB$YPb8As;qlIRg>;% Qrk35qR6V-SGj(_V6T33lbN~PV delta 77 zcmdnKsy$uA cn9+neIlp*%fH9*jo3^b2kiC7nG2>EO05Jj?#Q*>R diff --git a/public/assets/my.js b/public/assets/my.js index 43650d8..9001e0a 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -819,7 +819,7 @@ + '' + (['banner', 'text'].includes(c.type) ? (c.impsNas || 0).toLocaleString() : 'n/a') + '' + '' + c.clicks + (r.clickSources && r.clickSources[c.id] ? '
' + Object.entries(r.clickSources[c.id]).sort((a, b) => b[1] - a[1]).map(([k, v]) => '' + esc(k) + ' ' + v + '').join('') + (c.impsNas ? ' ยท network: see Network views' : '') + '
' : '') + '' + (c.type === 'visits' ? 'paid up front' + c.imps.toLocaleString() + ' of ' + Number(c.body || 0).toLocaleString() + ' visits' - : c.type === 'featured' ? 'paid up front' + Number(c.body || 0) + ' day' + (Number(c.body || 0) === 1 ? '' : 's') + '' + : c.type === 'featured' ? 'paid up front' + featRun(c) + '' : '' + c.spent + '' + c.budget + '') + '' + (c.status === 'out' ? (c.type === 'visits' ? 'pack delivered' : 'budget spent') : c.status === 'done' ? '' + (c.type === 'featured' ? 'run ended' : 'ended') + '' : c.scheduled ? 'scheduled' : c.status) + '' + '' + (c.status === 'active' ? '' @@ -1328,6 +1328,13 @@ } // schedule chips on the campaign table (local time) + by-hour view bars const fmtWhen = ms => new Date(ms).toLocaleString([], { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }); + // featured run column: days left of the booked total (Hugh, 2026-09-16: "says 14 but it's actually 7") + function featRun(c) { + const total = Number(c.body || 0), now = Date.now(); + if (c.status === 'done' || !c.expires || c.expires <= now) return '' + total + ' day' + (total === 1 ? '' : 's') + ' done'; + const left = Math.max(1, Math.ceil((c.expires - now) / 86400000)); + return '' + left + ' of ' + total + ' day' + (total === 1 ? '' : 's') + ' left'; + } function schedChips(c) { const now = Date.now(); let s = ''; if (c.starts && c.starts > now) s += ' starts ' + fmtWhen(c.starts) + ''; diff --git a/public/my.html b/public/my.html index 660f14d..e953efe 100644 --- a/public/my.html +++ b/public/my.html @@ -1021,7 +1021,7 @@ - +