1 Commits
8.2.0 ... main

View File

@@ -118,7 +118,10 @@
@change="fieldValueChanged('agent')" @change="fieldValueChanged('agent')"
></v-checkbox> ></v-checkbox>
</v-col> </v-col>
<v-col v-if="obj.agent && obj.id != 0" cols="12"> <v-col
v-if="obj.agent && obj.id != 0 && !formState.dirty"
cols="12"
>
<v-card outlined class="pa-3" data-cy="agentTokens"> <v-card outlined class="pa-3" data-cy="agentTokens">
<div class="text-subtitle-1"> <div class="text-subtitle-1">
{{ $sock.t("AgentTokens") }} {{ $sock.t("AgentTokens") }}
@@ -136,6 +139,15 @@
> >
<code>{{ newAgentToken }}</code> <code>{{ newAgentToken }}</code>
</div> </div>
<v-btn
small
class="mt-2"
data-cy="copyAgentToken"
@click="copyAgentToken()"
>
<v-icon small left>$sockiCopy</v-icon>
{{ $sock.t("CopyToClipboard") }}
</v-btn>
</v-alert> </v-alert>
<v-simple-table v-if="agentTokens.length > 0" dense> <v-simple-table v-if="agentTokens.length > 0" dense>
<tbody> <tbody>
@@ -198,7 +210,13 @@
</v-row> </v-row>
</v-card> </v-card>
</v-col> </v-col>
<v-col v-if="obj.allowLogin" cols="12" sm="6" lg="4" xl="3"> <v-col
v-if="obj.allowLogin && !obj.agent"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field <v-text-field
id="username" id="username"
ref="login" ref="login"
@@ -217,7 +235,13 @@
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col v-if="obj.allowLogin" cols="12" sm="6" lg="4" xl="3"> <v-col
v-if="obj.allowLogin && !obj.agent"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field <v-text-field
id="password" id="password"
ref="password" ref="password"
@@ -962,6 +986,13 @@ export default {
window.$gz.locale.getHour12() window.$gz.locale.getHour12()
); );
}, },
copyAgentToken() {
window.$gz.util.copyToClipboard(this.newAgentToken);
window.$gz.eventBus.$emit(
"notify-success",
this.$sock.t("CopyToClipboard")
);
},
async getAgentTokens() { async getAgentTokens() {
const vm = this; const vm = this;
vm.newAgentToken = null; vm.newAgentToken = null;
@@ -1276,6 +1307,7 @@ async function fetchTranslatedText() {
"AgentTokenRevoke", "AgentTokenRevoke",
"AgentTokenRevoked", "AgentTokenRevoked",
"AgentTokenNone", "AgentTokenNone",
"CopyToClipboard",
"Vendor", "Vendor",
"User", "User",
"UserSettings", "UserSettings",