refactor: reuse databaseConnectionString

This commit is contained in:
long2ice 2023-01-13 16:32:49 +08:00
parent 40ebc2df79
commit db757123ba
4 changed files with 2 additions and 10 deletions

View File

@ -1,6 +0,0 @@
BEGIN TRANSACTION;
ALTER TABLE monitor
ADD redis_connection_string VARCHAR(255);
COMMIT

View File

@ -66,7 +66,6 @@ class Database {
"patch-add-radius-monitor.sql": true,
"patch-monitor-add-resend-interval.sql": true,
"patch-maintenance-table2.sql": true,
"patch-redis-monitor.sql": true,
};
/**

View File

@ -122,7 +122,6 @@ class Monitor extends BeanModel {
basic_auth_pass: this.basic_auth_pass,
pushToken: this.pushToken,
databaseConnectionString: this.databaseConnectionString,
redisConnectionString: this.redisConnectionString,
radiusUsername: this.radiusUsername,
radiusPassword: this.radiusPassword,
radiusSecret: this.radiusSecret,
@ -623,7 +622,7 @@ class Monitor extends BeanModel {
} else if (this.type === "redis") {
let startTime = dayjs().valueOf();
bean.msg = await redisPingAsync(this.redisConnectionString);
bean.msg = await redisPingAsync(this.databaseConnectionString);
bean.status = UP;
bean.ping = dayjs().valueOf() - startTime;
} else {

View File

@ -274,7 +274,7 @@
<template v-if="monitor.type === 'redis'">
<div class="my-3">
<label for="redisConnectionString" class="form-label">{{ $t("Connection String") }}</label>
<input id="redisConnectionString" v-model="monitor.redisConnectionString" type="text" class="form-control" placeholder="redis://user:password@host:port">
<input id="redisConnectionString" v-model="monitor.databaseConnectionString" type="text" class="form-control" placeholder="redis://user:password@host:port">
</div>
</template>
<!-- Interval -->