437 lines
9.6 KiB
Svelte
437 lines
9.6 KiB
Svelte
<script lang="ts">
|
|
import DemoFlow from './lib/components/DemoFlow.svelte';
|
|
import ChurnPrediction from './lib/components/ChurnPrediction.svelte';
|
|
import Icon from './lib/components/Icon.svelte';
|
|
|
|
let currentNav = $state<'lead-scoring' | 'churn-prediction'>('lead-scoring');
|
|
</script>
|
|
|
|
<div class="app-layout">
|
|
<!-- Left Sidebar -->
|
|
<aside class="sidebar" aria-label="Menu điều hướng chính">
|
|
<!-- Brand Header -->
|
|
<div class="brand-header">
|
|
<div class="brand-logo-wrap">
|
|
<img src="/brand-assets/logo_thumbnail.svg" alt="DotB" class="brand-logo" width="28" height="28" />
|
|
</div>
|
|
<div class="brand-title-wrap">
|
|
<span class="brand-name">DotB</span>
|
|
<span class="brand-product">AI Platform</span>
|
|
</div>
|
|
<span class="env-chip">DEV</span>
|
|
</div>
|
|
|
|
<!-- Navigation Section: AI Services -->
|
|
<div class="nav-group">
|
|
<span class="nav-heading">DỊCH VỤ AI</span>
|
|
<nav class="nav-list">
|
|
<button
|
|
class="nav-item"
|
|
class:active={currentNav === 'lead-scoring'}
|
|
type="button"
|
|
onclick={() => (currentNav = 'lead-scoring')}
|
|
>
|
|
<div class="nav-item-content">
|
|
<Icon name="target" size={15} />
|
|
<span class="nav-label">Lead Scoring</span>
|
|
</div>
|
|
<span class="badge-live">Live</span>
|
|
</button>
|
|
|
|
<button
|
|
class="nav-item"
|
|
class:active={currentNav === 'churn-prediction'}
|
|
type="button"
|
|
onclick={() => (currentNav = 'churn-prediction')}
|
|
>
|
|
<div class="nav-item-content">
|
|
<Icon name="trending-down" size={15} />
|
|
<span class="nav-label">Churn Prediction</span>
|
|
</div>
|
|
<span class="badge-dev">In Dev</span>
|
|
</button>
|
|
</nav>
|
|
</div>
|
|
|
|
<!-- Navigation Section: Developer Resources -->
|
|
<div class="nav-group">
|
|
<span class="nav-heading">TÀI NGUYÊN KỸ THUẬT</span>
|
|
<nav class="nav-list">
|
|
<a class="nav-item nav-link" href="/lead-scoring-api-docs.html" target="_blank" rel="noopener noreferrer">
|
|
<div class="nav-item-content">
|
|
<Icon name="book-open" size={15} />
|
|
<span class="nav-label">API Reference</span>
|
|
</div>
|
|
<span class="nav-ext-icon">↗</span>
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
|
|
<!-- Sidebar Footer: Status & Tenant -->
|
|
<div class="sidebar-footer">
|
|
<div class="footer-status-row">
|
|
<span class="status-dot"></span>
|
|
<span class="status-text">AIHub Gateway Online</span>
|
|
</div>
|
|
<div class="footer-meta-row">
|
|
<span class="meta-label">Tenant:</span>
|
|
<code class="meta-value">omni-account-42</code>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Main Content Area -->
|
|
<main class="main-wrapper">
|
|
<!-- Top Bar -->
|
|
<header class="topbar">
|
|
<div class="breadcrumb">
|
|
<span class="breadcrumb-root">AI Platform</span>
|
|
<span class="breadcrumb-separator">/</span>
|
|
<span class="breadcrumb-current">
|
|
{currentNav === 'lead-scoring' ? 'Lead Scoring Engine' : 'Student Churn Prediction'}
|
|
</span>
|
|
</div>
|
|
<div class="topbar-actions">
|
|
<div class="backend-pill">
|
|
<span class="pill-dot"></span>
|
|
<span>Core API: <code>127.0.0.1</code></span>
|
|
</div>
|
|
<a class="doc-btn" href="/lead-scoring-api-docs.html" target="_blank" rel="noopener noreferrer">
|
|
Tài liệu API (Redoc) ↗
|
|
</a>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Content Body -->
|
|
<div class="content-body">
|
|
{#if currentNav === 'lead-scoring'}
|
|
<DemoFlow />
|
|
{:else if currentNav === 'churn-prediction'}
|
|
<ChurnPrediction />
|
|
{/if}
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<style>
|
|
.app-layout {
|
|
display: flex;
|
|
min-height: 100vh;
|
|
background-color: var(--bg-canvas);
|
|
}
|
|
|
|
/* Sidebar */
|
|
.sidebar {
|
|
width: 250px;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--bg-surface);
|
|
border-right: 1px solid var(--border-subtle);
|
|
position: sticky;
|
|
top: 0;
|
|
height: 100vh;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.brand-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 18px 20px;
|
|
border-bottom: 1px solid var(--border-subtle);
|
|
}
|
|
|
|
.brand-logo-wrap {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.brand-logo {
|
|
display: block;
|
|
width: 28px;
|
|
height: 28px;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.brand-title-wrap {
|
|
display: flex;
|
|
flex-direction: column;
|
|
line-height: 1.15;
|
|
}
|
|
|
|
.brand-name {
|
|
font-size: 0.92rem;
|
|
font-weight: 800;
|
|
color: var(--text-primary);
|
|
letter-spacing: -0.02em;
|
|
}
|
|
|
|
.brand-product {
|
|
font-size: 0.72rem;
|
|
font-weight: 600;
|
|
color: var(--accent-blue-strong);
|
|
}
|
|
|
|
.env-chip {
|
|
margin-left: auto;
|
|
padding: 2px 6px;
|
|
border-radius: var(--radius-xs);
|
|
background: var(--accent-blue-subtle);
|
|
color: var(--accent-blue-strong);
|
|
font-size: 0.62rem;
|
|
font-weight: 800;
|
|
letter-spacing: 0.04em;
|
|
border: 1px solid var(--accent-blue-border);
|
|
}
|
|
|
|
/* Nav Groups */
|
|
.nav-group {
|
|
padding: 16px 14px 8px;
|
|
}
|
|
|
|
.nav-heading {
|
|
display: block;
|
|
padding: 0 8px 8px;
|
|
font-size: 0.65rem;
|
|
font-weight: 800;
|
|
letter-spacing: 0.08em;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.nav-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.nav-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
padding: 8px 10px;
|
|
background: transparent;
|
|
border: 1px solid transparent;
|
|
border-radius: var(--radius-sm);
|
|
color: var(--text-secondary);
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
text-decoration: none;
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.nav-item:hover {
|
|
background: var(--bg-surface-subtle);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.nav-item.active {
|
|
background: var(--accent-blue-subtle);
|
|
color: var(--accent-blue-strong);
|
|
border-color: var(--accent-blue-border);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.nav-item-content {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.badge-live {
|
|
padding: 1px 6px;
|
|
border-radius: var(--radius-full);
|
|
background: #ecfdf5;
|
|
color: #047857;
|
|
font-size: 0.65rem;
|
|
font-weight: 700;
|
|
border: 1px solid #a7f3d0;
|
|
}
|
|
|
|
.badge-dev {
|
|
padding: 1px 6px;
|
|
border-radius: var(--radius-full);
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
font-size: 0.65rem;
|
|
font-weight: 700;
|
|
border: 1px solid #fde68a;
|
|
}
|
|
|
|
.nav-ext-icon {
|
|
font-size: 0.72rem;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
/* Sidebar Footer */
|
|
.sidebar-footer {
|
|
margin-top: auto;
|
|
padding: 14px 16px;
|
|
border-top: 1px solid var(--border-subtle);
|
|
background: var(--bg-surface-subtle);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
}
|
|
|
|
.footer-status-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.status-dot {
|
|
width: 7px;
|
|
height: 7px;
|
|
border-radius: 50%;
|
|
background: #10b981;
|
|
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
|
|
}
|
|
|
|
.status-text {
|
|
font-size: 0.72rem;
|
|
font-weight: 600;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.footer-meta-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 0.7rem;
|
|
}
|
|
|
|
.meta-label {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.meta-value {
|
|
color: var(--text-primary);
|
|
font-size: 0.68rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Main Wrapper */
|
|
.main-wrapper {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* Topbar */
|
|
.topbar {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 12px 28px;
|
|
background: var(--bg-surface);
|
|
border-bottom: 1px solid var(--border-subtle);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 10;
|
|
}
|
|
|
|
.breadcrumb {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
.breadcrumb-root {
|
|
color: var(--text-muted);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.breadcrumb-separator {
|
|
color: var(--border-medium);
|
|
}
|
|
|
|
.breadcrumb-current {
|
|
color: var(--text-primary);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.topbar-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.backend-pill {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 4px 10px;
|
|
border-radius: var(--radius-full);
|
|
background: var(--bg-surface-subtle);
|
|
border: 1px solid var(--border-subtle);
|
|
font-size: 0.72rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.pill-dot {
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 50%;
|
|
background: #10b981;
|
|
}
|
|
|
|
.backend-pill code {
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.doc-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 5px 12px;
|
|
border-radius: var(--radius-sm);
|
|
background: var(--accent-blue-subtle);
|
|
border: 1px solid var(--accent-blue-border);
|
|
color: var(--accent-blue-strong);
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
text-decoration: none;
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.doc-btn:hover {
|
|
background: var(--bg-surface-hover);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.content-body {
|
|
flex: 1;
|
|
}
|
|
|
|
@media (max-width: 900px) {
|
|
.sidebar {
|
|
width: 200px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.app-layout {
|
|
flex-direction: column;
|
|
}
|
|
.sidebar {
|
|
width: 100%;
|
|
height: auto;
|
|
position: relative;
|
|
}
|
|
.sidebar-footer {
|
|
display: none;
|
|
}
|
|
.topbar {
|
|
padding: 12px 16px;
|
|
}
|
|
}
|
|
</style>
|