Add spaces, the page tree and the Docwell design system
Spaces and pages: - Spaces inside workspaces, open or private, with admin/editor/commenter/viewer roles that cascade from the workspace role (rules in internal/access) - Page tree per space with fractional position keys, move with cycle checks, trash that hides whole subtrees, restore and permanent delete - OpenAPI, TypeScript client, and web app sidebar tree with drag-and-drop, page, space, trash and space settings views (EN + PL) Design system: - Tokens, type scale, radii and shadows from the design kit in @docwell/ui/theme.css; Inter, Source Serif 4 and JetBrains Mono bundled - Vue ports of Button, TextField, Badge, Callout, Icon, Breadcrumbs, SlashMenu and PageTreeItem, plus Logo; favicons and web manifest - Web app and admin panel restyled on the new tokens, in light and dark Also: fix the Vite dev server crashing on /config.json, and stop tracking the local Design/ and docs/ folders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4cb313aa95
commit
a96c6ad3ce
92 files changed
+5055
-892
No files matched your search
+15
-12
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { useTheme } from "@docwell/ui";
|
||||
import { DwBadge, DwButton, DwLogo, useTheme } from "@docwell/ui";
|
||||
import { useRouter } from "vue-router";
|
||||
import { computed } from "vue";
|
||||
import { currentUser, isSuperadmin, signOut } from "./session";
|
||||
@@ -32,29 +32,32 @@ function logout() {
|
||||
<template>
|
||||
<RouterView v-if="!currentUser" />
|
||||
<div v-else class="flex min-h-dvh flex-col md:flex-row">
|
||||
<aside class="flex flex-col border-b border-border bg-surface-muted md:w-56 md:border-r md:border-b-0">
|
||||
<div class="px-4 py-3 font-semibold">Docwell Admin</div>
|
||||
<nav class="flex gap-1 overflow-x-auto px-2 pb-2 text-sm md:flex-1 md:flex-col">
|
||||
<aside class="flex flex-col border-b border-line bg-surface-sunken md:w-56 md:border-r md:border-b-0">
|
||||
<div class="flex h-12 items-center gap-2 px-4">
|
||||
<DwLogo class="h-6" />
|
||||
<DwBadge tone="accent">Admin</DwBadge>
|
||||
</div>
|
||||
<nav class="flex gap-px overflow-x-auto px-2 pb-2 md:flex-1 md:flex-col">
|
||||
<RouterLink
|
||||
v-for="item in nav"
|
||||
:key="item.to"
|
||||
:to="item.to"
|
||||
class="rounded-md px-3 py-1.5 whitespace-nowrap hover:bg-surface"
|
||||
exact-active-class="bg-surface font-medium"
|
||||
class="flex h-control-sm items-center rounded-sm px-3 whitespace-nowrap text-ink-muted hover:bg-surface-hover hover:text-ink"
|
||||
exact-active-class="!bg-accent-soft font-semibold !text-accent"
|
||||
>
|
||||
{{ item.label }}
|
||||
</RouterLink>
|
||||
</nav>
|
||||
<div class="hidden border-t border-border p-3 text-sm md:block">
|
||||
<div class="truncate font-medium">{{ currentUser.name }}</div>
|
||||
<div class="truncate text-xs text-fg-muted">{{ currentUser.email }}</div>
|
||||
<div class="mt-1 text-xs text-fg-muted" data-testid="role">
|
||||
<div class="hidden border-t border-line p-3 md:block">
|
||||
<div class="truncate font-medium text-ink">{{ currentUser.name }}</div>
|
||||
<div class="truncate text-ui-sm text-ink-muted">{{ currentUser.email }}</div>
|
||||
<div class="mt-1 text-ui-sm text-ink-muted" data-testid="role">
|
||||
{{ isSuperadmin ? "Superadmin" : `Admin · ${currentUser.organizationName || "no organization"}` }}
|
||||
</div>
|
||||
<button class="mt-2 text-xs text-fg-muted hover:text-fg" @click="logout">Sign out</button>
|
||||
<DwButton variant="ghost" size="sm" icon="sign-out" class="mt-2 -ml-2" @click="logout">Sign out</DwButton>
|
||||
</div>
|
||||
</aside>
|
||||
<main class="flex-1 p-4 sm:p-8">
|
||||
<main class="min-w-0 flex-1 bg-surface p-4 sm:p-8">
|
||||
<RouterView />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ApiError } from "@docwell/api-client";
|
||||
import { DwButton } from "@docwell/ui";
|
||||
import { DwBadge, DwButton, DwCallout, DwLogo, DwTextField } from "@docwell/ui";
|
||||
import { ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { signIn } from "../session";
|
||||
@@ -35,20 +35,20 @@ async function submit() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid min-h-dvh place-items-center bg-surface-muted px-4">
|
||||
<form class="w-full max-w-sm space-y-4 rounded-xl border border-border bg-surface p-6 shadow-sm" @submit.prevent="submit">
|
||||
<h1 class="text-xl font-semibold">Docwell Admin</h1>
|
||||
<p class="text-sm text-fg-muted">Sign in with an organization admin or superadmin account.</p>
|
||||
<label class="block space-y-1 text-sm">
|
||||
<span class="font-medium">Email</span>
|
||||
<input v-model="email" type="email" autocomplete="email" required class="w-full rounded-md border border-border bg-surface px-3 py-2 outline-none focus:border-brand-500" />
|
||||
</label>
|
||||
<label class="block space-y-1 text-sm">
|
||||
<span class="font-medium">Password</span>
|
||||
<input v-model="password" type="password" autocomplete="current-password" required class="w-full rounded-md border border-border bg-surface px-3 py-2 outline-none focus:border-brand-500" />
|
||||
</label>
|
||||
<p v-if="error" role="alert" class="text-sm text-red-600">{{ error }}</p>
|
||||
<DwButton type="submit" class="w-full justify-center" :disabled="busy">Sign in</DwButton>
|
||||
</form>
|
||||
<div class="grid min-h-dvh place-items-center bg-surface-sunken px-4">
|
||||
<div class="w-full max-w-sm">
|
||||
<div class="mb-8 flex items-center justify-center gap-2">
|
||||
<DwLogo class="h-8" />
|
||||
<DwBadge tone="accent">Admin</DwBadge>
|
||||
</div>
|
||||
<form class="space-y-4 dw-card" @submit.prevent="submit">
|
||||
<h1 class="text-ui-lg">Sign in to the admin panel</h1>
|
||||
<p class="text-ink-muted">Use an organization admin or superadmin account.</p>
|
||||
<DwTextField v-model="email" label="Email" type="email" autocomplete="email" required />
|
||||
<DwTextField v-model="password" label="Password" type="password" autocomplete="current-password" required />
|
||||
<DwCallout v-if="error" tone="danger" size="ui">{{ error }}</DwCallout>
|
||||
<DwButton type="submit" variant="primary" class="w-full" :disabled="busy">Sign in</DwButton>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { Organization } from "@docwell/api-client";
|
||||
import { DwButton } from "@docwell/ui";
|
||||
import { DwButton, DwCallout } from "@docwell/ui";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { api, currentUser, errorMessage, isSuperadmin, reloadUser } from "../session";
|
||||
@@ -79,8 +79,8 @@ async function remove(o: Organization) {
|
||||
<template>
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold">{{ isSuperadmin ? "Organizations" : "Organization" }}</h1>
|
||||
<p class="text-sm text-fg-muted">
|
||||
<h1 class="text-2xl font-semibold tracking-tight">{{ isSuperadmin ? "Organizations" : "Organization" }}</h1>
|
||||
<p class="mt-1 text-ink-muted">
|
||||
{{
|
||||
isSuperadmin
|
||||
? "Every organization on this server. Admins of an organization manage only their own."
|
||||
@@ -88,38 +88,38 @@ async function remove(o: Organization) {
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
<DwButton v-if="isSuperadmin" @click="startNew">New organization</DwButton>
|
||||
<DwButton v-if="isSuperadmin" variant="primary" @click="startNew">New organization</DwButton>
|
||||
</div>
|
||||
|
||||
<p v-if="error" role="alert" class="mt-4 rounded-md bg-red-500/10 px-3 py-2 text-sm text-red-600">{{ error }}</p>
|
||||
<DwCallout v-if="error" tone="danger" size="ui" class="mt-4">{{ error }}</DwCallout>
|
||||
|
||||
<form v-if="editing" class="mt-4 flex flex-wrap items-end gap-2 rounded-lg border border-border bg-surface-muted p-4" @submit.prevent="save">
|
||||
<label class="flex-1 space-y-1 text-sm">
|
||||
<span>Name</span>
|
||||
<form v-if="editing" class="mt-4 flex flex-wrap items-end gap-2 dw-card !p-4" @submit.prevent="save">
|
||||
<label class="flex flex-1 flex-col gap-1.5">
|
||||
<span class="text-ui-sm font-semibold">Name</span>
|
||||
<input
|
||||
v-model="draft"
|
||||
required
|
||||
maxlength="120"
|
||||
class="w-full rounded-md border border-border bg-surface px-3 py-1.5 outline-none focus:border-brand-500"
|
||||
class="dw-input w-full"
|
||||
/>
|
||||
</label>
|
||||
<DwButton type="submit" :disabled="busy || !draft.trim()">{{ editing === "new" ? "Create" : "Save" }}</DwButton>
|
||||
<DwButton type="submit" variant="primary" :disabled="busy || !draft.trim()">{{ editing === "new" ? "Create" : "Save" }}</DwButton>
|
||||
<DwButton variant="ghost" :disabled="busy" @click="editing = null">Cancel</DwButton>
|
||||
</form>
|
||||
|
||||
<p v-if="!orgs.length && !error" class="mt-6 text-sm text-fg-muted">No organizations yet.</p>
|
||||
<ul v-else class="mt-6 divide-y divide-border rounded-lg border border-border">
|
||||
<p v-if="!orgs.length && !error" class="mt-6 text-ui-md text-ink-muted">No organizations yet.</p>
|
||||
<ul v-else class="mt-6 divide-y divide-line rounded-md border border-line bg-surface-raised">
|
||||
<li v-for="o in orgs" :key="o.id" class="flex flex-wrap items-center justify-between gap-3 px-4 py-3">
|
||||
<div class="min-w-0">
|
||||
<p class="truncate font-medium">{{ o.name }}</p>
|
||||
<p class="text-xs text-fg-muted">
|
||||
<p class="truncate font-medium text-ink">{{ o.name }}</p>
|
||||
<p class="text-ui-sm text-ink-muted">
|
||||
{{ o.members }} {{ o.members === 1 ? "member" : "members" }} · {{ o.workspaces }}
|
||||
{{ o.workspaces === 1 ? "workspace" : "workspaces" }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 gap-3 text-sm">
|
||||
<button class="text-brand-600 hover:underline" @click="startEdit(o)">Rename</button>
|
||||
<button class="text-red-600 hover:underline" :disabled="busy" @click="remove(o)">Delete</button>
|
||||
<div class="flex shrink-0 gap-1">
|
||||
<DwButton variant="ghost" size="sm" @click="startEdit(o)">Rename</DwButton>
|
||||
<DwButton variant="ghost" size="sm" class="!text-danger" :disabled="busy" @click="remove(o)">Delete</DwButton>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ApiError, type Status, type Version } from "@docwell/api-client";
|
||||
import { DwCallout } from "@docwell/ui";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { api } from "../session";
|
||||
|
||||
@@ -27,25 +28,25 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1 class="text-xl font-semibold">Overview</h1>
|
||||
<p v-if="error" class="mt-4 text-sm text-red-600">{{ error }}</p>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Overview</h1>
|
||||
<DwCallout v-if="error" tone="danger" size="ui" class="mt-4">{{ error }}</DwCallout>
|
||||
<div class="mt-6 grid gap-4 sm:grid-cols-3">
|
||||
<div class="rounded-lg border border-border p-4">
|
||||
<div class="text-xs text-fg-muted">Server version</div>
|
||||
<div class="mt-1 text-lg font-medium">{{ version?.version ?? "…" }}</div>
|
||||
<div class="rounded-md border border-line bg-surface-raised p-4">
|
||||
<div class="text-ui-sm text-ink-muted">Server version</div>
|
||||
<div class="mt-1 text-ui-lg">{{ version?.version ?? "…" }}</div>
|
||||
</div>
|
||||
<div class="rounded-lg border border-border p-4">
|
||||
<div class="text-xs text-fg-muted">Database</div>
|
||||
<div class="rounded-md border border-line bg-surface-raised p-4">
|
||||
<div class="text-ui-sm text-ink-muted">Database</div>
|
||||
<div
|
||||
class="mt-1 text-lg font-medium"
|
||||
:class="readiness?.status === 'ok' ? 'text-emerald-600' : readiness ? 'text-red-600' : ''"
|
||||
class="mt-1 text-ui-lg"
|
||||
:class="readiness?.status === 'ok' ? 'text-success' : readiness ? 'text-danger' : ''"
|
||||
>
|
||||
{{ readiness ? (readiness.status === "ok" ? "Connected" : "Unavailable") : "…" }}
|
||||
</div>
|
||||
</div>
|
||||
<RouterLink to="/users" class="rounded-lg border border-border p-4 hover:bg-surface-muted">
|
||||
<div class="text-xs text-fg-muted">Users</div>
|
||||
<div class="mt-1 text-lg font-medium" data-testid="user-count">{{ userCount ?? "…" }}</div>
|
||||
<RouterLink to="/users" class="rounded-md border border-line bg-surface-raised p-4 transition-colors duration-[120ms] hover:border-line-strong">
|
||||
<div class="text-ui-sm text-ink-muted">Users</div>
|
||||
<div class="mt-1 text-ui-lg" data-testid="user-count">{{ userCount ?? "…" }}</div>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<h1 class="text-xl font-semibold">{{ $route.meta.title }}</h1>
|
||||
<p class="mt-2 text-sm text-fg-muted">Not built yet. See docs/PLAN.md, section 8.</p>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">{{ $route.meta.title }}</h1>
|
||||
<p class="mt-2 text-ui-md text-ink-muted">Not built yet. See docs/PLAN.md, section 8.</p>
|
||||
</template>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { Organization, Role, User, UserList } from "@docwell/api-client";
|
||||
import { DwButton } from "@docwell/ui";
|
||||
import { DwBadge, DwButton, DwCallout } from "@docwell/ui";
|
||||
import { computed, onMounted, reactive, ref, watch } from "vue";
|
||||
import { api, currentUser, errorMessage, isSuperadmin } from "../session";
|
||||
|
||||
@@ -113,75 +113,74 @@ async function remove(u: User) {
|
||||
}
|
||||
}
|
||||
|
||||
const inputClass = "w-full rounded-md border border-border bg-surface px-3 py-1.5 text-sm outline-none focus:border-brand-500";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold">Users</h1>
|
||||
<p class="text-sm text-fg-muted">
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Users</h1>
|
||||
<p class="mt-1 text-ink-muted">
|
||||
{{ isSuperadmin ? "Everyone on this server." : `Members of ${currentUser?.organizationName}.` }}
|
||||
</p>
|
||||
</div>
|
||||
<DwButton @click="startNew">New user</DwButton>
|
||||
<DwButton variant="primary" @click="startNew">New user</DwButton>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex flex-wrap gap-2">
|
||||
<input v-model="search" type="search" placeholder="Search name or email" aria-label="Search users" :class="[inputClass, 'sm:w-64']" />
|
||||
<select v-if="isSuperadmin" v-model="orgFilter" aria-label="Filter by organization" :class="[inputClass, 'sm:w-56']">
|
||||
<input v-model="search" type="search" placeholder="Search name or email" aria-label="Search users" class="dw-input sm:w-64" />
|
||||
<select v-if="isSuperadmin" v-model="orgFilter" aria-label="Filter by organization" class="dw-input sm:w-56">
|
||||
<option value="">All organizations</option>
|
||||
<option value="none">No organization</option>
|
||||
<option v-for="o in orgs" :key="o.id" :value="o.id">{{ o.name }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<p v-if="error" role="alert" class="mt-4 rounded-md bg-red-500/10 px-3 py-2 text-sm text-red-600">{{ error }}</p>
|
||||
<DwCallout v-if="error" tone="danger" size="ui" class="mt-4">{{ error }}</DwCallout>
|
||||
|
||||
<form v-if="editing" class="mt-4 grid gap-3 rounded-lg border border-border bg-surface-muted p-4 sm:grid-cols-2" @submit.prevent="save">
|
||||
<h2 class="font-medium sm:col-span-2">{{ editing === "new" ? "New user" : `Edit ${editing.email}` }}</h2>
|
||||
<label class="space-y-1 text-sm">
|
||||
<span>Name</span>
|
||||
<input v-model="form.name" required :class="inputClass" />
|
||||
<form v-if="editing" class="mt-4 grid gap-3 dw-card !p-4 sm:grid-cols-2" @submit.prevent="save">
|
||||
<h2 class="text-ui-lg sm:col-span-2">{{ editing === "new" ? "New user" : `Edit ${editing.email}` }}</h2>
|
||||
<label class="flex flex-col gap-1.5">
|
||||
<span class="text-ui-sm font-semibold">Name</span>
|
||||
<input v-model="form.name" required class="dw-input" />
|
||||
</label>
|
||||
<label class="space-y-1 text-sm">
|
||||
<span>Email</span>
|
||||
<input v-model="form.email" type="email" required :class="inputClass" />
|
||||
<label class="flex flex-col gap-1.5">
|
||||
<span class="text-ui-sm font-semibold">Email</span>
|
||||
<input v-model="form.email" type="email" required class="dw-input" />
|
||||
</label>
|
||||
<label class="space-y-1 text-sm">
|
||||
<span>{{ editing === "new" ? "Password" : "New password (optional)" }}</span>
|
||||
<input v-model="form.password" type="password" autocomplete="new-password" :required="editing === 'new'" minlength="8" :class="inputClass" />
|
||||
<label class="flex flex-col gap-1.5">
|
||||
<span class="text-ui-sm font-semibold">{{ editing === "new" ? "Password" : "New password (optional)" }}</span>
|
||||
<input v-model="form.password" type="password" autocomplete="new-password" :required="editing === 'new'" minlength="8" class="dw-input" />
|
||||
</label>
|
||||
<label class="space-y-1 text-sm">
|
||||
<span>Role</span>
|
||||
<select v-model="form.role" :disabled="isSelf" :class="inputClass">
|
||||
<label class="flex flex-col gap-1.5">
|
||||
<span class="text-ui-sm font-semibold">Role</span>
|
||||
<select v-model="form.role" :disabled="isSelf" class="dw-input">
|
||||
<option v-for="r in roles" :key="r" :value="r">{{ roleLabel[r] }}</option>
|
||||
</select>
|
||||
<span v-if="isSelf" class="text-xs text-fg-muted">You cannot change your own role.</span>
|
||||
<span v-if="isSelf" class="text-ui-sm text-ink-muted">You cannot change your own role.</span>
|
||||
</label>
|
||||
<label v-if="isSuperadmin" class="space-y-1 text-sm">
|
||||
<span>Organization</span>
|
||||
<select v-model="form.organization" :class="inputClass">
|
||||
<label v-if="isSuperadmin" class="flex flex-col gap-1.5">
|
||||
<span class="text-ui-sm font-semibold">Organization</span>
|
||||
<select v-model="form.organization" class="dw-input">
|
||||
<option value="">No organization</option>
|
||||
<option v-for="o in orgs" :key="o.id" :value="o.id">{{ o.name }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-if="editing !== 'new'" class="space-y-1 text-sm">
|
||||
<span>Status</span>
|
||||
<select v-model="form.status" :disabled="isSelf" :class="inputClass">
|
||||
<label v-if="editing !== 'new'" class="flex flex-col gap-1.5">
|
||||
<span class="text-ui-sm font-semibold">Status</span>
|
||||
<select v-model="form.status" :disabled="isSelf" class="dw-input">
|
||||
<option value="active">Active</option>
|
||||
<option value="disabled">Disabled</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="flex gap-2 sm:col-span-2">
|
||||
<DwButton type="submit" :disabled="busy">{{ editing === "new" ? "Create user" : "Save" }}</DwButton>
|
||||
<DwButton type="submit" variant="primary" :disabled="busy">{{ editing === "new" ? "Create user" : "Save" }}</DwButton>
|
||||
<DwButton variant="ghost" :disabled="busy" @click="editing = null">Cancel</DwButton>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-6 overflow-x-auto rounded-lg border border-border">
|
||||
<table class="w-full text-left text-sm">
|
||||
<thead class="bg-surface-muted text-xs text-fg-muted">
|
||||
<div class="mt-6 overflow-x-auto rounded-md border border-line bg-surface-raised">
|
||||
<table class="w-full text-left text-ui-md">
|
||||
<thead class="bg-surface-sunken text-ui-xs uppercase text-ink-muted">
|
||||
<tr>
|
||||
<th class="px-4 py-2 font-medium">Name</th>
|
||||
<th class="px-4 py-2 font-medium">Email</th>
|
||||
@@ -192,33 +191,33 @@ const inputClass = "w-full rounded-md border border-border bg-surface px-3 py-1.
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="u in list?.items" :key="u.id" class="border-t border-border">
|
||||
<tr v-for="u in list?.items" :key="u.id" class="border-t border-line">
|
||||
<td class="px-4 py-2 font-medium">{{ u.name }}</td>
|
||||
<td class="px-4 py-2">{{ u.email }}</td>
|
||||
<td class="px-4 py-2">{{ roleLabel[u.role] }}</td>
|
||||
<td v-if="isSuperadmin" class="px-4 py-2">{{ u.organizationName || "—" }}</td>
|
||||
<td class="px-4 py-2 capitalize">{{ u.status }}</td>
|
||||
<td class="px-4 py-2">
|
||||
<DwBadge :tone="u.status === 'active' ? 'success' : u.status === 'disabled' ? 'danger' : 'neutral'" class="capitalize">{{ u.status }}</DwBadge>
|
||||
</td>
|
||||
<td class="px-4 py-2 text-right whitespace-nowrap">
|
||||
<template v-if="canEdit(u)">
|
||||
<button class="text-brand-600 hover:underline" @click="startEdit(u)">Edit</button>
|
||||
<button v-if="u.id !== currentUser?.id" class="ml-3 text-red-600 hover:underline" :disabled="busy" @click="remove(u)">
|
||||
<DwButton variant="ghost" size="sm" @click="startEdit(u)">Edit</DwButton>
|
||||
<DwButton v-if="u.id !== currentUser?.id" variant="ghost" size="sm" class="!text-danger" :disabled="busy" @click="remove(u)">
|
||||
Delete
|
||||
</button>
|
||||
</DwButton>
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="list && list.items.length === 0">
|
||||
<td :colspan="isSuperadmin ? 6 : 5" class="px-4 py-6 text-center text-fg-muted">No users found.</td>
|
||||
<td :colspan="isSuperadmin ? 6 : 5" class="px-4 py-6 text-center text-ink-muted">No users found.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div v-if="list && list.totalItems > perPage" class="mt-4 flex items-center gap-3 text-sm">
|
||||
<button class="rounded border border-border px-2 py-1 disabled:opacity-40" :disabled="page <= 1" @click="page--">Previous</button>
|
||||
<span class="text-fg-muted">Page {{ page }} of {{ Math.ceil(list.totalItems / perPage) }}</span>
|
||||
<button class="rounded border border-border px-2 py-1 disabled:opacity-40" :disabled="page * perPage >= list.totalItems" @click="page++">
|
||||
Next
|
||||
</button>
|
||||
<div v-if="list && list.totalItems > perPage" class="mt-4 flex items-center gap-3 text-ui-md">
|
||||
<DwButton size="sm" :disabled="page <= 1" @click="page--">Previous</DwButton>
|
||||
<span class="text-ink-muted">Page {{ page }} of {{ Math.ceil(list.totalItems / perPage) }}</span>
|
||||
<DwButton size="sm" :disabled="page * perPage >= list.totalItems" @click="page++">Next</DwButton>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user