Merge pull request #295 from EdouardVanbelle/style/front-format
This commit is contained in:
@@ -990,7 +990,9 @@ details[open] summary {
|
|||||||
padding: 18px 14px;
|
padding: 18px 14px;
|
||||||
border: 2px solid var(--color-border);
|
border: 2px solid var(--color-border);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
transition: border-color 0.2s, background 0.2s;
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
background 0.2s;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -696,14 +696,15 @@ async function saveOidcSettings() {
|
|||||||
|
|
||||||
/* ── Storage tab ── */
|
/* ── Storage tab ── */
|
||||||
|
|
||||||
|
// biome-ignore format: keep the following indent
|
||||||
const STORAGE_PRESETS = {
|
const STORAGE_PRESETS = {
|
||||||
'custom': { endpoint: '', region: '', pathStyle: false },
|
'custom': { endpoint: '', region: '', pathStyle: false },
|
||||||
'aws': { endpoint: '', region: 'us-east-1', pathStyle: false },
|
'aws': { endpoint: '', region: 'us-east-1', pathStyle: false },
|
||||||
'backblaze': { endpoint: 'https://s3.{region}.backblazeb2.com', region: 'us-west-004', pathStyle: false },
|
'backblaze': { endpoint: 'https://s3.{region}.backblazeb2.com', region: 'us-west-004', pathStyle: false },
|
||||||
'cloudflare-r2': { endpoint: 'https://{accountId}.r2.cloudflarestorage.com', region: 'auto', pathStyle: true },
|
'cloudflare-r2': { endpoint: 'https://{accountId}.r2.cloudflarestorage.com', region: 'auto', pathStyle: true },
|
||||||
'minio': { endpoint: 'http://localhost:9000', region: 'us-east-1', pathStyle: true },
|
'minio': { endpoint: 'http://localhost:9000', region: 'us-east-1', pathStyle: true },
|
||||||
'digitalocean': { endpoint: 'https://{region}.digitaloceanspaces.com', region: 'nyc3', pathStyle: false },
|
'digitalocean': { endpoint: 'https://{region}.digitaloceanspaces.com', region: 'nyc3', pathStyle: false },
|
||||||
'wasabi': { endpoint: 'https://s3.{region}.wasabisys.com', region: 'us-east-1', pathStyle: false },
|
'wasabi': { endpoint: 'https://s3.{region}.wasabisys.com', region: 'us-east-1', pathStyle: false },
|
||||||
};
|
};
|
||||||
|
|
||||||
function toggleS3Form(visible) {
|
function toggleS3Form(visible) {
|
||||||
@@ -875,26 +876,23 @@ function updateMigrationUI(m) {
|
|||||||
|
|
||||||
// Progress section
|
// Progress section
|
||||||
const progressSection = document.getElementById('migration-progress-section');
|
const progressSection = document.getElementById('migration-progress-section');
|
||||||
progressSection.style.display = (isActive || isCompleted) ? '' : 'none';
|
progressSection.style.display = isActive || isCompleted ? '' : 'none';
|
||||||
|
|
||||||
if (m.total_blobs > 0) {
|
if (m.total_blobs > 0) {
|
||||||
const pct = Math.round((m.migrated_blobs / m.total_blobs) * 100);
|
const pct = Math.round((m.migrated_blobs / m.total_blobs) * 100);
|
||||||
document.getElementById('migration-progress-fill').style.width = `${pct}%`;
|
document.getElementById('migration-progress-fill').style.width = `${pct}%`;
|
||||||
document.getElementById('migration-progress-label').textContent =
|
document.getElementById('migration-progress-label').textContent =
|
||||||
`${m.migrated_blobs.toLocaleString()} / ${m.total_blobs.toLocaleString()} blobs (${pct}%)`;
|
`${m.migrated_blobs.toLocaleString()} / ${m.total_blobs.toLocaleString()} blobs (${pct}%)`;
|
||||||
document.getElementById('migration-bytes-label').textContent =
|
document.getElementById('migration-bytes-label').textContent = `${formatBytes(m.migrated_bytes)} transferred`;
|
||||||
`${formatBytes(m.migrated_bytes)} transferred`;
|
|
||||||
|
|
||||||
if (m.throughput_bytes_per_sec && m.status === 'running') {
|
if (m.throughput_bytes_per_sec && m.status === 'running') {
|
||||||
document.getElementById('migration-throughput').textContent =
|
document.getElementById('migration-throughput').textContent = `${formatBytes(Math.round(m.throughput_bytes_per_sec))}/s`;
|
||||||
`${formatBytes(Math.round(m.throughput_bytes_per_sec))}/s`;
|
|
||||||
const remaining = m.total_blobs - m.migrated_blobs;
|
const remaining = m.total_blobs - m.migrated_blobs;
|
||||||
if (remaining > 0 && m.throughput_bytes_per_sec > 0) {
|
if (remaining > 0 && m.throughput_bytes_per_sec > 0) {
|
||||||
const avgBlobSize = m.migrated_bytes / Math.max(m.migrated_blobs, 1);
|
const avgBlobSize = m.migrated_bytes / Math.max(m.migrated_blobs, 1);
|
||||||
const etaSecs = Math.round((remaining * avgBlobSize) / m.throughput_bytes_per_sec);
|
const etaSecs = Math.round((remaining * avgBlobSize) / m.throughput_bytes_per_sec);
|
||||||
const etaMin = Math.ceil(etaSecs / 60);
|
const etaMin = Math.ceil(etaSecs / 60);
|
||||||
document.getElementById('migration-eta').textContent =
|
document.getElementById('migration-eta').textContent = `~${etaMin} min remaining`;
|
||||||
`~${etaMin} min remaining`;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('migration-throughput').textContent = '';
|
document.getElementById('migration-throughput').textContent = '';
|
||||||
@@ -913,16 +911,11 @@ function updateMigrationUI(m) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Button visibility
|
// Button visibility
|
||||||
document.getElementById('btn-start-migration').style.display =
|
document.getElementById('btn-start-migration').style.display = !isActive && !isCompleted ? '' : 'none';
|
||||||
(!isActive && !isCompleted) ? '' : 'none';
|
document.getElementById('btn-pause-migration').style.display = m.status === 'running' ? '' : 'none';
|
||||||
document.getElementById('btn-pause-migration').style.display =
|
document.getElementById('btn-resume-migration').style.display = m.status === 'paused' ? '' : 'none';
|
||||||
m.status === 'running' ? '' : 'none';
|
document.getElementById('btn-verify-migration').style.display = isCompleted ? '' : 'none';
|
||||||
document.getElementById('btn-resume-migration').style.display =
|
document.getElementById('btn-complete-migration').style.display = isCompleted ? '' : 'none';
|
||||||
m.status === 'paused' ? '' : 'none';
|
|
||||||
document.getElementById('btn-verify-migration').style.display =
|
|
||||||
isCompleted ? '' : 'none';
|
|
||||||
document.getElementById('btn-complete-migration').style.display =
|
|
||||||
isCompleted ? '' : 'none';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadMigrationStatus() {
|
async function loadMigrationStatus() {
|
||||||
@@ -944,7 +937,9 @@ async function loadMigrationStatus() {
|
|||||||
clearInterval(migrationPollTimer);
|
clearInterval(migrationPollTimer);
|
||||||
migrationPollTimer = null;
|
migrationPollTimer = null;
|
||||||
}
|
}
|
||||||
} catch (_e) { /* ignore */ }
|
} catch (_e) {
|
||||||
|
/* ignore */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function startMigration() {
|
async function startMigration() {
|
||||||
@@ -973,25 +968,33 @@ async function startMigration() {
|
|||||||
async function pauseMigration() {
|
async function pauseMigration() {
|
||||||
try {
|
try {
|
||||||
const resp = await fetch(`${API}/admin/storage/migration/pause`, {
|
const resp = await fetch(`${API}/admin/storage/migration/pause`, {
|
||||||
method: 'POST', headers: headers(), credentials: 'same-origin'
|
method: 'POST',
|
||||||
|
headers: headers(),
|
||||||
|
credentials: 'same-origin'
|
||||||
});
|
});
|
||||||
if (resp.ok) {
|
if (resp.ok) {
|
||||||
showMigrationMsg(t('admin.migration_paused_msg') || 'Migration paused', 'success');
|
showMigrationMsg(t('admin.migration_paused_msg') || 'Migration paused', 'success');
|
||||||
loadMigrationStatus();
|
loadMigrationStatus();
|
||||||
}
|
}
|
||||||
} catch (_e) { /* ignore */ }
|
} catch (_e) {
|
||||||
|
/* ignore */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function resumeMigration() {
|
async function resumeMigration() {
|
||||||
try {
|
try {
|
||||||
const resp = await fetch(`${API}/admin/storage/migration/resume`, {
|
const resp = await fetch(`${API}/admin/storage/migration/resume`, {
|
||||||
method: 'POST', headers: headers(), credentials: 'same-origin'
|
method: 'POST',
|
||||||
|
headers: headers(),
|
||||||
|
credentials: 'same-origin'
|
||||||
});
|
});
|
||||||
if (resp.ok) {
|
if (resp.ok) {
|
||||||
showMigrationMsg(t('admin.migration_resumed_msg') || 'Migration resumed', 'success');
|
showMigrationMsg(t('admin.migration_resumed_msg') || 'Migration resumed', 'success');
|
||||||
loadMigrationStatus();
|
loadMigrationStatus();
|
||||||
}
|
}
|
||||||
} catch (_e) { /* ignore */ }
|
} catch (_e) {
|
||||||
|
/* ignore */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function verifyMigration() {
|
async function verifyMigration() {
|
||||||
@@ -1027,7 +1030,9 @@ async function verifyMigration() {
|
|||||||
async function completeMigration() {
|
async function completeMigration() {
|
||||||
try {
|
try {
|
||||||
const resp = await fetch(`${API}/admin/storage/migration/complete`, {
|
const resp = await fetch(`${API}/admin/storage/migration/complete`, {
|
||||||
method: 'POST', headers: headers(), credentials: 'same-origin'
|
method: 'POST',
|
||||||
|
headers: headers(),
|
||||||
|
credentials: 'same-origin'
|
||||||
});
|
});
|
||||||
if (resp.ok) {
|
if (resp.ok) {
|
||||||
showMigrationMsg(t('admin.migration_completed_msg') || 'Migration finalized. Restart the server to use the new backend.', 'success');
|
showMigrationMsg(t('admin.migration_completed_msg') || 'Migration finalized. Restart the server to use the new backend.', 'success');
|
||||||
|
|||||||
Reference in New Issue
Block a user