Spaces:
Running
Running
up
Browse files- app.py +7 -0
- dashboard.html +1 -1
- index.html +9 -9
- js/analytics.js +1 -1
- js/cleaning.js +1 -1
- js/dashboard.js +1 -1
- js/data.js +1 -1
- js/history.js +2 -2
- js/shared.js +9 -9
- js/tweets.js +1 -1
- js/upload.js +2 -2
app.py
CHANGED
|
@@ -122,8 +122,15 @@ def serve_index():
|
|
| 122 |
|
| 123 |
@app.route('/<path:path>')
|
| 124 |
def serve_static(path):
|
|
|
|
| 125 |
if os.path.isfile(path):
|
| 126 |
return send_from_directory('.', path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
return send_from_directory('.', 'index.html')
|
| 128 |
|
| 129 |
|
|
|
|
| 122 |
|
| 123 |
@app.route('/<path:path>')
|
| 124 |
def serve_static(path):
|
| 125 |
+
# Try the exact path first
|
| 126 |
if os.path.isfile(path):
|
| 127 |
return send_from_directory('.', path)
|
| 128 |
+
|
| 129 |
+
# Try adding .html
|
| 130 |
+
html_path = path + ".html"
|
| 131 |
+
if os.path.isfile(html_path):
|
| 132 |
+
return send_from_directory('.', html_path)
|
| 133 |
+
|
| 134 |
return send_from_directory('.', 'index.html')
|
| 135 |
|
| 136 |
|
dashboard.html
CHANGED
|
@@ -23,7 +23,7 @@
|
|
| 23 |
<div class="sec-head" style="margin-bottom:14px">
|
| 24 |
<div><div class="sec-title">Ringkasan Analisis</div><div class="sec-sub" id="datePeriod"></div></div>
|
| 25 |
<div class="actions">
|
| 26 |
-
<button class="btn btn-ghost btn-sm" onclick="location.href='upload
|
| 27 |
</div>
|
| 28 |
</div>
|
| 29 |
<div class="kpi-grid" id="kpiGrid"></div>
|
|
|
|
| 23 |
<div class="sec-head" style="margin-bottom:14px">
|
| 24 |
<div><div class="sec-title">Ringkasan Analisis</div><div class="sec-sub" id="datePeriod"></div></div>
|
| 25 |
<div class="actions">
|
| 26 |
+
<button class="btn btn-ghost btn-sm" onclick="location.href='upload'">Upload Baru</button>
|
| 27 |
</div>
|
| 28 |
</div>
|
| 29 |
<div class="kpi-grid" id="kpiGrid"></div>
|
index.html
CHANGED
|
@@ -44,7 +44,7 @@
|
|
| 44 |
<span><strong>Mohon Maaf:</strong> Model machine learning IndoBERT saat ini masih dalam tahap pengembangan, sehingga hasil prediksi mungkin belum sepenuhnya akurat dan terkadang terjadi kesalahan klasifikasi.</span>
|
| 45 |
</div>
|
| 46 |
<div class="ih-hero-btns reveal-up" style="--d:300ms">
|
| 47 |
-
<a href="upload
|
| 48 |
<a href="#cara-pakai" class="btn btn-ghost" id="learnMoreBtn">Pelajari cara pakai β</a>
|
| 49 |
</div>
|
| 50 |
<div class="ih-stats reveal-up" style="--d:420ms">
|
|
@@ -76,14 +76,14 @@
|
|
| 76 |
<h3>Upload File CSV</h3>
|
| 77 |
<p>Seret & lepas file CSV ke halaman <strong>Upload Data</strong>. Mendukung file sangat besar (1GB+) dan
|
| 78 |
banyak file sekaligus.</p>
|
| 79 |
-
<a href="upload
|
| 80 |
</div>
|
| 81 |
<div class="ih-step-chevron">βΊ</div>
|
| 82 |
<div class="ih-step">
|
| 83 |
<div class="ih-step-num purple">03</div>
|
| 84 |
<h3>Analisis Mendalam</h3>
|
| 85 |
<p>Jelajahi berbagai visualisasi: Dashboard, Analytics, Tabel Data, dan Cleaning Lab yang interaktif.</p>
|
| 86 |
-
<a href="dashboard
|
| 87 |
</div>
|
| 88 |
</div>
|
| 89 |
</section>
|
|
@@ -146,7 +146,7 @@
|
|
| 146 |
<li>Hapus data sekali klik</li>
|
| 147 |
<li>Keamanan data enkripsi</li>
|
| 148 |
</ul>
|
| 149 |
-
<a href="history
|
| 150 |
</div>
|
| 151 |
<div class="ih-feat reveal-up" style="--d:60ms">
|
| 152 |
<h3>Dashboard Visual</h3>
|
|
@@ -157,7 +157,7 @@
|
|
| 157 |
<li>Time-series sentiment</li>
|
| 158 |
<li>Visualisasi per-kategori</li>
|
| 159 |
</ul>
|
| 160 |
-
<a href="dashboard
|
| 161 |
</div>
|
| 162 |
<div class="ih-feat reveal-up" style="--d:120ms">
|
| 163 |
<h3>Analytics</h3>
|
|
@@ -168,7 +168,7 @@
|
|
| 168 |
<li>Confidence histogram</li>
|
| 169 |
<li>Radar engagement per sentimen</li>
|
| 170 |
</ul>
|
| 171 |
-
<a href="analytics
|
| 172 |
</div>
|
| 173 |
<div class="ih-feat reveal-up" style="--d:180ms">
|
| 174 |
<h3>Data & Tabel</h3>
|
|
@@ -179,7 +179,7 @@
|
|
| 179 |
<li>Pagination cepat</li>
|
| 180 |
<li>Export hasil ke JSON</li>
|
| 181 |
</ul>
|
| 182 |
-
<a href="data
|
| 183 |
</div>
|
| 184 |
<div class="ih-feat reveal-up" style="--d:240ms">
|
| 185 |
<h3>Cleaning Lab</h3>
|
|
@@ -191,7 +191,7 @@
|
|
| 191 |
<li>Statistik kata dihapus</li>
|
| 192 |
<li>Distribusi sebelum/sesudah</li>
|
| 193 |
</ul>
|
| 194 |
-
<a href="cleaning
|
| 195 |
</div>
|
| 196 |
</div>
|
| 197 |
</section>
|
|
@@ -234,7 +234,7 @@
|
|
| 234 |
<p>Dapatkan data di XScraper, lalu upload ke SentiMeter dan mulai eksplorasi insight mendalam.</p>
|
| 235 |
<div class="ih-cta-box-btns">
|
| 236 |
<a href="https://xscraper.fwh.is" target="_blank" rel="noopener" class="btn btn-ghost">Ke XScraper</a>
|
| 237 |
-
<a href="upload
|
| 238 |
</div>
|
| 239 |
</div>
|
| 240 |
</section>
|
|
|
|
| 44 |
<span><strong>Mohon Maaf:</strong> Model machine learning IndoBERT saat ini masih dalam tahap pengembangan, sehingga hasil prediksi mungkin belum sepenuhnya akurat dan terkadang terjadi kesalahan klasifikasi.</span>
|
| 45 |
</div>
|
| 46 |
<div class="ih-hero-btns reveal-up" style="--d:300ms">
|
| 47 |
+
<a href="upload" class="btn btn-primary">Mulai Analisis</a>
|
| 48 |
<a href="#cara-pakai" class="btn btn-ghost" id="learnMoreBtn">Pelajari cara pakai β</a>
|
| 49 |
</div>
|
| 50 |
<div class="ih-stats reveal-up" style="--d:420ms">
|
|
|
|
| 76 |
<h3>Upload File CSV</h3>
|
| 77 |
<p>Seret & lepas file CSV ke halaman <strong>Upload Data</strong>. Mendukung file sangat besar (1GB+) dan
|
| 78 |
banyak file sekaligus.</p>
|
| 79 |
+
<a href="upload" class="ih-step-link">Upload Sekarang β</a>
|
| 80 |
</div>
|
| 81 |
<div class="ih-step-chevron">βΊ</div>
|
| 82 |
<div class="ih-step">
|
| 83 |
<div class="ih-step-num purple">03</div>
|
| 84 |
<h3>Analisis Mendalam</h3>
|
| 85 |
<p>Jelajahi berbagai visualisasi: Dashboard, Analytics, Tabel Data, dan Cleaning Lab yang interaktif.</p>
|
| 86 |
+
<a href="dashboard" class="ih-step-link">Mulai Eksplorasi β</a>
|
| 87 |
</div>
|
| 88 |
</div>
|
| 89 |
</section>
|
|
|
|
| 146 |
<li>Hapus data sekali klik</li>
|
| 147 |
<li>Keamanan data enkripsi</li>
|
| 148 |
</ul>
|
| 149 |
+
<a href="history" class="ih-feat-link">Buka Riwayat β</a>
|
| 150 |
</div>
|
| 151 |
<div class="ih-feat reveal-up" style="--d:60ms">
|
| 152 |
<h3>Dashboard Visual</h3>
|
|
|
|
| 157 |
<li>Time-series sentiment</li>
|
| 158 |
<li>Visualisasi per-kategori</li>
|
| 159 |
</ul>
|
| 160 |
+
<a href="dashboard" class="ih-feat-link">Buka Dashboard β</a>
|
| 161 |
</div>
|
| 162 |
<div class="ih-feat reveal-up" style="--d:120ms">
|
| 163 |
<h3>Analytics</h3>
|
|
|
|
| 168 |
<li>Confidence histogram</li>
|
| 169 |
<li>Radar engagement per sentimen</li>
|
| 170 |
</ul>
|
| 171 |
+
<a href="analytics" class="ih-feat-link">Buka Analytics β</a>
|
| 172 |
</div>
|
| 173 |
<div class="ih-feat reveal-up" style="--d:180ms">
|
| 174 |
<h3>Data & Tabel</h3>
|
|
|
|
| 179 |
<li>Pagination cepat</li>
|
| 180 |
<li>Export hasil ke JSON</li>
|
| 181 |
</ul>
|
| 182 |
+
<a href="data" class="ih-feat-link">Buka Tabel β</a>
|
| 183 |
</div>
|
| 184 |
<div class="ih-feat reveal-up" style="--d:240ms">
|
| 185 |
<h3>Cleaning Lab</h3>
|
|
|
|
| 191 |
<li>Statistik kata dihapus</li>
|
| 192 |
<li>Distribusi sebelum/sesudah</li>
|
| 193 |
</ul>
|
| 194 |
+
<a href="cleaning" class="ih-feat-link">Buka Lab β</a>
|
| 195 |
</div>
|
| 196 |
</div>
|
| 197 |
</section>
|
|
|
|
| 234 |
<p>Dapatkan data di XScraper, lalu upload ke SentiMeter dan mulai eksplorasi insight mendalam.</p>
|
| 235 |
<div class="ih-cta-box-btns">
|
| 236 |
<a href="https://xscraper.fwh.is" target="_blank" rel="noopener" class="btn btn-ghost">Ke XScraper</a>
|
| 237 |
+
<a href="upload" class="btn btn-primary">Mulai Upload Data</a>
|
| 238 |
</div>
|
| 239 |
</div>
|
| 240 |
</section>
|
js/analytics.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
// ββ Guard: stop cleanly if no data ββ
|
| 4 |
const _store = SM.loadData();
|
| 5 |
if (!_store) {
|
| 6 |
-
window.location.replace('upload
|
| 7 |
throw new Error('No data β redirecting');
|
| 8 |
}
|
| 9 |
|
|
|
|
| 3 |
// ββ Guard: stop cleanly if no data ββ
|
| 4 |
const _store = SM.loadData();
|
| 5 |
if (!_store) {
|
| 6 |
+
window.location.replace('upload');
|
| 7 |
throw new Error('No data β redirecting');
|
| 8 |
}
|
| 9 |
|
js/cleaning.js
CHANGED
|
@@ -4,7 +4,7 @@ SM.setChartDefaults();
|
|
| 4 |
|
| 5 |
const store = SM.loadData();
|
| 6 |
if (!store) {
|
| 7 |
-
window.location.replace('upload
|
| 8 |
throw new Error('No data β redirecting to upload');
|
| 9 |
}
|
| 10 |
const { rows, meta } = store;
|
|
|
|
| 4 |
|
| 5 |
const store = SM.loadData();
|
| 6 |
if (!store) {
|
| 7 |
+
window.location.replace('upload');
|
| 8 |
throw new Error('No data β redirecting to upload');
|
| 9 |
}
|
| 10 |
const { rows, meta } = store;
|
js/dashboard.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
// ββ Guard BEFORE DOM ββ
|
| 4 |
const _store = SM.loadData();
|
| 5 |
if (!_store) {
|
| 6 |
-
window.location.replace('upload
|
| 7 |
throw new Error('No data β redirecting');
|
| 8 |
}
|
| 9 |
|
|
|
|
| 3 |
// ββ Guard BEFORE DOM ββ
|
| 4 |
const _store = SM.loadData();
|
| 5 |
if (!_store) {
|
| 6 |
+
window.location.replace('upload');
|
| 7 |
throw new Error('No data β redirecting');
|
| 8 |
}
|
| 9 |
|
js/data.js
CHANGED
|
@@ -3,7 +3,7 @@ SM.injectLayout('nav-data');
|
|
| 3 |
|
| 4 |
const store = SM.loadData();
|
| 5 |
if (!store) {
|
| 6 |
-
window.location.replace('upload
|
| 7 |
throw new Error('No data β redirecting to upload');
|
| 8 |
}
|
| 9 |
const { rows, meta } = store;
|
|
|
|
| 3 |
|
| 4 |
const store = SM.loadData();
|
| 5 |
if (!store) {
|
| 6 |
+
window.location.replace('upload');
|
| 7 |
throw new Error('No data β redirecting to upload');
|
| 8 |
}
|
| 9 |
const { rows, meta } = store;
|
js/history.js
CHANGED
|
@@ -21,7 +21,7 @@ function renderHistory() {
|
|
| 21 |
<div class="history-empty reveal-up" style="--d:100ms">
|
| 22 |
<h3>Belum Ada Riwayat Analisis</h3>
|
| 23 |
<p>Log aktivitas analisis Anda akan muncul di sini. Silakan mulai dengan mengunggah dan memproses file CSV pertama Anda.</p>
|
| 24 |
-
<a href="upload
|
| 25 |
</div>
|
| 26 |
`;
|
| 27 |
return;
|
|
@@ -97,7 +97,7 @@ window.viewHistory = function(id) {
|
|
| 97 |
if (SM.loadHistoryItem(id)) {
|
| 98 |
SM.showToast('Data riwayat berhasil dimuat.');
|
| 99 |
setTimeout(() => {
|
| 100 |
-
window.location.href = 'dashboard
|
| 101 |
}, 500);
|
| 102 |
} else {
|
| 103 |
SM.showToast('Gagal memuat riwayat data.', 'error');
|
|
|
|
| 21 |
<div class="history-empty reveal-up" style="--d:100ms">
|
| 22 |
<h3>Belum Ada Riwayat Analisis</h3>
|
| 23 |
<p>Log aktivitas analisis Anda akan muncul di sini. Silakan mulai dengan mengunggah dan memproses file CSV pertama Anda.</p>
|
| 24 |
+
<a href="upload" class="btn btn-primary btn-lg empty-cta">Mulai Analisis Sekarang</a>
|
| 25 |
</div>
|
| 26 |
`;
|
| 27 |
return;
|
|
|
|
| 97 |
if (SM.loadHistoryItem(id)) {
|
| 98 |
SM.showToast('Data riwayat berhasil dimuat.');
|
| 99 |
setTimeout(() => {
|
| 100 |
+
window.location.href = 'dashboard';
|
| 101 |
}, 500);
|
| 102 |
} else {
|
| 103 |
SM.showToast('Gagal memuat riwayat data.', 'error');
|
js/shared.js
CHANGED
|
@@ -384,15 +384,15 @@ const I = {
|
|
| 384 |
|
| 385 |
// βββ SIDEBAR INJECTOR βββββββββββββββββββββββββββββββ
|
| 386 |
const NAV_ITEMS = [
|
| 387 |
-
{ href:'
|
| 388 |
-
{ href:'upload
|
| 389 |
-
{ href:'dashboard
|
| 390 |
-
{ href:'analytics
|
| 391 |
-
{ href:'tweets
|
| 392 |
-
{ href:'data
|
| 393 |
-
{ href:'cleaning
|
| 394 |
-
{ href:'history
|
| 395 |
-
{ href:'support
|
| 396 |
];
|
| 397 |
|
| 398 |
function injectLayout(activePage) {
|
|
|
|
| 384 |
|
| 385 |
// βββ SIDEBAR INJECTOR βββββββββββββββββββββββββββββββ
|
| 386 |
const NAV_ITEMS = [
|
| 387 |
+
{ href:'/', label:'Pengenalan', id:'nav-intro', icon: I.intro, alwaysUnlocked: true },
|
| 388 |
+
{ href:'upload', label:'Upload Data', id:'nav-upload', icon: I.upload, alwaysUnlocked: true },
|
| 389 |
+
{ href:'dashboard', label:'Dashboard', id:'nav-dashboard', icon: I.dash },
|
| 390 |
+
{ href:'analytics', label:'Analytics', id:'nav-analytics', icon: I.chart },
|
| 391 |
+
{ href:'tweets', label:'Tweet List', id:'nav-tweets', icon: I.tweets },
|
| 392 |
+
{ href:'data', label:'Data & Tabel', id:'nav-data', icon: I.table },
|
| 393 |
+
{ href:'cleaning', label:'Cleaning Lab', id:'nav-cleaning', icon: I.lab },
|
| 394 |
+
{ href:'history', label:'Riwayat Analisis', id:'nav-history', icon: I.history, alwaysUnlocked: true },
|
| 395 |
+
{ href:'support', label:'Dukungan', id:'nav-support', icon: I.heart, alwaysUnlocked: true },
|
| 396 |
];
|
| 397 |
|
| 398 |
function injectLayout(activePage) {
|
js/tweets.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
const _store = SM.loadData();
|
| 4 |
if (!_store) {
|
| 5 |
-
window.location.replace('upload
|
| 6 |
throw new Error('No data β redirecting');
|
| 7 |
}
|
| 8 |
|
|
|
|
| 2 |
|
| 3 |
const _store = SM.loadData();
|
| 4 |
if (!_store) {
|
| 5 |
+
window.location.replace('upload');
|
| 6 |
throw new Error('No data β redirecting');
|
| 7 |
}
|
| 8 |
|
js/upload.js
CHANGED
|
@@ -131,7 +131,7 @@ document.getElementById('btnAnalyze').addEventListener('click', async () => {
|
|
| 131 |
</span>
|
| 132 |
`,
|
| 133 |
type: 'success',
|
| 134 |
-
onConfirm: () => { window.location.href = 'dashboard
|
| 135 |
});
|
| 136 |
}, 400);
|
| 137 |
|
|
@@ -206,7 +206,7 @@ if (btnDemo) {
|
|
| 206 |
title: 'Demo Selesai',
|
| 207 |
message: `Berhasil memproses <strong>${rows.length}</strong> tweet demo dengan model IndoBERT. Lihat hasilnya di dashboard!`,
|
| 208 |
type: 'success',
|
| 209 |
-
onConfirm: () => { window.location.href = 'dashboard
|
| 210 |
});
|
| 211 |
}, 400);
|
| 212 |
} catch (err) {
|
|
|
|
| 131 |
</span>
|
| 132 |
`,
|
| 133 |
type: 'success',
|
| 134 |
+
onConfirm: () => { window.location.href = 'dashboard'; }
|
| 135 |
});
|
| 136 |
}, 400);
|
| 137 |
|
|
|
|
| 206 |
title: 'Demo Selesai',
|
| 207 |
message: `Berhasil memproses <strong>${rows.length}</strong> tweet demo dengan model IndoBERT. Lihat hasilnya di dashboard!`,
|
| 208 |
type: 'success',
|
| 209 |
+
onConfirm: () => { window.location.href = 'dashboard'; }
|
| 210 |
});
|
| 211 |
}, 400);
|
| 212 |
} catch (err) {
|