MCPcopy Create free account
hub / github.com/error311/FileRise / loadMcpServiceStatus

Function loadMcpServiceStatus

public/js/adminPanel.js:4271–4292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4269 };
4270
4271 const loadMcpServiceStatus = async () => {
4272 try {
4273 const data = await apiGet('/api/pro/gateways/mcp/service/status.php');
4274 const svc = data?.service || {};
4275 state.mcpService = svc;
4276 if (mcpSvcListenEl) mcpSvcListenEl.value = String(svc.listenAddr || '127.0.0.1');
4277 if (mcpSvcPortEl) mcpSvcPortEl.value = String(svc.port || 3030);
4278 if (mcpSvcAllowPublicEl) mcpSvcAllowPublicEl.checked = !!svc.allowPublicBind;
4279 if (mcpSvcAutostartEl) mcpSvcAutostartEl.checked = !!svc.autostart;
4280 const statusText = svc.running ? tf('gateway_running', 'Running') : tf('gateway_stopped', 'Stopped');
4281 const pidText = svc.pid ? ` pid=${svc.pid}` : '';
4282 const runtimeMode = String(svc.runtimeMode || '').trim();
4283 const runtimeText = runtimeMode ? ` • ${runtimeMode}` : '';
4284 const runtimeWarning = String(svc.runtimeWarning || '').trim();
4285 const warningText = runtimeWarning ? ` • ${runtimeWarning}` : '';
4286 const tone = runtimeWarning ? 'warning' : (svc.running ? 'success' : 'warning');
4287 setMcpServiceStatus(`${statusText}${pidText} • ${String(svc.listenAddr || '127.0.0.1')}:${String(svc.port || 3030)}${runtimeText}${warningText}`, tone);
4288 seedMcpTemplateDefaults();
4289 } catch (err) {
4290 setMcpServiceStatus(err?.message || tf('error', 'Error'), 'danger');
4291 }
4292 };
4293
4294 const runMcpServiceAction = async (action, extra = {}) => {
4295 const data = await apiPost('/api/pro/gateways/mcp/service/action.php', { action, ...extra });

Callers 2

runMcpServiceActionFunction · 0.85
initGatewaysSectionFunction · 0.85

Calls 4

setMcpServiceStatusFunction · 0.85
seedMcpTemplateDefaultsFunction · 0.85
apiGetFunction · 0.70
tfFunction · 0.70

Tested by

no test coverage detected