mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #2055] [CLOSED] fix: admin dashboard styles refactor #36507
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/2055
Author: @albertso
Created: 5/7/2024
Status: ❌ Closed
Base:
main← Head:feat-dashboard-fixes📝 Commits (2)
01b1a8bFixed styling issues and refactor341609fCorrect tab spacing📊 Changes
1 file changed (+191 additions, -315 deletions)
View changed files
📝
src/routes/(app)/admin/+page.svelte(+191 -315)📄 Description
Pull Request Checklist
Description
I have rewritten the Admin page to improve code readability and mantainability, and to facilitate inclusion of more tabs in the future. Visually and functionally the page remains the same, except for some style fixes. In the video I demonstrate how the row action buttons are now visible where they weren't, and also how the ui responds the same as before, even when the markup has changed.
Changelog Entry
Fixed
{#if user.role !== 'admin'}is reversed.Changed
Additional Information
The main improvement here relies on the use of tailwind's
@applydirective, which allows to apply tailwind styles in css:There are also improvements in how some conditional stylings were being applied, where instead of swapping a bunch of tailwind classes in code, now the code just changes a single class that controls the styles, which are separated from the markup.
One way to do it, seems would be this:
But this doesn't work entirely, because doing it this way the classes are not known to the svelte compiler. We can use the
:global()directive, but the tailwind processor cannot create thedark:classes for the dark theme. The only way this seems to work is to inform svelte of all the classes, like this:I modified this file because I'm attempting to implement some kind of plugins/extensions functionality to open-webui, even if it's only to see how far can I get. I was creating a page of its own in the
/pluginsroute, but then realized this should be part of the admin page.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.