mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-06-19 07:36:11 +00:00
feat: add optional token field for gamedig monitors (#7433)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
exports.up = function (knex) {
|
||||
return knex.schema.alterTable("monitor", function (table) {
|
||||
table.text("gamedig_token").defaultTo(null);
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function (knex) {
|
||||
return knex.schema.alterTable("monitor", function (table) {
|
||||
table.dropColumn("gamedig_token");
|
||||
});
|
||||
};
|
||||
@@ -231,6 +231,7 @@ class Monitor extends BeanModel {
|
||||
oauth_audience: this.oauth_audience,
|
||||
oauth_auth_method: this.oauth_auth_method,
|
||||
bearer_token: this.bearer_token,
|
||||
gamedigToken: this.gamedigToken,
|
||||
pushToken: this.pushToken,
|
||||
databaseConnectionString: this.databaseConnectionString,
|
||||
radiusUsername: this.radiusUsername,
|
||||
|
||||
@@ -15,6 +15,7 @@ class GameDigMonitorType extends MonitorType {
|
||||
host: monitor.hostname,
|
||||
port: monitor.port,
|
||||
givenPortOnly: Boolean(monitor.gamedigGivenPortOnly),
|
||||
...(monitor.gamedigToken ? { token: monitor.gamedigToken } : {}),
|
||||
});
|
||||
|
||||
heartbeat.msg = state.name;
|
||||
|
||||
@@ -918,6 +918,7 @@ let needSetup = false;
|
||||
bean.kafkaProducerSsl = monitor.kafkaProducerSsl;
|
||||
bean.kafkaProducerAllowAutoTopicCreation = monitor.kafkaProducerAllowAutoTopicCreation;
|
||||
bean.gamedigGivenPortOnly = monitor.gamedigGivenPortOnly;
|
||||
bean.gamedigToken = monitor.gamedigToken;
|
||||
bean.remote_browser = monitor.remote_browser;
|
||||
bean.smtpSecurity = monitor.smtpSecurity;
|
||||
bean.snmpVersion = monitor.snmpVersion;
|
||||
|
||||
@@ -1110,6 +1110,8 @@
|
||||
"noOrBadCertificate": "No/Bad Certificate",
|
||||
"cacheBusterParam": "Add the {0} parameter",
|
||||
"cacheBusterParamDescription": "Randomly generated parameter to skip caches.",
|
||||
"gamedigToken": "Token",
|
||||
"gamedigTokenDescription": "Optional. Some game servers require an authentication token.",
|
||||
"gamedigGuessPort": "Gamedig: Guess Port",
|
||||
"gamedigGuessPortDescription": "The port used by Valve Server Query Protocol may be different from the client port. Try this if the monitor cannot connect to your server.",
|
||||
"Message format": "Message format",
|
||||
|
||||
@@ -716,6 +716,21 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Gamedig Token -->
|
||||
<div v-if="monitor.type === 'gamedig'" class="my-3">
|
||||
<label for="gamedig-token" class="form-label">{{ $t("gamedigToken") }}</label>
|
||||
<input
|
||||
id="gamedig-token"
|
||||
v-model="monitor.gamedigToken"
|
||||
type="password"
|
||||
class="form-control"
|
||||
:placeholder="$t('gamedigToken')"
|
||||
/>
|
||||
<div class="form-text">
|
||||
{{ $t("gamedigTokenDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SNMP Monitor Type -->
|
||||
<div v-if="monitor.type === 'snmp'" class="my-3">
|
||||
<label for="snmp_community_string" class="form-label">
|
||||
@@ -3166,6 +3181,7 @@ const monitorDefaults = {
|
||||
kafkaProducerSsl: false,
|
||||
kafkaProducerAllowAutoTopicCreation: false,
|
||||
gamedigGivenPortOnly: true,
|
||||
gamedigToken: "",
|
||||
remote_browser: null,
|
||||
screenshot_delay: 0,
|
||||
rabbitmqNodes: [],
|
||||
|
||||
Reference in New Issue
Block a user