Skip to content

Commit e7848ec

Browse files
authored
feat(ui): update admin users and evaluations sidebars to leverage native anchor tags for robust new-tab link capabilities (open-webui#21723)
1 parent 39e5422 commit e7848ec

2 files changed

Lines changed: 20 additions & 24 deletions

File tree

src/lib/components/admin/Evaluations.svelte

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,14 @@
5454
id="users-tabs-container"
5555
class="tabs mx-[16px] lg:mx-0 lg:px-[16px] flex flex-row overflow-x-auto gap-2.5 max-w-full lg:gap-1 lg:flex-col lg:flex-none lg:w-50 dark:text-gray-200 text-sm font-medium text-left scrollbar-none"
5656
>
57-
<button
57+
<a
5858
id="leaderboard"
59-
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition {selectedTab ===
59+
href="/admin/evaluations/leaderboard"
60+
draggable="false"
61+
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition select-none {selectedTab ===
6062
'leaderboard'
6163
? ''
6264
: ' text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'}"
63-
on:click={() => {
64-
goto('/admin/evaluations/leaderboard');
65-
}}
6665
>
6766
<div class=" self-center mr-2">
6867
<svg
@@ -79,17 +78,16 @@
7978
</svg>
8079
</div>
8180
<div class=" self-center">{$i18n.t('Leaderboard')}</div>
82-
</button>
81+
</a>
8382

84-
<button
83+
<a
8584
id="feedback"
86-
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition {selectedTab ===
85+
href="/admin/evaluations/feedback"
86+
draggable="false"
87+
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition select-none {selectedTab ===
8788
'feedback'
8889
? ''
8990
: ' text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'}"
90-
on:click={() => {
91-
goto('/admin/evaluations/feedback');
92-
}}
9391
>
9492
<div class=" self-center mr-2">
9593
<svg
@@ -106,7 +104,7 @@
106104
</svg>
107105
</div>
108106
<div class=" self-center">{$i18n.t('Feedback')}</div>
109-
</button>
107+
</a>
110108
</div>
111109

112110
<div class="flex-1 mt-1 lg:mt-0 px-[16px] lg:pr-[16px] lg:pl-0 overflow-y-scroll">

src/lib/components/admin/Users.svelte

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,14 @@
6060
id="users-tabs-container"
6161
class="mx-[16px] lg:mx-0 lg:px-[16px] flex flex-row overflow-x-auto gap-2.5 max-w-full lg:gap-1 lg:flex-col lg:flex-none lg:w-50 dark:text-gray-200 text-sm font-medium text-left scrollbar-none"
6262
>
63-
<button
63+
<a
6464
id="overview"
65-
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition {selectedTab ===
65+
href="/admin/users/overview"
66+
draggable="false"
67+
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition select-none {selectedTab ===
6668
'overview'
6769
? ''
6870
: ' text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'}"
69-
on:click={() => {
70-
goto('/admin/users/overview');
71-
}}
7271
>
7372
<div class=" self-center mr-2">
7473
<svg
@@ -83,17 +82,16 @@
8382
</svg>
8483
</div>
8584
<div class=" self-center">{$i18n.t('Overview')}</div>
86-
</button>
85+
</a>
8786
88-
<button
87+
<a
8988
id="groups"
90-
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition {selectedTab ===
89+
href="/admin/users/groups"
90+
draggable="false"
91+
class="px-0.5 py-1 min-w-fit rounded-lg lg:flex-none flex text-right transition select-none {selectedTab ===
9192
'groups'
9293
? ''
9394
: ' text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'}"
94-
on:click={() => {
95-
goto('/admin/users/groups');
96-
}}
9795
>
9896
<div class=" self-center mr-2">
9997
<svg
@@ -108,7 +106,7 @@
108106
</svg>
109107
</div>
110108
<div class=" self-center">{$i18n.t('Groups')}</div>
111-
</button>
109+
</a>
112110
</div>
113111
114112
<div class="flex-1 mt-1 lg:mt-0 px-[16px] lg:pr-[16px] lg:pl-0 overflow-y-scroll">

0 commit comments

Comments
 (0)