|
@@ -335,6 +335,7 @@ export class Database extends SQLiteController {
|
|
|
} else {
|
|
} else {
|
|
|
// INSERT
|
|
// INSERT
|
|
|
const res = await this.run('INSERT INTO HealthCheckConfig(ServerID, Type, Title) VALUES(?, ?, ?);', [serverID, 'http', conf.title]);
|
|
const res = await this.run('INSERT INTO HealthCheckConfig(ServerID, Type, Title) VALUES(?, ?, ?);', [serverID, 'http', conf.title]);
|
|
|
|
|
+ conf.id = res.lastID;
|
|
|
|
|
|
|
|
const insCheckValues = conf.checks.map(c => [res.lastID, 'regexp', 'check', c]);
|
|
const insCheckValues = conf.checks.map(c => [res.lastID, 'regexp', 'check', c]);
|
|
|
await this.run(
|
|
await this.run(
|
|
@@ -344,7 +345,7 @@ export class Database extends SQLiteController {
|
|
|
[
|
|
[
|
|
|
...[res.lastID, 'text', 'url', conf.url],
|
|
...[res.lastID, 'text', 'url', conf.url],
|
|
|
...[res.lastID, 'number', 'interval', conf.interval],
|
|
...[res.lastID, 'number', 'interval', conf.interval],
|
|
|
- ...conf.checks.reduce((res, arr) => [...res, ...arr], [] as any[])
|
|
|
|
|
|
|
+ ...conf.checks.reduce((ret, check) => [...ret, res.lastID, 'regexp', 'check', check], [] as any[])
|
|
|
]
|
|
]
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|