Spaces:
Running
Running
ark945 commited on
Commit ·
16c5a63
1
Parent(s): 67b82ab
feat: expand progress table width to 1.5x and add unit status counters
Browse filesFiles changed (3)
11 unmodified lines12131415161734 unmodified lines5253545556579 unmodified lines6768697071727325 unmodified lines9910010110210310410510610718 unmodified lines12612712812913013113213313413511 unmodified lines1. 登入 [Supabase Dashboard](https://supabase.com/dashboard/)。2. 點擊 **"New Project"**,選擇您的 Organization,並填寫專案名稱 (例如:`WordApp-Basic`)、設定資料庫密碼與區域。3. 建立後,請稍等 1-2 分鐘讓資料庫實例配置完畢。### 2. 執行 SQL 結構初始化1. 在左側選單點擊 **"SQL Editor"**。34 unmodified lines`https://huggingface.co/spaces/easy-english/word-app`其獨立全螢幕網址將會是:`https://easy-english-word-app.hf.space/`5. **License**:留空或輸入 `mit`。6. **SDK**:務必選擇 **"Docker"**。7. **Template**:選擇 **"Blank"**。9 unmodified lines| Secret Key (名字) | Value (填寫內容) | 說明 || :--- | :--- | :--- || `SUPABASE_URL` | 您的新 Supabase API 網址 | 於左側選單 **INTEGRATIONS -> Data API** 最上方的 `API URL` 取得(只需複製到 `.supabase.co` 即可,例如:`https://xxxx.supabase.co`) || `SUPABASE_KEY` | 您的新 Supabase `service_role` 金鑰 | 於左側選單 **Project Settings (齒輪) -> API Keys -> Secret keys** 下的 **default**(點擊 Reveal 顯示後複製以 `sb_secret_` 開頭的金鑰) || `ADMIN_USERNAME` | 您的自訂後台登入帳號 | 例如:`teacher` (若不設定,預設為 `admin`) || `ADMIN_PASSWORD` | 您的自訂後台登入密碼 | 例如:`mysecurepwd123` (若不設定,預設為 `admin123`) |25 unmodified lines```bash# 連接您的新 Space(請將下方的用戶名與 Space 名稱替換為您實際的內容)git remote add hf https://huggingface.co/spaces/您的HF帳號/您的Space名稱# 將本地預設分支更名為 main(避免 Windows Git 預設的 master 分支導致推播失敗)git branch -M main# 推送代碼至 Hugging Face (通常預設分支為 main)git push -f hf main18 unmodified lines* **複習起迄時間**:選擇本次進度表的開始與結束日期。* **規定複習次數**:設定學生需要達到幾天 (例如 1 天或 2 天)。* **複習單元列表**:系統會自動抓取您匯入的單字單元,點選 **"全選"** 或 **"全不選"**,並勾選本次要納入計分的單元。(*注意:未勾選的單元不會出現在進度表上*)。2. **郵件通知設定 (Gmail API 發信)**:* 由於 Hugging Face 雲端封鎖了外發 SMTP Port (587),本系統已移除 SMTP 密碼發信功能,強制使用更安全的 **Gmail API OAuth** 發信。* **啟用方式**:請依照第二階段的說明,在 Hugging Face 的 Secrets 中新增 `GMAIL_CREDENTIALS`,並且在 `GMAIL_USER` 設定您的 Gmail 帳號。* **網頁後台設定**:只需勾選 **"啟用測驗完成 Email 通知"**,並填寫 **"收件者信箱"** (多位家長/老師請用逗號隔開) 即可。不需要(也無法)在後台網頁中填寫寄件者或密碼,防止使用者亂填造成錯誤。3. **儲存設定**:* 點選 **"💾 儲存所有設定"**,即刻完成部署!11 unmodified lines1213141516171834 unmodified lines535455565758599 unmodified lines69707172737475767725 unmodified lines10310410510610710810918 unmodified lines12812913013113213313413513613711 unmodified lines1. 登入 [Supabase Dashboard](https://supabase.com/dashboard/)。2. 點擊 **"New Project"**,選擇您的 Organization,並填寫專案名稱 (例如:`WordApp-Basic`)、設定資料庫密碼與區域。3. 建立後,請稍等 1-2 分鐘讓資料庫實例配置完畢。Database password:englisheasy88/englisheasy88### 2. 執行 SQL 結構初始化1. 在左側選單點擊 **"SQL Editor"**。34 unmodified lines`https://huggingface.co/spaces/easy-english/word-app`其獨立全螢幕網址將會是:`https://easy-english-word-app.hf.space/`MyClass5. **License**:留空或輸入 `mit`。6. **SDK**:務必選擇 **"Docker"**。7. **Template**:選擇 **"Blank"**。9 unmodified lines| Secret Key (名字) | Value (填寫內容) | 說明 || :--- | :--- | :--- || `SUPABASE_URL` | 您的新 Supabase API 網址 | 於左側選單 **INTEGRATIONS -> Data API** 最上方的 `API URL` 取得(只需複製到 `.supabase.co` 即可,例如:`https://xxxx.supabase.co`) |https://ivctjtcewasmkkkpftzl.supabase.co| `SUPABASE_KEY` | 您的新 Supabase `service_role` 金鑰 | 於左側選單 **Project Settings (齒輪) -> API Keys -> Secret keys** 下的 **default**(點擊 Reveal 顯示後複製以 `sb_secret_` 開頭的金鑰) |sb_secret_your_service_role_key| `ADMIN_USERNAME` | 您的自訂後台登入帳號 | 例如:`teacher` (若不設定,預設為 `admin`) || `ADMIN_PASSWORD` | 您的自訂後台登入密碼 | 例如:`mysecurepwd123` (若不設定,預設為 `admin123`) |25 unmodified lines```bash# 連接您的新 Space(請將下方的用戶名與 Space 名稱替換為您實際的內容)git remote add hf https://huggingface.co/spaces/您的HF帳號/您的Space名稱git remote add hf https://huggingface.co/spaces/englisheasy88/MyClass/# 推送代碼至 Hugging Face (通常預設分支為 main)git push -f hf main18 unmodified lines* **複習起迄時間**:選擇本次進度表的開始與結束日期。* **規定複習次數**:設定學生需要達到幾天 (例如 1 天或 2 天)。* **複習單元列表**:系統會自動抓取您匯入的單字單元,點選 **"全選"** 或 **"全不選"**,並勾選本次要納入計分的單元。(*注意:未勾選的單元不會出現在進度表上*)。2. **郵件通知設定 (SMTP 簡單設定)**:* 勾選 **"啟用測驗完成 Email 通知"**。* 輸入 **"寄件者信箱"** (例如您的 Gmail 地址)。* 輸入 **"郵件授權密碼 (App Password)"**(至 Google 帳號安全性設定中產生 16 位元應用程式密碼)。* 輸入 **"收件者信箱"**(多位家長/老師請用逗號隔開)。3. **儲存設定**:* 點選 **"💾 儲存所有設定"**,即刻完成部署!
31 unmodified lines32333435363731 unmodified linesmargin: 0 auto;}.card {background: var(--card-bg);backdrop-filter: blur(16px);31 unmodified lines3233343536373839404131 unmodified linesmargin: 0 auto;}.container.wide-mode {max-width: 1425px; /* 1.5x width */}.card {background: var(--card-bg);backdrop-filter: blur(16px);
99 unmodified lines100101102103104105130 unmodified lines23623723823924024124224382 unmodified lines326327328329330331126 unmodified lines4584594604614624634 unmodified lines4684694704714724734744754764774784792 unmodified lines48248348448548648799 unmodified lines</div></div><div class="progress-legend" style="margin-bottom: 20px;"><div class="legend-item"><span class="legend-box badge-quiz" style="border-radius: 4px; border: none; width: 14px; height: 14px;"></span>選中文</div><div class="legend-item"><span class="legend-box badge-reverse" style="border-radius: 4px; border: none; width: 14px; height: 14px;"></span>選英文</div>130 unmodified lines}});if (tabId === 'progress-tab') {loadProgressData();}}82 unmodified lines}function renderMatrixProgress() {if (!progressRawData) return;const selectedUser = document.getElementById('progressUserFilter').value;126 unmodified lines// 4. 繪製最底下的 Summary 橫列footerRow.innerHTML = '<td class="sticky-col-header" style="font-weight: 700; background-color: #f1f5f9; position: sticky; left:0; z-index: 10;">Summary</td>';units.forEach(unit => {const tdSummary = document.createElement('td');const daysCount = completedDaysMap[unit] || 0;4 unmodified lineslet statusBadge = '';if (isCompleted) {statusBadge = '<span class="unit-status-pill completed" style="padding: 2px 6px; font-size: 0.7rem; margin-top: 4px; display: inline-block;">🎉 達標</span>';tdSummary.style.backgroundColor = 'rgba(34, 197, 94, 0.08)';} else if (daysCount > 0) {statusBadge = '<span class="unit-status-pill in-progress" style="padding: 2px 6px; font-size: 0.7rem; margin-top: 4px; display: inline-block;">⏳ 進行中</span>';} else {statusBadge = '<span class="unit-status-pill not-started" style="padding: 2px 6px; font-size: 0.7rem; margin-top: 4px; display: inline-block;">未開始</span>';}tdSummary.innerHTML = `2 unmodified lines`;footerRow.appendChild(tdSummary);});}loadUsers();99 unmodified lines100101102103104105106107108109110111112113114115116117118119120121130 unmodified lines25225325425525625725825926026126226382 unmodified lines346347348349350351352353354355356357358359360361126 unmodified lines4884894904914924934944954964974 unmodified lines5025035045055065075085095105115125135145155162 unmodified lines51952052152252352452552652752852953053153299 unmodified lines</div></div><!-- 進度統計列 --><div style="display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; font-size: 0.95rem;"><div style="background: rgba(255, 255, 255, 0.03); padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px;"><span class="unit-status-pill not-started" style="padding: 2px 8px; border-radius: 50px;">未開始</span><span style="font-weight: bold; color: var(--text-muted);" id="stat-not-started">0</span> 個單元</div><div style="background: rgba(255, 255, 255, 0.03); padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px;"><span class="unit-status-pill in-progress" style="padding: 2px 8px; border-radius: 50px;">進行中</span><span style="font-weight: bold; color: #fbbf24;" id="stat-in-progress">0</span> 個單元</div><div style="background: rgba(255, 255, 255, 0.03); padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px;"><span class="unit-status-pill completed" style="padding: 2px 8px; border-radius: 50px;">已完成</span><span style="font-weight: bold; color: #34d399;" id="stat-completed">0</span> 個單元</div></div><div class="progress-legend" style="margin-bottom: 20px;"><div class="legend-item"><span class="legend-box badge-quiz" style="border-radius: 4px; border: none; width: 14px; height: 14px;"></span>選中文</div><div class="legend-item"><span class="legend-box badge-reverse" style="border-radius: 4px; border: none; width: 14px; height: 14px;"></span>選英文</div>130 unmodified lines}});const container = document.querySelector('.container');if (tabId === 'progress-tab') {if (container) container.classList.add('wide-mode');loadProgressData();} else {if (container) container.classList.remove('wide-mode');}}82 unmodified lines}function renderMatrixProgress() {const resetStats = () => {const statNotStarted = document.getElementById('stat-not-started');const statInProgress = document.getElementById('stat-in-progress');const statCompleted = document.getElementById('stat-completed');if (statNotStarted) statNotStarted.innerText = 0;if (statInProgress) statInProgress.innerText = 0;if (statCompleted) statCompleted.innerText = 0;};resetStats();if (!progressRawData) return;const selectedUser = document.getElementById('progressUserFilter').value;126 unmodified lines// 4. 繪製最底下的 Summary 橫列footerRow.innerHTML = '<td class="sticky-col-header" style="font-weight: 700; background-color: #f1f5f9; position: sticky; left:0; z-index: 10;">Summary</td>';let countNotStarted = 0;let countInProgress = 0;let countCompleted = 0;units.forEach(unit => {const tdSummary = document.createElement('td');const daysCount = completedDaysMap[unit] || 0;4 unmodified lineslet statusBadge = '';if (isCompleted) {statusBadge = '<span class="unit-status-pill completed" style="padding: 2px 6px; font-size: 0.7rem; margin-top: 4px; display: inline-block;">🎉 已完成</span>';tdSummary.style.backgroundColor = 'rgba(34, 197, 94, 0.08)';countCompleted++;} else if (daysCount > 0) {statusBadge = '<span class="unit-status-pill in-progress" style="padding: 2px 6px; font-size: 0.7rem; margin-top: 4px; display: inline-block;">⏳ 進行中</span>';countInProgress++;} else {statusBadge = '<span class="unit-status-pill not-started" style="padding: 2px 6px; font-size: 0.7rem; margin-top: 4px; display: inline-block;">未開始</span>';countNotStarted++;}tdSummary.innerHTML = `2 unmodified lines`;footerRow.appendChild(tdSummary);});// 更��統計看板const statNotStartedEl = document.getElementById('stat-not-started');const statInProgressEl = document.getElementById('stat-in-progress');const statCompletedEl = document.getElementById('stat-completed');if (statNotStartedEl) statNotStartedEl.innerText = countNotStarted;if (statInProgressEl) statInProgressEl.innerText = countInProgress;if (statCompletedEl) statCompletedEl.innerText = countCompleted;}loadUsers();
deploy_guide.md+10-8
static/style.css+4
templates/index.html+46-1