소스 수정
This commit is contained in:
@@ -4,7 +4,7 @@ import { refreshServerTimer } from '../../../utils/server-scheduler'
|
||||
export default defineEventHandler(async (event) => {
|
||||
const targetId = getRouterParam(event, 'id')
|
||||
const body = await readBody(event)
|
||||
const { name, host, port, username, auth_type, is_active } = body
|
||||
const { server_name, server_ip, glances_url, is_active, collect_interval, physical_location } = body
|
||||
|
||||
if (!targetId) {
|
||||
throw createError({
|
||||
@@ -15,15 +15,15 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
const changes = await execute(`
|
||||
UPDATE server_targets
|
||||
SET name = $1,
|
||||
host = $2,
|
||||
port = $3,
|
||||
username = $4,
|
||||
auth_type = $5,
|
||||
is_active = $6,
|
||||
SET server_name = $1,
|
||||
server_ip = $2,
|
||||
glances_url = $3,
|
||||
is_active = $4,
|
||||
collect_interval = $5,
|
||||
physical_location = $6,
|
||||
updated_at = NOW()
|
||||
WHERE target_id = $7
|
||||
`, [name, host, port || 22, username, auth_type || 'password', is_active ? 1 : 0, targetId])
|
||||
`, [server_name, server_ip, glances_url, is_active ? 1 : 0, collect_interval || 60, physical_location || '운영서버실', targetId])
|
||||
|
||||
// 스케줄러에 반영
|
||||
refreshServerTimer(Number(targetId))
|
||||
|
||||
Reference in New Issue
Block a user