feat: Kino-Feature mit TMDb-Proxy, Favoriten, Admin-Token-Einstellung
This commit is contained in:
@@ -2586,6 +2586,41 @@ const Field = ({ label, type='text', value, onChange, placeholder='', autoCapita
|
||||
);
|
||||
|
||||
// ── Admin: Upload-Freigabe Berechtigungen ─────────────────────────────────────
|
||||
function TmdbSettings({ toast }) {
|
||||
const [token, setToken] = useState('');
|
||||
const [configured, setConfigured] = useState(false);
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
api('/tools/media/settings').then(d => setConfigured(d.configured)).catch(()=>{});
|
||||
}, []);
|
||||
|
||||
const save = async () => {
|
||||
if (!token.trim()) { toast('Token eingeben', 'error'); return; }
|
||||
setBusy(true);
|
||||
try {
|
||||
await api('/tools/media/settings', { method:'PUT', body:{ tmdb_token: token.trim() } });
|
||||
toast('TMDb Token gespeichert ✓');
|
||||
setConfigured(true); setToken('');
|
||||
} catch(e) { toast(e.message, 'error'); } finally { setBusy(false); }
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ fontSize:12, color:'rgba(255,255,255,0.45)', fontFamily:'monospace', marginBottom:10, lineHeight:1.6 }}>
|
||||
API Read Access Token von <a href="https://www.themoviedb.org/settings/api" target="_blank"
|
||||
rel="noopener noreferrer" style={{ color:'#4ecdc4' }}>themoviedb.org</a> eintragen.
|
||||
{configured && <span style={{ color:'#4ecdc4', marginLeft:6 }}>✓ Konfiguriert</span>}
|
||||
</div>
|
||||
<Field label="BEARER TOKEN (API READ ACCESS TOKEN)" value={token} onChange={e=>setToken(e.target.value)}
|
||||
type="password" placeholder={configured ? '••• Token ersetzen •••' : 'eyJhbGciOi…'} />
|
||||
<button onClick={save} disabled={busy} style={{ ...S.btn('#4ecdc4'), width:'100%', textAlign:'center', padding:'11px 0' }}>
|
||||
{busy ? '…' : '✓ Token speichern'}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function UploadShareAdminPanel({ toast }) {
|
||||
const [users, setUsers] = useState([]);
|
||||
const [logs, setLogs] = useState([]);
|
||||
@@ -2805,6 +2840,9 @@ function AdminPanel({ toast, mobile, user, nav }) {
|
||||
<Sec title="UPLOAD-FREIGABE">
|
||||
<UploadShareAdminPanel toast={toast}/>
|
||||
</Sec>
|
||||
<Sec title="TMDB API (KINO-FEATURE)">
|
||||
<TmdbSettings toast={toast}/>
|
||||
</Sec>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user