Skip to content

Commit

Permalink
ui adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed May 15, 2024
1 parent f4ce5ac commit 5ac5177
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 58 deletions.
52 changes: 24 additions & 28 deletions web/src/views/admin/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,30 @@ function handleChatHome() {
</script>

<template>
<div>
<div class="h-full dark:bg-[#24272e] transition-all">
<div class="h-full overflow-hidden" :class="getMobileClass">
<header
class="sticky flex items-center justify-between min-w-0 overflow-hidden h-14 z-30 border-b dark:border-neutral-800 bg-white/80 dark:bg-black/20 backdrop-blur">
<h1 v-if="isMobile"
class="flex-1 px-4 pr-6 overflow-hidden cursor-pointer select-none text-ellipsis whitespace-nowrap">
Admin
</h1>
<div v-if="isMobile" class="flex items-center">
<button class="flex items-center justify-center mr-5" @click="handleUpdateCollapsed">
<SvgIcon v-if="collapsed" class="text-2xl" icon="ri:align-justify" />
<SvgIcon v-else class="text-2xl" icon="ri:align-right" />
</button>
</div>
<h1 v-if="!isMobile"
class="flex-1 px-4 pr-6 overflow-hidden cursor-pointer select-none text-ellipsis whitespace-nowrap">
Admin
</h1>
<HoverButton @click="handleChatHome" class="mr-5">
<span class="text-xl text-[#4f555e] dark:text-white">
<SvgIcon icon="ic:baseline-home" />
</span>
</HoverButton>
</header>
<NLayout has-sider>
<div class="h-full flex flex-col" :class="getMobileClass">
<header
class="sticky flex items-center justify-between overflow-hidden h-14 z-30 border-b dark:border-neutral-800 bg-white/80 dark:bg-black/20 backdrop-blur">
<h1 v-if="isMobile"
class="flex-1 px-4 pr-6 overflow-hidden cursor-pointer select-none text-ellipsis whitespace-nowrap">
Admin
</h1>
<div v-if="isMobile" class="flex items-center">
<button class="flex items-center justify-center mr-5" @click="handleUpdateCollapsed">
<SvgIcon v-if="collapsed" class="text-2xl" icon="ri:align-justify" />
<SvgIcon v-else class="text-2xl" icon="ri:align-right" />
</button>
</div>
<h1 v-if="!isMobile"
class="flex-1 px-4 pr-6 overflow-hidden cursor-pointer select-none text-ellipsis whitespace-nowrap ml-16">
Admin
</h1>
<HoverButton @click="handleChatHome" class="mr-5">
<span class="text-xl text-[#4f555e] dark:text-white">
<SvgIcon icon="ic:baseline-home" />
</span>
</HoverButton>
</header>
<NLayout has-sider class="flex-1">
<NLayoutSider bordered collapse-mode="width" :width="240" :collapsed-width="64" :collapsed="collapsed"
:show-trigger="isMobile ? false : 'arrow-circle'" :style="getMobileClass" @collapse="collapsed = true"
@expand="collapsed = false">
Expand All @@ -130,7 +128,5 @@ function handleChatHome() {
<Permission :visible="needPermission" />
</NLayout>
</NLayout>
</div>
</div>
</div>
</template>
16 changes: 7 additions & 9 deletions web/src/views/admin/model/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,17 @@ function checkNoRowIsDefaultTrue(v: boolean) {
</script>

<template>
<div>
<NModal v-model:show="dialogVisible" :title="$t('admin.add_user_model_rate_limit')" preset="dialog">
<AddModelForm @new-row-added="addRow" />
</NModal>
<div class="flex items-center justify-end h-16 w-full border-b border-gray-200">
<div class="flex items-center justify-end h-14 w-full border-b border-gray-200">
<HoverButton @click="dialogVisible = true" class="mr-10">
<span class="text-xl">
<SvgIcon icon="material-symbols:library-add-rounded" />
</span>
</HoverButton>
</div>
<div class="m-5">
<NDataTable :columns="columns" :data="data" :loading="loading" />
</div>
</div>
<div class="m-5">
<NDataTable :columns="columns" :data="data" :loading="loading" />
</div>
<NModal v-model:show="dialogVisible" :title="$t('admin.add_user_model_rate_limit')" preset="dialog">
<AddModelForm @new-row-added="addRow" />
</NModal>
</template>
30 changes: 12 additions & 18 deletions web/src/views/admin/modelRateLimit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,17 @@ async function newRowAdded() {
</script>

<template>
<div class="h-full flex flex-col">
<NModal v-model:show="dialogVisible" :title="$t('admin.add_user_model_rate_limit')" preset="dialog">
<AddChatModelForm @new-row-added="newRowAdded" />
</NModal>
<div class="flex items-center justify-end h-16 w-full border-b border-gray-200">
<div class="flex justify-end">
<HoverButton @click="dialogVisible = true" class="mr-10">
<span class="text-xl">
<SvgIcon icon="material-symbols:library-add-rounded" />
</span>
</HoverButton>
</div>
</div>
<div class="flex-1">
<div class="m-5 rounded-sm" >
<NDataTable :columns="columns" :data="data" :loading="loading" />
</div>
</div>
<div class="flex items-center justify-end h-14 w-full border-b border-gray-200">
<HoverButton @click="dialogVisible = true" class="mr-10">
<span class="text-xl">
<SvgIcon icon="material-symbols:library-add-rounded" />
</span>
</HoverButton>
</div>
<div class="m-5">
<NDataTable :columns="columns" :data="data" :loading="loading" />
</div>
<NModal v-model:show="dialogVisible" :title="$t('admin.add_user_model_rate_limit')" preset="dialog">
<AddChatModelForm @new-row-added="newRowAdded" />
</NModal>
</template>
4 changes: 1 addition & 3 deletions web/src/views/admin/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ async function handleRefresh() {
</script>

<template>
<div>
<div class="flex items-center justify-end h-16 w-full border-b border-gray-200">
<div class="flex items-center justify-end h-14 w-full border-b border-gray-200">
<HoverButton :tooltip="$t('admin.refresh')" @click="handleRefresh" class="mr-10">
<span class="text-xl text-[#4f555e] dark:text-white">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
Expand All @@ -174,5 +173,4 @@ async function handleRefresh() {
<div class="m-5">
<NDataTable :loading="loading" remote :data="tableData" :columns="columns" :pagination="pagination" />
</div>
</div>
</template>

0 comments on commit 5ac5177

Please sign in to comment.