Feat: Updating Mods button

This commit is contained in:
MCHost
2025-06-19 01:39:33 -04:00
parent 15f4564760
commit d2498c0cf8
4 changed files with 89 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import { URLSearchParams } from 'url';
import { getContainerStats, streamContainerLogs, readServerProperties, writeServerProperties } from './docker.js';
import { getContainerStats, streamContainerLogs, readServerProperties, writeServerProperties, updateMods } from './docker.js';
import { checkConnectionStatus, checkGeyserStatus, checkSftpStatus } from './status.js';
import { apiRequest } from './api.js';
@ -481,6 +481,8 @@ export function handleWebSocket(ws, req, docker) {
response = client.user === 'Unknown' ? { error: 'User not identified' } : await readServerProperties(docker, client.user);
} else if (endpoint === '/server-properties' && method === 'POST' && body && body.content) {
response = client.user === 'Unknown' ? { error: 'User not identified' } : await writeServerProperties(docker, client.user, body.content);
} else if (endpoint === '/update-mods' && method === 'POST') {
response = client.user === 'Unknown' ? { error: 'User not identified' } : await updateMods(docker, client.user);
} else {
response = await apiRequest(endpoint, client.apiKey, method, body);
}