feat: add optional token field for gamedig monitors (#7433)

This commit is contained in:
aminoacidity
2026-05-25 22:37:45 +08:00
committed by GitHub
parent d5d727cda3
commit efa194a6df
6 changed files with 32 additions and 0 deletions
@@ -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");
});
};
+1
View File
@@ -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,
+1
View File
@@ -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;
+1
View File
@@ -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;
+2
View File
@@ -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",
+16
View File
@@ -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: [],