From 687d9a1402bc4900a9a7779529d9143792e7cca1 Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:24:10 -0300 Subject: [PATCH] refresh and copy apikey --- src/components/instance/InstanceHeader.vue | 57 ++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/src/components/instance/InstanceHeader.vue b/src/components/instance/InstanceHeader.vue index f0e653e..f9b9b2a 100644 --- a/src/components/instance/InstanceHeader.vue +++ b/src/components/instance/InstanceHeader.vue @@ -26,14 +26,42 @@ {{ owner }} -

{{ instance.instance.instanceName }}

+

+ {{ instance.instance.instanceName }} + + mdi-key + {{ instance.instance.apikey.slice(0, 10) }}... + + {{ copied ? "mdi-check" : "mdi-content-copy" }} + + +

{{ instance.instance.profileStatus }}
+ + mdi-refresh + ({ disconnect: { confirm: false, loading: false }, restart: { loading: false, success: false }, + reload: false, + copied: false, statusMapper: statusMapper, AppStore: useAppStore(), }), methods: { + copyApikey() { + if (this.copied) return; + navigator.clipboard.writeText(this.instance.instance.apikey); + this.copied = true; + setTimeout(() => { + this.copied = false; + }, 5000); + }, + async refresh() { + try { + this.reload = true; + await this.AppStore.reconnect(); + } catch (e) { + console.log(e); + alert(e.message || e.error || "Erro desconhecido"); + } finally { + this.reload = false; + } + }, async restartInstance() { this.restart.loading = true; try {