3980 lines
133 KiB
HTML
3980 lines
133 KiB
HTML
<!DOCTYPE html>
|
||||
|
|
<html lang="en">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="UTF-8">
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
<title>OORT — Sovereign S3 & Mornye NAS Console</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js"></script>
|
||||
|
|
|
|||
<style>
|
||||
/* ═══════════════════════════════════════════════════════════════════
|
||||
OORT CONSOLE — 3D COSMIC GLASS DESIGN SYSTEM
|
||||
═══════════════════════════════════════════════════════════════════ */
|
||||
|
|
:root {
|
|||
--bg-space: #030712;
|
||||
|
|
--bg-deep: #050b18;
|
|||
|
|
--bg-card: rgba(13, 20, 36, 0.72);
|
|||
|
|
--bg-card-hover: rgba(20, 31, 55, 0.85);
|
|||
|
|
--bg-card-subtle: rgba(255, 255, 255, 0.03);
|
|||
|
|
--bg-surface: rgba(10, 16, 29, 0.90);
|
|||
|
|
--bg-input: rgba(7, 12, 22, 0.75);
|
|||
|
||||
--border-subtle: rgba(255, 255, 255, 0.08);
|
||||
|
|
--border-card: rgba(255, 255, 255, 0.12);
|
|||
|
|
--border-glow: rgba(56, 189, 248, 0.35);
|
|||
|
||||
--text-primary: #ffffff;
|
||||
|
|
--text-secondary: #e2e8f0;
|
|||
|
|
--text-muted: #94a3b8;
|
|||
|
|
--text-dim: #64748b;
|
|||
|
||||
--accent-cyan: #38bdf8;
|
||||
|
|
--accent-cyan-glow: rgba(56, 189, 248, 0.35);
|
|||
|
|
--accent-blue: #6366f1;
|
|||
|
|
--accent-indigo: #818cf8;
|
|||
|
|
--accent-emerald: #34d399;
|
|||
|
|
--accent-amber: #fbbf24;
|
|||
|
|
--accent-rose: #f43f5e;
|
|||
|
|
--accent-purple: #c084fc;
|
|||
|
||||
--font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
|
|
--font-mono: 'JetBrains Mono', monospace;
|
|||
|
||||
--sidebar-w: 260px;
|
||||
|
|
--header-h: 64px;
|
|||
|
|
--radius-sm: 8px;
|
|||
|
|
--radius-md: 12px;
|
|||
|
|
--radius-lg: 18px;
|
|||
|
|
--radius-xl: 24px;
|
|||
|
||||
--glass-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.08);
|
||||
|
|
--glow-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
|
|||
}
|
||||
|
|
|
|||
* {
|
||||
|
|
box-sizing: border-box;
|
|||
|
|
margin: 0;
|
|||
|
|
padding: 0;
|
|||
|
|
-webkit-font-smoothing: antialiased;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
body {
|
|||
|
|
background: var(--bg-space);
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
font-family: var(--font-sans);
|
|||
|
|
min-height: 100vh;
|
|||
|
|
overflow-x: hidden;
|
|||
position: relative;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
|
|
|||
/* ─── 3D Cosmic Starfield Canvas ─── */
|
||||
|
|
#cosmic-canvas {
|
|||
|
|
position: fixed;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
width: 100vw;
|
|||
|
|
height: 100vh;
|
|||
pointer-events: none;
|
||||
z-index: 0;
|
||||
|
|
opacity: 0.85;
|
|||
}
|
||||
|
|
|
|||
/* ─── Ambient Glow Gradients ─── */
|
||||
|
|
.cosmic-nebula {
|
|||
|
|
position: fixed;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
filter: blur(120px);
|
|||
|
|
pointer-events: none;
|
|||
|
|
z-index: 0;
|
|||
|
|
opacity: 0.18;
|
|||
|
|
}
|
|||
|
|
.nebula-1 {
|
|||
|
|
top: -10%;
|
|||
|
|
right: -5%;
|
|||
|
|
width: 600px;
|
|||
|
|
height: 600px;
|
|||
|
|
background: radial-gradient(circle, #38bdf8 0%, #6366f1 70%, transparent 100%);
|
|||
|
|
}
|
|||
|
|
.nebula-2 {
|
|||
|
|
bottom: -15%;
|
|||
|
|
left: 10%;
|
|||
|
|
width: 700px;
|
|||
|
|
height: 700px;
|
|||
|
|
background: radial-gradient(circle, #818cf8 0%, #34d399 70%, transparent 100%);
|
|||
}
|
||||
|
|
|
|||
/* ─── App Shell Layout ─── */
|
||||
|
|
.app-shell {
|
|||
position: relative;
|
||||
z-index: 1;
|
||||
|
|
display: flex;
|
|||
|
|
min-height: 100vh;
|
|||
}
|
||||
|
|
|
|||
/* ─── Header ─── */
|
||||
|
|
.app-header {
|
|||
|
|
position: fixed;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
height: var(--header-h);
|
|||
|
|
background: rgba(3, 7, 18, 0.75);
|
|||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
|
|
border-bottom: 1px solid var(--border-subtle);
|
|||
display: flex;
|
||||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
padding: 0 24px;
|
||||
|
|
z-index: 50;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.header-left {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 18px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.brand-link {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
gap: 12px;
|
||||
text-decoration: none;
|
||||
|
|
color: var(--text-primary);
|
|||
|
|
font-weight: 700;
|
|||
|
|
font-size: 17px;
|
|||
|
|
letter-spacing: -0.01em;
|
|||
}
|
||||
|
||||
|
|
.brand-orb {
|
|||
|
|
width: 32px;
|
|||
|
|
height: 32px;
|
|||
|
|
border-radius: 10px;
|
|||
|
|
background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
|
|||
display: flex;
|
||||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
|
||||
}
|
||||
|
||||
|
|
.brand-tag {
|
|||
|
|
font-size: 11px;
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
letter-spacing: 0.12em;
|
|||
|
|
padding: 3px 8px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
background: rgba(56, 189, 248, 0.12);
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
border: 1px solid rgba(56, 189, 248, 0.25);
|
|||
|
|
font-weight: 600;
|
|||
}
|
||||
|
||||
|
|
.station-nav {
|
|||
display: flex;
|
||||
|
|
align-items: center;
|
|||
|
|
gap: 4px;
|
|||
margin-left: 12px;
|
||||
|
|
padding: 4px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
background: var(--bg-card-subtle);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
}
|
||||
|
||||
|
|
.station-pill {
|
|||
|
|
font-size: 12px;
|
|||
|
|
padding: 5px 12px;
|
|||
|
|
border-radius: var(--radius-sm);
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
text-decoration: none;
|
|||
|
|
font-weight: 500;
|
|||
|
|
transition: all 0.2s ease;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.station-pill:hover {
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
background: rgba(255, 255, 255, 0.05);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.station-pill.active {
|
|||
|
|
background: rgba(56, 189, 248, 0.18);
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
font-weight: 600;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.header-center {
|
|||
|
|
flex: 1;
|
|||
|
|
max-width: 480px;
|
|||
|
|
margin: 0 24px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.search-box {
|
|||
display: flex;
|
||||
|
|
align-items: center;
|
|||
background: var(--bg-input);
|
||||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
padding: 0 14px;
|
|||
|
|
height: 38px;
|
|||
|
|
transition: all 0.2s ease;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.search-box:focus-within {
|
|||
|
|
border-color: var(--accent-cyan);
|
|||
|
|
box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.search-box input {
|
|||
background: transparent;
|
||||
border: none;
|
||||
|
|
color: var(--text-primary);
|
|||
|
|
font-family: var(--font-sans);
|
|||
|
|
font-size: 13px;
|
|||
|
|
width: 100%;
|
|||
|
|
margin-left: 10px;
|
|||
|
|
outline: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.search-shortcut {
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
font-size: 10px;
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
background: rgba(255, 255, 255, 0.06);
|
|||
|
|
padding: 2px 6px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.header-right {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 16px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.bucket-badge {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 8px;
|
|||
|
|
padding: 6px 12px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
background: rgba(99, 102, 241, 0.12);
|
|||
|
|
border: 1px solid rgba(99, 102, 241, 0.3);
|
|||
|
|
font-size: 12px;
|
|||
|
|
color: #c7d2fe;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.bucket-dot {
|
|||
|
|
width: 8px;
|
|||
|
|
height: 8px;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
background: var(--accent-emerald);
|
|||
|
|
box-shadow: 0 0 8px var(--accent-emerald);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.user-pill {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 10px;
|
|||
|
|
padding: 4px 10px 4px 6px;
|
|||
|
|
border-radius: var(--radius-lg);
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
text-decoration: none;
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: border-color 0.2s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.user-pill:hover {
|
|||
|
|
border-color: var(--border-glow);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.user-avatar {
|
|||
|
|
width: 28px;
|
|||
|
|
height: 28px;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
background: linear-gradient(135deg, #6366f1, #38bdf8);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
font-size: 12px;
|
|||
|
|
font-weight: 700;
|
|||
|
|
color: white;
|
|||
|
|
overflow: hidden;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.user-avatar img {
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
object-fit: cover;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.user-info {
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.user-name {
|
|||
|
|
font-size: 12px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.user-quota-mini {
|
|||
|
|
font-size: 10px;
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.mobile-toggle {
|
|||
|
|
display: none;
|
|||
|
|
background: transparent;
|
|||
|
|
border: none;
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
font-size: 20px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
padding: 6px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Sidebar ─── */
|
|||
|
|
.app-sidebar {
|
|||
|
|
position: fixed;
|
|||
|
|
top: var(--header-h);
|
|||
|
|
bottom: 0;
|
|||
|
|
left: 0;
|
|||
|
|
width: var(--sidebar-w);
|
|||
|
|
background: rgba(3, 7, 18, 0.82);
|
|||
|
|
backdrop-filter: blur(20px);
|
|||
|
|
-webkit-backdrop-filter: blur(20px);
|
|||
|
|
border-right: 1px solid var(--border-subtle);
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
padding: 20px 14px;
|
|||
|
|
z-index: 40;
|
|||
|
|
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nav-section-title {
|
|||
|
|
font-size: 10px;
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
letter-spacing: 0.12em;
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
padding: 0 12px;
|
|||
|
|
margin-bottom: 8px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nav-list {
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
gap: 4px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nav-item {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 12px;
|
|||
|
|
padding: 10px 14px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
text-decoration: none;
|
|||
|
|
font-size: 13px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.2s ease;
|
|||
border: 1px solid transparent;
|
||||
}
|
||||
|
|
|
|||
|
|
.nav-item:hover {
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
background: rgba(255, 255, 255, 0.04);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nav-item.active {
|
|||
|
|
background: rgba(56, 189, 248, 0.12);
|
|||
|
|
border-color: rgba(56, 189, 248, 0.25);
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
font-weight: 600;
|
|||
|
|
box-shadow: 0 0 15px rgba(56, 189, 248, 0.15) inset;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nav-item svg {
|
|||
|
|
width: 18px;
|
|||
|
|
height: 18px;
|
|||
|
|
flex-shrink: 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nav-badge {
|
|||
|
|
margin-left: auto;
|
|||
|
|
font-size: 10px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
padding: 2px 6px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background: rgba(56, 189, 248, 0.15);
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.sidebar-divider {
|
|||
|
|
height: 1px;
|
|||
|
|
background: var(--border-subtle);
|
|||
|
|
margin: 16px 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Sidebar Quota Card */
|
|||
|
|
.sidebar-quota-box {
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-lg);
|
|||
|
|
padding: 14px;
|
|||
|
|
margin-bottom: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.quota-header {
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
align-items: center;
|
|||
|
|
font-size: 11px;
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
margin-bottom: 8px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.quota-bar {
|
|||
|
|
height: 6px;
|
|||
|
|
border-radius: 3px;
|
|||
|
|
background: rgba(255, 255, 255, 0.08);
|
|||
|
|
overflow: hidden;
|
|||
|
|
margin-bottom: 8px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.quota-fill {
|
|||
|
|
height: 100%;
|
|||
|
|
width: 0%;
|
|||
|
|
border-radius: 3px;
|
|||
|
|
background: linear-gradient(90deg, #38bdf8, #818cf8);
|
|||
|
|
transition: width 0.4s ease;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.quota-numbers {
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
font-size: 11px;
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Main Content Container ─── */
|
|||
|
|
.app-main {
|
|||
|
|
flex: 1;
|
|||
|
|
margin-left: var(--sidebar-w);
|
|||
|
|
margin-top: var(--header-h);
|
|||
|
|
padding: 32px;
|
|||
|
|
max-width: 1600px;
|
|||
|
|
width: calc(100vw - var(--sidebar-w));
|
|||
|
|
min-height: calc(100vh - var(--header-h));
|
|||
|
|
position: relative;
|
|||
|
|
z-index: 10;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Views */
|
|||
|
|
.view-panel {
|
|||
|
|
display: none;
|
|||
|
|
animation: fadeIn 0.25s ease-out;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.view-panel.active {
|
|||
|
|
display: block;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@keyframes fadeIn {
|
|||
|
|
from { opacity: 0; transform: translateY(6px); }
|
|||
|
|
to { opacity: 1; transform: translateY(0); }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Page Title Header ─── */
|
|||
|
|
.view-header {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: flex-start;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
margin-bottom: 28px;
|
|||
|
|
gap: 16px;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.view-title-group h1 {
|
|||
|
|
font-size: 26px;
|
|||
|
|
font-weight: 700;
|
|||
|
|
letter-spacing: -0.02em;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.view-title-group p {
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
font-size: 14px;
|
|||
|
|
margin-top: 4px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.view-actions {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 10px;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Buttons ─── */
|
|||
|
|
.btn {
|
|||
|
|
display: inline-flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
gap: 8px;
|
|||
|
|
padding: 8px 16px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
font-family: var(--font-sans);
|
|||
|
|
font-size: 13px;
|
|||
font-weight: 600;
|
||||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.2s ease;
|
|||
border: 1px solid transparent;
|
||||
|
|
text-decoration: none;
|
|||
|
|
line-height: 1;
|
|||
|
|
white-space: nowrap;
|
|||
}
|
||||
|
|
|
|||
.btn-primary {
|
||||
|
|
background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
|
|||
|
|
color: #ffffff;
|
|||
|
|
box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-primary:hover {
|
|||
|
|
transform: translateY(-1px);
|
|||
|
|
box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-secondary {
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
border-color: var(--border-card);
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-secondary:hover {
|
|||
|
|
background: var(--bg-card-hover);
|
|||
|
|
border-color: var(--border-glow);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-success {
|
|||
|
|
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
|
|||
|
|
color: #ffffff;
|
|||
|
|
box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-danger {
|
|||
|
|
background: rgba(244, 63, 94, 0.15);
|
|||
|
|
border-color: rgba(244, 63, 94, 0.35);
|
|||
|
|
color: #fb7185;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-danger:hover {
|
|||
|
|
background: #f43f5e;
|
|||
|
|
color: white;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-ghost {
|
|||
|
|
background: transparent;
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-ghost:hover {
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
background: rgba(255, 255, 255, 0.05);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-icon {
|
|||
|
|
width: 36px;
|
|||
|
|
height: 36px;
|
|||
|
|
padding: 0;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
color: var(--text-secondary);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-icon:hover {
|
|||
|
|
border-color: var(--border-glow);
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Metric Cards Grid ─── */
|
|||
|
|
.metrics-grid {
|
|||
|
|
display: grid;
|
|||
|
|
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
|||
|
|
gap: 18px;
|
|||
|
|
margin-bottom: 28px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-card {
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
border: 1px solid var(--border-card);
|
|||
|
|
border-radius: var(--radius-xl);
|
|||
|
|
padding: 22px;
|
|||
|
|
position: relative;
|
|||
|
|
overflow: hidden;
|
|||
|
|
backdrop-filter: blur(16px);
|
|||
|
|
-webkit-backdrop-filter: blur(16px);
|
|||
|
|
box-shadow: var(--glass-shadow);
|
|||
|
|
transition: transform 0.25s ease, border-color 0.25s ease;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-card:hover {
|
|||
|
|
transform: translateY(-2px);
|
|||
|
|
border-color: var(--border-glow);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-card::before {
|
|||
|
|
content: '';
|
|||
|
|
position: absolute;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
height: 2px;
|
|||
|
|
background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
|
|||
|
|
opacity: 0.7;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-top {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
margin-bottom: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-label {
|
|||
|
|
font-size: 13px;
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
font-weight: 500;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-icon-wrap {
|
|||
|
|
width: 36px;
|
|||
|
|
height: 36px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-val {
|
|||
|
|
font-size: 28px;
|
|||
|
|
font-weight: 700;
|
|||
|
|
letter-spacing: -0.02em;
|
|||
|
|
font-family: var(--font-sans);
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
margin-bottom: 4px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.metric-sub {
|
|||
|
|
font-size: 12px;
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 6px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Glass Panels ─── */
|
|||
|
|
.glass-panel {
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
border: 1px solid var(--border-card);
|
|||
|
|
border-radius: var(--radius-xl);
|
|||
|
|
padding: 24px;
|
|||
|
|
backdrop-filter: blur(16px);
|
|||
|
|
-webkit-backdrop-filter: blur(16px);
|
|||
|
|
box-shadow: var(--glass-shadow);
|
|||
|
|
margin-bottom: 24px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.panel-header {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
margin-bottom: 20px;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
gap: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.panel-title {
|
|||
|
|
font-size: 17px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Mornye NAS Dedicated Section ─── */
|
|||
|
|
.nas-hero-card {
|
|||
|
|
background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.15) 0%, rgba(13, 20, 36, 0.85) 60%);
|
|||
|
|
border: 1px solid rgba(56, 189, 248, 0.3);
|
|||
|
|
border-radius: var(--radius-xl);
|
|||
|
|
padding: 28px;
|
|||
|
|
margin-bottom: 24px;
|
|||
|
|
box-shadow: 0 0 35px rgba(56, 189, 248, 0.12);
|
|||
|
|
position: relative;
|
|||
|
|
overflow: hidden;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nas-hero-grid {
|
|||
|
|
display: grid;
|
|||
|
|
grid-template-columns: 1fr auto;
|
|||
|
|
gap: 24px;
|
|||
|
|
align-items: center;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nas-badge {
|
|||
|
|
display: inline-flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 6px;
|
|||
|
|
padding: 4px 10px;
|
|||
|
|
border-radius: 20px;
|
|||
|
|
font-size: 11px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
letter-spacing: 0.08em;
|
|||
|
|
background: rgba(52, 211, 153, 0.15);
|
|||
|
|
color: #34d399;
|
|||
|
|
border: 1px solid rgba(52, 211, 153, 0.3);
|
|||
|
|
margin-bottom: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nas-badge.inactive {
|
|||
|
|
background: rgba(251, 191, 36, 0.15);
|
|||
|
|
color: #fbbf24;
|
|||
|
|
border-color: rgba(251, 191, 36, 0.3);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.nas-conn-grid {
|
|||
|
|
display: grid;
|
|||
|
|
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
|||
|
|
gap: 16px;
|
|||
|
|
margin-top: 20px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.conn-card {
|
|||
|
|
background: rgba(7, 12, 22, 0.7);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-lg);
|
|||
|
|
padding: 16px;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.conn-label {
|
|||
|
|
font-size: 11px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
letter-spacing: 0.06em;
|
|||
|
|
margin-bottom: 8px;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.conn-val-box {
|
|||
|
|
background: rgba(0, 0, 0, 0.45);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
padding: 8px 12px;
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
font-size: 12px;
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
word-break: break-all;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
gap: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.conn-val-box input {
|
|||
|
|
background: transparent;
|
|||
|
|
border: none;
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
font-size: 12px;
|
|||
|
|
width: 100%;
|
|||
|
|
outline: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Client Setup Tabs ─── */
|
|||
|
|
.guide-tabs {
|
|||
|
|
display: flex;
|
|||
|
|
gap: 8px;
|
|||
|
|
border-bottom: 1px solid var(--border-subtle);
|
|||
|
|
padding-bottom: 12px;
|
|||
|
|
margin-bottom: 18px;
|
|||
|
|
overflow-x: auto;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.guide-tab-btn {
|
|||
|
|
background: transparent;
|
|||
|
|
border: none;
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
font-family: var(--font-sans);
|
|||
|
|
font-size: 13px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
padding: 8px 16px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.2s;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.guide-tab-btn:hover {
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
background: rgba(255, 255, 255, 0.04);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.guide-tab-btn.active {
|
|||
|
|
background: rgba(56, 189, 248, 0.15);
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
font-weight: 600;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.guide-content {
|
|||
|
|
display: none;
|
|||
|
|
}
|
|||
|
|
.guide-content.active {
|
|||
|
|
display: block;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.step-card {
|
|||
|
|
background: rgba(255, 255, 255, 0.02);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
padding: 14px 18px;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.step-num {
|
|||
|
|
font-size: 11px;
|
|||
|
|
font-weight: 700;
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
margin-bottom: 4px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Object Explorer Toolbar & Tables ─── */
|
|||
|
|
.explorer-toolbar {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
margin-bottom: 16px;
|
|||
|
|
gap: 12px;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.breadcrumbs {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 6px;
|
|||
|
|
font-size: 13px;
|
|||
|
|
background: var(--bg-card-subtle);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
padding: 6px 14px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
overflow-x: auto;
|
|||
|
|
max-width: 100%;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.crumb-item {
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
cursor: pointer;
|
|||
|
|
text-decoration: none;
|
|||
|
|
font-weight: 500;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.crumb-item:hover {
|
|||
|
|
text-decoration: underline;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.crumb-sep {
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.crumb-current {
|
|||
|
|
color: var(--text-secondary);
|
|||
|
|
font-weight: 600;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.filter-chips {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 6px;
|
|||
|
|
overflow-x: auto;
|
|||
|
|
padding: 4px 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.chip-btn {
|
|||
|
|
font-size: 11px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
padding: 4px 10px;
|
|||
|
|
border-radius: 14px;
|
|||
|
|
background: var(--bg-card-subtle);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.2s;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.chip-btn:hover {
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
border-color: rgba(255, 255, 255, 0.2);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.chip-btn.active {
|
|||
|
|
background: rgba(56, 189, 248, 0.15);
|
|||
|
|
border-color: var(--accent-cyan);
|
|||
|
|
color: var(--accent-cyan);
|
|||
|
|
font-weight: 600;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Object Table ─── */
|
|||
|
|
.table-wrap {
|
|||
|
|
overflow-x: auto;
|
|||
|
|
border: 1px solid var(--border-card);
|
|||
|
|
border-radius: var(--radius-lg);
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.data-table {
|
|||
|
|
width: 100%;
|
|||
|
|
border-collapse: collapse;
|
|||
|
|
font-size: 13px;
|
|||
|
|
text-align: left;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.data-table th {
|
|||
|
|
padding: 12px 16px;
|
|||
|
|
background: rgba(255, 255, 255, 0.02);
|
|||
|
|
border-bottom: 1px solid var(--border-subtle);
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
font-size: 11px;
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
letter-spacing: 0.06em;
|
|||
|
|
font-weight: 600;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.data-table td {
|
|||
|
|
padding: 12px 16px;
|
|||
|
|
border-bottom: 1px solid var(--border-subtle);
|
|||
|
|
color: var(--text-secondary);
|
|||
|
|
vertical-align: middle;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.data-table tr:last-child td {
|
|||
|
|
border-bottom: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.data-table tr:hover td {
|
|||
|
|
background: rgba(255, 255, 255, 0.03);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.row-item {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 12px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.item-icon {
|
|||
|
|
width: 32px;
|
|||
|
|
height: 32px;
|
|||
|
|
border-radius: var(--radius-sm);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
flex-shrink: 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.icon-folder { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
|
|||
|
|
.icon-audio { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
|
|||
|
|
.icon-video { background: rgba(192, 132, 252, 0.15); color: #c084fc; }
|
|||
|
|
.icon-image { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
|
|||
|
|
.icon-code { background: rgba(52, 211, 153, 0.15); color: #34d399; }
|
|||
|
|
.icon-doc { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
|
|||
|
|
.icon-zip { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
|
|||
|
|
.icon-file { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
|
|||
|
|
|
|||
|
|
.item-name {
|
|||
|
|
font-weight: 500;
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
max-width: 340px;
|
|||
|
|
overflow: hidden;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.row-actions {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 6px;
|
|||
|
|
opacity: 0.6;
|
|||
|
|
transition: opacity 0.2s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.data-table tr:hover .row-actions {
|
|||
|
|
opacity: 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Grid View ─── */
|
|||
|
|
.object-grid {
|
|||
|
|
display: grid;
|
|||
|
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|||
|
|
gap: 16px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.grid-card {
|
|||
|
|
background: var(--bg-card);
|
|||
|
|
border: 1px solid var(--border-card);
|
|||
|
|
border-radius: var(--radius-lg);
|
|||
|
|
padding: 16px;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
position: relative;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.2s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.grid-card:hover {
|
|||
|
|
transform: translateY(-2px);
|
|||
|
|
border-color: var(--border-glow);
|
|||
|
|
background: var(--bg-card-hover);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.grid-card-icon {
|
|||
|
|
width: 48px;
|
|||
|
|
height: 48px;
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
margin-bottom: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.grid-card-name {
|
|||
|
|
font-size: 13px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
overflow: hidden;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
margin-bottom: 4px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.grid-card-meta {
|
|||
|
|
font-size: 11px;
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
color: var(--text-dim);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Batch Floating Bar ─── */
|
|||
|
|
.batch-bar {
|
|||
|
|
position: fixed;
|
|||
|
|
bottom: 24px;
|
|||
|
|
left: 50%;
|
|||
|
|
transform: translateX(-50%) translateY(120px);
|
|||
|
|
background: rgba(10, 16, 29, 0.92);
|
|||
|
|
border: 1px solid var(--border-glow);
|
|||
|
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.3);
|
|||
|
|
backdrop-filter: blur(20px);
|
|||
|
|
padding: 10px 20px;
|
|||
|
|
border-radius: var(--radius-xl);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 16px;
|
|||
|
|
z-index: 60;
|
|||
|
|
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.batch-bar.show {
|
|||
|
|
transform: translateX(-50%) translateY(0);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Drag & Drop Overlay ─── */
|
|||
|
|
#drop-overlay {
|
|||
|
|
position: fixed;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
width: 100vw;
|
|||
|
|
height: 100vh;
|
|||
|
|
background: rgba(3, 7, 18, 0.85);
|
|||
|
|
backdrop-filter: blur(16px);
|
|||
|
|
z-index: 100;
|
|||
|
|
display: none;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
flex-direction: column;
|
|||
|
|
pointer-events: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#drop-overlay.active {
|
|||
|
|
display: flex;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.drop-target-box {
|
|||
|
|
width: 80%;
|
|||
|
|
max-width: 600px;
|
|||
|
|
height: 300px;
|
|||
|
|
border: 2px dashed var(--accent-cyan);
|
|||
|
|
border-radius: var(--radius-xl);
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
background: rgba(56, 189, 248, 0.05);
|
|||
|
|
box-shadow: 0 0 40px rgba(56, 189, 248, 0.2);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Upload Drawer ─── */
|
|||
|
|
.upload-drawer {
|
|||
|
|
position: fixed;
|
|||
|
|
bottom: 24px;
|
|||
|
|
right: 24px;
|
|||
|
|
width: 380px;
|
|||
|
|
max-height: 480px;
|
|||
|
|
background: rgba(10, 16, 29, 0.95);
|
|||
|
|
border: 1px solid var(--border-card);
|
|||
|
|
border-radius: var(--radius-xl);
|
|||
|
|
box-shadow: var(--glass-shadow);
|
|||
|
|
backdrop-filter: blur(24px);
|
|||
|
|
z-index: 70;
|
|||
|
|
display: none;
|
|||
|
|
flex-direction: column;
|
|||
|
|
overflow: hidden;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.upload-drawer.show {
|
|||
|
|
display: flex;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.upload-header {
|
|||
|
|
padding: 12px 18px;
|
|||
|
|
border-bottom: 1px solid var(--border-subtle);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
background: rgba(255, 255, 255, 0.02);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.upload-list {
|
|||
|
|
padding: 12px 18px;
|
|||
|
|
overflow-y: auto;
|
|||
|
|
max-height: 360px;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
gap: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.upload-item {
|
|||
|
|
background: rgba(255, 255, 255, 0.02);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
padding: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.upload-item-title {
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
font-size: 12px;
|
|||
|
|
margin-bottom: 6px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.upload-progress-bar {
|
|||
|
|
height: 4px;
|
|||
|
|
background: rgba(255, 255, 255, 0.08);
|
|||
|
|
border-radius: 2px;
|
|||
|
|
overflow: hidden;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.upload-progress-fill {
|
|||
|
|
height: 100%;
|
|||
|
|
width: 0%;
|
|||
|
|
background: linear-gradient(90deg, #38bdf8, #34d399);
|
|||
|
|
transition: width 0.1s linear;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Modals ─── */
|
|||
|
|
.modal-backdrop {
|
|||
|
|
position: fixed;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
width: 100vw;
|
|||
|
|
height: 100vh;
|
|||
|
|
background: rgba(0, 0, 0, 0.75);
|
|||
|
|
backdrop-filter: blur(12px);
|
|||
|
|
z-index: 90;
|
|||
|
|
display: none;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
padding: 20px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.modal-backdrop.open {
|
|||
|
|
display: flex;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.modal-dialog {
|
|||
|
|
background: rgba(10, 16, 29, 0.96);
|
|||
|
|
border: 1px solid var(--border-card);
|
|||
|
|
border-radius: var(--radius-xl);
|
|||
|
|
box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 2px var(--border-glow);
|
|||
|
|
width: 100%;
|
|||
|
|
max-width: 540px;
|
|||
|
|
max-height: 90vh;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
overflow: hidden;
|
|||
|
|
animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.modal-dialog.modal-lg {
|
|||
|
|
max-width: 900px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@keyframes modalScale {
|
|||
|
|
from { opacity: 0; transform: scale(0.95); }
|
|||
|
|
to { opacity: 1; transform: scale(1); }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.modal-header {
|
|||
|
|
padding: 18px 24px;
|
|||
|
|
border-bottom: 1px solid var(--border-subtle);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.modal-title {
|
|||
|
|
font-size: 16px;
|
|||
|
|
font-weight: 700;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.modal-body {
|
|||
|
|
padding: 24px;
|
|||
|
|
overflow-y: auto;
|
|||
|
|
flex: 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.modal-footer {
|
|||
|
|
padding: 16px 24px;
|
|||
|
|
border-top: 1px solid var(--border-subtle);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: flex-end;
|
|||
|
|
gap: 10px;
|
|||
|
|
background: rgba(255, 255, 255, 0.01);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Form Controls */
|
|||
|
|
.form-group {
|
|||
|
|
margin-bottom: 16px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.form-label {
|
|||
|
|
display: block;
|
|||
|
|
font-size: 12px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
color: var(--text-muted);
|
|||
|
|
margin-bottom: 6px;
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
letter-spacing: 0.05em;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.form-input, .form-select, .form-textarea {
|
|||
|
|
width: 100%;
|
|||
|
|
background: var(--bg-input);
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
padding: 10px 14px;
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
font-family: var(--font-sans);
|
|||
|
|
font-size: 13px;
|
|||
|
|
outline: none;
|
|||
|
|
transition: border-color 0.2s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.form-input:focus, .form-select:focus, .form-textarea:focus {
|
|||
|
|
border-color: var(--accent-cyan);
|
|||
|
|
box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.form-select {
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.form-textarea {
|
|||
|
|
min-height: 120px;
|
|||
|
|
resize: vertical;
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Code Editor in Modal */
|
|||
|
|
.code-editor-area {
|
|||
|
|
width: 100%;
|
|||
|
|
min-height: 380px;
|
|||
|
|
background: #02040a;
|
|||
|
|
border: 1px solid var(--border-subtle);
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
padding: 14px;
|
|||
|
|
color: #38bdf8;
|
|||
|
|
font-family: var(--font-mono);
|
|||
|
|
font-size: 13px;
|
|||
|
|
line-height: 1.6;
|
|||
|
|
outline: none;
|
|||
|
|
resize: vertical;
|
|||
|
|
tab-size: 2;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Toast Notifications ─── */
|
|||
|
|
.toast-container {
|
|||
|
|
position: fixed;
|
|||
|
|
top: 24px;
|
|||
|
|
right: 24px;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
gap: 8px;
|
|||
|
|
z-index: 120;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.toast {
|
|||
|
|
background: rgba(10, 16, 29, 0.95);
|
|||
|
|
border: 1px solid var(--border-card);
|
|||
|
|
border-radius: var(--radius-md);
|
|||
|
|
padding: 12px 18px;
|
|||
|
|
color: var(--text-primary);
|
|||
|
|
font-size: 13px;
|
|||
|
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
|
|||
|
|
backdrop-filter: blur(16px);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 10px;
|
|||
|
|
animation: toastIn 0.25s ease-out;
|
|||
|
|
min-width: 260px;
|
|||
|
|
max-width: 400px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.toast.success { border-color: var(--accent-emerald); }
|
|||
|
|
.toast.error { border-color: var(--accent-rose); }
|
|||
|
|
.toast.info { border-color: var(--accent-cyan); }
|
|||
|
|
|
|||
|
|
@keyframes toastIn {
|
|||
|
|
from { opacity: 0; transform: translateX(20px); }
|
|||
|
|
to { opacity: 1; transform: translateX(0); }
|
|||
|
|
}
|
|||
|
|
|
|||
.sidebar-backdrop {
|
||||
|
|
display: none;
|
|||
|
|
position: fixed;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
width: 100vw;
|
|||
|
|
height: 100vh;
|
|||
|
|
background: rgba(0, 0, 0, 0.65);
|
|||
|
|
backdrop-filter: blur(4px);
|
|||
|
|
-webkit-backdrop-filter: blur(4px);
|
|||
|
|
z-index: 35;
|
|||
|
|
}
|
|||
|
|
|
|||
/* ─── Responsive Media Queries ─── */
|
||||
|
|
@media (max-width: 1024px) {
|
|||
.sidebar-backdrop.open {
|
||||
|
|
display: block;
|
|||
|
|
}
|
|||
.app-sidebar {
|
||||
|
|
transform: translateX(-100%);
|
|||
}
|
||||
.app-sidebar.open {
|
||||
|
|
transform: translateX(0);
|
|||
|
|
box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
|
|||
}
|
||||
.app-main {
|
||||
|
|
margin-left: 0;
|
|||
|
|
width: 100vw;
|
|||
|
|
padding: 20px 16px;
|
|||
}
|
||||
.mobile-toggle {
|
||||
|
|
display: block;
|
|||
|
|
}
|
|||
|
|
.station-nav {
|
|||
display: none;
|
||||
|
|
}
|
|||
|
|
}
|
|||
</style>
|
||||
|
|
</head>
|
|||
|
|
|
|||
<body>
|
||||
<!-- Mobile Sidebar Backdrop -->
|
||||
|
|
<div class="sidebar-backdrop" id="sidebar-backdrop" onclick="closeSidebar()"></div>
|
|||
|
|
|
|||
<!-- 3D Cosmic Background Canvas -->
|
||||
|
|
<canvas id="cosmic-canvas"></canvas>
|
|||
|
|
<div class="cosmic-nebula nebula-1"></div>
|
|||
|
|
<div class="cosmic-nebula nebula-2"></div>
|
|||
|
|
|
|||
|
|
<!-- Drop Overlay -->
|
|||
|
|
<div id="drop-overlay">
|
|||
|
|
<div class="drop-target-box">
|
|||
|
|
<svg width="48" height="48" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="color:var(--accent-cyan); margin-bottom:12px;">
|
|||
|
|
<path d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"/>
|
|||
|
|
</svg>
|
|||
|
|
<h3 style="font-size:18px; margin-bottom:6px;">Drop Files or Folders to Upload</h3>
|
|||
|
|
<p style="color:var(--text-muted); font-size:13px;">Direct Sovereign High-Speed Ingestion to OORT S3</p>
|
|||
|
|
</div>
|
|||
</div>
|
||||
|
|
|
|||
<!-- Upload Progress Drawer -->
|
||||
|
|
<div class="upload-drawer" id="upload-drawer">
|
|||
|
|
<div class="upload-header">
|
|||
|
|
<div style="font-size:13px; font-weight:600; display:flex; align-items:center; gap:8px;">
|
|||
|
|
<span id="upload-summary-title">Uploading...</span>
|
|||
</div>
|
||||
<button class="btn btn-ghost" style="padding:4px 8px; font-size:12px;" onclick="closeUploadDrawer()">✕</button>
|
||||
</div>
|
||||
<div class="upload-list" id="upload-items-container"></div>
|
||||
|
|
</div>
|
|||
|
||||
<!-- Batch Floating Bar -->
|
||||
|
|
<div class="batch-bar" id="batch-bar">
|
|||
|
|
<span style="font-size:13px; font-weight:600; color:var(--accent-cyan);" id="batch-selected-count">0 items selected</span>
|
|||
|
|
<button class="btn btn-secondary" onclick="batchDownloadZip()">
|
|||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
|
|||
|
|
Download as ZIP
|
|||
|
|
</button>
|
|||
|
|
<button class="btn btn-danger" onclick="confirmBatchDelete()">
|
|||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14H6L5 6"/><path d="M9 6V4h6v2"/></svg>
|
|||
|
|
Delete Selected
|
|||
|
|
</button>
|
|||
|
|
<button class="btn btn-ghost" onclick="clearBatchSelection()">Deselect</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="toast-container" id="toast-container"></div>
|
|||
|
|
|
|||
|
|
<div class="app-shell">
|
|||
|
|
<!-- Top App Header -->
|
|||
|
|
<header class="app-header">
|
|||
|
|
<div class="header-left">
|
|||
|
|
<button class="mobile-toggle" onclick="toggleSidebar()">☰</button>
|
|||
|
|
<a href="/" class="brand-link">
|
|||
|
|
<div class="brand-orb">
|
|||
|
|
<svg width="18" height="18" fill="none" stroke="#ffffff" stroke-width="2.5" viewBox="0 0 24 24">
|
|||
|
|
<circle cx="12" cy="12" r="9"/>
|
|||
|
|
<path d="M12 3a9 9 0 019 9M3 12a9 9 0 019-9"/>
|
|||
|
|
</svg>
|
|||
|
|
</div>
|
|||
|
|
<span>COSMOS</span>
|
|||
|
|
</a>
|
|||
|
|
<span class="brand-tag">OORT S3 & NAS</span>
|
|||
|
|
|
|||
|
|
<nav class="station-nav">
|
|||
|
|
<a href="/" class="station-pill">Cosmos</a>
|
|||
|
|
<a href="/git" class="station-pill">Forge</a>
|
|||
|
|
<a href="/orbit" class="station-pill">Orbit</a>
|
|||
|
|
<a href="/oort/console" class="station-pill active">Oort</a>
|
|||
|
|
</nav>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="header-center">
|
|||
|
|
<div class="search-box">
|
|||
|
|
<svg width="15" height="15" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="color:var(--text-dim);">
|
|||
|
|
<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
|||
|
|
</svg>
|
|||
|
|
<input type="text" id="global-search-input" placeholder="Search objects, audio tracks, directories..." oninput="handleGlobalSearch(this.value)">
|
|||
|
|
<span class="search-shortcut">/</span>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
|
|||
<div class="header-right">
|
||||
|
|
<div class="bucket-badge" title="Active S3 Storage Bucket">
|
|||
|
|
<span class="bucket-dot"></span>
|
|||
|
|
<span id="header-active-bucket-name" style="font-family:var(--font-mono); font-size:12px;">loading...</span>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="user-pill" onclick="switchView('account')">
|
|||
|
|
<div class="user-avatar" id="header-avatar-circle">U</div>
|
|||
|
|
<div class="user-info">
|
|||
|
|
<span class="user-name" id="header-username">{{.Username}}</span>
|
|||
|
|
<span class="user-quota-mini" id="header-quota-text">-- GB</span>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</header>
|
|||
|
|
|
|||
|
|
<!-- Left Sidebar Navigation -->
|
|||
|
|
<aside class="app-sidebar" id="app-sidebar">
|
|||
|
|
<div>
|
|||
|
|
<div class="nav-section-title">Navigation</div>
|
|||
|
|
<div class="nav-list">
|
|||
|
|
<a class="nav-item active" data-view="dashboard" onclick="switchView('dashboard')">
|
|||
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/></svg>
|
|||
|
|
<span>Overview</span>
|
|||
|
|
</a>
|
|||
|
|
|
|||
|
|
<a class="nav-item" data-view="browser" onclick="switchView('browser')">
|
|||
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/></svg>
|
|||
|
|
<span>Object Explorer</span>
|
|||
|
|
</a>
|
|||
|
|
|
|||
|
|
<a class="nav-item" data-view="nas" onclick="switchView('nas')">
|
|||
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
|||
|
|
<span>Mornye NAS</span>
|
|||
|
|
<span class="nav-badge">NAS</span>
|
|||
|
|
</a>
|
|||
|
|
|
|||
|
|
<a class="nav-item" data-view="analytics" onclick="switchView('analytics')">
|
|||
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg>
|
|||
|
|
<span>Telemetry</span>
|
|||
|
|
</a>
|
|||
|
|
|
|||
|
|
<a class="nav-item" data-view="api" onclick="switchView('api')">
|
|||
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="2"/><line x1="8" y1="12" x2="16" y2="12"/><line x1="12" y1="8" x2="12" y2="16"/></svg>
|
|||
|
|
<span>API & S3 Access</span>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="sidebar-divider"></div>
|
|||
|
|
|
|||
|
|
<div class="nav-section-title">Configuration</div>
|
|||
|
|
<div class="nav-list">
|
|||
|
|
<a class="nav-item" data-view="settings" onclick="switchView('settings')">
|
|||
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z"/></svg>
|
|||
|
|
<span>Drive Settings</span>
|
|||
|
|
</a>
|
|||
|
|
|
|||
|
|
<a class="nav-item" data-view="account" onclick="switchView('account')">
|
|||
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
|
|||
|
|
<span>Account & Quota</span>
|
|||
|
|
</a>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
|
|||
<div>
|
||||
|
|
<div class="sidebar-quota-box">
|
|||
|
|
<div class="quota-header">
|
|||
|
|
<span>Storage Quota</span>
|
|||
|
|
<span id="sidebar-quota-pct" style="color:var(--accent-cyan); font-weight:600;">0%</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="quota-bar">
|
|||
|
|
<div class="quota-fill" id="sidebar-quota-fill"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="quota-numbers">
|
|||
|
|
<span id="sidebar-quota-used">0 B</span>
|
|||
|
|
<span id="sidebar-quota-total">10 GB</span>
|
|||
|
|
</div>
|
|||
</div>
|
||||
|
||||
|
|
<a href="/oort/logout" class="nav-item" style="color:var(--accent-rose);">
|
|||
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
|
||||
<span>Sign Out</span>
|
||||
</a>
|
||||
|
|
</div>
|
|||
</aside>
|
||||
|
||||
<!-- Main Content Areas -->
|
||||
|
|
<main class="app-main">
|
|||
|
||||
<!-- ════════════════════ VIEW 1: DASHBOARD (OVERVIEW) ════════════════════ -->
|
||||
|
|
<div class="view-panel active" id="view-dashboard">
|
|||
|
|
<div class="view-header">
|
|||
|
|
<div class="view-title-group">
|
|||
|
|
<h1>
|
|||
|
|
<span>Sovereign Storage Overview</span>
|
|||
|
|
<span class="badge" style="background:rgba(52,211,153,0.15); color:#34d399; font-size:12px; font-weight:600; padding:3px 8px; border-radius:6px; border:1px solid rgba(52,211,153,0.3);">Online</span>
|
|||
|
|
</h1>
|
|||
|
|
<p>Global storage telemetry, S3 buckets, Mornye NAS status, and file inventory.</p>
|
|||
</div>
|
||||
<div class="view-actions">
|
||||
|
|
<button class="btn btn-secondary" onclick="openCreateBucketModal()">
|
|||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
|||
|
|
New Bucket
|
|||
|
|
</button>
|
|||
|
|
<button class="btn btn-primary" onclick="switchView('browser')">
|
|||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/></svg>
|
|||
|
|
Browse Objects
|
|||
</button>
|
||||
|
|
</div>
|
|||
</div>
|
||||
|
|
|
|||
|
|
<!-- Metrics 4-Pack -->
|
|||
|
|
<div class="metrics-grid">
|
|||
|
|
<div class="metric-card">
|
|||
|
|
<div class="metric-top">
|
|||
|
|
<span class="metric-label">Storage Consumed</span>
|
|||
|
|
<div class="metric-icon-wrap" style="background:rgba(56,189,248,0.15); color:#38bdf8;">
|
|||
|
|
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/></svg>
|
|||
|
|
</div>
|
|||
</div>
|
||||
<div class="metric-val" id="metric-storage-used">0 B</div>
|
||||
|
|
<div class="metric-sub" id="metric-storage-sub">Allocated Quota: 10 GB</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="metric-card">
|
|||
|
|
<div class="metric-top">
|
|||
|
|
<span class="metric-label">Total Objects</span>
|
|||
|
|
<div class="metric-icon-wrap" style="background:rgba(99,102,241,0.15); color:#818cf8;">
|
|||
|
|
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="metric-val" id="metric-objects-count">0</div>
|
|||
|
|
<div class="metric-sub">Across active drives</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="metric-card">
|
|||
|
|
<div class="metric-top">
|
|||
|
|
<span class="metric-label">Active Drives / Buckets</span>
|
|||
|
|
<div class="metric-icon-wrap" style="background:rgba(52,211,153,0.15); color:#34d399;">
|
|||
|
|
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><line x1="12" y1="4" x2="12" y2="20"/></svg>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="metric-val" id="metric-buckets-count">1</div>
|
|||
|
|
<div class="metric-sub" id="metric-default-bucket-name">Primary: mybucket</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="metric-card">
|
|||
|
|
<div class="metric-top">
|
|||
|
|
<span class="metric-label">Mornye NAS Audio Tracks</span>
|
|||
|
|
<div class="metric-icon-wrap" style="background:rgba(251,191,36,0.15); color:#fbbf24;">
|
|||
|
|
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="metric-val" id="metric-audio-tracks">0</div>
|
|||
|
|
<div class="metric-sub" id="metric-nas-status-sub">High-Speed Streaming Active</div>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
|
|||
<!-- Quick Storage Breakdown & Fast Action Cards -->
|
||||
|
|
<div style="display:grid; grid-template-columns: 2fr 1fr; gap:24px; margin-bottom:28px;">
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">
|
|||
|
|
<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 2a10 10 0 0110 10H12V2z"/></svg>
|
|||
|
|
Storage Categorization
|
|||
|
|
</span>
|
|||
|
|
<span style="font-size:12px; color:var(--text-dim);" id="breakdown-total-size">0 B total</span>
|
|||
</div>
|
||||
<div id="storage-breakdown-bars" style="display:flex; flex-direction:column; gap:12px;">
|
||||
|
|
<!-- Category bars rendered by JS -->
|
|||
|
|
<div style="color:var(--text-dim); font-size:13px;">Analyzing storage telemetry...</div>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
||||
<div class="glass-panel">
|
||||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">
|
|||
|
|
<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
|
|||
|
|
Quick Protocols
|
|||
</span>
|
||||
|
|
</div>
|
|||
<div style="display:flex; flex-direction:column; gap:10px;">
|
||||
|
|
<div class="step-card" style="cursor:pointer;" onclick="switchView('nas')">
|
|||
|
|
<div class="step-num">Mornye Music Server</div>
|
|||
|
|
<div style="font-size:12px; color:var(--text-secondary); margin-top:2px;">Connect your music library via WebDAV / HTTP.</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="step-card" style="cursor:pointer;" onclick="switchView('api')">
|
|||
|
|
<div class="step-num">S3 SDK & AWS CLI</div>
|
|||
|
|
<div style="font-size:12px; color:var(--text-secondary); margin-top:2px;">Credentials for rclone, Cyberduck, Boto3, and Go.</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="step-card" style="cursor:pointer;" onclick="openCreateBucketModal()">
|
|||
|
|
<div class="step-num">New Storage Drive</div>
|
|||
|
|
<div style="font-size:12px; color:var(--text-secondary); margin-top:2px;">Create an isolated space for backups or media.</div>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- Recent Objects -->
|
||||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">
|
|||
|
|
<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
|
|||
|
|
Recent Objects
|
|||
|
|
</span>
|
|||
|
|
<button class="btn btn-ghost" onclick="switchView('browser')">View All Objects →</button>
|
|||
</div>
|
||||
<div class="table-wrap">
|
||||
|
|
<table class="data-table">
|
|||
<thead>
|
||||
<tr>
|
||||
|
|
<th>Name</th>
|
|||
|
|
<th>Size</th>
|
|||
|
|
<th>Last Modified</th>
|
|||
|
|
<th style="text-align:right;">Actions</th>
|
|||
</tr>
|
||||
|
|
</thead>
|
|||
<tbody id="dashboard-recent-objects-body">
|
||||
|
|
<tr>
|
|||
|
|
<td colspan="4" style="text-align:center; color:var(--text-dim); padding:30px;">Loading objects...</td>
|
|||
|
|
</tr>
|
|||
</tbody>
|
||||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- ════════════════════ VIEW 2: OBJECT EXPLORER (BROWSER) ════════════════════ -->
|
||||
|
|
<div class="view-panel" id="view-browser">
|
|||
|
|
<div class="view-header">
|
|||
|
|
<div class="view-title-group">
|
|||
|
|
<h1>Object Explorer</h1>
|
|||
|
|
<p>Browse, upload, organize, and inspect your sovereign S3 objects.</p>
|
|||
</div>
|
||||
<div class="view-actions">
|
||||
|
|
<select id="browser-bucket-select" class="form-select" style="width:auto; max-width:200px;" onchange="changeBucket(this.value)"></select>
|
|||
|
|
<button class="btn btn-secondary" onclick="openMkdirModal()">
|
|||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/><line x1="12" y1="11" x2="12" y2="17"/><line x1="9" y1="14" x2="15" y2="14"/></svg>
|
|||
|
|
New Folder
|
|||
|
|
</button>
|
|||
|
|
<button class="btn btn-primary" onclick="triggerFileInput()">
|
|||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
|
|||
|
|
Upload Files
|
|||
|
|
</button>
|
|||
|
|
<input type="file" id="hidden-file-input" multiple style="display:none;" onchange="handleFileInputChange(this.files)">
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
|
|||
<!-- Explorer Controls -->
|
||||
|
|
<div class="glass-panel" style="padding:16px;">
|
|||
|
|
<div class="explorer-toolbar">
|
|||
|
|
<div class="breadcrumbs" id="browser-breadcrumbs">
|
|||
|
|
<span class="crumb-item" onclick="navigateToPrefix('')">root</span>
|
|||
</div>
|
||||
|
||||
|
|
<div style="display:flex; align-items:center; gap:8px;">
|
|||
|
|
<button class="btn btn-icon" title="Refresh directory" onclick="loadObjects()">
|
|||
|
|
<svg width="15" height="15" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"/></svg>
|
|||
|
|
</button>
|
|||
|
|
<button class="btn btn-icon" id="btn-toggle-view" title="Toggle Table/Grid View" onclick="toggleExplorerView()">
|
|||
|
|
<svg width="15" height="15" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/></svg>
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Filter Chips -->
|
|||
|
|
<div class="filter-chips">
|
|||
|
|
<button class="chip-btn active" data-cat="all" onclick="filterByCategory('all')">All Objects</button>
|
|||
|
|
<button class="chip-btn" data-cat="audio" onclick="filterByCategory('audio')">🎵 Audio / Mornye</button>
|
|||
|
|
<button class="chip-btn" data-cat="video" onclick="filterByCategory('video')">🎬 Video</button>
|
|||
|
|
<button class="chip-btn" data-cat="image" onclick="filterByCategory('image')">🖼️ Images</button>
|
|||
|
|
<button class="chip-btn" data-cat="documents" onclick="filterByCategory('documents')">📄 Documents</button>
|
|||
|
|
<button class="chip-btn" data-cat="code" onclick="filterByCategory('code')">💻 Code</button>
|
|||
|
|
<button class="chip-btn" data-cat="archives" onclick="filterByCategory('archives')">📦 Archives</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Objects Container (Table & Grid) -->
|
|||
|
|
<div id="explorer-table-container" class="table-wrap">
|
|||
|
|
<table class="data-table">
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th style="width:40px;"><input type="checkbox" id="master-select-checkbox" onchange="toggleSelectAll(this.checked)"></th>
|
|||
|
|
<th>Name</th>
|
|||
|
|
<th>Size</th>
|
|||
|
|
<th>Last Modified</th>
|
|||
|
|
<th style="text-align:right;">Actions</th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody id="browser-objects-tbody">
|
|||
|
|
<tr>
|
|||
|
|
<td colspan="5" style="text-align:center; color:var(--text-dim); padding:40px;">Loading objects...</td>
|
|||
|
|
</tr>
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="explorer-grid-container" class="object-grid" style="display:none; margin-top:16px;"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- ════════════════════ VIEW 3: MORNYE NAS HUB ════════════════════ -->
|
|||
|
|
<div class="view-panel" id="view-nas">
|
|||
|
|
<div class="view-header">
|
|||
|
|
<div class="view-title-group">
|
|||
|
|
<h1>Mornye NAS Server</h1>
|
|||
|
|
<p>Sovereign private cloud storage engine connecting directly to the Mornye music app and native network clients.</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="view-actions">
|
|||
<select id="nas-bucket-select" class="form-select" style="width:auto; max-width:200px;" onchange="changeBucket(this.value)"></select>
|
||||
<button class="btn btn-secondary" onclick="triggerNASMusicUpload()">
|
||||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
|||
|
|
Upload Music to NAS
|
|||
|
|
</button>
|
|||
|
|
<button class="btn btn-primary" id="btn-nas-enable-streaming" onclick="enableNASStreaming()">
|
|||
|
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><polygon points="5 3 19 12 5 21 5 3"/></svg>
|
|||
|
|
Enable High-Speed Streaming
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- NAS Hero Status Card -->
|
|||
|
|
<div class="nas-hero-card">
|
|||
|
|
<div class="nas-hero-grid">
|
|||
<div>
|
||||
<span class="nas-badge" id="nas-status-badge">
|
||||
|
|
<span style="width:6px; height:6px; border-radius:50%; background:#34d399;"></span>
|
|||
|
|
Streaming Active
|
|||
|
|
</span>
|
|||
|
|
<h2 style="font-size:22px; font-weight:700; margin-bottom:8px;">Private Audio Storage & Streaming Hub</h2>
|
|||
|
|
<p style="color:var(--text-secondary); font-size:14px; max-width:680px; line-height:1.6;">
|
|||
|
|
OORT serves your lossless FLAC, ALAC, WAV, and MP3 files directly to Mornye. No middleman, zero compression, and full byte-range seeking over encrypted HTTP & WebDAV.
|
|||
|
|
</p>
|
|||
|
|
</div>
|
|||
|
|
<div style="text-align:right;">
|
|||
|
|
<div style="font-size:32px; font-weight:700; color:var(--accent-cyan);" id="nas-track-count">0</div>
|
|||
|
|
<div style="font-size:12px; color:var(--text-muted);">Indexed Tracks</div>
|
|||
|
|
<div style="font-size:14px; font-family:var(--font-mono); color:var(--text-secondary); margin-top:4px;" id="nas-music-bytes">0 MB</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Connection Cards Grid -->
|
|||
|
|
<div class="nas-conn-grid">
|
|||
|
|
<div class="conn-card">
|
|||
|
|
<div class="conn-label">
|
|||
|
|
<span>WebDAV Endpoint (Mornye / Finder / Explorer)</span>
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 6px; font-size:11px;" onclick="copyFieldValue('nas-input-webdav')">Copy</button>
|
|||
</div>
|
||||
<div class="conn-val-box">
|
||||
|
|
<input type="text" id="nas-input-webdav" readonly value="https://cosmos.linuxguy.space/oort/username/mybucket/">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="conn-card">
|
|||
|
|
<div class="conn-label">
|
|||
|
|
<span>Master M3U Audio Playlist</span>
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 6px; font-size:11px;" onclick="copyFieldValue('nas-input-playlist')">Copy</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="conn-val-box">
|
|||
|
|
<input type="text" id="nas-input-playlist" readonly value="https://cosmos.linuxguy.space/oort/username/mybucket/playlist.m3u">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="conn-card">
|
|||
|
|
<div class="conn-label">
|
|||
|
|
<span>Cosmos Username</span>
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 6px; font-size:11px;" onclick="copyFieldValue('nas-input-username')">Copy</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="conn-val-box">
|
|||
|
|
<input type="text" id="nas-input-username" readonly value="{{.Username}}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="conn-card">
|
|||
|
|
<div class="conn-label">
|
|||
|
|
<span>Secret Key / Access Password</span>
|
|||
|
|
<div style="display:flex; gap:4px;">
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 6px; font-size:11px;" onclick="toggleSecretVisibility('nas-input-password')">Show</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 6px; font-size:11px;" onclick="copyFieldValue('nas-input-password')">Copy</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="conn-val-box">
|
|||
|
|
<input type="password" id="nas-input-password" readonly value="••••••••••••••••">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Setup Guides Tabs -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">
|
|||
|
|
<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>
|
|||
|
|
Native Client Connection Instructions
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="guide-tabs">
|
|||
|
|
<button class="guide-tab-btn active" onclick="switchGuideTab('mornye')">🎵 Mornye App</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchGuideTab('macos')">🍏 macOS Finder</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchGuideTab('windows')">🪟 Windows Explorer</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchGuideTab('linux')">🐧 Linux & VLC</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchGuideTab('mobile')">📱 iOS / Android</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Mornye Guide -->
|
|||
|
|
<div class="guide-content active" id="guide-mornye">
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Step 1 — Open Mornye Settings</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Launch Mornye on your phone or desktop. Go to <strong>Sources > Add Sovereign NAS</strong>.
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Step 2 — Paste WebDAV or Playlist URL</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Enter the WebDAV URL or paste the Master M3U playlist URL generated above. Mornye will automatically index tags, album art, and lossless audio tracks.
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Step 3 — Enjoy Lossless Sovereign Streaming</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Your entire music library streams with instant scrubbing, caching, and background playback.
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- macOS Guide -->
|
||||
|
|
<div class="guide-content" id="guide-macos">
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Step 1 — Connect to Server</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
In macOS Finder, press <kbd style="background:rgba(255,255,255,0.1); padding:2px 6px; border-radius:4px;">Cmd + K</kbd> or click <strong>Go > Connect to Server</strong>.
|
|||
</div>
|
||||
</div>
|
||||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Step 2 — Enter WebDAV Address</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Paste your WebDAV URL: <code style="color:var(--accent-cyan);" id="mac-code-sample">https://cosmos.linuxguy.space/oort/username/mybucket/</code>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Step 3 — Authenticate</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Select "Registered User". Enter your Cosmos username and Secret Key as the password. Your storage mounts as a native local drive!
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- Windows Guide -->
|
||||
|
|
<div class="guide-content" id="guide-windows">
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Step 1 — Map Network Drive</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Open <strong>File Explorer</strong>, right-click on <strong>This PC</strong>, and select <strong>Map network drive...</strong>
|
|||
</div>
|
||||
|
|
</div>
|
|||
<div class="step-card">
|
||||
|
|
<div class="step-num">Step 2 — Enter Folder Address</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Click <em>"Connect to a Web site that you can use to store your documents and pictures"</em>. Enter your WebDAV URL.
|
|||
</div>
|
||||
|
|
</div>
|
|||
<div class="step-card">
|
||||
|
|
<div class="step-num">Step 3 — Credentials</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Provide your Cosmos username and Secret Key. The drive appears in "This PC" alongside your internal disks.
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- Linux Guide -->
|
||||
|
|
<div class="guide-content" id="guide-linux">
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">Mounting with davfs2 or rclone</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
<pre style="background:#02040a; padding:12px; border-radius:8px; font-family:var(--font-mono); font-size:12px; color:#38bdf8; overflow-x:auto;">sudo mount -t davfs https://cosmos.linuxguy.space/oort/username/mybucket/ /mnt/cosmos
|
|||
|
|
# Or stream directly in VLC:
|
|||
|
|
vlc https://cosmos.linuxguy.space/oort/username/mybucket/playlist.m3u</pre>
|
|||
</div>
|
||||
</div>
|
||||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Mobile Guide -->
|
|||
|
|
<div class="guide-content" id="guide-mobile">
|
|||
|
|
<div class="step-card">
|
|||
|
|
<div class="step-num">iOS & Android Audio Players</div>
|
|||
|
|
<div style="font-size:13px; color:var(--text-secondary); margin-top:4px;">
|
|||
|
|
Compatible with <strong>Symfonium</strong>, <strong>Feishin</strong>, <strong>VLC</strong>, and <strong>Infuse</strong>. Simply choose WebDAV connection and paste your credentials.
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- ════════════════════ VIEW 4: TELEMETRY & ANALYTICS ════════════════════ -->
|
||||
|
|
<div class="view-panel" id="view-analytics">
|
|||
|
|
<div class="view-header">
|
|||
|
|
<div class="view-title-group">
|
|||
|
|
<h1>Storage & Egress Telemetry</h1>
|
|||
|
|
<p>Real-time bandwidth transfer, cache performance, and API request analytics.</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="view-actions">
|
|||
|
|
<select id="analytics-range-select" class="form-select" style="width:auto;" onchange="loadAnalytics()">
|
|||
|
|
<option value="24h">Last 24 Hours</option>
|
|||
|
|
<option value="7d" selected>Last 7 Days</option>
|
|||
|
|
<option value="30d">Last 30 Days</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Bandwidth Chart Panel -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">
|
|||
|
|
<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>
|
|||
|
|
Egress Bandwidth & Requests Timeline
|
|||
|
|
</span>
|
|||
|
|
<span style="font-size:12px; color:var(--text-dim);" id="analytics-total-reqs">Total: 0 reqs</span>
|
|||
|
|
</div>
|
|||
|
|
<div style="height:320px; width:100%; position:relative;">
|
|||
|
|
<canvas id="analytics-chart"></canvas>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div style="display:grid; grid-template-columns: 1fr 1fr; gap:24px;">
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">HTTP Status Distribution</span>
|
|||
</div>
|
||||
<div style="height:240px; display:flex; align-items:center; justify-content:center;">
|
||||
|
|
<canvas id="status-chart"></canvas>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
|
|||
<div class="glass-panel">
|
||||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Storage by File Type</span>
|
|||
</div>
|
||||
<div id="analytics-category-list" style="display:flex; flex-direction:column; gap:12px; margin-top:10px;">
|
||||
|
|
<div style="color:var(--text-dim); font-size:13px;">Loading telemetry...</div>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- ════════════════════ VIEW 5: API KEYS & S3 ACCESS ════════════════════ -->
|
||||
|
|
<div class="view-panel" id="view-api">
|
|||
|
|
<div class="view-header">
|
|||
|
|
<div class="view-title-group">
|
|||
|
|
<h1>S3 API & SDK Access</h1>
|
|||
|
|
<p>Universal S3-compatible credentials for CLI tools, SDKs, and automated workflows.</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">S3 Credentials</span>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div style="display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap:18px;">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">S3 Endpoint URL</label>
|
|||
|
|
<div class="conn-val-box">
|
|||
|
|
<input type="text" id="api-endpoint-url" readonly value="https://cosmos.linuxguy.space">
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 8px; font-size:11px;" onclick="copyFieldValue('api-endpoint-url')">Copy</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Access Key ID</label>
|
|||
|
|
<div class="conn-val-box">
|
|||
|
|
<input type="text" id="api-access-key" readonly value="...">
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 8px; font-size:11px;" onclick="copyFieldValue('api-access-key')">Copy</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Secret Access Key</label>
|
|||
|
|
<div class="conn-val-box">
|
|||
|
|
<input type="password" id="api-secret-key" readonly value="...">
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 8px; font-size:11px;" onclick="toggleSecretVisibility('api-secret-key')">Show</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 8px; font-size:11px;" onclick="copyFieldValue('api-secret-key')">Copy</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Code Snippets -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Configuration Snippets</span>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="guide-tabs">
|
|||
|
|
<button class="guide-tab-btn active" onclick="switchApiTab('awscli')">AWS CLI</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchApiTab('rclone')">rclone.conf</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchApiTab('python')">Python (boto3)</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchApiTab('nodejs')">Node.js (@aws-sdk)</button>
|
|||
|
|
<button class="guide-tab-btn" onclick="switchApiTab('go')">Go (minio-go)</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="guide-content active" id="api-tab-awscli">
|
|||
|
|
<pre style="background:#02040a; padding:16px; border-radius:8px; font-family:var(--font-mono); font-size:12px; color:#38bdf8; overflow-x:auto;"># Configure AWS CLI:
|
|||
|
|
aws configure set aws_access_key_id <ACCESS_KEY>
|
|||
|
|
aws configure set aws_secret_access_key <SECRET_KEY>
|
|||
|
|
aws configure set default.s3.endpoint_url https://cosmos.linuxguy.space
|
|||
|
|
|
|||
|
|
# List buckets:
|
|||
|
|
aws --endpoint-url=https://cosmos.linuxguy.space s3 ls</pre>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="guide-content" id="api-tab-rclone">
|
|||
|
|
<pre style="background:#02040a; padding:16px; border-radius:8px; font-family:var(--font-mono); font-size:12px; color:#38bdf8; overflow-x:auto;">[cosmos]
|
|||
|
|
type = s3
|
|||
|
|
provider = Minio
|
|||
|
|
env_auth = false
|
|||
|
|
access_key_id = <ACCESS_KEY>
|
|||
|
|
secret_access_key = <SECRET_KEY>
|
|||
|
|
endpoint = https://cosmos.linuxguy.space
|
|||
|
|
acl = private</pre>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="guide-content" id="api-tab-python">
|
|||
|
|
<pre style="background:#02040a; padding:16px; border-radius:8px; font-family:var(--font-mono); font-size:12px; color:#38bdf8; overflow-x:auto;">import boto3
|
|||
|
|
|
|||
|
|
s3 = boto3.client(
|
|||
|
|
's3',
|
|||
|
|
endpoint_url='https://cosmos.linuxguy.space',
|
|||
|
|
aws_access_key_id='<ACCESS_KEY>',
|
|||
|
|
aws_secret_access_key='<SECRET_KEY>'
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
for bucket in s3.list_buckets()['Buckets']:
|
|||
|
|
print(bucket['Name'])</pre>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="guide-content" id="api-tab-nodejs">
|
|||
|
|
<pre style="background:#02040a; padding:16px; border-radius:8px; font-family:var(--font-mono); font-size:12px; color:#38bdf8; overflow-x:auto;">import { S3Client, ListBucketsCommand } from "@aws-sdk/client-s3";
|
|||
|
|
|
|||
|
|
const client = new S3Client({
|
|||
|
|
endpoint: "https://cosmos.linuxguy.space",
|
|||
|
|
region: "us-east-1",
|
|||
|
|
credentials: {
|
|||
|
|
accessKeyId: "<ACCESS_KEY>",
|
|||
|
|
secretAccessKey: "<SECRET_KEY>"
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
const res = await client.send(new ListBucketsCommand({}));
|
|||
|
|
console.log(res.Buckets);</pre>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="guide-content" id="api-tab-go">
|
|||
|
|
<pre style="background:#02040a; padding:16px; border-radius:8px; font-family:var(--font-mono); font-size:12px; color:#38bdf8; overflow-x:auto;">import (
|
|||
|
|
"github.com/minio/minio-go/v7"
|
|||
|
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
client, err := minio.New("cosmos.linuxguy.space", &minio.Options{
|
|||
|
|
Creds: credentials.NewStaticV4("<ACCESS_KEY>", "<SECRET_KEY>", ""),
|
|||
|
|
Secure: true,
|
|||
|
|
})</pre>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
</div>
|
||||
|
||||
|
|
<!-- ════════════════════ VIEW 6: DRIVE / BUCKET SETTINGS ════════════════════ -->
|
|||
|
|
<div class="view-panel" id="view-settings">
|
|||
|
|
<div class="view-header">
|
|||
|
|
<div class="view-title-group">
|
|||
|
|
<h1>Drive & Bucket Settings</h1>
|
|||
|
|
<p>Configure custom domains, static website hosting, webhooks, and bucket management.</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Bucket Alias -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Drive Display Name</span>
|
|||
|
|
</div>
|
|||
|
|
<div style="display:flex; gap:12px; max-width:480px;">
|
|||
|
|
<input type="text" id="settings-drive-rename-input" class="form-input" placeholder="e.g. music-library">
|
|||
|
|
<button class="btn btn-primary" onclick="saveBucketRename()">Update Alias</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Static Website Hosting -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Static Website Hosting</span>
|
|||
|
|
<label style="display:flex; align-items:center; gap:8px; cursor:pointer;">
|
|||
|
|
<input type="checkbox" id="settings-website-toggle" onchange="toggleWebsiteHosting(this.checked)">
|
|||
|
|
<span style="font-size:13px; font-weight:600;">Enable Hosting</span>
|
|||
|
|
</label>
|
|||
|
|
</div>
|
|||
|
|
<p style="color:var(--text-muted); font-size:13px; margin-bottom:16px;">
|
|||
|
|
Host single-page applications or static websites directly out of this bucket.
|
|||
|
|
</p>
|
|||
|
|
<div style="display:grid; grid-template-columns: 1fr 1fr; gap:16px; max-width:560px;">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Index Document</label>
|
|||
|
|
<input type="text" id="settings-website-index" class="form-input" value="index.html">
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Error Document</label>
|
|||
|
|
<input type="text" id="settings-website-error" class="form-input" value="404.html">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<button class="btn btn-secondary" onclick="saveWebsiteConfig()">Save Website Config</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Custom Domains -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Custom CDN Domains</span>
|
|||
|
|
<button class="btn btn-secondary" onclick="openAddDomainModal()">+ Add Domain</button>
|
|||
|
|
</div>
|
|||
|
|
<div id="settings-domains-list" style="display:flex; flex-direction:column; gap:8px;">
|
|||
|
|
<div style="color:var(--text-dim); font-size:13px;">No custom domains attached to this drive.</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Webhooks -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Event Webhooks</span>
|
|||
|
|
<button class="btn btn-secondary" onclick="openAddWebhookModal()">+ Add Webhook</button>
|
|||
|
|
</div>
|
|||
|
|
<div id="settings-webhooks-list" style="display:flex; flex-direction:column; gap:8px;">
|
|||
|
|
<div style="color:var(--text-dim); font-size:13px;">No webhooks configured.</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Danger Zone -->
|
|||
|
|
<div class="glass-panel" style="border-color:rgba(244,63,94,0.3); background:rgba(244,63,94,0.03);">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title" style="color:#fb7185;">Danger Zone</span>
|
|||
|
|
</div>
|
|||
|
|
<div style="display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid rgba(244,63,94,0.15);">
|
|||
|
|
<div>
|
|||
|
|
<div style="font-weight:600; font-size:14px;">Empty Bucket Objects</div>
|
|||
|
|
<div style="color:var(--text-dim); font-size:12px;">Permanently delete all files in this bucket without deleting the bucket itself.</div>
|
|||
|
|
</div>
|
|||
|
|
<button class="btn btn-danger" onclick="confirmEmptyBucket()">Empty Bucket</button>
|
|||
|
|
</div>
|
|||
|
|
<div style="display:flex; align-items:center; justify-content:space-between; padding:12px 0;">
|
|||
|
|
<div>
|
|||
|
|
<div style="font-weight:600; font-size:14px;">Delete Entire Bucket</div>
|
|||
|
|
<div style="color:var(--text-dim); font-size:12px;">Deletes the bucket and all associated metadata. Cannot be undone.</div>
|
|||
|
|
</div>
|
|||
|
|
<button class="btn btn-danger" onclick="confirmDeleteBucket()">Delete Bucket</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- ════════════════════ VIEW 7: ACCOUNT & QUOTA ════════════════════ -->
|
|||
|
|
<div class="view-panel" id="view-account">
|
|||
|
|
<div class="view-header">
|
|||
|
|
<div class="view-title-group">
|
|||
|
|
<h1>Account & Storage Quota</h1>
|
|||
|
|
<p>Manage your account identity, security, and request storage capacity upgrades.</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Profile Card -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Account Profile</span>
|
|||
|
|
</div>
|
|||
|
|
<div style="display:flex; gap:20px; align-items:center;">
|
|||
|
|
<div class="user-avatar" style="width:64px; height:64px; font-size:24px;" id="account-avatar-large">U</div>
|
|||
|
|
<div>
|
|||
|
|
<h3 style="font-size:16px; font-weight:700;" id="account-display-username">{{.Username}}</h3>
|
|||
|
|
<p style="color:var(--text-muted); font-size:13px;" id="account-display-email">loading...</p>
|
|||
|
|
<div style="margin-top:10px;">
|
|||
|
|
<input type="file" id="avatar-file-input" style="display:none;" accept="image/*" onchange="uploadAvatarImage(this.files[0])">
|
|||
|
|
<button class="btn btn-secondary" style="font-size:12px; padding:4px 10px;" onclick="document.getElementById('avatar-file-input').click()">Change Avatar</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Quota Upgrade -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Storage Quota Increase</span>
|
|||
|
|
</div>
|
|||
|
|
<p style="color:var(--text-muted); font-size:13px; margin-bottom:16px;">
|
|||
|
|
Need more space for your lossless audio library or backups? Request an instant sovereign quota bump.
|
|||
|
|
</p>
|
|||
|
|
<div style="display:flex; gap:12px; max-width:480px; align-items:center;">
|
|||
|
|
<select id="quota-upgrade-amount" class="form-select">
|
|||
|
|
<option value="25">25 GB Total</option>
|
|||
|
|
<option value="50">50 GB Total</option>
|
|||
|
|
<option value="100">100 GB Total</option>
|
|||
|
|
<option value="250">250 GB Total</option>
|
|||
|
|
<option value="500">500 GB Total</option>
|
|||
|
|
</select>
|
|||
|
|
<button class="btn btn-primary" onclick="submitQuotaRequest()">Request Quota</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Change Password -->
|
|||
|
|
<div class="glass-panel">
|
|||
|
|
<div class="panel-header">
|
|||
|
|
<span class="panel-title">Security & Password</span>
|
|||
|
|
</div>
|
|||
|
|
<div style="max-width:400px; display:flex; flex-direction:column; gap:14px;">
|
|||
|
|
<div class="form-group" style="margin-bottom:0;">
|
|||
|
|
<label class="form-label">Current Password</label>
|
|||
|
|
<input type="password" id="inp-pwd-old" class="form-input">
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group" style="margin-bottom:0;">
|
|||
|
|
<label class="form-label">New Password</label>
|
|||
|
|
<input type="password" id="inp-pwd-new" class="form-input">
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group" style="margin-bottom:0;">
|
|||
|
|
<label class="form-label">Confirm New Password</label>
|
|||
|
|
<input type="password" id="inp-pwd-confirm" class="form-input">
|
|||
|
|
</div>
|
|||
|
|
<button class="btn btn-secondary" onclick="submitChangePassword()">Update Password</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</main>
|
|||
</div>
|
||||
|
|
|
|||
<!-- ════════════════════ MODALS ════════════════════ -->
|
||||
|
||||
<!-- Modal: File Preview & Live Code Editor -->
|
||||
|
|
<div class="modal-backdrop" id="modal-preview">
|
|||
|
|
<div class="modal-dialog modal-lg">
|
|||
<div class="modal-header">
|
||||
<div class="modal-title" id="preview-modal-title">File Preview</div>
|
||||
|
|
<div style="display:flex; gap:8px;">
|
|||
|
|
<button class="btn btn-secondary" id="preview-download-btn" style="font-size:12px; padding:4px 10px;">Download</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-preview')">✕</button>
|
|||
</div>
|
||||
|
|
</div>
|
|||
<div class="modal-body" id="preview-modal-body" style="background:#02040a; min-height:360px; display:flex; align-items:center; justify-content:center;">
|
||||
|
|
<!-- Dynamic Preview Content -->
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer" id="preview-modal-footer" style="display:none;">
|
|||
|
|
<button class="btn btn-ghost" onclick="closeModal('modal-preview')">Close</button>
|
|||
|
|
<button class="btn btn-primary" id="preview-save-btn" onclick="saveEditedPreviewContent()">Save Changes</button>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- Modal: Secure Share Link -->
|
||||
|
|
<div class="modal-backdrop" id="modal-share">
|
|||
|
|
<div class="modal-dialog">
|
|||
<div class="modal-header">
|
||||
|
|
<div class="modal-title">Create Secure Share Link</div>
|
|||
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-share')">✕</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Object</label>
|
|||
|
|
<input type="text" id="share-target-key" class="form-input" readonly>
|
|||
</div>
|
||||
<div class="form-group">
|
||||
|
|
<label class="form-label">Expiration Period</label>
|
|||
|
|
<select id="share-expiry-select" class="form-select">
|
|||
<option value="3600">1 Hour</option>
|
||||
|
|
<option value="86400" selected>24 Hours (1 Day)</option>
|
|||
|
|
<option value="604800">7 Days</option>
|
|||
|
|
<option value="2592000">30 Days</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
<div class="form-group">
|
||||
|
|
<label class="form-label">Password Protection (Optional)</label>
|
|||
|
|
<input type="password" id="share-password-input" class="form-input" placeholder="Leave empty for public link">
|
|||
</div>
|
||||
<div id="share-result-box" style="display:none; margin-top:16px;">
|
||||
|
|
<label class="form-label" style="color:var(--accent-cyan);">Generated Share URL</label>
|
|||
|
|
<div class="conn-val-box">
|
|||
|
|
<input type="text" id="share-result-url" readonly>
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 8px; font-size:11px;" onclick="copyFieldValue('share-result-url')">Copy</button>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
<button class="btn btn-ghost" onclick="closeModal('modal-share')">Cancel</button>
|
||||
|
|
<button class="btn btn-primary" id="btn-create-share" onclick="submitCreateShare()">Generate Link</button>
|
|||
</div>
|
||||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
<!-- Modal: New Folder -->
|
||||
|
|
<div class="modal-backdrop" id="modal-mkdir">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<div class="modal-title">Create New Folder</div>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-mkdir')">✕</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Folder Name</label>
|
|||
|
|
<input type="text" id="mkdir-name-input" class="form-input" placeholder="e.g. lossless-audio" onkeydown="if(event.key==='Enter')submitMkdir()">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button class="btn btn-ghost" onclick="closeModal('modal-mkdir')">Cancel</button>
|
|||
|
|
<button class="btn btn-primary" onclick="submitMkdir()">Create Folder</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
||||
<!-- Modal: Create Bucket -->
|
||||
|
|
<div class="modal-backdrop" id="modal-create-bucket">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<div class="modal-title">Create Storage Bucket / Drive</div>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-create-bucket')">✕</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Bucket Display Name</label>
|
|||
|
|
<input type="text" id="create-bucket-name" class="form-input" placeholder="e.g. hi-res-music" onkeydown="if(event.key==='Enter')submitCreateBucket()">
|
|||
|
|
</div>
|
|||
|
|
<p style="color:var(--text-dim); font-size:12px;">
|
|||
|
|
Bucket names can contain lowercase letters, numbers, and hyphens.
|
|||
|
|
</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button class="btn btn-ghost" onclick="closeModal('modal-create-bucket')">Cancel</button>
|
|||
|
|
<button class="btn btn-primary" onclick="submitCreateBucket()">Create Bucket</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Modal: Move / Rename Object -->
|
|||
|
|
<div class="modal-backdrop" id="modal-move">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<div class="modal-title">Move or Rename Object</div>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-move')">✕</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<input type="hidden" id="move-source-key">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Destination Path</label>
|
|||
|
|
<input type="text" id="move-dest-key" class="form-input">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button class="btn btn-ghost" onclick="closeModal('modal-move')">Cancel</button>
|
|||
|
|
<button class="btn btn-primary" onclick="submitMoveObject()">Confirm Move</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Modal: Object Versions -->
|
|||
|
|
<div class="modal-backdrop" id="modal-versions">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<div class="modal-title">Object Version History</div>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-versions')">✕</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<div class="table-wrap">
|
|||
|
|
<table class="data-table">
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th>Version ID</th>
|
|||
|
|
<th>Modified</th>
|
|||
|
|
<th>Size</th>
|
|||
|
|
<th style="text-align:right;">Restore</th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody id="versions-tbody">
|
|||
|
|
<tr><td colspan="4" style="text-align:center;">Loading versions...</td></tr>
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Modal: Add Domain -->
|
|||
|
|
<div class="modal-backdrop" id="modal-domain">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<div class="modal-title">Add Custom CDN Domain</div>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-domain')">✕</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Domain Name</label>
|
|||
|
|
<input type="text" id="domain-name-input" class="form-input" placeholder="cdn.example.com">
|
|||
|
|
</div>
|
|||
|
|
<p style="color:var(--text-dim); font-size:12px;">Point a CNAME record for this domain to cosmos.linuxguy.space.</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button class="btn btn-ghost" onclick="closeModal('modal-domain')">Cancel</button>
|
|||
|
|
<button class="btn btn-primary" onclick="submitAddDomain()">Add Domain</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Modal: Add Webhook -->
|
|||
|
|
<div class="modal-backdrop" id="modal-webhook">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<div class="modal-title">Add Event Webhook</div>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px;" onclick="closeModal('modal-webhook')">✕</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Target URL</label>
|
|||
|
|
<input type="text" id="webhook-url-input" class="form-input" placeholder="https://api.example.com/hooks/storage">
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="form-label">Secret Token (Optional)</label>
|
|||
|
|
<input type="password" id="webhook-secret-input" class="form-input" placeholder="HMAC Secret">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button class="btn btn-ghost" onclick="closeModal('modal-webhook')">Cancel</button>
|
|||
|
|
<button class="btn btn-primary" onclick="submitAddWebhook()">Create Webhook</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- ════════════════════ SCRIPT LOGIC ════════════════════ -->
|
|||
<script>
|
||||
|
|
const SID = '{{.SID}}';
|
|||
const DEFAULT_USERNAME = '{{.Username}}';
|
||||
|
|
const CHUNK_SIZE = 10 * 1024 * 1024; // 10MB chunking
|
|||
|
||||
|
|
let state = {
|
|||
currentBucket: '',
|
||||
|
|
currentPrefix: '',
|
|||
|
|
buckets: [],
|
|||
|
|
objects: [],
|
|||
|
|
selectedKeys: new Set(),
|
|||
|
|
profile: null,
|
|||
|
|
activeView: 'dashboard',
|
|||
|
|
explorerMode: 'table', // 'table' or 'grid'
|
|||
|
|
categoryFilter: 'all',
|
|||
|
|
searchQuery: '',
|
|||
|
|
editingKey: '',
|
|||
|
|
editingBucket: '',
|
|||
|
|
analyticsChart: null,
|
|||
|
|
statusChart: null,
|
|||
};
|
||||
|
|
|
|||
/* ─── API Wrapper ─── */
|
||||
async function api(path, opts = {}) {
|
||||
|
|
try {
|
|||
|
|
const url = new URL(path, location.origin);
|
|||
const headers = {
|
||||
|
|
'X-Session-Id': SID,
|
|||
|
|
'Content-Type': 'application/json',
|
|||
|
|
...(opts.headers || {})
|
|||
|
|
};
|
|||
|
|
const res = await fetch(url.toString(), { ...opts, headers });
|
|||
|
|
if (!res.ok) {
|
|||
|
|
const err = await res.json().catch(() => ({}));
|
|||
|
|
throw new Error(err.error || `HTTP ${res.status}`);
|
|||
}
|
||||
return res.json();
|
||||
|
|
} catch (err) {
|
|||
|
|
toast(err.message, 'error');
|
|||
return null;
|
||||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
/* ─── Toast System ─── */
|
||||
|
|
function toast(message, type = 'success') {
|
|||
|
|
const container = document.getElementById('toast-container');
|
|||
const el = document.createElement('div');
|
||||
|
|
el.className = `toast ${type}`;
|
|||
let icon = '✓';
|
||||
|
|
if (type === 'error') icon = '✕';
|
|||
|
|
if (type === 'info') icon = 'ℹ';
|
|||
|
|
el.innerHTML = `<span style="font-weight:700;">${icon}</span><span>${escapeHtml(message)}</span>`;
|
|||
|
|
container.appendChild(el);
|
|||
setTimeout(() => {
|
||||
el.style.opacity = '0';
|
||||
|
|
el.style.transform = 'translateY(-10px)';
|
|||
|
|
el.style.transition = 'all 0.3s ease';
|
|||
|
|
setTimeout(() => el.remove(), 300);
|
|||
|
|
}, 4000);
|
|||
}
|
||||
|
|
|
|||
function escapeHtml(str) {
|
||||
|
|
if (!str) return '';
|
|||
|
|
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|||
}
|
||||
|
|
|
|||
function fmtBytes(bytes) {
|
||||
|
|
if (!bytes || bytes <= 0) return '0 B';
|
|||
|
|
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|||
|
|
const i = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);
|
|||
|
|
return (bytes / Math.pow(1024, i)).toFixed(i === 0 ? 0 : 2) + ' ' + units[i];
|
|||
}
|
||||
|
|
|
|||
/* ─── View Switcher ─── */
|
||||
|
|
function switchView(viewName) {
|
|||
|
|
state.activeView = viewName;
|
|||
|
|
document.querySelectorAll('.view-panel').forEach(p => p.classList.remove('active'));
|
|||
|
|
document.querySelectorAll('.app-sidebar .nav-item').forEach(n => n.classList.remove('active'));
|
|||
|
|
|
|||
|
|
const targetPanel = document.getElementById(`view-${viewName}`);
|
|||
|
|
if (targetPanel) targetPanel.classList.add('active');
|
|||
|
|
|
|||
|
|
const targetNav = document.querySelector(`.app-sidebar .nav-item[data-view="${viewName}"]`);
|
|||
|
|
if (targetNav) targetNav.classList.add('active');
|
|||
|
|
|
|||
|
|
closeSidebar();
|
|||
|
|
history.replaceState(null, '', `#${viewName}`);
|
|||
|
|
|
|||
|
|
if (viewName === 'dashboard') loadDashboardStats();
|
|||
|
|
if (viewName === 'browser') loadObjects();
|
|||
|
|
if (viewName === 'nas') loadNASInfo();
|
|||
|
|
if (viewName === 'analytics') loadAnalytics();
|
|||
|
|
if (viewName === 'api') loadAPICredentials();
|
|||
|
|
if (viewName === 'settings') loadSettings();
|
|||
|
|
if (viewName === 'account') loadAccountProfile();
|
|||
}
|
||||
|
||||
function toggleSidebar() {
|
||||
const sb = document.getElementById('app-sidebar');
|
||||
|
|
const bd = document.getElementById('sidebar-backdrop');
|
|||
|
|
sb.classList.toggle('open');
|
|||
|
|
if (bd) bd.classList.toggle('open', sb.classList.contains('open'));
|
|||
}
|
||||
|
|
|
|||
function closeSidebar() {
|
||||
const sb = document.getElementById('app-sidebar');
|
||||
|
|
const bd = document.getElementById('sidebar-backdrop');
|
|||
|
|
sb.classList.remove('open');
|
|||
|
|
if (bd) bd.classList.remove('open');
|
|||
}
|
||||
|
|
|
|||
|
|
/* ─── Buckets Management ─── */
|
|||
|
|
async function loadBuckets() {
|
|||
|
|
const data = await api('/oort/api/buckets');
|
|||
|
|
if (!data || !data.buckets) return;
|
|||
|
|
state.buckets = data.buckets;
|
|||
|
|
|
|||
|
|
const select = document.getElementById('browser-bucket-select');
|
|||
const nasSelect = document.getElementById('nas-bucket-select');
|
||||
|
|
if (select) select.innerHTML = '';
|
|||
|
|
if (nasSelect) nasSelect.innerHTML = '';
|
|||
|
|
|
|||
data.buckets.forEach(b => {
|
||||
|
|
const opt = document.createElement('option');
|
|||
|
|
opt.value = b.Name;
|
|||
|
|
opt.textContent = b.DisplayName || b.Name;
|
|||
if (select) select.appendChild(opt);
|
||||
|
|
|
|||
|
|
const opt2 = document.createElement('option');
|
|||
|
|
opt2.value = b.Name;
|
|||
|
|
opt2.textContent = b.DisplayName || b.Name;
|
|||
|
|
if (nasSelect) nasSelect.appendChild(opt2);
|
|||
});
|
||||
|
|
|
|||
|
|
if (!state.currentBucket && data.buckets.length > 0) {
|
|||
|
|
state.currentBucket = data.buckets[0].Name;
|
|||
|
|
}
|
|||
if (select) select.value = state.currentBucket;
|
||||
|
|
if (nasSelect) nasSelect.value = state.currentBucket;
|
|||
updateActiveBucketDisplay();
|
||||
|
|
}
|
|||
|
|
|
|||
|
|
function updateActiveBucketDisplay() {
|
|||
|
|
const current = state.buckets.find(b => b.Name === state.currentBucket);
|
|||
|
|
const name = current ? (current.DisplayName || current.Name) : state.currentBucket;
|
|||
|
|
document.getElementById('header-active-bucket-name').textContent = name;
|
|||
|
|
document.getElementById('metric-default-bucket-name').textContent = `Primary: ${name}`;
|
|||
|
|
document.getElementById('settings-drive-rename-input').value = name;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function changeBucket(bucketName) {
|
|||
|
|
state.currentBucket = bucketName;
|
|||
|
|
state.currentPrefix = '';
|
|||
|
|
updateActiveBucketDisplay();
|
|||
|
|
if (state.activeView === 'browser') loadObjects();
|
|||
|
|
if (state.activeView === 'nas') loadNASInfo();
|
|||
|
|
if (state.activeView === 'dashboard') loadDashboardStats();
|
|||
|
|
if (state.activeView === 'settings') loadSettings();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Dashboard Stats ─── */
|
|||
|
|
async function loadDashboardStats() {
|
|||
|
|
const stats = await api(`/oort/api/stats?bucket=${encodeURIComponent(state.currentBucket)}`);
|
|||
|
|
if (stats) {
|
|||
|
|
document.getElementById('metric-storage-used').textContent = fmtBytes(stats.total_size);
|
|||
|
|
document.getElementById('metric-objects-count').textContent = stats.object_count.toLocaleString();
|
|||
|
|
const quota = stats.quota || (10 * 1024 * 1024 * 1024);
|
|||
|
|
document.getElementById('metric-storage-sub').textContent = `Allocated Quota: ${fmtBytes(quota)}`;
|
|||
|
|
document.getElementById('sidebar-quota-used').textContent = fmtBytes(stats.total_size);
|
|||
|
|
document.getElementById('sidebar-quota-total').textContent = fmtBytes(quota);
|
|||
|
|
|
|||
|
|
const pct = Math.min(100, Math.round((stats.total_size / quota) * 100));
|
|||
|
|
document.getElementById('sidebar-quota-pct').textContent = `${pct}%`;
|
|||
|
|
document.getElementById('sidebar-quota-fill').style.width = `${pct}%`;
|
|||
|
|
document.getElementById('header-quota-text').textContent = `${pct}% of ${fmtBytes(quota)}`;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
document.getElementById('metric-buckets-count').textContent = state.buckets.length || 1;
|
|||
|
|
|
|||
|
|
// Load Breakdown
|
|||
|
|
const bd = await api(`/oort/api/storage/breakdown?bucket=${encodeURIComponent(state.currentBucket)}`);
|
|||
|
|
if (bd && bd.categories) {
|
|||
|
|
renderStorageBreakdown(bd.categories, bd.total_bytes);
|
|||
|
|
if (bd.categories.audio) {
|
|||
|
|
document.getElementById('metric-audio-tracks').textContent = bd.categories.audio.count.toLocaleString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Load Recent Objects
|
|||
|
|
const objData = await api(`/oort/api/objects?bucket=${encodeURIComponent(state.currentBucket)}&recursive=true`);
|
|||
|
|
if (objData && objData.objects) {
|
|||
|
|
const recent = objData.objects.filter(o => !o.is_dir).slice(0, 8);
|
|||
|
|
renderRecentObjects(recent);
|
|||
}
|
||||
|
|
}
|
|||
|
|
|
|||
function renderStorageBreakdown(cats, totalBytes) {
|
||||
|
|
const container = document.getElementById('storage-breakdown-bars');
|
|||
|
|
document.getElementById('breakdown-total-size').textContent = `${fmtBytes(totalBytes)} total`;
|
|||
|
|
container.innerHTML = '';
|
|||
|
||||
const meta = [
|
||||
|
|
{ key: 'audio', label: 'Audio & Music (Mornye)', color: '#38bdf8' },
|
|||
|
|
{ key: 'video', label: 'Video Streams', color: '#c084fc' },
|
|||
|
|
{ key: 'images', label: 'Images & Photos', color: '#f43f5e' },
|
|||
|
|
{ key: 'documents', label: 'Documents & PDFs', color: '#818cf8' },
|
|||
|
|
{ key: 'code', label: 'Code & Scripts', color: '#34d399' },
|
|||
|
|
{ key: 'archives', label: 'Archives (ZIP/TAR)', color: '#fbbf24' },
|
|||
|
|
{ key: 'others', label: 'Other Objects', color: '#94a3b8' },
|
|||
|
|
];
|
|||
|
|
|
|||
|
|
meta.forEach(m => {
|
|||
|
|
const stat = cats[m.key] || { count: 0, bytes: 0 };
|
|||
|
|
if (stat.count === 0 && stat.bytes === 0) return;
|
|||
|
|
const pct = totalBytes > 0 ? ((stat.bytes / totalBytes) * 100).toFixed(1) : 0;
|
|||
|
|
const row = document.createElement('div');
|
|||
|
|
row.innerHTML = `
|
|||
|
|
<div style="display:flex; justify-content:space-between; font-size:12px; margin-bottom:4px;">
|
|||
|
|
<span style="color:var(--text-secondary); font-weight:500;">${m.label} (${stat.count})</span>
|
|||
|
|
<span style="font-family:var(--font-mono); color:var(--text-dim);">${fmtBytes(stat.bytes)} (${pct}%)</span>
|
|||
|
|
</div>
|
|||
|
|
<div style="height:5px; background:rgba(255,255,255,0.06); border-radius:3px; overflow:hidden;">
|
|||
|
|
<div style="height:100%; width:${pct}%; background:${m.color}; border-radius:3px;"></div>
|
|||
|
|
</div>
|
|||
|
|
`;
|
|||
|
|
container.appendChild(row);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function renderRecentObjects(objects) {
|
|||
|
|
const tbody = document.getElementById('dashboard-recent-objects-body');
|
|||
|
|
if (!objects || objects.length === 0) {
|
|||
|
|
tbody.innerHTML = `<tr><td colspan="4" style="text-align:center; color:var(--text-dim); padding:24px;">No objects found in this drive.</td></tr>`;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
tbody.innerHTML = '';
|
|||
|
|
objects.forEach(obj => {
|
|||
|
|
const tr = document.createElement('tr');
|
|||
|
|
tr.innerHTML = `
|
|||
|
|
<td>
|
|||
|
|
<div class="row-item" onclick="openPreviewModal('${escapeHtml(obj.key)}')">
|
|||
|
|
<div class="item-icon ${getItemIconClass(obj.name, false)}">
|
|||
|
|
${getItemSVG(obj.name, false)}
|
|||
|
|
</div>
|
|||
|
|
<span class="item-name">${escapeHtml(obj.name || obj.key)}</span>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
<td style="font-family:var(--font-mono); font-size:12px;">${fmtBytes(obj.size)}</td>
|
|||
|
|
<td style="font-size:12px; color:var(--text-muted);">${formatDate(obj.last_modified)}</td>
|
|||
|
|
<td style="text-align:right;">
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px; font-size:12px;" onclick="openPreviewModal('${escapeHtml(obj.key)}')">Inspect</button>
|
|||
|
|
</td>
|
|||
|
|
`;
|
|||
|
|
tbody.appendChild(tr);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Object Explorer Engine ─── */
|
|||
|
|
async function loadObjects() {
|
|||
|
|
const tbody = document.getElementById('browser-objects-tbody');
|
|||
|
|
tbody.innerHTML = `<tr><td colspan="5" style="text-align:center; color:var(--text-dim); padding:30px;">Loading objects...</td></tr>`;
|
|||
|
|
|
|||
|
|
updateBreadcrumbs();
|
|||
|
|
state.selectedKeys.clear();
|
|||
|
|
updateBatchBar();
|
|||
|
|
|
|||
|
|
const url = `/oort/api/objects?bucket=${encodeURIComponent(state.currentBucket)}&prefix=${encodeURIComponent(state.currentPrefix)}`;
|
|||
|
|
const data = await api(url);
|
|||
|
|
if (!data || !data.objects) {
|
|||
|
|
tbody.innerHTML = `<tr><td colspan="5" style="text-align:center; color:var(--text-dim); padding:30px;">Failed to load objects.</td></tr>`;
|
|||
return;
|
||||
|
|
}
|
|||
|
|
|
|||
state.objects = data.objects;
|
||||
renderFilteredObjects();
|
||||
|
|
}
|
|||
|
|
|
|||
function updateBreadcrumbs() {
|
||||
|
|
const container = document.getElementById('browser-breadcrumbs');
|
|||
|
|
container.innerHTML = `<span class="crumb-item" onclick="navigateToPrefix('')">root</span>`;
|
|||
|
|
|
|||
|
|
if (!state.currentPrefix) return;
|
|||
|
|
const parts = state.currentPrefix.replace(/\/$/, '').split('/');
|
|||
|
|
let built = '';
|
|||
|
|
parts.forEach((p, idx) => {
|
|||
|
|
built += p + '/';
|
|||
|
|
const isLast = idx === parts.length - 1;
|
|||
|
|
container.innerHTML += `<span class="crumb-sep">/</span>`;
|
|||
|
|
if (isLast) {
|
|||
|
|
container.innerHTML += `<span class="crumb-current">${escapeHtml(p)}</span>`;
|
|||
|
|
} else {
|
|||
|
|
const clickPrefix = built;
|
|||
|
|
container.innerHTML += `<span class="crumb-item" onclick="navigateToPrefix('${escapeHtml(clickPrefix)}')">${escapeHtml(p)}</span>`;
|
|||
|
|
}
|
|||
|
|
});
|
|||
}
|
||||
|
|
|
|||
function navigateToPrefix(prefix) {
|
||||
|
|
state.currentPrefix = prefix;
|
|||
|
|
loadObjects();
|
|||
}
|
||||
|
|
|
|||
function filterByCategory(cat) {
|
||||
state.categoryFilter = cat;
|
||||
|
|
document.querySelectorAll('.filter-chips .chip-btn').forEach(b => {
|
|||
|
|
b.classList.toggle('active', b.getAttribute('data-cat') === cat);
|
|||
});
|
||||
|
|
renderFilteredObjects();
|
|||
|
|
}
|
|||
|
|
|
|||
function handleGlobalSearch(q) {
|
||||
state.searchQuery = (q || '').trim().toLowerCase();
|
||||
if (state.activeView !== 'browser') {
|
||||
|
|
switchView('browser');
|
|||
|
|
} else {
|
|||
|
|
renderFilteredObjects();
|
|||
|
|
}
|
|||
}
|
||||
|
|
|
|||
|
|
function renderFilteredObjects() {
|
|||
let list = state.objects.slice();
|
||||
|
||||
// Category Filter
|
||||
|
|
if (state.categoryFilter !== 'all') {
|
|||
|
|
list = list.filter(o => {
|
|||
if (o.is_dir) return false;
|
||||
return getFileCategory(o.name) === state.categoryFilter;
|
||||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Search Filter
|
|||
|
|
if (state.searchQuery) {
|
|||
|
|
list = list.filter(o => o.name.toLowerCase().includes(state.searchQuery));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Sort: Folders first, then names
|
|||
|
|
list.sort((a, b) => {
|
|||
|
|
if (a.is_dir && !b.is_dir) return -1;
|
|||
|
|
if (!a.is_dir && b.is_dir) return 1;
|
|||
|
|
return a.name.localeCompare(b.name);
|
|||
});
|
||||
|
|
|
|||
if (state.explorerMode === 'table') {
|
||||
|
|
renderObjectsTable(list);
|
|||
|
|
} else {
|
|||
|
|
renderObjectsGrid(list);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function renderObjectsTable(objects) {
|
|||
|
|
const tbody = document.getElementById('browser-objects-tbody');
|
|||
|
|
document.getElementById('explorer-table-container').style.display = 'block';
|
|||
|
|
document.getElementById('explorer-grid-container').style.display = 'none';
|
|||
|
|
|
|||
|
|
if (objects.length === 0) {
|
|||
|
|
tbody.innerHTML = `<tr><td colspan="5" style="text-align:center; color:var(--text-dim); padding:40px;">No objects match this view. Drag and drop files to upload.</td></tr>`;
|
|||
return;
|
||||
|
|
}
|
|||
|
|
|
|||
tbody.innerHTML = '';
|
||||
|
|
objects.forEach(obj => {
|
|||
|
|
const tr = document.createElement('tr');
|
|||
|
|
const isChecked = state.selectedKeys.has(obj.key);
|
|||
|
|
tr.innerHTML = `
|
|||
|
|
<td>
|
|||
|
|
${obj.is_dir ? '' : `<input type="checkbox" ${isChecked ? 'checked' : ''} onchange="toggleSelectKey('${escapeHtml(obj.key)}', this.checked)">`}
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<div class="row-item" onclick="handleObjectClick('${escapeHtml(obj.key)}', ${obj.is_dir})">
|
|||
|
|
<div class="item-icon ${getItemIconClass(obj.name, obj.is_dir)}">
|
|||
|
|
${getItemSVG(obj.name, obj.is_dir)}
|
|||
|
|
</div>
|
|||
|
|
<span class="item-name">${escapeHtml(obj.name)}</span>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
<td style="font-family:var(--font-mono); font-size:12px;">${obj.is_dir ? '--' : fmtBytes(obj.size)}</td>
|
|||
|
|
<td style="font-size:12px; color:var(--text-muted);">${obj.is_dir ? '--' : formatDate(obj.last_modified)}</td>
|
|||
|
|
<td style="text-align:right;">
|
|||
|
|
<div class="row-actions" style="justify-content:flex-end;">
|
|||
|
|
${obj.is_dir ? `
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 8px; font-size:12px;" onclick="confirmDeleteObject('${escapeHtml(obj.key)}')">Delete</button>
|
|||
|
|
` : `
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 6px;" title="Preview / Edit" onclick="openPreviewModal('${escapeHtml(obj.key)}')">👁️</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 6px;" title="Share Link" onclick="openShareModal('${escapeHtml(obj.key)}')">🔗</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 6px;" title="Download" onclick="downloadObject('${escapeHtml(obj.key)}')">⬇️</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 6px;" title="Versions" onclick="openVersionsModal('${escapeHtml(obj.key)}')">📜</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 6px;" title="Move / Rename" onclick="openMoveModal('${escapeHtml(obj.key)}')">✏️</button>
|
|||
|
|
<button class="btn btn-ghost" style="padding:4px 6px; color:var(--accent-rose);" title="Delete" onclick="confirmDeleteObject('${escapeHtml(obj.key)}')">🗑️</button>
|
|||
|
|
`}
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
`;
|
|||
|
|
tbody.appendChild(tr);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function renderObjectsGrid(objects) {
|
|||
|
|
const grid = document.getElementById('explorer-grid-container');
|
|||
|
|
document.getElementById('explorer-table-container').style.display = 'none';
|
|||
|
|
grid.style.display = 'grid';
|
|||
|
|
|
|||
|
|
if (objects.length === 0) {
|
|||
|
|
grid.innerHTML = `<div style="grid-column:1/-1; text-align:center; color:var(--text-dim); padding:40px;">No objects found.</div>`;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
grid.innerHTML = '';
|
|||
|
|
objects.forEach(obj => {
|
|||
|
|
const card = document.createElement('div');
|
|||
|
|
card.className = 'grid-card';
|
|||
|
|
card.onclick = () => handleObjectClick(obj.key, obj.is_dir);
|
|||
|
|
card.innerHTML = `
|
|||
|
|
<div>
|
|||
|
|
<div class="grid-card-icon ${getItemIconClass(obj.name, obj.is_dir)}">
|
|||
|
|
${getItemSVG(obj.name, obj.is_dir)}
|
|||
|
|
</div>
|
|||
|
|
<div class="grid-card-name">${escapeHtml(obj.name)}</div>
|
|||
</div>
|
||||
<div class="grid-card-meta">
|
||||
|
|
${obj.is_dir ? 'Directory' : fmtBytes(obj.size)}
|
|||
|
|
</div>
|
|||
|
|
`;
|
|||
|
|
grid.appendChild(card);
|
|||
|
|
});
|
|||
}
|
||||
|
|
|
|||
function toggleExplorerView() {
|
||||
|
|
state.explorerMode = state.explorerMode === 'table' ? 'grid' : 'table';
|
|||
|
|
renderFilteredObjects();
|
|||
}
|
||||
|
|
|
|||
function handleObjectClick(key, isDir) {
|
||||
|
|
if (isDir) {
|
|||
|
|
state.currentPrefix = key.endsWith('/') ? key : key + '/';
|
|||
|
|
loadObjects();
|
|||
} else {
|
||||
openPreviewModal(key);
|
||||
}
|
||||
|
|
}
|
|||
|
|
|
|||
/* ─── Multi-Select Batch Actions ─── */
|
||||
|
|
function toggleSelectKey(key, isChecked) {
|
|||
|
|
if (isChecked) {
|
|||
|
|
state.selectedKeys.add(key);
|
|||
|
|
} else {
|
|||
|
|
state.selectedKeys.delete(key);
|
|||
|
|
}
|
|||
|
|
updateBatchBar();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function toggleSelectAll(isChecked) {
|
|||
|
|
state.selectedKeys.clear();
|
|||
|
|
if (isChecked) {
|
|||
|
|
state.objects.filter(o => !o.is_dir).forEach(o => state.selectedKeys.add(o.key));
|
|||
|
|
}
|
|||
|
|
renderFilteredObjects();
|
|||
|
|
updateBatchBar();
|
|||
|
|
}
|
|||
|
|
|
|||
function clearBatchSelection() {
|
||||
state.selectedKeys.clear();
|
||||
|
|
document.getElementById('master-select-checkbox').checked = false;
|
|||
|
|
renderFilteredObjects();
|
|||
|
|
updateBatchBar();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function updateBatchBar() {
|
|||
|
|
const bar = document.getElementById('batch-bar');
|
|||
|
|
const count = state.selectedKeys.size;
|
|||
|
|
if (count > 0) {
|
|||
|
|
document.getElementById('batch-selected-count').textContent = `${count} item${count > 1 ? 's' : ''} selected`;
|
|||
|
|
bar.classList.add('show');
|
|||
|
|
} else {
|
|||
|
|
bar.classList.remove('show');
|
|||
|
|
}
|
|||
}
|
||||
|
|
|
|||
|
|
function batchDownloadZip() {
|
|||
if (state.selectedKeys.size === 0) return;
|
||||
|
|
const keys = Array.from(state.selectedKeys).join(',');
|
|||
|
|
const url = `/oort/api/batch/zip?bucket=${encodeURIComponent(state.currentBucket)}&keys=${encodeURIComponent(keys)}`;
|
|||
|
|
window.open(url, '_blank');
|
|||
}
|
||||
|
|
|
|||
async function confirmBatchDelete() {
|
||||
|
|
const count = state.selectedKeys.size;
|
|||
|
|
if (!confirm(`Are you sure you want to permanently delete ${count} selected objects?`)) return;
|
|||
|
|
const keys = Array.from(state.selectedKeys);
|
|||
|
|
const res = await api('/oort/api/batch/delete', {
|
|||
method: 'POST',
|
||||
body: JSON.stringify({ bucket: state.currentBucket, keys })
|
||||
});
|
||||
if (res) {
|
||||
|
|
toast(`Successfully deleted ${res.deleted || count} objects`, 'success');
|
|||
clearBatchSelection();
|
||||
|
|
loadObjects();
|
|||
}
|
||||
|
|
}
|
|||
|
|
|
|||
/* ─── Mornye NAS Controller ─── */
|
||||
|
|
async function loadNASInfo() {
|
|||
|
|
const data = await api('/oort/api/nas/info');
|
|||
|
|
if (!data) return;
|
|||
|
||||
const username = data.username || DEFAULT_USERNAME;
|
||||
const bucket = (data.buckets && (data.buckets.find(b => b.name === state.currentBucket) || data.buckets[0])) || null;
|
||||
const bucketName = bucket ? bucket.name : state.currentBucket;
|
||||
|
|
const disp = bucket ? bucket.display_name : bucketName;
|
|||
|
||||
const webdavUrl = `https://cosmos.linuxguy.space/oort/${username}/${disp}/`;
|
||||
|
|
const playlistUrl = `https://cosmos.linuxguy.space/oort/${username}/${disp}/playlist.m3u`;
|
|||
|
||||
document.getElementById('nas-input-webdav').value = webdavUrl;
|
||||
|
|
document.getElementById('nas-input-playlist').value = playlistUrl;
|
|||
|
|
document.getElementById('nas-input-username').value = username;
|
|||
|
|
document.getElementById('mac-code-sample').textContent = webdavUrl;
|
|||
|
||||
const nasSelect = document.getElementById('nas-bucket-select');
|
||||
|
|
if (nasSelect) nasSelect.value = state.currentBucket;
|
|||
|
|
|
|||
if (data.secret_key) {
|
||||
|
|
document.getElementById('nas-input-password').dataset.secret = data.secret_key;
|
|||
}
|
||||
|
|
|
|||
if (bucket) {
|
||||
|
|
document.getElementById('nas-track-count').textContent = bucket.track_count.toLocaleString();
|
|||
|
|
document.getElementById('nas-music-bytes').textContent = fmtBytes(bucket.music_bytes);
|
|||
|
||||
const badge = document.getElementById('nas-status-badge');
|
||||
|
|
const btn = document.getElementById('btn-nas-enable-streaming');
|
|||
|
|
if (bucket.is_public) {
|
|||
|
|
badge.className = 'nas-badge';
|
|||
|
|
badge.innerHTML = `<span style="width:6px; height:6px; border-radius:50%; background:#34d399;"></span> Streaming Active`;
|
|||
|
|
btn.style.display = 'none';
|
|||
} else {
|
||||
badge.className = 'nas-badge inactive';
|
||||
|
|
badge.innerHTML = `<span style="width:6px; height:6px; border-radius:50%; background:#fbbf24;"></span> Private Access Only`;
|
|||
|
|
btn.style.display = 'inline-flex';
|
|||
}
|
||||
|
|
}
|
|||
|
|
}
|
|||
|
||||
async function enableNASStreaming() {
|
||||
|
|
const res = await api('/oort/api/nas/enable-streaming', {
|
|||
method: 'POST',
|
||||
body: JSON.stringify({ bucket: state.currentBucket })
|
||||
});
|
||||
if (res && res.success) {
|
||||
|
|
toast('High-speed Mornye streaming active for this drive!', 'success');
|
|||
|
|
loadNASInfo();
|
|||
}
|
||||
|
|
}
|
|||
|
|
|
|||
|
|
function triggerNASMusicUpload() {
|
|||
switchView('browser');
|
||||
|
|
triggerFileInput();
|
|||
}
|
||||
|
|
|
|||
function switchGuideTab(tabId) {
|
||||
|
|
document.querySelectorAll('.guide-tab-btn').forEach(b => b.classList.remove('active'));
|
|||
|
|
document.querySelectorAll('.guide-content').forEach(c => c.classList.remove('active'));
|
|||
|
|
|
|||
|
|
event.currentTarget.classList.add('active');
|
|||
|
|
const target = document.getElementById(`guide-${tabId}`);
|
|||
|
|
if (target) target.classList.add('active');
|
|||
}
|
||||
|
|
|
|||
/* ─── File Preview & Code Editor ─── */
|
||||
|
|
async function openPreviewModal(key) {
|
|||
|
|
state.editingKey = key;
|
|||
|
|
state.editingBucket = state.currentBucket;
|
|||
|
|
const title = document.getElementById('preview-modal-title');
|
|||
|
|
const body = document.getElementById('preview-modal-body');
|
|||
|
|
const footer = document.getElementById('preview-modal-footer');
|
|||
|
|
const dlBtn = document.getElementById('preview-download-btn');
|
|||
|
||||
title.textContent = `Inspect: ${key}`;
|
||||
|
|
body.innerHTML = `<div style="color:var(--text-dim); padding:40px;">Fetching preview stream...</div>`;
|
|||
|
|
footer.style.display = 'none';
|
|||
|
|
openModal('modal-preview');
|
|||
|
||||
dlBtn.onclick = () => downloadObject(key);
|
||||
|
||||
const ext = key.toLowerCase().split('.').pop();
|
||||
|
|
const previewUrl = `/oort/api/preview?bucket=${encodeURIComponent(state.currentBucket)}&key=${encodeURIComponent(key)}`;
|
|||
|
|
|
|||
|
|
if (['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp', 'ico'].includes(ext)) {
|
|||
|
|
body.innerHTML = `<img src="${previewUrl}" style="max-width:100%; max-height:70vh; object-fit:contain; border-radius:8px;">`;
|
|||
|
|
} else if (['mp3', 'wav', 'flac', 'ogg', 'm4a', 'aac', 'opus'].includes(ext)) {
|
|||
|
|
body.innerHTML = `
|
|||
|
|
<div style="text-align:center; padding:30px; width:100%; max-width:480px;">
|
|||
|
|
<div style="font-size:48px; margin-bottom:12px;">🎵</div>
|
|||
|
|
<div style="font-weight:600; margin-bottom:16px;">${escapeHtml(key)}</div>
|
|||
|
|
<audio controls src="${previewUrl}" style="width:100%; outline:none;"></audio>
|
|||
|
|
</div>
|
|||
|
|
`;
|
|||
|
|
} else if (['mp4', 'webm', 'mov', 'mkv'].includes(ext)) {
|
|||
|
|
body.innerHTML = `<video controls src="${previewUrl}" style="max-width:100%; max-height:70vh; border-radius:8px;"></video>`;
|
|||
|
|
} else if (ext === 'pdf') {
|
|||
|
|
body.innerHTML = `<iframe src="${previewUrl}" style="width:100%; height:70vh; border:none; border-radius:8px;"></iframe>`;
|
|||
} else {
|
||||
// Text / Code Live Editor
|
||||
|
|
try {
|
|||
|
|
const res = await fetch(previewUrl, { headers: { 'X-Session-Id': SID } });
|
|||
|
|
const text = await res.text();
|
|||
|
|
body.innerHTML = `<textarea class="code-editor-area" id="preview-editor-textarea">${escapeHtml(text)}</textarea>`;
|
|||
|
|
footer.style.display = 'flex';
|
|||
|
|
} catch (e) {
|
|||
|
|
body.innerHTML = `<div style="color:var(--accent-rose); padding:30px;">Unable to load file content: ${escapeHtml(e.message)}</div>`;
|
|||
|
|
}
|
|||
}
|
||||
|
|
}
|
|||
|
||||
async function saveEditedPreviewContent() {
|
||||
|
|
const content = document.getElementById('preview-editor-textarea').value;
|
|||
|
|
const res = await api('/oort/api/preview/save', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({
|
|||
|
|
bucket: state.editingBucket,
|
|||
|
|
key: state.editingKey,
|
|||
|
|
content: content
|
|||
|
|
})
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast(`Saved changes to ${state.editingKey}`, 'success');
|
|||
|
|
closeModal('modal-preview');
|
|||
|
|
loadObjects();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
||||
/* ─── Share Modal ─── */
|
||||
|
|
function openShareModal(key) {
|
|||
|
|
document.getElementById('share-target-key').value = key;
|
|||
|
|
document.getElementById('share-result-box').style.display = 'none';
|
|||
|
|
document.getElementById('btn-create-share').style.display = 'inline-flex';
|
|||
|
|
openModal('modal-share');
|
|||
|
|
}
|
|||
|
||||
async function submitCreateShare() {
|
||||
|
|
const key = document.getElementById('share-target-key').value;
|
|||
|
|
const expiry = parseInt(document.getElementById('share-expiry-select').value, 10);
|
|||
|
|
const password = document.getElementById('share-password-input').value;
|
|||
|
|
|
|||
|
|
const res = await api('/oort/api/shares/create', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({
|
|||
|
|
bucket: state.currentBucket,
|
|||
|
|
key: key,
|
|||
|
|
expires_in_sec: expiry,
|
|||
|
|
password: password
|
|||
|
|
})
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
if (res && res.share_url) {
|
|||
|
|
const fullUrl = `${location.origin}${res.share_url}`;
|
|||
|
|
document.getElementById('share-result-url').value = fullUrl;
|
|||
|
|
document.getElementById('share-result-box').style.display = 'block';
|
|||
|
|
document.getElementById('btn-create-share').style.display = 'none';
|
|||
|
|
toast('Secure share link created!', 'success');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Move & Rename Modal ─── */
|
|||
|
|
function openMoveModal(key) {
|
|||
|
|
document.getElementById('move-source-key').value = key;
|
|||
|
|
document.getElementById('move-dest-key').value = key;
|
|||
|
|
openModal('modal-move');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function submitMoveObject() {
|
|||
|
|
const src = document.getElementById('move-source-key').value;
|
|||
|
|
const dst = document.getElementById('move-dest-key').value;
|
|||
|
|
if (!dst || src === dst) {
|
|||
|
|
closeModal('modal-move');
|
|||
return;
|
||||
|
|
}
|
|||
const res = await api('/oort/api/objects/move', {
|
||||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({
|
|||
|
|
src_bucket: state.currentBucket,
|
|||
|
|
src_key: src,
|
|||
|
|
dst_bucket: state.currentBucket,
|
|||
|
|
dst_key: dst
|
|||
|
|
})
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Object moved successfully', 'success');
|
|||
|
|
closeModal('modal-move');
|
|||
|
|
loadObjects();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Version History Modal ─── */
|
|||
|
|
async function openVersionsModal(key) {
|
|||
|
|
openModal('modal-versions');
|
|||
|
|
const tbody = document.getElementById('versions-tbody');
|
|||
|
|
tbody.innerHTML = `<tr><td colspan="4" style="text-align:center;">Loading versions...</td></tr>`;
|
|||
|
|
|
|||
|
|
const data = await api(`/oort/api/objects/versions?bucket=${encodeURIComponent(state.currentBucket)}&key=${encodeURIComponent(key)}`);
|
|||
|
|
if (!data || !data.versions || data.versions.length === 0) {
|
|||
|
|
tbody.innerHTML = `<tr><td colspan="4" style="text-align:center; color:var(--text-dim);">No previous versions found.</td></tr>`;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
tbody.innerHTML = '';
|
|||
|
|
data.versions.forEach(v => {
|
|||
|
|
const tr = document.createElement('tr');
|
|||
|
|
tr.innerHTML = `
|
|||
|
|
<td style="font-family:var(--font-mono); font-size:11px;">${escapeHtml(v.version_id ? v.version_id.substring(0, 16) : 'latest')}</td>
|
|||
|
|
<td style="font-size:12px;">${formatDate(v.last_modified)}</td>
|
|||
|
|
<td style="font-family:var(--font-mono); font-size:12px;">${fmtBytes(v.size)}</td>
|
|||
|
|
<td style="text-align:right;">
|
|||
|
|
${v.is_latest ? '<span style="color:var(--accent-emerald); font-size:11px;">Current</span>' : `
|
|||
|
|
<button class="btn btn-ghost" style="padding:2px 8px; font-size:11px;" onclick="restoreVersion('${escapeHtml(key)}', '${escapeHtml(v.version_id)}')">Restore</button>
|
|||
|
|
`}
|
|||
|
|
</td>
|
|||
|
|
`;
|
|||
|
|
tbody.appendChild(tr);
|
|||
|
|
});
|
|||
}
|
||||
|
|
|
|||
|
|
async function restoreVersion(key, versionId) {
|
|||
const res = await api('/oort/api/objects/restore', {
|
||||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, key, version_id: versionId })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Version restored!', 'success');
|
|||
closeModal('modal-versions');
|
||||
|
|
loadObjects();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
/* ─── Folder & Bucket Creation ─── */
|
||||
|
|
function openMkdirModal() {
|
|||
|
|
document.getElementById('mkdir-name-input').value = '';
|
|||
|
|
openModal('modal-mkdir');
|
|||
|
|
}
|
|||
|
||||
async function submitMkdir() {
|
||||
|
|
const name = document.getElementById('mkdir-name-input').value.trim();
|
|||
|
|
if (!name) return;
|
|||
|
|
const res = await api('/oort/api/mkdir', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({
|
|||
|
|
bucket: state.currentBucket,
|
|||
|
|
prefix: state.currentPrefix,
|
|||
|
|
name: name
|
|||
|
|
})
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast(`Folder '${name}' created`, 'success');
|
|||
|
|
closeModal('modal-mkdir');
|
|||
|
|
loadObjects();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function openCreateBucketModal() {
|
|||
|
|
document.getElementById('create-bucket-name').value = '';
|
|||
|
|
openModal('modal-create-bucket');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function submitCreateBucket() {
|
|||
|
|
const name = document.getElementById('create-bucket-name').value.trim();
|
|||
|
|
if (!name) return;
|
|||
|
|
const res = await api('/oort/api/buckets', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ name })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast(`Bucket '${name}' created successfully`, 'success');
|
|||
|
|
closeModal('modal-create-bucket');
|
|||
|
|
await loadBuckets();
|
|||
|
|
changeBucket(name);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Download & Delete Objects ─── */
|
|||
|
|
async function downloadObject(key) {
|
|||
|
|
const res = await api(`/oort/api/presign?bucket=${encodeURIComponent(state.currentBucket)}&key=${encodeURIComponent(key)}`);
|
|||
|
|
if (res && res.url) {
|
|||
|
|
window.open(res.url, '_blank');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function confirmDeleteObject(key) {
|
|||
|
|
if (!confirm(`Permanently delete '${key}'?`)) return;
|
|||
|
|
const res = await api('/oort/api/delete', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, key })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Deleted successfully', 'success');
|
|||
|
|
loadObjects();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── High-Speed Multipart Upload Engine ─── */
|
|||
|
|
function triggerFileInput() {
|
|||
|
|
document.getElementById('hidden-file-input').click();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function handleFileInputChange(files) {
|
|||
|
|
if (!files || files.length === 0) return;
|
|||
|
|
queueUploadFiles(Array.from(files));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
let uploadQueue = [];
|
|||
|
|
let isUploading = false;
|
|||
|
|
|
|||
|
|
function queueUploadFiles(files) {
|
|||
|
|
const drawer = document.getElementById('upload-drawer');
|
|||
|
|
drawer.classList.add('show');
|
|||
|
|
|
|||
|
|
files.forEach(f => {
|
|||
|
|
const key = (state.currentPrefix || '') + f.name;
|
|||
|
|
uploadQueue.push({ file: f, key: key, size: f.size, progress: 0, status: 'pending' });
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
renderUploadDrawer();
|
|||
|
|
if (!isUploading) processNextUpload();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function renderUploadDrawer() {
|
|||
|
|
const container = document.getElementById('upload-items-container');
|
|||
|
|
container.innerHTML = '';
|
|||
|
|
const pendingCount = uploadQueue.filter(u => u.status !== 'done').length;
|
|||
|
|
document.getElementById('upload-summary-title').textContent = pendingCount > 0 ? `Uploading ${pendingCount} files...` : 'All uploads completed';
|
|||
|
|
|
|||
|
|
uploadQueue.slice(-10).forEach(u => {
|
|||
|
|
const el = document.createElement('div');
|
|||
|
|
el.className = 'upload-item';
|
|||
|
|
el.innerHTML = `
|
|||
|
|
<div class="upload-item-title">
|
|||
|
|
<span style="font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:240px;">${escapeHtml(u.file.name)}</span>
|
|||
|
|
<span style="font-family:var(--font-mono); color:var(--text-dim);">${fmtBytes(u.size)}</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="upload-progress-bar">
|
|||
|
|
<div class="upload-progress-fill" style="width:${u.progress}%;"></div>
|
|||
|
|
</div>
|
|||
|
|
`;
|
|||
|
|
container.appendChild(el);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function closeUploadDrawer() {
|
|||
|
|
document.getElementById('upload-drawer').classList.remove('show');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function processNextUpload() {
|
|||
|
|
const item = uploadQueue.find(u => u.status === 'pending');
|
|||
|
|
if (!item) {
|
|||
|
|
isUploading = false;
|
|||
|
|
loadObjects();
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
isUploading = true;
|
|||
|
|
item.status = 'uploading';
|
|||
|
|
|
|||
|
|
try {
|
|||
|
|
if (item.size > CHUNK_SIZE) {
|
|||
|
|
await uploadMultipartChunked(item);
|
|||
|
|
} else {
|
|||
|
|
await uploadSingleDirect(item);
|
|||
|
|
}
|
|||
|
|
item.progress = 100;
|
|||
|
|
item.status = 'done';
|
|||
|
|
toast(`Uploaded: ${item.file.name}`, 'success');
|
|||
|
|
} catch (err) {
|
|||
|
|
item.status = 'error';
|
|||
|
|
toast(`Failed to upload ${item.file.name}: ${err.message}`, 'error');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
renderUploadDrawer();
|
|||
|
|
processNextUpload();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function uploadSingleDirect(item) {
|
|||
|
|
// Use init + presigned or direct FormData
|
|||
|
|
const form = new FormData();
|
|||
|
|
form.append('file', item.file);
|
|||
|
|
form.append('bucket', state.currentBucket);
|
|||
|
|
form.append('key', item.key);
|
|||
|
|
|
|||
|
|
const xhr = new XMLHttpRequest();
|
|||
|
|
await new Promise((resolve, reject) => {
|
|||
|
|
xhr.open('POST', `/oort/api/upload/init`);
|
|||
|
|
xhr.setRequestHeader('X-Session-Id', SID);
|
|||
|
|
xhr.upload.onprogress = (e) => {
|
|||
|
|
if (e.lengthComputable) {
|
|||
|
|
item.progress = Math.round((e.loaded / e.total) * 100);
|
|||
|
|
renderUploadDrawer();
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
xhr.onload = () => {
|
|||
|
|
if (xhr.status >= 200 && xhr.status < 300) resolve();
|
|||
|
|
else reject(new Error(`HTTP ${xhr.status}`));
|
|||
|
|
};
|
|||
|
|
xhr.onerror = () => reject(new Error('Network error'));
|
|||
|
|
xhr.send(form);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function uploadMultipartChunked(item) {
|
|||
|
|
const initRes = await api('/oort/api/upload/init', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, key: item.key, is_multipart: true })
|
|||
|
|
});
|
|||
|
|
if (!initRes || !initRes.upload_id) throw new Error('Init multipart failed');
|
|||
|
|
|
|||
|
|
const uploadId = initRes.upload_id;
|
|||
|
|
const parts = [];
|
|||
|
|
const totalParts = Math.ceil(item.size / CHUNK_SIZE);
|
|||
|
|
|
|||
|
|
for (let i = 0; i < totalParts; i++) {
|
|||
|
|
const start = i * CHUNK_SIZE;
|
|||
|
|
const end = Math.min(item.size, start + CHUNK_SIZE);
|
|||
|
|
const chunk = item.file.slice(start, end);
|
|||
|
|
|
|||
|
|
const partRes = await fetch(`/oort/api/upload/part?bucket=${encodeURIComponent(state.currentBucket)}&key=${encodeURIComponent(item.key)}&upload_id=${encodeURIComponent(uploadId)}&part_number=${i + 1}`, {
|
|||
|
|
method: 'POST',
|
|||
|
|
headers: { 'X-Session-Id': SID },
|
|||
|
|
body: chunk
|
|||
|
|
});
|
|||
|
|
if (!partRes.ok) throw new Error(`Part ${i + 1} failed`);
|
|||
|
|
const partData = await partRes.json();
|
|||
|
|
parts.push({ PartNumber: i + 1, ETag: partData.etag });
|
|||
|
|
|
|||
|
|
item.progress = Math.round(((i + 1) / totalParts) * 100);
|
|||
|
|
renderUploadDrawer();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
await api('/oort/api/upload/complete', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, key: item.key, upload_id: uploadId, parts })
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Drag & Drop Event Handlers ─── */
|
|||
|
|
window.addEventListener('dragover', (e) => {
|
|||
|
|
e.preventDefault();
|
|||
|
|
document.getElementById('drop-overlay').classList.add('active');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
window.addEventListener('dragleave', (e) => {
|
|||
|
|
if (e.relatedTarget === null) {
|
|||
|
|
document.getElementById('drop-overlay').classList.remove('active');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
window.addEventListener('drop', (e) => {
|
|||
|
|
e.preventDefault();
|
|||
|
|
document.getElementById('drop-overlay').classList.remove('active');
|
|||
|
|
if (e.dataTransfer && e.dataTransfer.files.length > 0) {
|
|||
|
|
queueUploadFiles(Array.from(e.dataTransfer.files));
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
/* ─── Telemetry Charts ─── */
|
|||
|
|
async function loadAnalytics() {
|
|||
|
|
const range = document.getElementById('analytics-range-select').value;
|
|||
|
|
const data = await api(`/oort/api/analytics?bucket=${encodeURIComponent(state.currentBucket)}&range=${range}`);
|
|||
|
|
if (!data) return;
|
|||
|
|
|
|||
|
|
document.getElementById('analytics-total-reqs').textContent = `Total: ${data.total_requests || 0} requests`;
|
|||
|
|
|
|||
|
|
// Render Line Chart
|
|||
|
|
const ctx = document.getElementById('analytics-chart').getContext('2d');
|
|||
|
|
if (state.analyticsChart) state.analyticsChart.destroy();
|
|||
|
|
|
|||
|
|
const labels = data.timeseries ? data.timeseries.labels : ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00'];
|
|||
|
|
const reqs = data.timeseries ? data.timeseries.reqs : [0, 0, 0, 0, 0, 0];
|
|||
|
|
const origin = data.timeseries ? data.timeseries.origin : [0, 0, 0, 0, 0, 0];
|
|||
|
|
|
|||
|
|
state.analyticsChart = new Chart(ctx, {
|
|||
|
|
type: 'line',
|
|||
|
|
data: {
|
|||
|
|
labels: labels,
|
|||
|
|
datasets: [
|
|||
|
|
{
|
|||
|
|
label: 'Requests',
|
|||
|
|
data: reqs,
|
|||
|
|
borderColor: '#38bdf8',
|
|||
|
|
backgroundColor: 'rgba(56, 189, 248, 0.1)',
|
|||
|
|
fill: true,
|
|||
|
|
tension: 0.35,
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: 'Bandwidth (MB)',
|
|||
|
|
data: origin,
|
|||
|
|
borderColor: '#818cf8',
|
|||
|
|
backgroundColor: 'rgba(129, 140, 248, 0.05)',
|
|||
|
|
fill: true,
|
|||
|
|
tension: 0.35,
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
options: {
|
|||
|
|
responsive: true,
|
|||
|
|
maintainAspectRatio: false,
|
|||
|
|
plugins: { legend: { labels: { color: '#94a3b8' } } },
|
|||
|
|
scales: {
|
|||
|
|
x: { grid: { color: 'rgba(255,255,255,0.05)' }, ticks: { color: '#64748b' } },
|
|||
|
|
y: { grid: { color: 'rgba(255,255,255,0.05)' }, ticks: { color: '#64748b' } }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// Render Status Pie
|
|||
|
|
const sCtx = document.getElementById('status-chart').getContext('2d');
|
|||
|
|
if (state.statusChart) state.statusChart.destroy();
|
|||
|
|
|
|||
|
|
state.statusChart = new Chart(sCtx, {
|
|||
|
|
type: 'doughnut',
|
|||
|
|
data: {
|
|||
|
|
labels: ['2xx Success', '4xx Client', '5xx Server'],
|
|||
|
|
datasets: [{
|
|||
|
|
data: [data.total_success || 1, data.total_4xx || 0, data.total_5xx || 0],
|
|||
|
|
backgroundColor: ['#34d399', '#fbbf24', '#f43f5e'],
|
|||
|
|
borderWidth: 0
|
|||
|
|
}]
|
|||
|
|
},
|
|||
|
|
options: {
|
|||
|
|
responsive: true,
|
|||
|
|
maintainAspectRatio: false,
|
|||
|
|
plugins: { legend: { position: 'bottom', labels: { color: '#94a3b8' } } }
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── API Credentials ─── */
|
|||
|
|
async function loadAPICredentials() {
|
|||
|
|
const data = await api('/oort/api/profile');
|
|||
|
|
if (!data) return;
|
|||
|
|
document.getElementById('api-access-key').value = data.access_key || DEFAULT_USERNAME;
|
|||
|
|
if (data.secret_key) {
|
|||
|
|
document.getElementById('api-secret-key').dataset.secret = data.secret_key;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function switchApiTab(tabId) {
|
|||
|
|
document.querySelectorAll('#view-api .guide-tab-btn').forEach(b => b.classList.remove('active'));
|
|||
|
|
document.querySelectorAll('#view-api .guide-content').forEach(c => c.classList.remove('active'));
|
|||
|
|
|
|||
|
|
event.currentTarget.classList.add('active');
|
|||
|
|
const target = document.getElementById(`api-tab-${tabId}`);
|
|||
|
|
if (target) target.classList.add('active');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Drive Settings ─── */
|
|||
|
|
async function loadSettings() {
|
|||
|
|
// Website
|
|||
|
|
const web = await api(`/oort/api/bucket/website?bucket=${encodeURIComponent(state.currentBucket)}`);
|
|||
|
|
if (web) {
|
|||
|
|
document.getElementById('settings-website-toggle').checked = web.enabled;
|
|||
|
|
document.getElementById('settings-website-index').value = web.index_doc || 'index.html';
|
|||
|
|
document.getElementById('settings-website-error').value = web.error_doc || '404.html';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Domains
|
|||
|
|
const doms = await api(`/oort/api/bucket/domains?bucket=${encodeURIComponent(state.currentBucket)}`);
|
|||
|
|
const domContainer = document.getElementById('settings-domains-list');
|
|||
|
|
if (doms && doms.domains && doms.domains.length > 0) {
|
|||
|
|
domContainer.innerHTML = '';
|
|||
|
|
doms.domains.forEach(d => {
|
|||
|
|
const el = document.createElement('div');
|
|||
|
|
el.className = 'conn-val-box';
|
|||
|
|
el.innerHTML = `
|
|||
|
|
<span>${escapeHtml(d)}</span>
|
|||
|
|
<button class="btn btn-ghost" style="color:var(--accent-rose); font-size:11px;" onclick="removeDomain('${escapeHtml(d)}')">Remove</button>
|
|||
|
|
`;
|
|||
|
|
domContainer.appendChild(el);
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
domContainer.innerHTML = `<div style="color:var(--text-dim); font-size:13px;">No custom domains attached.</div>`;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Webhooks
|
|||
|
|
const whs = await api(`/oort/api/bucket/webhooks?bucket=${encodeURIComponent(state.currentBucket)}`);
|
|||
|
|
const whContainer = document.getElementById('settings-webhooks-list');
|
|||
|
|
if (whs && whs.length > 0) {
|
|||
|
|
whContainer.innerHTML = '';
|
|||
|
|
whs.forEach(w => {
|
|||
|
|
const el = document.createElement('div');
|
|||
|
|
el.className = 'conn-val-box';
|
|||
|
|
el.innerHTML = `
|
|||
|
|
<span>${escapeHtml(w.target_url)}</span>
|
|||
|
|
<div>
|
|||
|
|
<button class="btn btn-ghost" style="font-size:11px;" onclick="testWebhook('${escapeHtml(w.id)}')">Test</button>
|
|||
|
|
<button class="btn btn-ghost" style="color:var(--accent-rose); font-size:11px;" onclick="deleteWebhook('${escapeHtml(w.id)}')">Delete</button>
|
|||
|
|
</div>
|
|||
|
|
`;
|
|||
|
|
whContainer.appendChild(el);
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
whContainer.innerHTML = `<div style="color:var(--text-dim); font-size:13px;">No webhooks configured.</div>`;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function saveBucketRename() {
|
|||
|
|
const newName = document.getElementById('settings-drive-rename-input').value.trim();
|
|||
|
|
if (!newName) return;
|
|||
|
|
const res = await api('/oort/api/buckets/rename', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ old_name: state.currentBucket, new_name: newName })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Drive alias updated', 'success');
|
|||
|
|
loadBuckets();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function saveWebsiteConfig() {
|
|||
|
|
const enabled = document.getElementById('settings-website-toggle').checked;
|
|||
|
|
const indexDoc = document.getElementById('settings-website-index').value;
|
|||
|
|
const errorDoc = document.getElementById('settings-website-error').value;
|
|||
|
|
|
|||
|
|
const res = await api('/oort/api/bucket/website', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({
|
|||
|
|
bucket: state.currentBucket,
|
|||
|
|
enabled,
|
|||
|
|
index_doc: indexDoc,
|
|||
|
|
error_doc: errorDoc
|
|||
|
|
})
|
|||
|
|
});
|
|||
|
|
if (res) toast('Website hosting settings saved', 'success');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function openAddDomainModal() {
|
|||
|
|
document.getElementById('domain-name-input').value = '';
|
|||
|
|
openModal('modal-domain');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function submitAddDomain() {
|
|||
|
|
const dom = document.getElementById('domain-name-input').value.trim();
|
|||
|
|
if (!dom) return;
|
|||
|
|
const res = await api('/oort/api/bucket/domain/add', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, domain: dom })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast(`Domain '${dom}' attached`, 'success');
|
|||
|
|
closeModal('modal-domain');
|
|||
|
|
loadSettings();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function removeDomain(dom) {
|
|||
|
|
if (!confirm(`Remove domain '${dom}'?`)) return;
|
|||
|
|
const res = await api('/oort/api/bucket/domain/remove', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, domain: dom })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Domain removed', 'success');
|
|||
|
|
loadSettings();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function openAddWebhookModal() {
|
|||
|
|
document.getElementById('webhook-url-input').value = '';
|
|||
|
|
document.getElementById('webhook-secret-input').value = '';
|
|||
|
|
openModal('modal-webhook');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function submitAddWebhook() {
|
|||
|
|
const url = document.getElementById('webhook-url-input').value.trim();
|
|||
|
|
const secret = document.getElementById('webhook-secret-input').value.trim();
|
|||
|
|
if (!url) return;
|
|||
|
|
const res = await api('/oort/api/bucket/webhooks', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, target_url: url, secret: secret, events: ['upload', 'delete'] })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Webhook configured', 'success');
|
|||
|
|
closeModal('modal-webhook');
|
|||
|
|
loadSettings();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function testWebhook(id) {
|
|||
|
|
const res = await api('/oort/api/bucket/webhooks/test', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket, webhook_id: id })
|
|||
|
|
});
|
|||
|
|
if (res) toast('Test event dispatched to webhook!', 'success');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function deleteWebhook(id) {
|
|||
|
|
if (!confirm('Delete this webhook?')) return;
|
|||
|
|
const res = await api(`/oort/api/bucket/webhooks?bucket=${encodeURIComponent(state.currentBucket)}&id=${encodeURIComponent(id)}`, {
|
|||
|
|
method: 'DELETE'
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Webhook deleted', 'success');
|
|||
|
|
loadSettings();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function confirmEmptyBucket() {
|
|||
|
|
const code = prompt(`Type "EMPTY" to permanently delete ALL files in ${state.currentBucket}:`);
|
|||
|
|
if (code !== 'EMPTY') return;
|
|||
|
|
const res = await api('/oort/api/bucket/empty', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ bucket: state.currentBucket })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast(`Bucket '${state.currentBucket}' emptied`, 'success');
|
|||
|
|
loadObjects();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function confirmDeleteBucket() {
|
|||
|
|
const code = prompt(`Type "DELETE" to permanently delete bucket ${state.currentBucket}:`);
|
|||
|
|
if (code !== 'DELETE') return;
|
|||
|
|
const res = await api(`/oort/api/buckets?name=${encodeURIComponent(state.currentBucket)}`, {
|
|||
|
|
method: 'DELETE'
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Bucket deleted', 'success');
|
|||
|
|
await loadBuckets();
|
|||
|
|
changeBucket(state.buckets[0] ? state.buckets[0].Name : '');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Account & Profile ─── */
|
|||
|
|
async function loadAccountProfile() {
|
|||
|
|
const data = await api('/oort/api/profile');
|
|||
|
|
if (!data) return;
|
|||
|
|
state.profile = data;
|
|||
|
|
document.getElementById('account-display-username').textContent = data.username || DEFAULT_USERNAME;
|
|||
|
|
document.getElementById('account-display-email').textContent = data.email || 'sovereign@cosmos';
|
|||
|
|
if (data.avatar) {
|
|||
|
|
const avatarHtml = `<img src="${data.avatar}" alt="Avatar">`;
|
|||
|
|
document.getElementById('account-avatar-large').innerHTML = avatarHtml;
|
|||
|
|
document.getElementById('header-avatar-circle').innerHTML = avatarHtml;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function uploadAvatarImage(file) {
|
|||
|
|
if (!file) return;
|
|||
|
|
const form = new FormData();
|
|||
|
|
form.append('image', file);
|
|||
|
|
const res = await fetch('/oort/api/profile/image', {
|
|||
|
|
method: 'POST',
|
|||
|
|
headers: { 'X-Session-Id': SID },
|
|||
|
|
body: form
|
|||
|
|
});
|
|||
|
|
if (res.ok) {
|
|||
|
|
toast('Profile avatar updated', 'success');
|
|||
|
|
loadAccountProfile();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function submitQuotaRequest() {
|
|||
|
|
const amt = parseInt(document.getElementById('quota-upgrade-amount').value, 10);
|
|||
|
|
const res = await api('/oort/api/quota', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ amount: amt })
|
|||
|
|
});
|
|||
|
|
if (res) toast(`Quota upgrade request for ${amt} GB sent to Cosmos administrator`, 'success');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
async function submitChangePassword() {
|
|||
|
|
const oldPwd = document.getElementById('inp-pwd-old').value;
|
|||
|
|
const newPwd = document.getElementById('inp-pwd-new').value;
|
|||
|
|
const confirmPwd = document.getElementById('inp-pwd-confirm').value;
|
|||
|
|
|
|||
|
|
if (newPwd !== confirmPwd) {
|
|||
|
|
toast('Passwords do not match', 'error');
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
const res = await api('/oort/api/password', {
|
|||
|
|
method: 'POST',
|
|||
|
|
body: JSON.stringify({ old_password: oldPwd, new_password: newPwd })
|
|||
|
|
});
|
|||
|
|
if (res) {
|
|||
|
|
toast('Password changed successfully', 'success');
|
|||
|
|
document.getElementById('inp-pwd-old').value = '';
|
|||
|
|
document.getElementById('inp-pwd-new').value = '';
|
|||
|
|
document.getElementById('inp-pwd-confirm').value = '';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Helpers & Icons ─── */
|
|||
|
|
function openModal(id) {
|
|||
|
|
document.getElementById(id).classList.add('open');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function closeModal(id) {
|
|||
|
|
document.getElementById(id).classList.remove('open');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function copyFieldValue(elemId) {
|
|||
|
|
const el = document.getElementById(elemId);
|
|||
|
|
if (!el) return;
|
|||
|
|
const val = el.dataset.secret || el.value;
|
|||
|
|
navigator.clipboard.writeText(val);
|
|||
|
|
toast('Copied to clipboard!', 'info');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function toggleSecretVisibility(elemId) {
|
|||
|
|
const el = document.getElementById(elemId);
|
|||
|
|
if (!el || !el.dataset.secret) return;
|
|||
|
|
if (el.type === 'password') {
|
|||
|
|
el.type = 'text';
|
|||
|
|
el.value = el.dataset.secret;
|
|||
|
|
} else {
|
|||
|
|
el.type = 'password';
|
|||
|
|
el.value = '••••••••••••••••';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function formatDate(isoStr) {
|
|||
|
|
if (!isoStr) return '--';
|
|||
|
|
const d = new Date(isoStr);
|
|||
|
|
return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric', hour: '2-digit', minute: '2-digit' });
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getFileCategory(name) {
|
|||
|
|
const ext = (name || '').toLowerCase().split('.').pop();
|
|||
|
|
if (['mp3', 'wav', 'flac', 'ogg', 'm4a', 'aac', 'opus', 'alac'].includes(ext)) return 'audio';
|
|||
|
|
if (['mp4', 'webm', 'mov', 'mkv', 'avi'].includes(ext)) return 'video';
|
|||
|
|
if (['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp', 'ico'].includes(ext)) return 'image';
|
|||
|
|
if (['pdf', 'doc', 'docx', 'txt', 'rtf', 'odt'].includes(ext)) return 'documents';
|
|||
|
|
if (['js', 'ts', 'go', 'py', 'json', 'html', 'css', 'rs', 'sh', 'md', 'sql'].includes(ext)) return 'code';
|
|||
|
|
if (['zip', 'tar', 'gz', 'rar', '7z'].includes(ext)) return 'archives';
|
|||
|
|
return 'others';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getItemIconClass(name, isDir) {
|
|||
|
|
if (isDir) return 'icon-folder';
|
|||
|
|
const cat = getFileCategory(name);
|
|||
|
|
if (cat === 'audio') return 'icon-audio';
|
|||
|
|
if (cat === 'video') return 'icon-video';
|
|||
|
|
if (cat === 'image') return 'icon-image';
|
|||
|
|
if (cat === 'documents') return 'icon-doc';
|
|||
|
|
if (cat === 'code') return 'icon-code';
|
|||
|
|
if (cat === 'archives') return 'icon-zip';
|
|||
|
|
return 'icon-file';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getItemSVG(name, isDir) {
|
|||
|
|
if (isDir) {
|
|||
|
|
return `<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/></svg>`;
|
|||
|
|
}
|
|||
|
|
const cat = getFileCategory(name);
|
|||
|
|
if (cat === 'audio') {
|
|||
|
|
return `<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>`;
|
|||
|
|
}
|
|||
|
|
if (cat === 'image') {
|
|||
|
|
return `<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>`;
|
|||
|
|
}
|
|||
|
|
if (cat === 'video') {
|
|||
|
|
return `<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2"/></svg>`;
|
|||
|
|
}
|
|||
|
|
if (cat === 'code') {
|
|||
|
|
return `<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>`;
|
|||
|
|
}
|
|||
|
|
return `<svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>`;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ─── Keyboard Hotkeys ─── */
|
|||
|
|
window.addEventListener('keydown', (e) => {
|
|||
|
|
if (e.key === 'Escape') {
|
|||
|
|
document.querySelectorAll('.modal-backdrop').forEach(m => m.classList.remove('open'));
|
|||
|
|
}
|
|||
|
|
if (e.key === '/' && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {
|
|||
|
|
e.preventDefault();
|
|||
|
|
document.getElementById('global-search-input').focus();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
/* ─── 3D Cosmic Starfield Engine ─── */
|
|||
|
|
(function initCosmicCanvas() {
|
|||
|
|
const canvas = document.getElementById('cosmic-canvas');
|
|||
|
|
const ctx = canvas.getContext('2d');
|
|||
|
|
let width, height;
|
|||
|
|
let stars = [];
|
|||
|
|
const COUNT = 140;
|
|||
|
|
|
|||
|
|
function resize() {
|
|||
|
|
width = canvas.width = window.innerWidth;
|
|||
|
|
height = canvas.height = window.innerHeight;
|
|||
}
|
||||
|
|
window.addEventListener('resize', resize);
|
|||
|
|
resize();
|
|||
|
|
|
|||
for (let i = 0; i < COUNT; i++) {
|
||||
stars.push({
|
||||
x: (Math.random() - 0.5) * width * 2,
|
||||
|
|
y: (Math.random() - 0.5) * height * 2,
|
|||
|
|
z: Math.random() * width,
|
|||
|
|
size: Math.random() * 1.5 + 0.5,
|
|||
|
|
alpha: Math.random() * 0.7 + 0.3
|
|||
});
|
||||
|
|
}
|
|||
|
|
|
|||
function render() {
|
||||
|
|
ctx.clearRect(0, 0, width, height);
|
|||
|
|
const cx = width / 2;
|
|||
|
|
const cy = height / 2;
|
|||
|
||||
for (let i = 0; i < stars.length; i++) {
|
||||
|
|
const s = stars[i];
|
|||
|
|
s.z -= 0.45;
|
|||
|
|
if (s.z <= 0) {
|
|||
|
|
s.z = width;
|
|||
|
|
s.x = (Math.random() - 0.5) * width * 2;
|
|||
|
|
s.y = (Math.random() - 0.5) * height * 2;
|
|||
|
|
}
|
|||
|
||||
const k = 250 / s.z;
|
||||
|
|
const px = s.x * k + cx;
|
|||
|
|
const py = s.y * k + cy;
|
|||
|
||||
if (px >= 0 && px <= width && py >= 0 && py <= height) {
|
||||
|
|
const radius = Math.max(0.6, s.size * k);
|
|||
|
|
const alpha = Math.min(1, (1 - s.z / width) * s.alpha);
|
|||
|
||||
ctx.beginPath();
|
||||
|
|
ctx.arc(px, py, radius, 0, Math.PI * 2);
|
|||
|
|
ctx.fillStyle = `rgba(180, 220, 255, ${alpha})`;
|
|||
|
|
ctx.shadowBlur = radius * 4;
|
|||
|
|
ctx.shadowColor = 'rgba(56, 189, 248, 0.4)';
|
|||
|
|
ctx.fill();
|
|||
|
|
ctx.shadowBlur = 0;
|
|||
|
|
}
|
|||
}
|
||||
requestAnimationFrame(render);
|
||||
}
|
||||
render();
|
||||
|
|
})();
|
|||
|
||||
/* ─── Initialization on Page Load ─── */
|
||||
|
|
window.addEventListener('DOMContentLoaded', async () => {
|
|||
|
|
await loadBuckets();
|
|||
|
|
const hash = location.hash.replace('#', '');
|
|||
|
|
if (['dashboard', 'browser', 'nas', 'analytics', 'api', 'settings', 'account'].includes(hash)) {
|
|||
|
|
switchView(hash);
|
|||
|
|
} else {
|
|||
|
|
switchView('dashboard');
|
|||
|
|
}
|
|||
|
|
});
|
|||
</script>
|
||||
</body>
|
||||
</html>
|