feat(inferium-server): add delete-config endpoint
This commit is contained in:
parent
b88bc8a023
commit
a28ccbc920
@ -105,12 +105,26 @@ local function setConfig(message)
|
||||
return false
|
||||
end
|
||||
|
||||
LOCAL_CONFIGS[harvesterId] = config
|
||||
saveConfigForComputer(harvesterId, config)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
local function deleteConfig(message)
|
||||
local payload = message and message.payload
|
||||
local harvesterId = payload and payload.id
|
||||
|
||||
if not harvesterId then
|
||||
return false
|
||||
end
|
||||
|
||||
if LOCAL_CONFIGS[harvesterId] then
|
||||
saveConfigForComputer(harvesterId, nil)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-- return a table of harvesters { id: string, name: string }[]
|
||||
local function listHarvesters()
|
||||
local result = {}
|
||||
@ -135,6 +149,7 @@ end
|
||||
local ROUTES = {
|
||||
['get-config'] = getConfig,
|
||||
['set-config'] = setConfig,
|
||||
['delete-config'] = deleteConfig,
|
||||
['list-harvesters'] = listHarvesters,
|
||||
['exit-server'] = exitServer,
|
||||
['upgrade-server'] = upgradeServer,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user