diff --git a/README.md b/README.md index a22b14a..e002f51 100644 --- a/README.md +++ b/README.md @@ -353,6 +353,8 @@ Copy `.env.example` (Compose) or `server/.env.example` (local) and fill in. **`. | `CLIENT_ORIGIN` | `http://localhost:5173` | enables CORS in dev only | | `LOG_LEVEL` / `FILE_LOG_LEVEL` | `info` / `debug` | console / file verbosity | | `LOG_TO_FILE` / `LOG_DIR` / `LOG_FILE` | `true` / `/logs` / `app.log` | log file (bind-mounted to `./logs` in Docker) | +| `ANNOUNCE_POLL_MS` | `15000` | how often the news-announcement dispatcher sweeps `announce_jobs` for due/retry legs (town crier + Discord) | +| `TOWNCRIER_DURATION_SEC` | `3600` | how long a news post's in-game town-crier message stays up (≤ `86400`) | --- diff --git a/client/src/api/client.js b/client/src/api/client.js index a880c5f..8fde9b1 100644 --- a/client/src/api/client.js +++ b/client/src/api/client.js @@ -112,6 +112,10 @@ export const api = { deletePost: (id) => req(`/admin/posts/${id}`, { method: 'DELETE' }), publishPost: (id, published) => req(`/admin/posts/${id}/publish`, { method: 'PATCH', body: { published } }), + // News announcement pipeline (town crier + Discord) status + per-leg retry. + getAnnounce: (id) => req(`/admin/posts/${id}/announce`), + retryAnnounceLeg: (id, leg) => + req(`/admin/posts/${id}/announce/retry`, { method: 'POST', body: { leg } }), uploadImage: (file) => { const fd = new FormData() fd.append('image', file) diff --git a/client/src/routes/admin/views/PostEditor.jsx b/client/src/routes/admin/views/PostEditor.jsx index 5747b45..fb7e68c 100644 --- a/client/src/routes/admin/views/PostEditor.jsx +++ b/client/src/routes/admin/views/PostEditor.jsx @@ -1,4 +1,4 @@ -import { lazy, Suspense, useState } from 'react' +import { lazy, Suspense, useEffect, useState } from 'react' import Modal from '../../../components/Modal.jsx' import { api } from '../../../api/client.js' @@ -105,6 +105,8 @@ export default function PostEditor({ post, onClose, onSaved }) {
{error &&

{error}

} + {isEdit && post.category === 'news' && } +