Skip to content

Commit 4a78c99

Browse files
authored
Use textfield with visible key for API key generation (#250)
1 parent c3c3a5e commit 4a78c99

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Diff for: src/components/ApiKeyManagement.vue

+10-10
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@
7070
/>
7171
</v-card-text>
7272
<v-card-text v-else>
73-
This is the only time your API key will be accessable. Please copy it to your clipboard now and store it
73+
This is the only time your API key will be accessible. Please copy it to your clipboard now and store it
7474
in a secure location. You'll need it to access the API and won't be able to retrieve it again later.
75-
<br />
76-
<div class="d-flex justify-center">
77-
<v-btn class="mt-6" @click="copyApiKey(newApiKeyToken, isActive)" prepend-icon="mdi-content-copy"
78-
>Copy API key to clipboard</v-btn
79-
>
80-
</div>
75+
<v-text-field
76+
class="mt-3"
77+
v-model="newApiKeyToken"
78+
append-inner-icon="mdi-content-copy"
79+
@click="copyApiKey(newApiKeyToken)"
80+
hint="Click the textfield to copy the key to your clipboard"
81+
persistent-hint
82+
></v-text-field>
8183
</v-card-text>
8284
<v-card-actions v-if="!newApiKeyToken">
8385
<v-spacer></v-spacer>
@@ -170,14 +172,12 @@ export default {
170172
})
171173
.finally(() => {});
172174
},
173-
copyApiKey(text, isActive) {
175+
copyApiKey(text) {
174176
navigator.clipboard.writeText(text);
175177
this.$eventBus.emit("displayMessage", {
176178
status: "info",
177179
message: "API key copied to clipboard!"
178180
});
179-
this.newApiKeyToken = null;
180-
isActive.value = false;
181181
}
182182
}
183183
};

0 commit comments

Comments
 (0)