mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-27 06:01:08 +08:00
Fixup user admin page
This commit is contained in:
parent
79f1619841
commit
9ba2bdb584
@ -1,3 +1,4 @@
|
||||
DROP VIEW IF EXISTS pinned_versions;
|
||||
CREATE OR REPLACE VIEW pinned_versions AS
|
||||
SELECT *
|
||||
FROM (SELECT DISTINCT ON (version_id) version_id,
|
||||
@ -40,6 +41,7 @@ CREATE OR REPLACE VIEW pinned_versions AS
|
||||
ORDER BY pv.created_at DESC)) AS pvs) AS t
|
||||
ORDER BY t.created_at DESC;
|
||||
|
||||
DROP VIEW IF EXISTS pinned_projects;
|
||||
CREATE OR REPLACE VIEW pinned_projects AS
|
||||
SELECT DISTINCT ON (project_id) project_id,
|
||||
user_id,
|
||||
|
@ -86,39 +86,34 @@ useHead(useSeo(i18n.t("userAdmin.title") + " " + route.params.user, null, route,
|
||||
</Link>
|
||||
</PageTitle>
|
||||
<div class="flex lt-md:flex-col mb-2 gap-2">
|
||||
<Card class="basis-full md:basis-8/12">
|
||||
<Card class="basis-full">
|
||||
<template #header>{{ i18n.t("userAdmin.roles") }}</template>
|
||||
<div class="space-x-1">
|
||||
<Tag v-for="roleId in user?.roles" :key="roleId" :color="{ background: getRole(roleId).color }" :name="getRole(roleId).title" />
|
||||
</div>
|
||||
|
||||
<div class="flex mt-2">
|
||||
<div class="flex mt-2 items-center">
|
||||
<div class="flex-grow">
|
||||
<InputSelect v-model="selectedRole" :values="useBackendData.globalRoles.filter((role) => role.assignable)" item-text="title" item-value="value" />
|
||||
</div>
|
||||
<div>
|
||||
<Button size="medium" :disabled="!selectedRole || user?.roles.some((r) => getRole(r).value === selectedRole)" @click="processRole(true)">
|
||||
{{ i18n.t("general.add") }}
|
||||
</Button>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<Button size="medium" :disabled="!selectedRole || !user?.roles.some((r) => getRole(r).value === selectedRole)" @click="processRole(false)">
|
||||
{{ i18n.t("general.delete") }}
|
||||
</Button>
|
||||
<InputSelect
|
||||
v-model="selectedRole"
|
||||
:values="useBackendData.globalRoles.filter((r) => r.value !== 'Organization')"
|
||||
item-text="title"
|
||||
item-value="value"
|
||||
/>
|
||||
</div>
|
||||
<Button size="medium" :disabled="!selectedRole || user?.roles.some((r) => getRole(r).value === selectedRole)" class="ml-1" @click="processRole(true)">
|
||||
{{ i18n.t("general.add") }}
|
||||
</Button>
|
||||
<Button
|
||||
size="medium"
|
||||
:disabled="!selectedRole || !user?.roles.some((r) => getRole(r).value === selectedRole)"
|
||||
@click="processRole(false)"
|
||||
class="ml-1"
|
||||
>
|
||||
{{ i18n.t("general.delete") }}
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
<Card class="basis-full md:basis-4/12">
|
||||
<template #header>{{ i18n.t("userAdmin.sidebar") }}</template>
|
||||
<ul>
|
||||
<li>
|
||||
<Link :href="_authUrl">{{ i18n.t("userAdmin.hangarAuth") }}</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link :href="_forumUserUrl">{{ i18n.t("userAdmin.forum") }}</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<Card md="mb-2">
|
||||
@ -139,7 +134,8 @@ useHead(useSeo(i18n.t("userAdmin.title") + " " + route.params.user, null, route,
|
||||
{{ getRole(orgs[item.name].roleId).title }}
|
||||
</template>
|
||||
<template #item_accepted="{ item }">
|
||||
<InputCheckbox v-model="orgs[item.name].accepted" :disabled="true" />
|
||||
<IconMdiCheck v-if="orgs[item.name].accepted" class="text-green" />
|
||||
<IconMdiClose v-else class="text-red" />
|
||||
</template>
|
||||
</SortableTable>
|
||||
</Card>
|
||||
@ -157,12 +153,13 @@ useHead(useSeo(i18n.t("userAdmin.title") + " " + route.params.user, null, route,
|
||||
{{ item.namespace.owner }}
|
||||
</Link>
|
||||
</template>
|
||||
<template #item_role="{ item }">
|
||||
<!-- todo add role -->
|
||||
<{{ item.name }}'s role>
|
||||
</template>
|
||||
<!-- todo -->
|
||||
<!--<template #item_role="{ item }">
|
||||
{{ item.name }}
|
||||
</template>-->
|
||||
<template #item_accepted="{ item }">
|
||||
<InputCheckbox :model-value="item.visibility === 'public'" :disabled="true" />
|
||||
<IconMdiCheck v-if="item.visibility === 'public'" class="text-green" />
|
||||
<IconMdiClose v-else class="text-red" />
|
||||
</template>
|
||||
</SortableTable>
|
||||
</Card>
|
||||
|
1
frontend/src/types/generated/icons.d.ts
vendored
1
frontend/src/types/generated/icons.d.ts
vendored
@ -14,6 +14,7 @@ declare module "@vue/runtime-core" {
|
||||
IconMdiAlertBox: typeof import("~icons/mdi/alert-box")["default"];
|
||||
IconMdiAlertDecagram: typeof import("~icons/mdi/alert-decagram")["default"];
|
||||
IconMdiAlertOutline: typeof import("~icons/mdi/alert-outline")["default"];
|
||||
IconMdiAlphaX: typeof import("~icons/mdi/alpha-x")["default"];
|
||||
IconMdiBell: typeof import("~icons/mdi/bell")["default"];
|
||||
IconMdiBellOutline: typeof import("~icons/mdi/bell-outline")["default"];
|
||||
IconMdiBookshelf: typeof import("~icons/mdi/bookshelf")["default"];
|
||||
|
Loading…
Reference in New Issue
Block a user