mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-25 10:56:10 +03:00
Add description to monitor
* Add description to monitor model * Add description field to database * Add english and spanish translation for description * Closes: #482
This commit is contained in:
parent
5bc68d7f3b
commit
934d633d4d
10 changed files with 26 additions and 0 deletions
7
db/patch-add-description-monitor.sql
Normal file
7
db/patch-add-description-monitor.sql
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
-- You should not modify if this have pushed to Github, unless it does serious wrong with the db.
|
||||||
|
BEGIN TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE monitor
|
||||||
|
ADD description TEXT default null;
|
||||||
|
|
||||||
|
COMMIT;
|
|
@ -53,6 +53,7 @@ class Database {
|
||||||
"patch-2fa-invalidate-used-token.sql": true,
|
"patch-2fa-invalidate-used-token.sql": true,
|
||||||
"patch-notification_sent_history.sql": true,
|
"patch-notification_sent_history.sql": true,
|
||||||
"patch-monitor-basic-auth.sql": true,
|
"patch-monitor-basic-auth.sql": true,
|
||||||
|
"patch-add-description-monitor.sql": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,6 +31,7 @@ class Monitor extends BeanModel {
|
||||||
return {
|
return {
|
||||||
id: this.id,
|
id: this.id,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
description: this.description,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ class Monitor extends BeanModel {
|
||||||
return {
|
return {
|
||||||
id: this.id,
|
id: this.id,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
description: this.description,
|
||||||
url: this.url,
|
url: this.url,
|
||||||
method: this.method,
|
method: this.method,
|
||||||
body: this.body,
|
body: this.body,
|
||||||
|
|
|
@ -568,6 +568,7 @@ exports.entryPage = "dashboard";
|
||||||
}
|
}
|
||||||
|
|
||||||
bean.name = monitor.name;
|
bean.name = monitor.name;
|
||||||
|
bean.description = monitor.description;
|
||||||
bean.type = monitor.type;
|
bean.type = monitor.type;
|
||||||
bean.url = monitor.url;
|
bean.url = monitor.url;
|
||||||
bean.method = monitor.method;
|
bean.method = monitor.method;
|
||||||
|
@ -1134,6 +1135,7 @@ exports.entryPage = "dashboard";
|
||||||
let monitor = {
|
let monitor = {
|
||||||
// Define the new variable from earlier here
|
// Define the new variable from earlier here
|
||||||
name: monitorListData[i].name,
|
name: monitorListData[i].name,
|
||||||
|
description: monitorListData[i].description,
|
||||||
type: monitorListData[i].type,
|
type: monitorListData[i].type,
|
||||||
url: monitorListData[i].url,
|
url: monitorListData[i].url,
|
||||||
method: monitorListData[i].method || "GET",
|
method: monitorListData[i].method || "GET",
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<Uptime :monitor="item" type="24" :pill="true" />
|
<Uptime :monitor="item" type="24" :pill="true" />
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
|
<span :title="item.description">
|
||||||
|
<font-awesome-icon icon="info-circle" />
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
<Tag v-for="tag in item.tags" :key="tag" :item="tag" :size="'sm'" />
|
<Tag v-for="tag in item.tags" :key="tag" :item="tag" :size="'sm'" />
|
||||||
|
|
|
@ -33,6 +33,7 @@ import {
|
||||||
faFile,
|
faFile,
|
||||||
faAward,
|
faAward,
|
||||||
faLink,
|
faLink,
|
||||||
|
faInfoCircle,
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
|
|
||||||
library.add(
|
library.add(
|
||||||
|
@ -65,6 +66,7 @@ library.add(
|
||||||
faFile,
|
faFile,
|
||||||
faAward,
|
faAward,
|
||||||
faLink,
|
faLink,
|
||||||
|
faInfoCircle,
|
||||||
);
|
);
|
||||||
|
|
||||||
export { FontAwesomeIcon };
|
export { FontAwesomeIcon };
|
||||||
|
|
|
@ -46,6 +46,7 @@ export default {
|
||||||
Unknown: "Unknown",
|
Unknown: "Unknown",
|
||||||
Pause: "Pause",
|
Pause: "Pause",
|
||||||
Name: "Name",
|
Name: "Name",
|
||||||
|
Description: "Description",
|
||||||
Status: "Status",
|
Status: "Status",
|
||||||
DateTime: "DateTime",
|
DateTime: "DateTime",
|
||||||
Message: "Message",
|
Message: "Message",
|
||||||
|
|
|
@ -34,6 +34,7 @@ export default {
|
||||||
Unknown: "Desconocido",
|
Unknown: "Desconocido",
|
||||||
Pause: "Pausar",
|
Pause: "Pausar",
|
||||||
Name: "Nombre",
|
Name: "Nombre",
|
||||||
|
Description: "Descripción",
|
||||||
Status: "Estado",
|
Status: "Estado",
|
||||||
DateTime: "Fecha y Hora",
|
DateTime: "Fecha y Hora",
|
||||||
Message: "Mensaje",
|
Message: "Mensaje",
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<transition name="slide-fade" appear>
|
<transition name="slide-fade" appear>
|
||||||
<div v-if="monitor">
|
<div v-if="monitor">
|
||||||
<h1> {{ monitor.name }}</h1>
|
<h1> {{ monitor.name }}</h1>
|
||||||
|
<p>{{ monitor.description }}</p>
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
<Tag v-for="tag in monitor.tags" :key="tag.id" :item="tag" :size="'sm'" />
|
<Tag v-for="tag in monitor.tags" :key="tag.id" :item="tag" :size="'sm'" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -41,6 +41,12 @@
|
||||||
<input id="name" v-model="monitor.name" type="text" class="form-control" required>
|
<input id="name" v-model="monitor.name" type="text" class="form-control" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Description -->
|
||||||
|
<div class="my-3">
|
||||||
|
<label for="description" class="form-label">{{ $t("Description") }}</label>
|
||||||
|
<input id="description" v-model="monitor.description" type="text" class="form-control">
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- URL -->
|
<!-- URL -->
|
||||||
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' " class="my-3">
|
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' " class="my-3">
|
||||||
<label for="url" class="form-label">{{ $t("URL") }}</label>
|
<label for="url" class="form-label">{{ $t("URL") }}</label>
|
||||||
|
|
Loading…
Reference in a new issue