Chore: make sql monitors eazier to use (#3474)

* Fixed the sql monitor not having the query required

* Apply suggestions from code review

* added `redis` and  `mongodb` to the connectionString as requested by @chakflying
pull/3357/head^2
Frank Elsinga 1 year ago committed by GitHub
parent eb6167aaf1
commit 149d08ecbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -373,42 +373,18 @@
</div> </div>
</template> </template>
<!-- SQL Server / PostgreSQL / MySQL --> <!-- SQL Server / PostgreSQL / MySQL / Redis / MongoDB -->
<template v-if="monitor.type === 'sqlserver' || monitor.type === 'postgres' || monitor.type === 'mysql'"> <template v-if="monitor.type === 'sqlserver' || monitor.type === 'postgres' || monitor.type === 'mysql' || monitor.type === 'redis' || monitor.type === 'mongodb'">
<div class="my-3">
<label for="sqlConnectionString" class="form-label">{{ $t("Connection String") }}</label>
<template v-if="monitor.type === 'sqlserver'">
<input id="sqlConnectionString" v-model="monitor.databaseConnectionString" type="text" class="form-control">
</template>
<template v-if="monitor.type === 'postgres'">
<input id="sqlConnectionString" v-model="monitor.databaseConnectionString" type="text" class="form-control">
</template>
<template v-if="monitor.type === 'mysql'">
<input id="sqlConnectionString" v-model="monitor.databaseConnectionString" type="text" class="form-control">
</template>
</div>
<div class="my-3">
<label for="sqlQuery" class="form-label">{{ $t("Query") }}</label>
<textarea id="sqlQuery" v-model="monitor.databaseQuery" class="form-control" placeholder="Example: select getdate()"></textarea>
</div>
</template>
<!-- Redis -->
<template v-if="monitor.type === 'redis'">
<div class="my-3"> <div class="my-3">
<label for="redisConnectionString" class="form-label">{{ $t("Connection String") }}</label> <label for="connectionString" class="form-label">{{ $t("Connection String") }}</label>
<input id="redisConnectionString" v-model="monitor.databaseConnectionString" type="text" class="form-control"> <input id="connectionString" v-model="monitor.databaseConnectionString" type="text" class="form-control" required>
</div> </div>
</template> </template>
<!-- SQL Server / PostgreSQL / MySQL -->
<!-- MongoDB --> <template v-if="monitor.type === 'sqlserver' || monitor.type === 'postgres' || monitor.type === 'mysql'">
<template v-if="monitor.type === 'mongodb'">
<div class="my-3"> <div class="my-3">
<label for="sqlConnectionString" class="form-label">{{ $t("Connection String") }}</label> <label for="sqlQuery" class="form-label">{{ $t("Query") }}</label>
<textarea id="sqlQuery" v-model="monitor.databaseQuery" class="form-control" :placeholder="$t('Example:', [ 'select getdate()' ])" required></textarea>
<template v-if="monitor.type === 'mongodb'">
<input id="sqlConnectionString" v-model="monitor.databaseConnectionString" type="text" class="form-control">
</template>
</div> </div>
</template> </template>

Loading…
Cancel
Save