MCPcopy Index your code
hub / github.com/su-kaka/gcli2api / action

Function action

front/common.js:291–310  ·  view source on GitHub ↗
(filename, action)

Source from the content-addressed store, hash-verified

289
290 // 凭证操作
291 async action(filename, action) {
292 try {
293 const response = await fetch(`${this.getEndpoint('action')}?${this.getModeParam()}`, {
294 method: 'POST',
295 headers: getAuthHeaders(),
296 body: JSON.stringify({ filename, action })
297 });
298
299 const data = await response.json();
300
301 if (response.ok) {
302 showStatus(data.message || `操作成功: ${action}`, 'success');
303 await this.refresh();
304 } else {
305 showStatus(`操作失败: ${data.detail || data.error || '未知错误'}`, 'error');
306 }
307 } catch (error) {
308 showStatus(`网络错误: ${error.message}`, 'error');
309 }
310 },
311
312 // 批量操作
313 async batchAction(action) {

Callers

nothing calls this directly

Calls 3

getAuthHeadersFunction · 0.85
showStatusFunction · 0.85
refreshMethod · 0.80

Tested by

no test coverage detected