發佈 0.1.6:速度固定 Fast,移除選項與 footer 顯示
摘要: 速度(service tier)固定為 priority(Fast 1.5x):表單移除速度下拉、 footer 不再顯示 Fast 字樣;舊設定檔存空值也會矯正回 priority。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -217,10 +217,7 @@
|
||||
<div class="field">
|
||||
<label>推理強度</label>
|
||||
<select id="f-effort"></select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>速度</label>
|
||||
<select id="f-tier"></select>
|
||||
<div class="hint">速度固定為 Fast(1.5x)</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>逾時(分鐘)</label>
|
||||
@@ -314,7 +311,7 @@ async function loadModels() {
|
||||
} catch { modelsCache = []; }
|
||||
}
|
||||
// 下拉沒有「預設」空選項:直接把真實預設值選起來
|
||||
function populateModelSelects(selModel, selEffort, selTier) {
|
||||
function populateModelSelects(selModel, selEffort) {
|
||||
const mSel = document.getElementById('f-model');
|
||||
let opts = modelsCache.map(m => '<option value="' + esc(m.slug) + '">' + esc(m.label) + '</option>').join('');
|
||||
// 設定檔裡有但快取沒有的模型(手填過的)也要能顯示
|
||||
@@ -326,9 +323,9 @@ function populateModelSelects(selModel, selEffort, selTier) {
|
||||
const wanted = selModel || modelDefaults.model;
|
||||
mSel.value = wanted;
|
||||
if (mSel.value !== wanted || !mSel.value) mSel.selectedIndex = 0;
|
||||
syncEffortTier(selEffort, selTier);
|
||||
syncEffortTier(selEffort);
|
||||
}
|
||||
function syncEffortTier(selEffort, selTier) {
|
||||
function syncEffortTier(selEffort) {
|
||||
const slug = document.getElementById('f-model').value;
|
||||
const m = modelsCache.find(x => x.slug === slug);
|
||||
let efforts = m ? m.efforts.slice() : ['low', 'medium', 'high', 'xhigh', 'max'];
|
||||
@@ -341,22 +338,6 @@ function syncEffortTier(selEffort, selTier) {
|
||||
: efforts.includes(modelDefaults.effort) ? modelDefaults.effort
|
||||
: (m && efforts.includes(m.defaultEffort)) ? m.defaultEffort
|
||||
: efforts[0];
|
||||
|
||||
const tiers = m ? m.tiers.slice() : [];
|
||||
const tSel = document.getElementById('f-tier');
|
||||
const prevT = (selTier !== undefined && selTier !== '') ? selTier : tSel.value;
|
||||
if (!tiers.length) {
|
||||
tSel.innerHTML = '<option value="">標準</option>';
|
||||
tSel.value = '';
|
||||
} else {
|
||||
// 模型快取只列「額外」的速度層級,補一個標準選項在前面
|
||||
tSel.innerHTML = '<option value="">標準</option>' +
|
||||
tiers.map(t => '<option value="' + esc(t.id) + '">' + esc(t.name) + (t.description ? '(' + esc(t.description) + ')' : '') + '</option>').join('');
|
||||
tSel.value = tiers.some(t => t.id === prevT) ? prevT
|
||||
: tiers.some(t => t.id === modelDefaults.tier) ? modelDefaults.tier
|
||||
: tiers.some(t => t.id === (m && m.defaultTier)) ? m.defaultTier
|
||||
: '';
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Bot 管理 ----------
|
||||
@@ -393,8 +374,8 @@ function renderBots(bots) {
|
||||
'<td>' + statusBadge(b.status) + '</td>' +
|
||||
'<td><span class="mono" title="' + esc(b.workDir) + '">' + esc(shortPath(b.workDir)) + '</span></td>' +
|
||||
'<td class="mono">' + esc(b.sandbox || '-') +
|
||||
((b.model || b.reasoningEffort || b.serviceTier)
|
||||
? '<br><span class="script-name">' + esc([b.model, b.reasoningEffort, b.serviceTier].filter(Boolean).join(' / ')) + '</span>'
|
||||
((b.model || b.reasoningEffort)
|
||||
? '<br><span class="script-name">' + esc([b.model, b.reasoningEffort].filter(Boolean).join(' / ')) + '</span>'
|
||||
: '') + '</td>' +
|
||||
'<td class="mono">' + esc(b.tokenMasked || '-') + '</td>' +
|
||||
'<td>' + fmtBytes(b.memory) + '</td>' +
|
||||
@@ -462,7 +443,7 @@ function openCreate() {
|
||||
document.getElementById('f-token-hint').textContent = '跟 @BotFather 申請;儲存時會自動驗證';
|
||||
document.getElementById('f-workdir').value = '';
|
||||
document.getElementById('f-sandbox').value = 'workspace-write';
|
||||
populateModelSelects('', '', '');
|
||||
populateModelSelects('', '');
|
||||
document.getElementById('f-timeout').value = '30';
|
||||
document.getElementById('f-autostart-wrap').style.display = '';
|
||||
document.getElementById('f-autostart').checked = true;
|
||||
@@ -483,7 +464,7 @@ function openEdit(name) {
|
||||
document.getElementById('f-token-hint').textContent = '留空表示沿用現有 token';
|
||||
document.getElementById('f-workdir').value = b.workDir || '';
|
||||
document.getElementById('f-sandbox').value = b.sandbox || 'workspace-write';
|
||||
populateModelSelects(b.model || '', b.reasoningEffort || '', b.serviceTier || '');
|
||||
populateModelSelects(b.model || '', b.reasoningEffort || '');
|
||||
document.getElementById('f-timeout').value = b.timeoutMinutes || 30;
|
||||
document.getElementById('f-autostart-wrap').style.display = 'none';
|
||||
document.getElementById('bot-modal').classList.add('show');
|
||||
@@ -504,7 +485,6 @@ async function saveBot() {
|
||||
sandbox: document.getElementById('f-sandbox').value,
|
||||
model: document.getElementById('f-model').value,
|
||||
reasoningEffort: document.getElementById('f-effort').value,
|
||||
serviceTier: document.getElementById('f-tier').value,
|
||||
timeoutMinutes: document.getElementById('f-timeout').value,
|
||||
};
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user