feat(panel): let a sponsor slot start at a scheduled time

sponsors.json only had an end date, so a booked placement had to be
added to the file on the day it started. An optional `from` now hides
a sponsor (and its logo) until that instant; entries without it show
immediately as before.
This commit is contained in:
MHSanaei
2026-09-27 16:30:20 +02:00
parent 044e2926a0
commit 09617f04f5
11 changed files with 48 additions and 20 deletions
+8 -1
View File
@@ -4502,6 +4502,12 @@
"nullable": true,
"type": "boolean"
},
"from": {
"example": "2026-10-01T00:00:00Z",
"format": "date-time",
"nullable": true,
"type": "string"
},
"id": {
"example": "acme-2026-10",
"type": "string"
@@ -5029,7 +5035,7 @@
"tags": [
"Authentication"
],
"summary": "Public. Active paid sponsor placements read from the project sponsors.json (cached for 1h); expired entries are dropped. Logos are proxied by the panel at /sponsors/logo/{name}. Used by the login page and panel sponsor slots.",
"summary": "Public. Active paid sponsor placements read from the project sponsors.json (cached for 1h); entries outside their from/until window are dropped. Logos are proxied by the panel at /sponsors/logo/{name}. Used by the login page and panel sponsor slots.",
"operationId": "get_sponsors",
"responses": {
"200": {
@@ -5057,6 +5063,7 @@
"sponsors": [
{
"enable": true,
"from": "2026-10-01T00:00:00Z",
"id": "acme-2026-10",
"link": "https://acme.example/?utm_source=3x-ui",
"logo": "/sponsors/logo/acme.png",