rhmnsae commited on
Commit
3cc3895
Β·
1 Parent(s): a083d22
Files changed (11) hide show
  1. app.py +7 -0
  2. dashboard.html +1 -1
  3. index.html +9 -9
  4. js/analytics.js +1 -1
  5. js/cleaning.js +1 -1
  6. js/dashboard.js +1 -1
  7. js/data.js +1 -1
  8. js/history.js +2 -2
  9. js/shared.js +9 -9
  10. js/tweets.js +1 -1
  11. 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.html'">Upload Baru</button>
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.html" 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,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.html" 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.html" class="ih-step-link">Mulai Eksplorasi β†’</a>
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.html" 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,7 +157,7 @@
157
  <li>Time-series sentiment</li>
158
  <li>Visualisasi per-kategori</li>
159
  </ul>
160
- <a href="dashboard.html" class="ih-feat-link">Buka Dashboard β†’</a>
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.html" class="ih-feat-link">Buka Analytics β†’</a>
172
  </div>
173
  <div class="ih-feat reveal-up" style="--d:180ms">
174
  <h3>Data &amp; Tabel</h3>
@@ -179,7 +179,7 @@
179
  <li>Pagination cepat</li>
180
  <li>Export hasil ke JSON</li>
181
  </ul>
182
- <a href="data.html" 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,7 +191,7 @@
191
  <li>Statistik kata dihapus</li>
192
  <li>Distribusi sebelum/sesudah</li>
193
  </ul>
194
- <a href="cleaning.html" class="ih-feat-link">Buka Lab β†’</a>
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.html" class="btn btn-primary">Mulai Upload Data</a>
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 &amp; 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.html');
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.html');
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.html');
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.html');
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.html" class="btn btn-primary btn-lg empty-cta">Mulai Analisis Sekarang</a>
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.html';
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:'index.html', label:'Pengenalan', id:'nav-intro', icon: I.intro, alwaysUnlocked: true },
388
- { href:'upload.html', label:'Upload Data', id:'nav-upload', icon: I.upload, alwaysUnlocked: true },
389
- { href:'dashboard.html', label:'Dashboard', id:'nav-dashboard', icon: I.dash },
390
- { href:'analytics.html', label:'Analytics', id:'nav-analytics', icon: I.chart },
391
- { href:'tweets.html', label:'Tweet List', id:'nav-tweets', icon: I.tweets },
392
- { href:'data.html', label:'Data & Tabel', id:'nav-data', icon: I.table },
393
- { href:'cleaning.html', label:'Cleaning Lab', id:'nav-cleaning', icon: I.lab },
394
- { href:'history.html', label:'Riwayat Analisis', id:'nav-history', icon: I.history, alwaysUnlocked: true },
395
- { href:'support.html', label:'Dukungan', id:'nav-support', icon: I.heart, alwaysUnlocked: true },
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.html');
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.html'; }
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.html'; }
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) {