feat: introducing self hosted admin dashboard package (#12)
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com> Co-authored-by: Anwarul Islam <anwaarulislaam@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2ba05a46ee
commit
3f59597864
83
packages/hoppscotch-sh-admin/src/pages/dashboard.vue
Normal file
83
packages/hoppscotch-sh-admin/src/pages/dashboard.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<div class="sm:px-6 p-4">
|
||||
<h3 class="text-3xl font-medium text-gray-800 dark:text-gray-200">
|
||||
Dashboard
|
||||
</h3>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="flex flex-wrap -mx-6">
|
||||
<div class="w-full px-6 sm:w-1/2 xl:w-1/3">
|
||||
<div
|
||||
class="flex items-center px-5 py-6 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<icon-lucide-user-cog class="text-2xl text-emerald-500" />
|
||||
|
||||
<div class="mx-5">
|
||||
<h4
|
||||
class="text-2xl font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
1000
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-400">Total Users</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full px-6 mt-6 sm:w-1/2 xl:w-1/3 sm:mt-0">
|
||||
<div
|
||||
class="flex items-center px-5 py-6 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<icon-lucide-users class="text-2xl text-pink-400" />
|
||||
|
||||
<div class="mx-5">
|
||||
<h4
|
||||
class="text-2xl font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
200
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-400">Total Teams</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full px-6 mt-6 sm:w-1/2 xl:w-1/3 xl:mt-0">
|
||||
<div
|
||||
class="flex items-center px-5 py-6 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<icon-lucide-lock class="text-2xl text-cyan-400" />
|
||||
|
||||
<div class="mx-5">
|
||||
<h4
|
||||
class="text-2xl font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
20
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-400">Total Roles</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full px-6 mt-6 sm:w-1/2 xl:w-1/3 xl:mt-10">
|
||||
<div
|
||||
class="flex items-center px-5 py-6 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<icon-lucide-line-chart class="text-2xl text-orange-400" />
|
||||
|
||||
<div class="mx-5">
|
||||
<h4
|
||||
class="text-2xl font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
215
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-400">
|
||||
Total Collections
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8"></div>
|
||||
</div>
|
||||
</template>
|
||||
114
packages/hoppscotch-sh-admin/src/pages/index.vue
Normal file
114
packages/hoppscotch-sh-admin/src/pages/index.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<div
|
||||
class="flex items-center justify-center h-screen px-6 bg-gray-200 dark:bg-gradient-to-r dark:from-zinc-700 dark:to-gray-900"
|
||||
>
|
||||
<div
|
||||
class="w-full max-w-lg p-8 bg-white dark:bg-gradient-to-r dark:from-zinc-800 dark:to-gray-900 rounded-lg shadow-md"
|
||||
>
|
||||
<div class="flex items-center justify-center mt-6">
|
||||
<div class="flex items-center">
|
||||
<img src="/public/cover.jpg" alt="" class="h-12" />
|
||||
|
||||
<span
|
||||
class="mx-2 text-2xl font-semibold text-gray-600 dark:text-gray-300"
|
||||
>Hoppscotch</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="mt-4" @submit.prevent="login">
|
||||
<label class="block">
|
||||
<span class="text-sm text-gray-400">Email</span>
|
||||
<input
|
||||
type="email"
|
||||
class="block w-full p-2 mt-1 bg-gray-700 border-gray-700 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
v-model="email"
|
||||
/>
|
||||
</label>
|
||||
|
||||
<label class="block mt-3">
|
||||
<span class="text-sm text-gray-400">Password</span>
|
||||
<input
|
||||
type="password"
|
||||
class="block w-full p-2 mt-1 bg-gray-700 border-gray-700 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
v-model="password"
|
||||
/>
|
||||
</label>
|
||||
|
||||
<div class="flex items-center justify-between mt-4">
|
||||
<div>
|
||||
<label class="inline-flex items-center">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="text-indigo-600 border-gray-200 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
/>
|
||||
<span class="mx-2 text-sm text-gray-400">Remember me</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a
|
||||
class="block text-sm text-emerald-700 fontme hover:underline"
|
||||
href="#"
|
||||
>Forgot your password?</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full px-4 py-2 text-sm text-center text-white bg-emerald-600 rounded-md focus:outline-none hover:bg-emerald-500"
|
||||
>
|
||||
Sign in
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full px-4 py-2 text-sm text-center text-white border border-gray-500 rounded-md focus:outline-none hover:bg-gray-700"
|
||||
>
|
||||
Sign in with Google
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full px-4 py-2 text-sm text-center text-white border border-gray-500 rounded-md focus:outline-none hover:bg-gray-700"
|
||||
>
|
||||
Sign in with Microsoft
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full px-4 py-2 text-sm text-center text-white border border-gray-500 rounded-md focus:outline-none hover:bg-gray-700"
|
||||
>
|
||||
Sign in with Github
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const router = useRouter();
|
||||
const email = ref('joel@gmail.com');
|
||||
const password = ref('@#!@#asdf1231!_!@#');
|
||||
|
||||
function login() {
|
||||
router.push('/dashboard');
|
||||
}
|
||||
</script>
|
||||
|
||||
<route lang="yaml">
|
||||
meta:
|
||||
layout: empty
|
||||
</route>
|
||||
5
packages/hoppscotch-sh-admin/src/pages/settings.vue
Normal file
5
packages/hoppscotch-sh-admin/src/pages/settings.vue
Normal file
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<h3 class="sm:px-6 p-4 text-3xl font-medium text-zinc-800 dark:text-gray-200">
|
||||
Settings
|
||||
</h3>
|
||||
</template>
|
||||
37
packages/hoppscotch-sh-admin/src/pages/teams/AddTeam.vue
Normal file
37
packages/hoppscotch-sh-admin/src/pages/teams/AddTeam.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<h3 class="sm:px-6 p-4 text-3xl font-medium text-zinc-800 dark:text-gray-200">
|
||||
Create Team
|
||||
</h3>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div class="px-6 rounded-md">
|
||||
<form>
|
||||
<div class="flex mt-4 ml-10">
|
||||
<div>
|
||||
<label
|
||||
class="text-gray-800 dark:text-gray-200 mr-5 text-lg"
|
||||
for="username"
|
||||
>Name:
|
||||
</label>
|
||||
<input
|
||||
class="w-96 p-2 mt-2 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="text"
|
||||
placeholder="Enter Name"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="mt-6"></div>
|
||||
|
||||
<div class="mx-10">
|
||||
<TeamsAddMembers />
|
||||
</div>
|
||||
|
||||
<div class="mt-8"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts"></script>
|
||||
144
packages/hoppscotch-sh-admin/src/pages/teams/details.vue
Normal file
144
packages/hoppscotch-sh-admin/src/pages/teams/details.vue
Normal file
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<div class="sm:px-6 p-4">
|
||||
<h3
|
||||
class="sm:px-6 p-4 text-3xl font-medium text-zinc-800 dark:text-gray-200"
|
||||
>
|
||||
Team Details
|
||||
</h3>
|
||||
|
||||
<div class="mt-5">
|
||||
<div class="flex flex-wrap justify-center mx-6">
|
||||
<div class="w-full px-4 sm:w-1/2 xl:w-1/3">
|
||||
<div
|
||||
class="h-80 px-6 py-6 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<div class="flex ml-3 mt-2">
|
||||
<icon-lucide-user class="text-emerald-400 text-3xl" />
|
||||
|
||||
<h4
|
||||
class="text-3xl ml-2 font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
Team Info
|
||||
</h4>
|
||||
</div>
|
||||
<div class="flex mt-5 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Team ID:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ team.id }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Team Name:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ team.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Creation Date:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ team.date }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Number of members:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ team.members }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full px-4 sm:w-1/2 xl:w-1/3">
|
||||
<div
|
||||
class="h-80 px-5 py-6 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<div class="flex ml-3 mt-2">
|
||||
<icon-lucide-line-chart class="text-yellow-300 text-3xl" />
|
||||
|
||||
<h4
|
||||
class="text-3xl ml-2 font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
Stats
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-5 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Number of Collections:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ stats.collections }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Number of Requests:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ stats.requests }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Number of Environments:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ stats.environments }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6"></div>
|
||||
|
||||
<div class="mx-10">
|
||||
<TeamsAddMembers />
|
||||
</div>
|
||||
|
||||
<div class="mt-8"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue';
|
||||
|
||||
interface Team {
|
||||
id: string;
|
||||
name: string;
|
||||
date: string;
|
||||
members: number;
|
||||
}
|
||||
|
||||
const team = reactive<Team>({
|
||||
id: 'absd123',
|
||||
name: 'SelfHosters',
|
||||
date: '30-01-2023',
|
||||
members: 20,
|
||||
});
|
||||
|
||||
interface Stats {
|
||||
collections: number;
|
||||
requests: number;
|
||||
environments: number;
|
||||
}
|
||||
|
||||
const stats = reactive<Stats>({
|
||||
collections: 10,
|
||||
requests: 20,
|
||||
environments: 30,
|
||||
});
|
||||
</script>
|
||||
173
packages/hoppscotch-sh-admin/src/pages/teams/index.vue
Normal file
173
packages/hoppscotch-sh-admin/src/pages/teams/index.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3
|
||||
class="sm:px-6 p-4 text-3xl font-medium text-zinc-800 dark:text-gray-200"
|
||||
>
|
||||
Teams
|
||||
</h3>
|
||||
|
||||
<div class="flex flex-col">
|
||||
<div class="py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-4 lg:-mx-8 lg:px-8">
|
||||
<div class="inline-block min-w-full overflow-hidden align-middle">
|
||||
<div class="sm:px-7 p-4">
|
||||
<div v-if="showOptions" class="flex w-full items-center mb-7">
|
||||
<button
|
||||
class="inline-flex mr-3 items-center h-8 pl-2.5 pr-2 rounded-md shadow text-gray-700 dark:text-gray-400 dark:border-gray-800 border-2 border-gray-200 leading-none py-0"
|
||||
>
|
||||
Last 30 days
|
||||
<icon-lucide-chevron-down
|
||||
class="w-4 ml-1.5 text-gray-400 dark:text-gray-600"
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex items-center h-8 pl-2.5 pr-2 rounded-md shadow text-gray-700 dark:text-gray-400 dark:border-gray-800 border-2 border-gray-200 leading-none py-0"
|
||||
>
|
||||
Filter by
|
||||
<icon-lucide-chevron-down
|
||||
class="w-4 ml-1.5 text-gray-400 dark:text-gray-600"
|
||||
/>
|
||||
</button>
|
||||
<router-link to="/teams/addteam">
|
||||
<button
|
||||
class="inline-flex items-center bg-emerald-700 h-8 ml-3 pl-2.5 pr-2 rounded-md shadow text-gray-200 dark:border-gray-800 border border-gray-200 leading-none py-0 hover:bg-emerald-700 focus:outline-none focus:bg-emerald-800"
|
||||
>
|
||||
Create Team
|
||||
</button>
|
||||
</router-link>
|
||||
<div
|
||||
class="ml-auto text-gray-400 text-xs sm:inline-flex hidden items-center"
|
||||
>
|
||||
<span class="mr-3">Page 2 of 4</span>
|
||||
<button
|
||||
class="inline-flex mr-2 items-center h-8 w-8 justify-center text-gray-400 rounded-md shadow border border-gray-200 dark:border-gray-800 leading-none py-0"
|
||||
>
|
||||
<icon-lucide-chevron-left class="text-xl" />
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex items-center h-8 w-8 justify-center text-gray-400 rounded-md shadow border border-gray-200 dark:border-gray-800 leading-none py-0"
|
||||
>
|
||||
<icon-lucide-chevron-right class="text-xl" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table class="w-full text-left">
|
||||
<thead>
|
||||
<tr
|
||||
class="text-zinc-900 dark:text-gray-200 border-b border-gray-300 dark:border-gray-600 text-sm"
|
||||
>
|
||||
<th class="font-normal px-3 pt-0 pb-3"></th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Team ID</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Team Name</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3 hidden md:table-cell">
|
||||
Members
|
||||
</th>
|
||||
<!-- <th class="font-normal px-3 pt-0 pb-3">Status</th> -->
|
||||
<th class="font-normal px-3 pt-0 pb-3">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-gray-600 dark:text-gray-300">
|
||||
<!-- <router-link :custom="true" class="" :to="'/team/detail'"> -->
|
||||
<tr
|
||||
v-for="team in teams"
|
||||
id="team.id"
|
||||
class="border-b border-gray-300 dark:border-gray-600 hover:bg-zinc-800 rounded-xl"
|
||||
@click="goToTeam"
|
||||
>
|
||||
<td>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="appearance-none bg-gray-600 checked:bg-emerald-600 rounded-md ml-3 w-5 h-5"
|
||||
name="radio"
|
||||
/>
|
||||
</label>
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1">
|
||||
<div class="flex">
|
||||
<span class="ml-3">
|
||||
{{ team.id }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td
|
||||
class="sm:p-3 py-2 px-1 md:table-cell hidden text-sky-500 dark:text-sky-300"
|
||||
>
|
||||
{{ team.name }}
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1 justify-center">
|
||||
{{ team.members }}
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1">
|
||||
<div class="flex items-center">
|
||||
<div class="sm:flex hidden flex-col">
|
||||
{{ team.date }}
|
||||
<div class="text-gray-400 text-xs">11:16 AM</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<button
|
||||
class="w-8 h-8 inline-flex items-center justify-right text-gray-400"
|
||||
>
|
||||
<icon-lucide-more-horizontal />
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- </router-link> -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router';
|
||||
import { defineProps } from 'vue';
|
||||
|
||||
defineProps({
|
||||
showOptions: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
interface Team {
|
||||
id: string;
|
||||
name: string;
|
||||
members: number;
|
||||
date: string;
|
||||
}
|
||||
|
||||
const teams: Array<Team> = [
|
||||
{
|
||||
id: '123e4',
|
||||
name: 'HoppMain',
|
||||
members: 100,
|
||||
date: '15-01-2023',
|
||||
},
|
||||
{
|
||||
id: '12vbe',
|
||||
name: 'Hopp',
|
||||
members: 10,
|
||||
date: '19-05-2023',
|
||||
},
|
||||
{
|
||||
id: 'bg1d2',
|
||||
name: 'Kratos',
|
||||
members: 59,
|
||||
date: '15-03-2023',
|
||||
},
|
||||
];
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const goToTeam = () => {
|
||||
router.push('/teams/details');
|
||||
};
|
||||
</script>
|
||||
125
packages/hoppscotch-sh-admin/src/pages/users/AddUser.vue
Normal file
125
packages/hoppscotch-sh-admin/src/pages/users/AddUser.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<h3 class="sm:px-6 p-4 text-3xl font-medium text-zinc-800 dark:text-gray-200">
|
||||
Add User
|
||||
</h3>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div class="px-6 rounded-md">
|
||||
<form @submit.prevent="register">
|
||||
<div class="grid gap-6 mt-4">
|
||||
<div>
|
||||
<label class="text-gray-800 dark:text-gray-200" for="username"
|
||||
>Name</label
|
||||
>
|
||||
<input
|
||||
class="w-full mt-2 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="text"
|
||||
placeholder="Enter Name"
|
||||
v-model="user.name"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-gray-800 dark:text-gray-200" for="username"
|
||||
>Username</label
|
||||
>
|
||||
<input
|
||||
class="w-full mt-2 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="text"
|
||||
placeholder="Enter Username"
|
||||
v-model="user.username"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-gray-800 dark:text-gray-200" for="emailAddress"
|
||||
>Email Address</label
|
||||
>
|
||||
<input
|
||||
class="w-full mt-2 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="email"
|
||||
placeholder="Enter Email Address"
|
||||
v-model="user.email"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2">
|
||||
<div class="sm:mt-0 sm:mr-3">
|
||||
<label class="text-gray-800 dark:text-gray-200" for="password"
|
||||
>Password</label
|
||||
>
|
||||
<input
|
||||
class="w-full mt-2 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="password"
|
||||
placeholder="Enter Password"
|
||||
v-model="user.password"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 ml-0 sm:mt-0 sm:ml-3">
|
||||
<label
|
||||
class="text-gray-800 dark:text-gray-200"
|
||||
for="passwordConfirmation"
|
||||
>Password Confirmation</label
|
||||
>
|
||||
<input
|
||||
class="w-full mt-2 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="password"
|
||||
placeholder="Password Confirmation"
|
||||
v-model="user.confirm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-center sm:justify-start mt-8">
|
||||
<router-link to="/user">
|
||||
<button
|
||||
class="px-4 py-2 text-gray-200 bg-emerald-900 rounded-md hover:bg-emerald-700 focus:outline-none focus:bg-emerald-800"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
</router-link>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
open: {
|
||||
type: Boolean,
|
||||
},
|
||||
});
|
||||
|
||||
interface User {
|
||||
name: string;
|
||||
username: string;
|
||||
email: string;
|
||||
password: string;
|
||||
confirm: string;
|
||||
}
|
||||
|
||||
const user = ref<User>({
|
||||
name: '',
|
||||
username: '',
|
||||
email: '',
|
||||
password: '',
|
||||
confirm: '',
|
||||
});
|
||||
|
||||
const register = () => {
|
||||
const data = JSON.parse(JSON.stringify(user.value));
|
||||
console.log('Registered: ', data);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.modal {
|
||||
transition: opacity 0.25s ease;
|
||||
}
|
||||
</style>
|
||||
126
packages/hoppscotch-sh-admin/src/pages/users/details.vue
Normal file
126
packages/hoppscotch-sh-admin/src/pages/users/details.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div class="sm:px-6 p-4">
|
||||
<h3
|
||||
class="sm:px-6 p-4 text-3xl font-medium text-gray-800 dark:text-gray-200"
|
||||
>
|
||||
User Detail
|
||||
</h3>
|
||||
|
||||
<div class="mt-5">
|
||||
<div class="flex flex-wrap justify-center mx-6">
|
||||
<div class="w-full px-4 sm:w-1/2 xl:w-1/3">
|
||||
<div
|
||||
class="h-80 px-6 py-6 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<div class="flex ml-3 mt-2">
|
||||
<icon-lucide-user class="text-emerald-400 text-3xl" />
|
||||
|
||||
<h4
|
||||
class="text-3xl ml-2 font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
User Info
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-5 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Name:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ user.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Username:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ user.username }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Email:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ user.email }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Password:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ user.password }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full px-6 sm:w-1/2 xl:w-1/3">
|
||||
<div
|
||||
class="h-80 px-5 py-5 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-sm"
|
||||
>
|
||||
<div class="flex ml-5 mt-2">
|
||||
<icon-lucide-line-chart class="text-yellow-300 text-3xl" />
|
||||
|
||||
<h4
|
||||
class="text-3xl ml-2 font-semibold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
Stats
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-5 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Role:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">
|
||||
{{ user.role }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2 ml-5 text-xl">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-400">
|
||||
Number of Teams:
|
||||
</h4>
|
||||
<div class="text-gray-600 dark:text-gray-200 ml-2">10</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-8"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
interface User {
|
||||
name: string;
|
||||
username: string;
|
||||
email: string;
|
||||
password: string;
|
||||
confirm: string;
|
||||
role: string;
|
||||
}
|
||||
|
||||
const user = ref<User>({
|
||||
name: 'Joel',
|
||||
username: 'joeljs',
|
||||
email: 'joel@gmail.com',
|
||||
password: 'joel@2436',
|
||||
confirm: 'yes',
|
||||
role: 'Owner',
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.modal {
|
||||
transition: opacity 0.25s ease;
|
||||
}
|
||||
</style>
|
||||
265
packages/hoppscotch-sh-admin/src/pages/users/index.vue
Normal file
265
packages/hoppscotch-sh-admin/src/pages/users/index.vue
Normal file
@@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3
|
||||
class="sm:px-6 p-4 text-3xl font-medium text-zinc-800 dark:text-gray-200"
|
||||
>
|
||||
Users
|
||||
</h3>
|
||||
|
||||
<div class="flex flex-col">
|
||||
<div class="py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-4 lg:-mx-8 lg:px-8">
|
||||
<div class="inline-block min-w-full overflow-hidden align-middle">
|
||||
<div class="sm:px-7 p-4">
|
||||
<div class="flex w-full items-center mb-7">
|
||||
<button
|
||||
class="inline-flex mr-3 items-center h-8 pl-2.5 pr-2 rounded-md shadow text-gray-700 dark:text-gray-400 dark:border-gray-800 border-2 border-gray-200 leading-none py-0"
|
||||
>
|
||||
Last 30 days
|
||||
<icon-lucide-chevron-down
|
||||
class="w-4 ml-1.5 text-gray-400 dark:text-gray-600"
|
||||
/>
|
||||
</button>
|
||||
|
||||
<div class="relative">
|
||||
<button
|
||||
@click="dropdownOpen = !dropdownOpen"
|
||||
class="inline-flex items-center h-8 pl-2.5 pr-2 rounded-md shadow text-gray-700 dark:text-gray-400 dark:border-gray-800 border-2 border-gray-200 leading-none py-0"
|
||||
>
|
||||
Filter by
|
||||
<icon-lucide-chevron-down
|
||||
class="w-4 ml-1.5 text-gray-400 dark:text-gray-600"
|
||||
/>
|
||||
</button>
|
||||
|
||||
<div
|
||||
v-show="dropdownOpen"
|
||||
@click="dropdownOpen = false"
|
||||
class="fixed inset-0 z-10 w-full h-full"
|
||||
></div>
|
||||
|
||||
<transition
|
||||
enter-active-class="transition duration-150 ease-out transform"
|
||||
enter-from-class="scale-95 opacity-0"
|
||||
enter-to-class="scale-100 opacity-100"
|
||||
leave-active-class="transition duration-150 ease-in transform"
|
||||
leave-from-class="scale-100 opacity-100"
|
||||
leave-to-class="scale-95 opacity-0"
|
||||
>
|
||||
<div
|
||||
v-show="dropdownOpen"
|
||||
class="absolute left-0 z-20 w-48 mt-2 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-xl"
|
||||
>
|
||||
<button
|
||||
href="#"
|
||||
class="block w-full text-left rounded-md px-4 py-2 text-gray-800 dark:text-gray-200 hover:bg-emerald-700 hover:text-white"
|
||||
>
|
||||
Status
|
||||
</button>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
|
||||
<Modal v-if="open" :button="button" :title="title">
|
||||
<template #title>
|
||||
<p class="text-2xl font-bold">Invite User</p>
|
||||
</template>
|
||||
<template #content>
|
||||
<div>
|
||||
<div>
|
||||
<div class="px-6 rounded-md">
|
||||
<form>
|
||||
<div class="my-4">
|
||||
<div>
|
||||
<label
|
||||
class="text-gray-800 dark:text-gray-200"
|
||||
for="emailAddress"
|
||||
>Email Address</label
|
||||
>
|
||||
<input
|
||||
class="w-full p-3 mt-3 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="email"
|
||||
v-model="email"
|
||||
placeholder="Enter Email Address"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end my-2 pt-3">
|
||||
<button
|
||||
@click="sendInvite"
|
||||
class="px-4 py-2 font-medium tracking-wide text-white bg-emerald-700 rounded-md hover:bg-emerald-600 focus:outline-none"
|
||||
>
|
||||
Send Invite
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Modal>
|
||||
|
||||
<button
|
||||
class="inline-flex items-center bg-zinc-700 h-8 ml-3 pl-2.5 pr-2 rounded-md shadow text-gray-200 dark:border-gray-800 border border-gray-200 leading-none py-0 hover:bg-emerald-700 focus:outline-none focus:bg-emerald-800"
|
||||
>
|
||||
<router-link :to="'/users/invited'">
|
||||
Invited Users
|
||||
</router-link>
|
||||
</button>
|
||||
<div
|
||||
class="ml-auto text-gray-400 text-xs sm:inline-flex hidden items-center"
|
||||
>
|
||||
<span class="mr-3">Page 2 of 4</span>
|
||||
<button
|
||||
class="inline-flex mr-2 items-center h-8 w-8 justify-center text-gray-400 rounded-md shadow border border-gray-200 dark:border-gray-800 leading-none py-0"
|
||||
>
|
||||
<icon-lucide-chevron-left class="text-xl" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex items-center h-8 w-8 justify-center text-gray-400 rounded-md shadow border border-gray-200 dark:border-gray-800 leading-none py-0"
|
||||
>
|
||||
<icon-lucide-chevron-right class="text-xl" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table class="w-full text-left">
|
||||
<thead>
|
||||
<tr
|
||||
class="text-zinc-900 dark:text-gray-200 border-b border-gray-300 dark:border-gray-600 text-sm"
|
||||
>
|
||||
<th class="font-normal px-3 pt-0 pb-3"></th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">User ID</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Sign-In Method</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3 hidden md:table-cell">
|
||||
Email
|
||||
</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Status</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="text-gray-600 dark:text-gray-300">
|
||||
<tr
|
||||
v-for="user in users"
|
||||
@click="goToUser"
|
||||
class="border-b border-gray-300 dark:border-gray-600 hover:bg-zinc-800 rounded-xl"
|
||||
>
|
||||
<td>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="appearance-none bg-gray-600 checked:bg-emerald-600 rounded-md ml-3 w-5 h-5"
|
||||
name="radio"
|
||||
/>
|
||||
</label>
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1">
|
||||
<div class="flex">
|
||||
<span class="ml-3 truncate">
|
||||
{{ user?.id }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1 0">
|
||||
<div class="flex items-center">
|
||||
{{ user?.signin }}
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="sm:p-3 py-2 px-1 md:table-cell hidden text-sky-500 dark:text-sky-300"
|
||||
>
|
||||
{{ user?.email }}
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1 text-green-500">
|
||||
{{ user?.status }}
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1">
|
||||
<div class="flex items-center">
|
||||
<div class="sm:flex hidden flex-col">
|
||||
{{ user?.date }}
|
||||
<div class="text-gray-400 text-xs">11:16 AM</div>
|
||||
</div>
|
||||
<button
|
||||
class="w-8 h-8 inline-flex items-center justify-center text-gray-400 ml-auto"
|
||||
>
|
||||
<icon-lucide-more-horizontal />
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import Modal from '../../components/app/Modal.vue';
|
||||
|
||||
const open = ref(true);
|
||||
|
||||
const sendInvite = () => {
|
||||
open.value = false;
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const { fetching, data } = useQuery({
|
||||
query: `
|
||||
query {
|
||||
me {
|
||||
displayName
|
||||
}
|
||||
}
|
||||
`,
|
||||
});
|
||||
|
||||
const goToUser = () => {
|
||||
router.push('/users/details');
|
||||
};
|
||||
|
||||
const email = ref('');
|
||||
|
||||
type User = {
|
||||
id: string;
|
||||
signin: string;
|
||||
email: string;
|
||||
status: string;
|
||||
date: string;
|
||||
};
|
||||
|
||||
const title = 'Invite User';
|
||||
const button = 'Send Invite';
|
||||
const dropdownOpen = ref(false);
|
||||
|
||||
const users: Array<User> = [
|
||||
{
|
||||
id: 'abc12',
|
||||
signin: 'Microsoft',
|
||||
email: 'joel@gmail.com',
|
||||
status: 'Active',
|
||||
date: '15-01-2023',
|
||||
},
|
||||
{
|
||||
id: 'zxc21',
|
||||
signin: 'Microsoft',
|
||||
email: 'andrew@gmail.com',
|
||||
status: 'Active',
|
||||
date: '15-01-2023',
|
||||
},
|
||||
{
|
||||
id: 'cadf4',
|
||||
signin: 'Microsoft',
|
||||
email: 'liyas@gmail.com',
|
||||
status: 'Active',
|
||||
date: '15-01-2023',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
226
packages/hoppscotch-sh-admin/src/pages/users/invited.vue
Normal file
226
packages/hoppscotch-sh-admin/src/pages/users/invited.vue
Normal file
@@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3
|
||||
class="sm:px-6 p-4 text-3xl font-medium text-zinc-800 dark:text-gray-200"
|
||||
>
|
||||
Invited Users
|
||||
</h3>
|
||||
|
||||
<div class="flex flex-col">
|
||||
<div class="py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-4 lg:-mx-8 lg:px-8">
|
||||
<div class="inline-block min-w-full overflow-hidden align-middle">
|
||||
<div class="sm:px-7 p-4">
|
||||
<div class="flex w-full items-center mb-7">
|
||||
<button
|
||||
class="inline-flex mr-3 items-center h-8 pl-2.5 pr-2 rounded-md shadow text-gray-700 dark:text-gray-400 dark:border-gray-800 border-2 border-gray-200 leading-none py-0"
|
||||
>
|
||||
Last 30 days
|
||||
<icon-lucide-chevron-down
|
||||
class="w-4 ml-1.5 text-gray-400 dark:text-gray-600"
|
||||
/>
|
||||
</button>
|
||||
|
||||
<div class="relative">
|
||||
<button
|
||||
@click="dropdownOpen = !dropdownOpen"
|
||||
class="inline-flex items-center h-8 pl-2.5 pr-2 rounded-md shadow text-gray-700 dark:text-gray-400 dark:border-gray-800 border-2 border-gray-200 leading-none py-0"
|
||||
>
|
||||
Filter by
|
||||
<icon-lucide-chevron-down
|
||||
class="w-4 ml-1.5 text-gray-400 dark:text-gray-600"
|
||||
/>
|
||||
</button>
|
||||
|
||||
<div
|
||||
v-show="dropdownOpen"
|
||||
@click="dropdownOpen = false"
|
||||
class="fixed inset-0 z-10 w-full h-full"
|
||||
></div>
|
||||
|
||||
<transition
|
||||
enter-active-class="transition duration-150 ease-out transform"
|
||||
enter-from-class="scale-95 opacity-0"
|
||||
enter-to-class="scale-100 opacity-100"
|
||||
leave-active-class="transition duration-150 ease-in transform"
|
||||
leave-from-class="scale-100 opacity-100"
|
||||
leave-to-class="scale-95 opacity-0"
|
||||
>
|
||||
<div
|
||||
v-show="dropdownOpen"
|
||||
class="absolute left-0 z-20 w-48 mt-2 bg-zinc-200 dark:bg-zinc-800 rounded-md shadow-xl"
|
||||
>
|
||||
<button
|
||||
href="#"
|
||||
class="block w-full text-left rounded-md px-4 py-2 text-gray-800 dark:text-gray-200 hover:bg-emerald-700 hover:text-white"
|
||||
>
|
||||
Status
|
||||
</button>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
|
||||
<Modal v-if="open" :button="button" :title="title">
|
||||
<template #title>
|
||||
<p class="text-2xl font-bold">Invite User</p>
|
||||
</template>
|
||||
<template #content>
|
||||
<div>
|
||||
<div>
|
||||
<div class="px-6 rounded-md">
|
||||
<form>
|
||||
<div class="my-4">
|
||||
<div>
|
||||
<label
|
||||
class="text-gray-800 dark:text-gray-200"
|
||||
for="emailAddress"
|
||||
>Email Address</label
|
||||
>
|
||||
<input
|
||||
class="w-full mt-2 dark:bg-zinc-800 border-gray-200 dark:border-gray-600 rounded-md focus:border-emerald-600 focus:ring focus:ring-opacity-40 focus:ring-emerald-500"
|
||||
type="email"
|
||||
placeholder="Enter Email Address"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Modal>
|
||||
|
||||
<div
|
||||
class="ml-auto text-gray-400 text-xs sm:inline-flex hidden items-center"
|
||||
>
|
||||
<span class="mr-3">Page 2 of 4</span>
|
||||
<button
|
||||
class="inline-flex mr-2 items-center h-8 w-8 justify-center text-gray-400 rounded-md shadow border border-gray-200 dark:border-gray-800 leading-none py-0"
|
||||
>
|
||||
<icon-lucide-chevron-left class="text-xl" />
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex items-center h-8 w-8 justify-center text-gray-400 rounded-md shadow border border-gray-200 dark:border-gray-800 leading-none py-0"
|
||||
>
|
||||
<icon-lucide-chevron-right class="text-xl" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table class="w-full text-left">
|
||||
<thead>
|
||||
<tr
|
||||
class="text-zinc-900 dark:text-gray-200 border-b border-gray-300 dark:border-gray-600 text-sm"
|
||||
>
|
||||
<th class="font-normal px-3 pt-0 pb-3"></th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Admin ID</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Admin Email</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3 hidden md:table-cell">
|
||||
Invitee Email
|
||||
</th>
|
||||
<th class="font-normal px-3 pt-0 pb-3">Invited On</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody
|
||||
v-for="user in invitedUsers"
|
||||
id="user.id"
|
||||
class="text-gray-600 dark:text-gray-300"
|
||||
>
|
||||
<tr
|
||||
@click="goToUser"
|
||||
class="border-b border-gray-300 dark:border-gray-600 hover:bg-zinc-800 rounded-xl"
|
||||
>
|
||||
<td>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="appearance-none bg-gray-600 checked:bg-emerald-600 rounded-md ml-3 w-5 h-5"
|
||||
name="radio"
|
||||
/>
|
||||
</label>
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1">
|
||||
<div class="flex">
|
||||
<span class="ml-3">
|
||||
{{ user.adminId }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="sm:p-3 py-2 px-1 text-sky-500 dark:text-sky-300">
|
||||
<div class="flex items-center">
|
||||
{{ user.adminEmail }}
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="sm:p-3 py-2 px-1 md:table-cell hidden text-sky-500 dark:text-sky-300"
|
||||
>
|
||||
{{ user.inviteeEmail }}
|
||||
</td>
|
||||
|
||||
<td class="sm:p-3 py-2 px-1">
|
||||
<div class="flex items-center">
|
||||
<div class="sm:flex hidden flex-col">
|
||||
{{ user.invitedOn }}
|
||||
<div class="text-gray-400 text-xs">11:16 AM</div>
|
||||
</div>
|
||||
<button
|
||||
class="w-8 h-8 inline-flex items-center justify-center text-gray-400 ml-auto"
|
||||
>
|
||||
<icon-lucide-more-horizontal />
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import Modal from '../../components/app/Modal.vue';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const goToUser = () => {
|
||||
router.push('/users/detail');
|
||||
};
|
||||
|
||||
const open = ref(false);
|
||||
const title = 'Invite User';
|
||||
const button = 'Send Invite';
|
||||
const dropdownOpen = ref(false);
|
||||
|
||||
type InvitedUser = {
|
||||
adminId: string;
|
||||
adminEmail: string;
|
||||
inviteeEmail: string;
|
||||
invitedOn: string;
|
||||
};
|
||||
|
||||
const invitedUsers: Array<InvitedUser> = [
|
||||
{
|
||||
adminId: 'abc12',
|
||||
adminEmail: 'joel@gmail.com',
|
||||
inviteeEmail: 'jack@gmail.com',
|
||||
invitedOn: '15-01-2023',
|
||||
},
|
||||
{
|
||||
adminId: 'zxc21',
|
||||
adminEmail: 'andrew@gmail.com',
|
||||
inviteeEmail: 'max@gmail.com',
|
||||
invitedOn: '15-01-2023',
|
||||
},
|
||||
{
|
||||
adminId: 'cadf4',
|
||||
adminEmail: 'liyas@gmail.com',
|
||||
inviteeEmail: 'john@gmail.com',
|
||||
invitedOn: '15-01-2023',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
Reference in New Issue
Block a user