MCPcopy Create free account
hub / github.com/TQZHR/grok2api / updateStorageModeButton

Function updateStorageModeButton

app/static/common/admin-auth.js:228–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226}
227
228async function updateStorageModeButton() {
229 const buttons = Array.from(document.querySelectorAll('#storage-mode-btn, [data-storage-mode-btn]'));
230 if (!buttons.length) return;
231 buttons.forEach((btn) => {
232 btn.textContent = '...';
233 btn.title = '存储模式';
234 btn.classList.remove('storage-ready');
235 });
236 const storageType = await fetchStorageType();
237 const label = formatStorageLabel(storageType);
238 buttons.forEach((btn) => {
239 btn.textContent = label === '-' ? label : label.toUpperCase();
240 btn.title = '存储模式';
241 if (label !== '-') btn.classList.add('storage-ready');
242 });
243}
244
245if (document.readyState === 'loading') {
246 document.addEventListener('DOMContentLoaded', updateStorageModeButton);

Callers 2

admin-auth.jsFile · 0.85
loadAdminHeaderFunction · 0.85

Calls 4

fetchStorageTypeFunction · 0.85
formatStorageLabelFunction · 0.85
removeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected