mirror of https://github.com/wg-easy/wg-easy
8 changed files with 170 additions and 151 deletions
@ -1,32 +1,26 @@ |
|||
<!-- ClientNewButton.vue --> |
|||
<template> |
|||
<div |
|||
class="flex flex-row flex-auto items-center p-3 px-5 border-b-2 border-gray-100 dark:border-neutral-600" |
|||
> |
|||
<div class="flex-grow"> |
|||
<p class="text-2xl font-medium dark:text-neutral-200">Clients</p> |
|||
</div> |
|||
<div class="flex-shrink-0"> |
|||
<button |
|||
@click="createNewClient" |
|||
class="hover:bg-red-800 hover:border-red-800 hover:text-white text-gray-700 dark:text-neutral-200 border-2 border-gray-100 dark:border-neutral-600 py-2 px-4 rounded inline-flex items-center transition" |
|||
> |
|||
<IconNew class="w-4 mr-2" /> |
|||
<span class="text-sm">New</span> |
|||
</button> |
|||
</div> |
|||
<div> |
|||
<button |
|||
class="hover:bg-red-800 hover:border-red-800 hover:text-white text-gray-700 dark:text-neutral-200 border-2 border-gray-100 dark:border-neutral-600 py-2 px-4 rounded inline-flex items-center transition" |
|||
@click="handleNewClient()" |
|||
> |
|||
<IconNew class="w-4 mr-2" /> |
|||
<span class="text-sm">New</span> |
|||
</button> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
<script setup> |
|||
import { storeToRefs } from 'pinia'; |
|||
import { useStore } from '@/store/store'; |
|||
import IconNew from './icons/IconNew.vue'; |
|||
|
|||
export default { |
|||
methods: { |
|||
createNewClient() { |
|||
this.$emit('create-new-client'); |
|||
}, |
|||
}, |
|||
components: { IconNew }, |
|||
const store = useStore(); |
|||
const { clientCreateShowModal, clientCreateName } = storeToRefs(store); |
|||
|
|||
const handleNewClient = () => { |
|||
clientCreateShowModal.value = true; |
|||
clientCreateName.value = ''; |
|||
}; |
|||
</script> |
|||
|
|||
@ -0,0 +1,31 @@ |
|||
<template> |
|||
<div> |
|||
<span |
|||
v-if="requiresPassword" |
|||
class="text-sm text-gray-400 dark:text-neutral-400 mb-10 mr-2 mt-3 cursor-pointer hover:underline float-right" |
|||
@click="logout" |
|||
> |
|||
Logout |
|||
<IconLogout /> |
|||
</span> |
|||
<h1 class="text-4xl dark:text-neutral-200 font-medium mt-2 mb-2"> |
|||
<img src="@/assets/img/logo.png" width="32" class="inline align-middle dark:bg" /> |
|||
<span class="align-middle">WireGuard</span> |
|||
</h1> |
|||
<h2 class="text-sm text-gray-400 dark:text-neutral-400 mb-10"></h2> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import IconLogout from './icons/IconLogout.vue'; |
|||
|
|||
import { useStore } from '@/store/store'; |
|||
import { storeToRefs } from 'pinia'; |
|||
|
|||
const store = useStore(); |
|||
const { requiresPassword } = storeToRefs(store); |
|||
|
|||
const logout = store.logout; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
Loading…
Reference in new issue