This commit is contained in:
innerpeacez 2025-03-10 14:46:33 +08:00
parent efbfc11c39
commit ea77747ff6
2 changed files with 12 additions and 17 deletions

View file

@ -1,10 +1,13 @@
const NotificationProvider = require("./notification-provider"); const NotificationProvider = require("./notification-provider");
const {DOWN, UP} = require("../../src/util"); const { DOWN, UP } = require("../../src/util");
const {default: axios} = require("axios"); const { default: axios } = require("axios");
class YZJ extends NotificationProvider { class YZJ extends NotificationProvider {
name = "YZJ"; name = "YZJ";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
let okMsg = "Sent Successfully."; let okMsg = "Sent Successfully.";
@ -31,8 +34,8 @@ class YZJ extends NotificationProvider {
/** /**
* Send message to YZJ * Send message to YZJ
* @param {BeanModel} notification * @param {object} notification Notification
* @param {Object} params Parameters of message * @param {object} params Parameters of message
* @returns {boolean} True if successful else false * @returns {boolean} True if successful else false
*/ */
async sendToYZJ(notification, params) { async sendToYZJ(notification, params) {
@ -56,7 +59,7 @@ class YZJ extends NotificationProvider {
/** /**
* Convert status constant to string * Convert status constant to string
* @param {string} status The status constant * @param {string} status The status constant
* @returns {string} * @returns {string} status
*/ */
statusToString(status) { statusToString(status) {
switch (status) { switch (status) {

View file

@ -1,21 +1,13 @@
<template> <template>
<div class="mb-3"> <div class="mb-3">
<label for="yzjWebHookUrl" class="form-label">{{ $t("YZJ Webhook URL") }}<span style="color: red;"><sup>*</sup></span></label> <label for="yzjWebHookUrl" class="form-label">{{ $t("YZJ Webhook URL") }}<span style="color: red;"><sup>*</sup></span></label>
<input id="yzjWebHookUrl" v-model="$parent.notification.yzjWebHookUrl" type="text" class="form-control" <input id="yzjWebHookUrl" v-model="$parent.notification.yzjWebHookUrl" type="text" class="form-control" required />
required>
<label for="yzjType" class="form-label">{{ $t("YZJ Robot Type") }}<span style="color: red;"><sup>*</sup></span></label> <label for="yzjType" class="form-label">{{ $t("YZJ Robot Type") }}<span style="color: red;"><sup>*</sup></span></label>
<input id="yzjType" v-model="$parent.notification.yzjType" type="text" class="form-control" required> <input id="yzjType" v-model="$parent.notification.yzjType" type="text" class="form-control" required />
<label for="yzjToken" class="form-label">{{ $t("YZJ Robot Token") }}<span style="color: red;"><sup>*</sup></span></label>
<label for="yzjToken" class="form-label">{{ $t("YZJ Robot Token") }}<span
style="color: red;"><sup>*</sup></span></label>
<hidden-input id="yzjToken" v-model="$parent.notification.yzjToken" type="text" class="form-control" required /> <hidden-input id="yzjToken" v-model="$parent.notification.yzjToken" type="text" class="form-control" required />
<i18n-t class="form-text" keypath="wayToGetTeamsURL"> <i18n-t class="form-text" keypath="wayToGetTeamsURL">
<a <a href="https://www.yunzhijia.com/opendocs/docs.html#/tutorial/index/robot" target="_blank">{{ $t("here") }}</a>
href="https://www.yunzhijia.com/opendocs/docs.html#/tutorial/index/robot" target="_blank">
{{ $t("here") }}
</a>
</i18n-t> </i18n-t>
</div> </div>
</template> </template>