940 lines
35 KiB
HTML
Executable file
940 lines
35 KiB
HTML
Executable file
<!DOCTYPE html>
|
||
<html lang="fa" dir="rtl">
|
||
<head>
|
||
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🔍</text></svg>">
|
||
<title>داشبورد اجرایی هوش تجاری و ماتریس RICE سئو | Hamed Ecosystem</title>
|
||
<style>
|
||
@font-face {
|
||
font-family: 'Vazirmatn';
|
||
src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
|
||
font-weight: 400;
|
||
font-style: normal;
|
||
font-display: swap;
|
||
}
|
||
@font-face {
|
||
font-family: 'Vazirmatn';
|
||
src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
|
||
font-weight: 700;
|
||
font-style: normal;
|
||
font-display: swap;
|
||
}
|
||
* {
|
||
box-sizing: border-box;
|
||
margin: 0;
|
||
padding: 0;
|
||
font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||
}
|
||
body {
|
||
background-color: #F8FAFC;
|
||
color: #0F172A;
|
||
direction: rtl;
|
||
line-height: 1.6;
|
||
-webkit-font-smoothing: antialiased;
|
||
}
|
||
.tnum {
|
||
font-feature-settings: "tnum" 1;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
.container {
|
||
max-width: 1440px;
|
||
margin: 0 auto;
|
||
padding: 0 24px;
|
||
}
|
||
/* Top sticky header */
|
||
.top-header {
|
||
position: sticky;
|
||
top: 0;
|
||
z-index: 1000;
|
||
background: rgba(255, 255, 255, 0.94);
|
||
backdrop-filter: blur(12px);
|
||
border-bottom: 1px solid #E2E8F0;
|
||
padding: 14px 0;
|
||
box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
|
||
}
|
||
.header-inner {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
flex-wrap: wrap;
|
||
gap: 16px;
|
||
}
|
||
.brand-group {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 14px;
|
||
}
|
||
.logo-badge {
|
||
background: #0F172A;
|
||
color: #FFFFFF;
|
||
font-weight: 800;
|
||
padding: 6px 12px;
|
||
border-radius: 8px;
|
||
font-size: 14px;
|
||
letter-spacing: 0.5px;
|
||
}
|
||
.brand-text h1 {
|
||
font-size: 18px;
|
||
font-weight: 800;
|
||
color: #0F172A;
|
||
line-height: 1.3;
|
||
}
|
||
.brand-text p {
|
||
font-size: 12px;
|
||
color: #64748B;
|
||
}
|
||
/* Navigation tier pills */
|
||
.nav-tiers {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
background: #F1F5F9;
|
||
padding: 4px;
|
||
border-radius: 10px;
|
||
border: 1px solid #E2E8F0;
|
||
}
|
||
.tier-link {
|
||
text-decoration: none;
|
||
font-size: 12px;
|
||
font-weight: 700;
|
||
padding: 6px 14px;
|
||
border-radius: 7px;
|
||
color: #475569;
|
||
transition: all 0.2s ease;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
.tier-link:hover {
|
||
color: #0F172A;
|
||
background: rgba(255, 255, 255, 0.6);
|
||
}
|
||
.tier-link.active {
|
||
background: #FFFFFF;
|
||
color: #0F172A;
|
||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||
}
|
||
/* KPI telemetry bar */
|
||
.telemetry-band {
|
||
display: grid;
|
||
grid-template-columns: repeat(6, 1fr);
|
||
gap: 14px;
|
||
margin: 24px 0;
|
||
}
|
||
@media (max-width: 1200px) {
|
||
.telemetry-band { grid-template-columns: repeat(3, 1fr); }
|
||
}
|
||
@media (max-width: 768px) {
|
||
.telemetry-band { grid-template-columns: repeat(2, 1fr); }
|
||
}
|
||
.card-kpi {
|
||
background: #FFFFFF;
|
||
border: 1px solid #E2E8F0;
|
||
border-radius: 14px;
|
||
padding: 16px;
|
||
box-shadow: 0 1px 3px rgba(0,0,0,0.02);
|
||
transition: transform 0.2s, border-color 0.2s;
|
||
}
|
||
.card-kpi:hover {
|
||
transform: translateY(-2px);
|
||
border-color: #CBD5E1;
|
||
}
|
||
.card-kpi .label {
|
||
font-size: 11.5px;
|
||
font-weight: 600;
|
||
color: #64748B;
|
||
margin-bottom: 6px;
|
||
}
|
||
.card-kpi .value {
|
||
font-size: 22px;
|
||
font-weight: 800;
|
||
color: #0F172A;
|
||
line-height: 1.2;
|
||
}
|
||
.card-kpi .sub {
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
margin-top: 4px;
|
||
}
|
||
/* Badges */
|
||
.badge {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding: 2px 8px;
|
||
border-radius: 6px;
|
||
font-size: 11px;
|
||
font-weight: 700;
|
||
}
|
||
.badge-p0 { background: #FFE4E6; color: #E11D48; border: 1px solid #FECDD3; }
|
||
.badge-p1 { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
|
||
.badge-p2 { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
|
||
.badge-p3 { background: #F3E8FF; color: #9333EA; border: 1px solid #E9D5FF; }
|
||
|
||
.badge-frontend { background: #EEF2FF; color: #4F46E5; }
|
||
.badge-backend { background: #ECFDF5; color: #059669; }
|
||
.badge-devops { background: #FFF7ED; color: #EA580C; }
|
||
.badge-taxonomy { background: #F0FDF4; color: #16A34A; }
|
||
|
||
/* Cards */
|
||
.card {
|
||
background: #FFFFFF;
|
||
border: 1px solid #E2E8F0;
|
||
border-radius: 16px;
|
||
padding: 20px;
|
||
margin-bottom: 20px;
|
||
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02), 0 6px 16px -4px rgba(15, 23, 42, 0.03);
|
||
}
|
||
.card-title {
|
||
font-size: 15px;
|
||
font-weight: 800;
|
||
color: #0F172A;
|
||
margin-bottom: 14px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
/* Tables */
|
||
.table-wrap {
|
||
overflow-x: auto;
|
||
border-radius: 12px;
|
||
border: 1px solid #E2E8F0;
|
||
}
|
||
table {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
text-align: right;
|
||
font-size: 13px;
|
||
}
|
||
thead th {
|
||
background: #F8FAFC;
|
||
color: #475569;
|
||
font-weight: 700;
|
||
padding: 12px 14px;
|
||
border-bottom: 1px solid #E2E8F0;
|
||
white-space: nowrap;
|
||
}
|
||
tbody tr {
|
||
border-bottom: 1px solid #F1F5F9;
|
||
transition: background 0.15s;
|
||
}
|
||
tbody tr:hover {
|
||
background: #F8FAFC;
|
||
cursor: pointer;
|
||
}
|
||
tbody td {
|
||
padding: 12px 14px;
|
||
color: #334155;
|
||
vertical-align: middle;
|
||
}
|
||
|
||
/* Sprint Gantt view */
|
||
.sprint-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(4, 1fr);
|
||
gap: 16px;
|
||
margin-bottom: 24px;
|
||
}
|
||
@media (max-width: 992px) {
|
||
.sprint-grid { grid-template-columns: 1fr; }
|
||
}
|
||
.sprint-box {
|
||
background: #FFFFFF;
|
||
border: 1px solid #E2E8F0;
|
||
border-radius: 12px;
|
||
padding: 16px;
|
||
}
|
||
.sprint-box.active-sprint {
|
||
border-color: #3B82F6;
|
||
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
|
||
}
|
||
.sprint-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-bottom: 8px;
|
||
}
|
||
.sprint-title {
|
||
font-size: 13px;
|
||
font-weight: 800;
|
||
color: #0F172A;
|
||
}
|
||
|
||
/* Code / Drawer */
|
||
.drawer-overlay {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(15, 23, 42, 0.5);
|
||
backdrop-filter: blur(3px);
|
||
z-index: 9998;
|
||
opacity: 0;
|
||
pointer-events: none;
|
||
transition: opacity 0.25s ease;
|
||
}
|
||
.drawer-overlay.open {
|
||
opacity: 1;
|
||
pointer-events: auto;
|
||
}
|
||
.drawer {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
width: 720px;
|
||
max-width: 92vw;
|
||
height: 100vh;
|
||
background: #FFFFFF;
|
||
z-index: 9999;
|
||
box-shadow: 4px 0 24px rgba(0,0,0,0.2);
|
||
transform: translateX(-100%);
|
||
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
}
|
||
.drawer.open {
|
||
transform: translateX(0);
|
||
}
|
||
.drawer-header {
|
||
padding: 16px 20px;
|
||
border-bottom: 1px solid #E2E8F0;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
background: #F8FAFC;
|
||
}
|
||
.drawer-body {
|
||
flex: 1;
|
||
overflow-y: auto;
|
||
padding: 20px;
|
||
}
|
||
.code-block {
|
||
background: #0F172A;
|
||
color: #E2E8F0;
|
||
padding: 14px;
|
||
border-radius: 10px;
|
||
font-family: monospace;
|
||
font-size: 12px;
|
||
direction: ltr;
|
||
text-align: left;
|
||
overflow-x: auto;
|
||
white-space: pre-wrap;
|
||
position: relative;
|
||
}
|
||
.copy-btn {
|
||
position: absolute;
|
||
top: 8px;
|
||
right: 8px;
|
||
background: rgba(255,255,255,0.15);
|
||
color: #FFFFFF;
|
||
border: none;
|
||
padding: 4px 10px;
|
||
border-radius: 6px;
|
||
font-size: 11px;
|
||
cursor: pointer;
|
||
}
|
||
.copy-btn:hover {
|
||
background: rgba(255,255,255,0.3);
|
||
}
|
||
.btn-action {
|
||
background: #0F172A;
|
||
color: #FFFFFF;
|
||
border: none;
|
||
padding: 8px 16px;
|
||
border-radius: 8px;
|
||
font-weight: 700;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
text-decoration: none;
|
||
}
|
||
.btn-action:hover {
|
||
background: #1E293B;
|
||
}
|
||
.btn-outline {
|
||
background: #FFFFFF;
|
||
color: #0F172A;
|
||
border: 1px solid #CBD5E1;
|
||
padding: 8px 16px;
|
||
border-radius: 8px;
|
||
font-weight: 700;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
.btn-outline:hover {
|
||
background: #F8FAFC;
|
||
}
|
||
</style>
|
||
<script src="../data_bundle.js?v=20260915_22tasks"></script>
|
||
<script src="../vendor/plotly.min.js"></script>
|
||
|
||
<style>
|
||
.charts-grid {
|
||
display: grid;
|
||
grid-template-columns: 1.8fr 1.2fr;
|
||
gap: 16px;
|
||
margin-bottom: 20px;
|
||
}
|
||
.bottom-charts-grid {
|
||
display: grid;
|
||
grid-template-columns: 1fr 1fr;
|
||
gap: 16px;
|
||
margin-bottom: 20px;
|
||
}
|
||
@media (max-width: 1024px) {
|
||
.charts-grid, .bottom-charts-grid { grid-template-columns: 1fr; }
|
||
}
|
||
.scope-toggle-wrap {
|
||
display: inline-flex;
|
||
background: #F1F5F9;
|
||
padding: 3px;
|
||
border-radius: 10px;
|
||
border: 1px solid #E2E8F0;
|
||
}
|
||
.btn-scope {
|
||
border: none;
|
||
background: transparent;
|
||
padding: 6px 14px;
|
||
font-size: 12px;
|
||
font-weight: 700;
|
||
border-radius: 7px;
|
||
cursor: pointer;
|
||
color: #64748B;
|
||
transition: all 0.2s;
|
||
}
|
||
.btn-scope.active {
|
||
background: #FFFFFF;
|
||
color: #0F172A;
|
||
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
||
}
|
||
.badge-crit {
|
||
background: #FEE2E2;
|
||
color: #DC2626;
|
||
border: 1px solid #FCA5A5;
|
||
font-size: 10.5px;
|
||
padding: 2px 6px;
|
||
border-radius: 4px;
|
||
font-weight: 800;
|
||
}
|
||
.badge-ext {
|
||
background: #F1F5F9;
|
||
color: #475569;
|
||
border: 1px solid #CBD5E1;
|
||
font-size: 10.5px;
|
||
padding: 2px 6px;
|
||
border-radius: 4px;
|
||
font-weight: 700;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<!-- Top Navigation Bar -->
|
||
<div class="top-header">
|
||
<div class="container header-inner">
|
||
<div class="brand-group">
|
||
<span class="logo-badge" style="background: #2563EB;">EXECUTIVE BI</span>
|
||
<div class="brand-text">
|
||
<h1>داشبورد تحلیل مدیریتی RICE و برآورد اثر اقتصادی سئو</h1>
|
||
<p>ارزیابی ارزش تجاری، بازده سرمایهگذاری (ROI) و توزیع لایههای فنی اکیپا (مدل ۲۲ اقدام)</p>
|
||
</div>
|
||
</div>
|
||
<div class="nav-tiers">
|
||
<a href="../" class="tier-link">
|
||
<span>📌</span> نسخه ۱: عملیات
|
||
</a>
|
||
<a href="../v2/" class="tier-link active">
|
||
<span>📊</span> نسخه ۲: Executive BI
|
||
</a>
|
||
<a href="../v3/" class="tier-link">
|
||
<span>⚡</span> نسخه ۳: Apex Cockpit
|
||
</a>
|
||
<a href="../new/" class="tier-link">
|
||
<span>🚀</span> نسخه جدید: C-Level Staging
|
||
</a>
|
||
</div>
|
||
<div>
|
||
<button class="btn-action" onclick="exportTasksToCSV()">
|
||
<span>📥</span> دانلود ماتریس RICE (اکسل)
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<main class="container" style="padding-top: 16px; padding-bottom: 60px;">
|
||
<!-- Telemetry Band -->
|
||
<div class="telemetry-band">
|
||
<div class="card-kpi">
|
||
<div class="label">بالاترین امتیاز RICE</div>
|
||
<div class="value tnum" style="color: #059669;">۷۵۰,۰۰۰</div>
|
||
<div class="sub" style="color: #64748B;">SEO-08: اصلاح robots.txt</div>
|
||
</div>
|
||
<div class="card-kpi">
|
||
<div class="label">رشد کلیک ماهانه پیشبینی</div>
|
||
<div class="value tnum" style="color: #2563EB;">+۱,۴۵۰ کلیک</div>
|
||
<div class="sub" style="color: #059669;">از رفع باگ رندر سفید PDP</div>
|
||
</div>
|
||
<div class="card-kpi">
|
||
<div class="label">جهش نرخ کلیک (CTR)</div>
|
||
<div class="value tnum" style="color: #059669;">+۴۷۵٪</div>
|
||
<div class="sub" style="color: #64748B;">با فعالسازی ریچریزالت ستاره</div>
|
||
</div>
|
||
<div class="card-kpi">
|
||
<div class="label">برآورد ارزش افزوده GMV</div>
|
||
<div class="value tnum" style="color: #D97706;">+۳۸۰ م.ت</div>
|
||
<div class="sub" style="color: #059669;">سهم کمیسیون ۱۵٪ اکیپا</div>
|
||
</div>
|
||
<div class="card-kpi">
|
||
<div class="label">مجموع ساعت مهندسی</div>
|
||
<div class="value tnum" style="color: #0F172A;" id="kpi-hours">۲۱.۵ ساعت</div>
|
||
<div class="sub" style="color: #64748B;" id="kpi-hours-sub">۱۲ اقدام بحرانی</div>
|
||
</div>
|
||
<div class="card-kpi">
|
||
<div class="label">نسبت ایمپکت به زمان (ROI)</div>
|
||
<div class="value tnum" style="color: #059669;">۲۴.۸x</div>
|
||
<div class="sub" style="color: #059669;">بازدهی فوقالعاده سرمایهگذاری</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Scope Switcher Bar -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; background: #FFFFFF; border: 1px solid #E2E8F0; padding: 12px 18px; border-radius: 12px;">
|
||
<div style="display: flex; align-items: center; gap: 10px;">
|
||
<span style="font-weight: 800; font-size: 13px; color: #0F172A;">دامنه تحلیل نمودارها و ماتریس:</span>
|
||
<div class="scope-toggle-wrap">
|
||
<button id="btn-scope-critical" class="btn-scope active" onclick="setScope('critical')">🔥 فقط ۱۲ ایراد بحرانی</button>
|
||
<button id="btn-scope-all" class="btn-scope" onclick="setScope('all')">🌐 نمایش کل ۲۲ اقدام</button>
|
||
</div>
|
||
</div>
|
||
<div id="scope-status-text" style="font-size: 12px; color: #64748B; font-weight: 700;">
|
||
نمایش ۱۲ تسک بحرانی (P0/P1) با ۲۱.۵ ساعت دولوپر
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Top Charts Grid -->
|
||
<div class="charts-grid">
|
||
<div class="card" style="margin-bottom: 0;">
|
||
<div class="card-title">
|
||
<span>🎯 ماتریس توزیع RICE اقدامات (Developer Effort در برابر Reach)</span>
|
||
<span style="font-size: 11.5px; color: #64748B;">اندازه حباب = امتیاز RICE | رنگ = سطح اولویت</span>
|
||
</div>
|
||
<div id="chart-rice-scatter" style="height: 380px; width: 100%;"></div>
|
||
</div>
|
||
|
||
<div class="card" style="margin-bottom: 0;">
|
||
<div class="card-title">
|
||
<span>🧩 سهم حوزههای فنی از وظایف</span>
|
||
<span style="font-size: 11.5px; color: #64748B;">توزیع در ۴ حوزه تخصصی مهندسی</span>
|
||
</div>
|
||
<div id="chart-layers-donut" style="height: 380px; width: 100%;"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Bottom Charts Grid -->
|
||
<div class="bottom-charts-grid">
|
||
<div class="card" style="margin-bottom: 0;">
|
||
<div class="card-title">
|
||
<span>⏱ تخصیص زمان دولوپرها در فازهای اسپرینت (ساعت کاری)</span>
|
||
<span id="chart-sprint-sub" style="font-size: 11.5px; color: #64748B;">مجموع: ۲۱.۵ ساعت</span>
|
||
</div>
|
||
<div id="chart-sprint-hours" style="height: 290px; width: 100%;"></div>
|
||
</div>
|
||
|
||
<div class="card" style="margin-bottom: 0;">
|
||
<div class="card-title">
|
||
<span>📈 مدل رشد کلیک و نرخ CTR اورگانیک (پیش و پس از اصلاحات)</span>
|
||
<span style="font-size: 11.5px; color: #64748B;">بر مبنای ۳۹,۴۶۱ ایمپرشن ماهانه</span>
|
||
</div>
|
||
<div id="chart-ctr-projection" style="height: 290px; width: 100%;"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- RICE Detailed Ranking Table -->
|
||
<div class="card">
|
||
<div class="card-title">
|
||
<span id="table-rice-title">🏆 جدول رتبهبندی دقیق RICE به تفکیک اقدامات</span>
|
||
<div style="display: flex; gap: 8px;">
|
||
<input type="text" id="rice-search" placeholder="فیلتر تسک..." style="padding: 6px 12px; border: 1px solid #CBD5E1; border-radius: 8px; font-size: 12px; width: 180px;" oninput="filterRiceTable()" />
|
||
<button class="btn-action" style="padding: 6px 14px; font-size: 11.5px;" onclick="exportTasksToCSV()">خروجی اکسل 📥</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="table-wrap">
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>رتبه</th>
|
||
<th>شناسه</th>
|
||
<th>وضعیت</th>
|
||
<th>عنوان اقدام</th>
|
||
<th>لایه فنی</th>
|
||
<th>Reach</th>
|
||
<th>Impact</th>
|
||
<th>Confidence</th>
|
||
<th>Effort</th>
|
||
<th>امتیاز نهایی RICE</th>
|
||
<th>اولویت</th>
|
||
<th>عملیات</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="rice-tbody">
|
||
<!-- Rendered by JS -->
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</main>
|
||
|
||
|
||
<!-- Task Detail Drawer -->
|
||
<div id="drawer-overlay" class="drawer-overlay" onclick="closeTaskDrawer()"></div>
|
||
<div id="task-drawer" class="drawer">
|
||
<div class="drawer-header">
|
||
<div style="display: flex; align-items: center; gap: 8px;">
|
||
<span id="drawer-badge-p" class="badge"></span>
|
||
<span id="drawer-badge-sprint" class="badge" style="background:#F1F5F9; color:#475569;"></span>
|
||
<span id="drawer-id" class="tnum" style="font-weight: 800; font-size: 14px; color: #0F172A;"></span>
|
||
</div>
|
||
<button onclick="closeTaskDrawer()" style="background: none; border: none; font-size: 20px; cursor: pointer; color: #64748B;">✕</button>
|
||
</div>
|
||
<div class="drawer-body">
|
||
<h2 id="drawer-title" style="font-size: 16px; font-weight: 800; color: #0F172A; margin-bottom: 12px; line-height: 1.5;"></h2>
|
||
|
||
<div style="background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 10px; padding: 12px; margin-bottom: 16px; font-size: 12.5px;">
|
||
<div style="display: flex; justify-content: space-between; margin-bottom: 6px;">
|
||
<span style="color: #64748B;">فایل هدف و خطوط:</span>
|
||
<span id="drawer-file" class="font-mono tnum" style="font-weight: 700; color: #2563EB;"></span>
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; margin-bottom: 6px;">
|
||
<span style="color: #64748B;">زمان تخمینی دولوپر:</span>
|
||
<span id="drawer-hours" class="tnum" style="font-weight: 700; color: #0F172A;"></span>
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; margin-bottom: 6px;">
|
||
<span style="color: #64748B;">امتیاز و مؤلفههای RICE:</span>
|
||
<span id="drawer-rice" class="tnum" style="font-weight: 800; color: #059669;"></span>
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<span style="color: #64748B;">ستون نظارتی C-Level:</span>
|
||
<span id="drawer-pillar" style="font-weight: 700; color: #4F46E5;"></span>
|
||
</div>
|
||
</div>
|
||
|
||
<div style="margin-bottom: 16px;">
|
||
<div style="font-size: 12.5px; font-weight: 700; color: #0F172A; margin-bottom: 6px;">🎯 اثر بیزینسی و شاخص هدف:</div>
|
||
<div id="drawer-impact" style="font-size: 12px; color: #334155; line-height: 1.6; background: #ECFDF5; border: 1px solid #A7F3D0; padding: 10px; border-radius: 8px;"></div>
|
||
</div>
|
||
|
||
<div style="margin-bottom: 16px;">
|
||
<div style="font-size: 12.5px; font-weight: 700; color: #0F172A; margin-bottom: 6px;">🔍 تحلیل ریشهای علت باگ (Root-Cause):</div>
|
||
<div id="drawer-root-cause" style="font-size: 12px; color: #334155; line-height: 1.6; background: #FFFBEB; border: 1px solid #FDE68A; padding: 10px; border-radius: 8px;"></div>
|
||
</div>
|
||
|
||
<div style="margin-bottom: 16px;">
|
||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;">
|
||
<span style="font-size: 12.5px; font-weight: 700; color: #DC2626;">❌ سورسکد باگدار فعلی:</span>
|
||
<button class="btn-copy" onclick="copyCode('drawer-buggy-code')">کپی سورس</button>
|
||
</div>
|
||
<pre class="code-block"><code id="drawer-buggy-code"></code></pre>
|
||
</div>
|
||
|
||
<div style="margin-bottom: 16px;">
|
||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;">
|
||
<span style="font-size: 12.5px; font-weight: 700; color: #16A34A;">✅ سورسکد اصلاحشده پیشنهادی:</span>
|
||
<button class="btn-copy" onclick="copyCode('drawer-fixed-code')">کپی راهحل</button>
|
||
</div>
|
||
<pre class="code-block"><code id="drawer-fixed-code"></code></pre>
|
||
</div>
|
||
|
||
<div style="margin-bottom: 24px;">
|
||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;">
|
||
<span style="font-size: 12.5px; font-weight: 700; color: #0F172A;">⚡ دستور تست زنده در ترمینال (Verification cURL):</span>
|
||
<button class="btn-copy" onclick="copyCode('drawer-test-command')">کپی دستور</button>
|
||
</div>
|
||
<pre class="code-block" style="background: #090D16;"><code id="drawer-test-command" style="color: #38BDF8;"></code></pre>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<script>
|
||
|
||
let activeTask = null;
|
||
|
||
function openTaskDrawer(taskId) {
|
||
const tasks = window.bundle?.tasks || [];
|
||
const task = tasks.find(t => t.id === taskId);
|
||
if (!task) return;
|
||
activeTask = task;
|
||
|
||
document.getElementById('drawer-id').innerText = task.id;
|
||
document.getElementById('drawer-title').innerText = task.title;
|
||
document.getElementById('drawer-file').innerText = `${task.file_path} (${task.lines})`;
|
||
document.getElementById('drawer-hours').innerText = `${task.hours} ساعت کاری`;
|
||
document.getElementById('drawer-rice').innerText = `${task.rice.score.toLocaleString('fa-IR')} (R:${task.rice.reach.toLocaleString('fa-IR')} | I:${task.rice.impact} | C:${task.rice.confidence} | E:${task.rice.effort})`;
|
||
document.getElementById('drawer-pillar').innerText = task.c_level_pillar || 'C-Suite Council';
|
||
document.getElementById('drawer-impact').innerText = task.business_impact;
|
||
document.getElementById('drawer-root-cause').innerText = task.root_cause_analysis || 'تحلیل فنی در ممیزی ۵ لایه تایید شده است.';
|
||
document.getElementById('drawer-buggy-code').innerText = task.buggy_code;
|
||
document.getElementById('drawer-fixed-code').innerText = task.fixed_code;
|
||
document.getElementById('drawer-test-command').innerText = task.test_command;
|
||
document.getElementById('drawer-badge-sprint').innerText = task.sprint;
|
||
|
||
const pBadge = document.getElementById('drawer-badge-p');
|
||
pBadge.className = `badge ${task.priority === 'P0' ? 'badge-p0' : (task.priority === 'P1' ? 'badge-p1' : 'badge-p2')}`;
|
||
pBadge.innerText = task.priority;
|
||
|
||
document.getElementById('task-drawer').classList.add('open');
|
||
document.getElementById('drawer-overlay').classList.add('open');
|
||
}
|
||
|
||
function closeTaskDrawer() {
|
||
document.getElementById('task-drawer').classList.remove('open');
|
||
document.getElementById('drawer-overlay').classList.remove('open');
|
||
}
|
||
|
||
function copyCode(elementId) {
|
||
const text = document.getElementById(elementId).innerText;
|
||
navigator.clipboard.writeText(text).then(() => {
|
||
alert('دستور / کد در حافظه کپی شد!');
|
||
});
|
||
}
|
||
|
||
function exportTasksToCSV() {
|
||
const tasks = window.bundle?.tasks || [];
|
||
if (!tasks.length) return;
|
||
|
||
let csv = '\\uFEFF';
|
||
csv += 'شناسه,وضعیت بحرانی,عنوان اقدام,لایه فنی,فاز اسپرینت,اولویت,زمان دولوپر (ساعت),Reach,Impact,Confidence,Effort,امتیاز RICE,ستون C-Level,مسیر فایل,خطوط,اثر بیزینسی,دستور تست\\n';
|
||
|
||
tasks.forEach(t => {
|
||
const isCrit = t.is_critical ? 'بحرانی P0/P1' : 'توسعه و استانداردسازی';
|
||
const cleanTitle = `"${(t.title || '').replace(/"/g, '""')}"`;
|
||
const cleanImpact = `"${(t.business_impact || '').replace(/"/g, '""')}"`;
|
||
const cleanTest = `"${(t.test_command || '').replace(/"/g, '""')}"`;
|
||
csv += `${t.id},${isCrit},${cleanTitle},${t.layer_title},${t.sprint},${t.priority},${t.hours},${t.rice.reach},${t.rice.impact},${t.rice.confidence},${t.rice.effort},${t.rice.score},${t.c_level_pillar || ''},${t.file_path},"${t.lines}",${cleanImpact},${cleanTest}\\n`;
|
||
});
|
||
|
||
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
||
const url = URL.createObjectURL(blob);
|
||
const link = document.createElement('a');
|
||
link.setAttribute('href', url);
|
||
link.setAttribute('download', `ekeepa_seo_all_22_tasks_${new Date().toISOString().slice(0,10)}.csv`);
|
||
document.body.appendChild(link);
|
||
link.click();
|
||
document.body.removeChild(link);
|
||
}
|
||
|
||
|
||
let currentScope = 'critical';
|
||
|
||
const positionMap = {
|
||
'SEO-08': 'top center',
|
||
'SEO-01': 'top left',
|
||
'SEO-02': 'bottom right',
|
||
'SEO-07': 'top right',
|
||
'SEO-04': 'bottom left',
|
||
'SEO-03': 'bottom center',
|
||
'SEO-06': 'top right',
|
||
'SEO-05': 'top center',
|
||
'SEO-09': 'bottom center',
|
||
'SEO-11': 'bottom right',
|
||
'SEO-12': 'top center',
|
||
'SEO-10': 'top center',
|
||
'SEO-13': 'top right',
|
||
'SEO-14': 'bottom right',
|
||
'SEO-15': 'top left',
|
||
'SEO-16': 'bottom left',
|
||
'SEO-17': 'top center',
|
||
'SEO-18': 'bottom right',
|
||
'SEO-19': 'top left',
|
||
'SEO-20': 'bottom center',
|
||
'SEO-21': 'top right',
|
||
'SEO-22': 'bottom left'
|
||
};
|
||
|
||
function setScope(scope) {
|
||
currentScope = scope;
|
||
document.getElementById('btn-scope-critical').className = `btn-scope ${scope === 'critical' ? 'active' : ''}`;
|
||
document.getElementById('btn-scope-all').className = `btn-scope ${scope === 'all' ? 'active' : ''}`;
|
||
|
||
const allTasks = window.bundle?.tasks || [];
|
||
const critTasks = allTasks.filter(t => t.is_critical);
|
||
const activeTasks = scope === 'critical' ? critTasks : allTasks;
|
||
const totalH = activeTasks.reduce((acc, t) => acc + t.hours, 0).toFixed(1);
|
||
|
||
document.getElementById('kpi-hours').innerText = `${totalH} ساعت`;
|
||
document.getElementById('kpi-hours-sub').innerText = scope === 'critical' ? '۱۲ اقدام بحرانی' : 'کل ۲۲ اقدام مهندسی';
|
||
document.getElementById('chart-sprint-sub').innerText = `مجموع: ${totalH} ساعت`;
|
||
document.getElementById('scope-status-text').innerText = scope === 'critical'
|
||
? `نمایش ۱۲ تسک بحرانی (P0/P1) با ${totalH} ساعت دولوپر`
|
||
: `نمایش کل ۲۲ تسک مهندسی با ${totalH} ساعت دولوپر`;
|
||
|
||
renderAllChartsAndTable();
|
||
}
|
||
|
||
function renderAllChartsAndTable() {
|
||
const allTasks = window.bundle?.tasks || [];
|
||
const tasks = currentScope === 'critical' ? allTasks.filter(t => t.is_critical) : allTasks;
|
||
const sortedTasks = [...tasks].sort((a, b) => b.rice.score - a.rice.score);
|
||
|
||
// 1. Scatter Plot
|
||
if (typeof Plotly !== 'undefined') {
|
||
try {
|
||
const scatterTrace = {
|
||
x: sortedTasks.map(t => t.hours),
|
||
y: sortedTasks.map(t => t.rice.reach),
|
||
text: sortedTasks.map(t => t.id),
|
||
customdata: sortedTasks.map(t => `${t.title} (امتیاز: ${t.rice.score.toLocaleString('fa-IR')})`),
|
||
mode: 'markers+text',
|
||
textposition: sortedTasks.map(t => positionMap[t.id] || 'top center'),
|
||
textfont: { family: 'Vazirmatn', size: 10.5, color: '#0F172A' },
|
||
cliponaxis: false,
|
||
hovertemplate: '<b>%{text}</b>: %{customdata}<br>زمان دولوپر: %{x} ساعت<br>پوشش خزش: %{y:,.0f}<extra></extra>',
|
||
marker: {
|
||
size: sortedTasks.map(t => Math.max(14, Math.sqrt(t.rice.score) / 16)),
|
||
color: sortedTasks.map(t => t.priority === 'P0' ? '#E11D48' : (t.priority === 'P1' ? '#D97706' : '#2563EB')),
|
||
opacity: 0.88,
|
||
line: { color: '#FFFFFF', width: 2 }
|
||
}
|
||
};
|
||
Plotly.newPlot('chart-rice-scatter', [scatterTrace], {
|
||
margin: { l: 60, r: 20, t: 20, b: 60 },
|
||
paper_bgcolor: '#FFFFFF',
|
||
plot_bgcolor: '#FFFFFF',
|
||
xaxis: { title: 'تخمین ساعت مهندسی دولوپر (Effort)', gridcolor: '#F1F5F9', zeroline: false },
|
||
yaxis: { title: 'ایمپکت و پوشش خزش (Reach)', gridcolor: '#F1F5F9', zeroline: false },
|
||
font: { family: 'Vazirmatn', size: 11 }
|
||
}, { responsive: true, displayModeBar: false });
|
||
|
||
// 2. Donut
|
||
const layerCounts = {};
|
||
tasks.forEach(t => layerCounts[t.layer_title] = (layerCounts[t.layer_title] || 0) + 1);
|
||
Plotly.newPlot('chart-layers-donut', [{
|
||
labels: Object.keys(layerCounts),
|
||
values: Object.values(layerCounts),
|
||
type: 'pie',
|
||
hole: 0.55,
|
||
marker: { colors: ['#4F46E5', '#059669', '#EA580C', '#16A34A', '#D97706'] },
|
||
textinfo: 'percent',
|
||
textposition: 'inside',
|
||
insidetextorientation: 'radial',
|
||
hovertemplate: '<b>%{label}</b><br>تعداد تسک: %{value}<br>سهم: %{percent}<extra></extra>'
|
||
}], {
|
||
margin: { l: 10, r: 10, t: 10, b: 10 },
|
||
paper_bgcolor: '#FFFFFF',
|
||
showlegend: true,
|
||
legend: { orientation: 'h', y: -0.15, font: { family: 'Vazirmatn', size: 10.5 } },
|
||
font: { family: 'Vazirmatn', size: 11 }
|
||
}, { responsive: true, displayModeBar: false });
|
||
|
||
// 3. Sprint Hours
|
||
const sprintMap = { 'Sprint 0': 0, 'Sprint 1': 0, 'Sprint 2': 0, 'Sprint 3': 0 };
|
||
tasks.forEach(t => sprintMap[t.sprint] = (sprintMap[t.sprint] || 0) + t.hours);
|
||
Plotly.newPlot('chart-sprint-hours', [{
|
||
x: Object.keys(sprintMap),
|
||
y: Object.values(sprintMap),
|
||
type: 'bar',
|
||
marker: { color: ['#E11D48', '#D97706', '#2563EB', '#7C3AED'] },
|
||
text: Object.values(sprintMap).map(v => `${v.toFixed(1)} ساعت`),
|
||
textposition: 'auto',
|
||
textfont: { family: 'Vazirmatn', size: 11, color: '#FFFFFF' }
|
||
}], {
|
||
margin: { l: 40, r: 20, t: 20, b: 40 },
|
||
paper_bgcolor: '#FFFFFF',
|
||
plot_bgcolor: '#FFFFFF',
|
||
xaxis: { gridcolor: '#F1F5F9' },
|
||
yaxis: { title: 'ساعت مهندسی', gridcolor: '#F1F5F9' },
|
||
font: { family: 'Vazirmatn', size: 11 }
|
||
}, { responsive: true, displayModeBar: false });
|
||
|
||
// 4. CTR Projection
|
||
Plotly.newPlot('chart-ctr-projection', [{
|
||
x: ['وضعیت زنده', 'اسپرینت ۰ (فوری)', 'اسپرینت ۱ (اسکیما)', 'اسپرینت ۳ (مقیاس)'],
|
||
y: [0.66, 1.20, 2.85, 3.80],
|
||
type: 'scatter',
|
||
mode: 'lines+markers+text',
|
||
line: { color: '#059669', width: 3, shape: 'spline' },
|
||
marker: { size: 8, color: '#059669' },
|
||
text: ['۰.۶۶٪ (فعلی)', '۱.۲۰٪', '۲.۸۵٪', '۳.۸۰٪ (هدف)'],
|
||
textposition: 'top center',
|
||
textfont: { family: 'Vazirmatn', size: 11 }
|
||
}], {
|
||
margin: { l: 40, r: 20, t: 30, b: 40 },
|
||
paper_bgcolor: '#FFFFFF',
|
||
plot_bgcolor: '#FFFFFF',
|
||
xaxis: { gridcolor: '#F1F5F9' },
|
||
yaxis: { title: 'نرخ کلیک CTR (درصد)', gridcolor: '#F1F5F9', range: [0, 4.5] },
|
||
font: { family: 'Vazirmatn', size: 11 }
|
||
}, { responsive: true, displayModeBar: false });
|
||
} catch(e) {
|
||
console.error(e);
|
||
}
|
||
}
|
||
|
||
// 5. Render Table
|
||
renderRiceTable(sortedTasks);
|
||
}
|
||
|
||
function renderRiceTable(tasksList) {
|
||
const tbody = document.getElementById('rice-tbody');
|
||
tbody.innerHTML = '';
|
||
|
||
tasksList.forEach((t, idx) => {
|
||
const tr = document.createElement('tr');
|
||
tr.onclick = () => openTaskDrawer(t.id);
|
||
|
||
let pClass = t.priority === 'P0' ? 'badge-p0' : (t.priority === 'P1' ? 'badge-p1' : (t.priority === 'P2' ? 'badge-p2' : 'badge-p3'));
|
||
const critBadge = t.is_critical ? '<span class="badge-crit">🔥 بحرانی</span>' : '<span class="badge-ext">⚙️ تکمیلی</span>';
|
||
|
||
tr.innerHTML = `
|
||
<td class="tnum font-bold">${idx + 1}</td>
|
||
<td class="tnum font-bold" style="color: #0F172A;">${t.id}</td>
|
||
<td>${critBadge}</td>
|
||
<td style="font-weight: 700;">${t.title}</td>
|
||
<td><span class="badge badge-${t.layer}">${t.layer_title}</span></td>
|
||
<td class="tnum">${t.rice.reach.toLocaleString('fa-IR')}</td>
|
||
<td class="tnum font-bold">${t.rice.impact}</td>
|
||
<td class="tnum">${t.rice.confidence}</td>
|
||
<td class="tnum">${t.rice.effort}h</td>
|
||
<td class="tnum font-bold" style="color: #059669; font-size: 13px;">${t.rice.score.toLocaleString('fa-IR')}</td>
|
||
<td><span class="badge ${pClass}">${t.priority}</span></td>
|
||
<td>
|
||
<button class="btn-outline" onclick="event.stopPropagation(); openTaskDrawer('${t.id}')">
|
||
دیف کد ↗
|
||
</button>
|
||
</td>
|
||
`;
|
||
tbody.appendChild(tr);
|
||
});
|
||
|
||
document.getElementById('table-rice-title').innerText = currentScope === 'critical'
|
||
? `🏆 جدول رتبهبندی RICE ۱۲ اقدام بحرانی (نمایش ${tasksList.length} مورد)`
|
||
: `🏆 جدول رتبهبندی RICE کل ۲۲ اقدام مهندسی (نمایش ${tasksList.length} مورد)`;
|
||
}
|
||
|
||
function filterRiceTable() {
|
||
const q = document.getElementById('rice-search').value.toLowerCase();
|
||
const allTasks = window.bundle?.tasks || [];
|
||
const scopeTasks = currentScope === 'critical' ? allTasks.filter(t => t.is_critical) : allTasks;
|
||
const sorted = [...scopeTasks].sort((a, b) => b.rice.score - a.rice.score);
|
||
|
||
const filtered = sorted.filter(t => {
|
||
return t.title.toLowerCase().includes(q) || t.id.toLowerCase().includes(q);
|
||
});
|
||
|
||
renderRiceTable(filtered);
|
||
}
|
||
|
||
document.addEventListener('DOMContentLoaded', () => {
|
||
renderAllChartsAndTable();
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|