(filename)
| 1772 | } |
| 1773 | |
| 1774 | async function configurePreviewChannel(filename) { |
| 1775 | try { |
| 1776 | // 显示加载状态 |
| 1777 | showStatus('🔧 正在配置Preview通道,请稍候...', 'info'); |
| 1778 | |
| 1779 | const response = await fetch(`./creds/configure-preview/${encodeURIComponent(filename)}`, { |
| 1780 | method: 'POST', |
| 1781 | headers: getAuthHeaders() |
| 1782 | }); |
| 1783 | |
| 1784 | const data = await response.json(); |
| 1785 | |
| 1786 | if (response.ok && data.success) { |
| 1787 | // 配置成功 |
| 1788 | const successMsg = `✅ 配置成功!\n文件: ${filename}\n状态: ${data.message}`; |
| 1789 | showStatus(successMsg.replace(/\n/g, '<br>'), 'success'); |
| 1790 | showMessageModal('Preview通道配置成功', `✅ Preview通道配置成功!\n\n文件: ${filename}\n\n${data.message}\n\nSetting ID: ${data.setting_id || 'N/A'}\nBinding ID: ${data.binding_id || 'N/A'}`, 'success'); |
| 1791 | |
| 1792 | // 刷新凭证列表 |
| 1793 | await AppState.creds.refresh(); |
| 1794 | } else { |
| 1795 | // 配置失败 |
| 1796 | const errorMsg = data.message || '配置失败'; |
| 1797 | const errorDetail = data.error || ''; |
| 1798 | const step = data.step || ''; |
| 1799 | |
| 1800 | let alertMsg = `❌ Preview通道配置失败\n\n文件: ${filename}\n\n${errorMsg}`; |
| 1801 | if (step) { |
| 1802 | alertMsg += `\n失败步骤: ${step}`; |
| 1803 | } |
| 1804 | if (errorDetail) { |
| 1805 | alertMsg += `\n\n错误详情: ${errorDetail}`; |
| 1806 | } |
| 1807 | |
| 1808 | showStatus(`❌ ${errorMsg}`, 'error'); |
| 1809 | showMessageModal('Preview通道配置失败', alertMsg, 'error'); |
| 1810 | } |
| 1811 | } catch (error) { |
| 1812 | const errorMsg = `配置Preview通道失败: ${error.message}`; |
| 1813 | showStatus(`❌ ${errorMsg}`, 'error'); |
| 1814 | showMessageModal('配置Preview通道失败', `❌ ${errorMsg}`, 'error'); |
| 1815 | } |
| 1816 | } |
| 1817 | |
| 1818 | async function toggleAntigravityQuotaDetails(pathId) { |
| 1819 | const quotaDetails = document.getElementById('quota-' + pathId); |
nothing calls this directly
no test coverage detected