aboutsummaryrefslogtreecommitdiff
path: root/extension/src/entries/popup/Components/Login.vue
blob: c86343072fca6c2dd45e60c2cd4c34c46b6c0d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
    <div id="login-template" class="py-4">
        <form class="" @submit.prevent="onSubmit">
            <fieldset class="px-4 input-container">
                <label class="">Please enter your authentication token</label>
                <textarea class="w-full input" v-model="token" rows="5">
                </textarea>
            </fieldset>
            <div class="flex justify-end mt-2">
                <div class="px-3">
                    <button class="w-24 rounded btn sm primary">
                        <fa-icon v-if="waiting" icon="spinner" class="animate-spin" />
                        <span v-else>Submit</span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</template>

<script setup lang="ts">
import { useWait } from "@vnuge/vnlib.browser";
import { ref } from "vue";
import { useManagment } from "~/bg-api/popup.ts";

const { login } = useManagment()
const { waiting } = useWait()

const token = ref('')

const onSubmit = async () => {
  //console.log(token.value)
  await login(token.value)
}

</script>

<style lang="scss">

</style>