Finished theming
This commit is contained in:
@@ -55,17 +55,17 @@
|
||||
<h2 class="text-2xl font-bold mb-6">System Management</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-8">
|
||||
<!-- ROM Scanning -->
|
||||
<!-- Game Scanning -->
|
||||
<div class="bg-secondary rounded-lg p-6 border border-theme">
|
||||
<div class="flex items-center mb-4">
|
||||
<svg class="w-8 h-8 text-accent mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
||||
</svg>
|
||||
<h3 class="text-lg font-semibold">ROM Scanner</h3>
|
||||
<h3 class="text-lg font-semibold">Game Scanner</h3>
|
||||
</div>
|
||||
<p class="text-secondary text-sm mb-4">Scan directories for new ROM files and add them to the database</p>
|
||||
<button onclick="triggerRomScan()" class="w-full bg-accent hover:bg-accent px-4 py-2 rounded font-medium transition-colors" id="scan-btn">
|
||||
<span class="scan-text">Start ROM Scan</span>
|
||||
<p class="text-secondary text-sm mb-4">Scan directories for new Game files and add them to the database</p>
|
||||
<button onclick="triggerGameScan()" class="w-full bg-accent hover:bg-accent px-4 py-2 rounded font-medium transition-colors" id="scan-btn">
|
||||
<span class="scan-text">Start Game Scan</span>
|
||||
<span class="scan-loading hidden">Scanning...</span>
|
||||
</button>
|
||||
<div id="scan-status" class="mt-2 text-sm text-secondary"></div>
|
||||
@@ -318,8 +318,8 @@
|
||||
<h4 class="text-lg font-semibold text-accent">Paths</h4>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-secondary mb-1">ROM Directory</label>
|
||||
<input type="text" id="config-rom-path" class="w-full px-3 py-2 bg-tertiary border border-theme rounded text-primary" placeholder="/path/to/roms">
|
||||
<label class="block text-sm font-medium text-secondary mb-1">Game Directory</label>
|
||||
<input type="text" id="config-rom-path" class="w-full px-3 py-2 bg-tertiary border border-theme rounded text-primary" placeholder="/path/to/games">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -415,7 +415,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
async function triggerRomScan() {
|
||||
async function triggerGameScan() {
|
||||
const btn = document.getElementById('scan-btn');
|
||||
const status = document.getElementById('scan-status');
|
||||
const scanText = btn.querySelector('.scan-text');
|
||||
@@ -426,7 +426,7 @@ async function triggerRomScan() {
|
||||
scanLoading.classList.remove('hidden');
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/admin/rom-scan', {
|
||||
const response = await fetch('/api/admin/game-scan', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Authorization': `Bearer ${getCookie('auth_token')}`
|
||||
@@ -436,17 +436,17 @@ async function triggerRomScan() {
|
||||
const result = await response.json();
|
||||
|
||||
if (result.status === 'started') {
|
||||
status.textContent = 'ROM scan started...';
|
||||
status.textContent = 'Game scan started...';
|
||||
status.className = 'mt-2 text-sm text-accent';
|
||||
|
||||
// Poll for completion
|
||||
pollTaskStatus('rom_scan', status);
|
||||
pollTaskStatus('game_scan', status);
|
||||
} else if (result.status === 'already_running') {
|
||||
status.textContent = 'ROM scan already in progress';
|
||||
status.textContent = 'Game scan already in progress';
|
||||
status.className = 'mt-2 text-sm text-warning-color';
|
||||
}
|
||||
} catch (error) {
|
||||
status.textContent = 'Failed to start ROM scan';
|
||||
status.textContent = 'Failed to start Game scan';
|
||||
status.className = 'mt-2 text-sm text-danger-color';
|
||||
} finally {
|
||||
btn.disabled = false;
|
||||
@@ -674,8 +674,8 @@ async function showSystemStats() {
|
||||
<h4 class="text-lg font-semibold mb-3 text-primary">Running Tasks</h4>
|
||||
<div class="space-y-2 text-secondary">
|
||||
<div class="flex justify-between">
|
||||
<span>ROM Scan:</span>
|
||||
<span class="${stats.running_tasks.rom_scan ? 'text-accent' : 'text-secondary'}">${stats.running_tasks.rom_scan ? 'Running' : 'Idle'}</span>
|
||||
<span>Game Scan:</span>
|
||||
<span class="${stats.running_tasks.game_scan ? 'text-accent' : 'text-secondary'}">${stats.running_tasks.game_scan ? 'Running' : 'Idle'}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span>Metadata Refresh:</span>
|
||||
@@ -1307,7 +1307,7 @@ function populateConfigForm(config) {
|
||||
// Populate form fields
|
||||
document.getElementById('config-host').value = config.host || '';
|
||||
document.getElementById('config-port').value = config.port || '';
|
||||
document.getElementById('config-rom-path').value = config.rom_path || '';
|
||||
document.getElementById('config-rom-path').value = config.game_path || '';
|
||||
document.getElementById('config-images-path').value = config.images_path || '';
|
||||
document.getElementById('config-igdb-client-id').value = config.igdb_client_id || '';
|
||||
document.getElementById('config-igdb-secret').value = config.igdb_api_key || '';
|
||||
@@ -1320,7 +1320,7 @@ function collectConfigFromForm() {
|
||||
const config = {
|
||||
host: document.getElementById('config-host').value,
|
||||
port: parseInt(document.getElementById('config-port').value) || 8080,
|
||||
rom_path: document.getElementById('config-rom-path').value,
|
||||
game_path: document.getElementById('config-rom-path').value,
|
||||
images_path: document.getElementById('config-images-path').value,
|
||||
igdb_client_id: document.getElementById('config-igdb-client-id').value,
|
||||
igdb_api_key: document.getElementById('config-igdb-secret').value
|
||||
|
||||
Reference in New Issue
Block a user