v7.2: ServiceAuthToken management, backup/Server tab reorg, WIP warnings, map cleanup
This commit is contained in:
1 parent
a2d5af20c9
commit
aee4028f5c
7 files changed
+294
-5
No files matched your search
@@ -233,6 +233,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span>Funcom Service Auth Token <span style="font-size:10px;color:var(--warn);font-weight:400;">[WIP]</span></span>
|
||||
<span id="sat-status" style="font-size:12px;color:var(--text-muted);"></span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div style="margin-bottom:12px;padding:10px 12px;background:var(--warn-bg, #fff3cd);border:1px solid var(--warn-border, #ffc107);border-radius:6px;font-size:12px;line-height:1.5;color:var(--warn-text, #856404);">
|
||||
<strong>⚠ WIP — Use with caution.</strong> This feature is still experimental.
|
||||
Only use if you understand the risks. Backup your <code>*.yaml</code> files first.
|
||||
</div>
|
||||
<div style="margin-bottom:12px;padding:12px;background:var(--bg);border-radius:6px;font-size:13px;line-height:1.6;">
|
||||
<strong style="color:var(--primary);">ServiceAuthToken</strong> — Used by the game server to authenticate with Funcom's live services.
|
||||
If this token is regenerated by Funcom, paste the new JWT below and save.
|
||||
All consuming pods must be restarted afterward.
|
||||
</div>
|
||||
<div style="margin-bottom:12px;">
|
||||
<textarea id="sat-token" rows="4"
|
||||
style="width:100%;padding:10px 12px;background:var(--bg-input);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:12px;font-family:monospace;resize:vertical;"
|
||||
placeholder="Paste the new ServiceAuthToken JWT here..."></textarea>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;align-items:center;flex-wrap:wrap;">
|
||||
<button id="sat-save-btn" onclick="saveServiceAuthToken()"
|
||||
style="padding:8px 20px;background:var(--primary);color:#fff;border:none;border-radius:6px;cursor:pointer;font-size:13px;font-weight:600;">Save Token</button>
|
||||
<span id="sat-message" style="font-size:12px;color:var(--text-muted);"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header" style="cursor:pointer;" onclick="document.getElementById('debug-section').classList.toggle('hidden');">
|
||||
<span>🐛 Debug Logging</span>
|
||||
@@ -784,5 +812,56 @@ loadDebugStatus();
|
||||
// Auto-load battlegroup and pods once on page load, then require manual refresh
|
||||
bgRefreshStatus();
|
||||
refreshPods();
|
||||
|
||||
// ServiceAuthToken
|
||||
async function saveServiceAuthToken() {
|
||||
const token = document.getElementById('sat-token').value.trim();
|
||||
const btn = document.getElementById('sat-save-btn');
|
||||
const msg = document.getElementById('sat-message');
|
||||
const status = document.getElementById('sat-status');
|
||||
|
||||
if (!token) {
|
||||
msg.textContent = 'Please paste the new token first.';
|
||||
msg.style.color = 'var(--danger)';
|
||||
return;
|
||||
}
|
||||
if (!confirm('Are you sure you want to replace the ServiceAuthToken?\n\nThis will update the K8s secret and YAML file. All consuming pods must be restarted for the change to take effect.')) return;
|
||||
if (!confirm('Are you absolutely sure? An incorrect token may break server connectivity with Funcom live services.')) return;
|
||||
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Saving...';
|
||||
msg.textContent = 'Updating token...';
|
||||
msg.style.color = 'var(--text-muted)';
|
||||
status.textContent = 'Updating...';
|
||||
|
||||
try {
|
||||
const resp = await csrfFetch('/api/server/service-auth-token', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ token })
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
msg.textContent = data.message || 'Token updated successfully.';
|
||||
msg.style.color = 'var(--success)';
|
||||
status.textContent = 'Token saved';
|
||||
status.style.color = 'var(--success)';
|
||||
document.getElementById('sat-token').value = '';
|
||||
} else {
|
||||
msg.textContent = 'Error: ' + (data.error || 'Unknown error');
|
||||
msg.style.color = 'var(--danger)';
|
||||
status.textContent = 'Failed';
|
||||
status.style.color = 'var(--danger)';
|
||||
}
|
||||
} catch (e) {
|
||||
msg.textContent = 'Error: ' + e.message;
|
||||
msg.style.color = 'var(--danger)';
|
||||
status.textContent = 'Error';
|
||||
status.style.color = 'var(--danger)';
|
||||
}
|
||||
|
||||
btn.disabled = false;
|
||||
btn.textContent = 'Save Token';
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user