θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content

[CHORE] Consistent table styling across settings pages #3597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions frontend/src/pages/Admin/Invitations/InviteRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,34 @@ export default function InviteRow({ invite }) {
<>
<tr
ref={rowRef}
className="bg-transparent text-white text-opacity-80 text-sm font-medium"
className="bg-transparent text-white text-opacity-80 text-xs font-medium border-b border-white/10 h-10"
>
<td scope="row" className="px-6 py-4 whitespace-nowrap">
<td scope="row" className="px-6 whitespace-nowrap">
{titleCase(status)}
</td>
<td className="px-6 py-4">
<td className="px-6">
{invite.claimedBy
? invite.claimedBy?.username || "deleted user"
: "--"}
</td>
<td className="px-6 py-4">
{invite.createdBy?.username || "deleted user"}
</td>
<td className="px-6 py-4">{invite.createdAt}</td>
<td className="px-6 py-4 flex items-center gap-x-6">
<td className="px-6">{invite.createdBy?.username || "deleted user"}</td>
<td className="px-6">{invite.createdAt}</td>
<td className="px-6 flex items-center gap-x-6 h-full mt-1">
{status === "pending" && (
<>
<button
onClick={copyInviteLink}
disabled={copied}
className="border-none font-medium text-blue-300 rounded-lg hover:text-blue-400 hover:underline"
className="text-xs font-medium text-blue-300 rounded-lg hover:text-blue-400 hover:underline"
>
{copied ? "Copied" : "Copy Invite Link"}
</button>
<td className="px-6 py-4 flex items-center gap-x-6">
<button
onClick={handleDelete}
className="border-none font-medium text-theme-text-primary hover:text-red-500 px-2 py-1 rounded-lg"
>
<Trash className="h-5 w-5" />
</button>
</td>
<button
onClick={handleDelete}
className="text-xs font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10"
>
<Trash className="h-5 w-5" />
</button>
</>
)}
</td>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Admin/Invitations/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function InvitationsContainer() {
}

return (
<table className="w-full text-sm text-left rounded-lg min-w-[640px] border-spacing-0">
<table className="w-full text-xs text-left rounded-lg min-w-[640px] border-spacing-0">
<thead className="text-theme-text-secondary text-xs leading-[18px] font-bold uppercase border-white/10 border-b">
<tr>
<th scope="col" className="px-6 py-3 rounded-tl-lg">
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/pages/Admin/Logging/LogRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@ export default function LogRow({ log }) {
<>
<tr
onClick={handleRowClick}
className={`bg-transparent text-white text-opacity-80 text-sm font-medium ${
className={`bg-transparent text-white text-opacity-80 text-xs font-medium border-b border-white/10 h-10 ${
hasMetadata ? "cursor-pointer hover:bg-white/5" : ""
}`}
>
<EventBadge event={log.event} />
<td className="px-6 py-4 border-transparent transform transition-transform duration-200">
<td className="px-6 border-transparent transform transition-transform duration-200">
{log.user.username}
</td>
<td className="px-6 py-4 border-transparent transform transition-transform duration-200">
<td className="px-6 border-transparent transform transition-transform duration-200">
{log.occurredAt}
</td>
{hasMetadata && (
<>
<div className="mt-1">
{expanded ? (
<td
className={`px-2 gap-x-1 flex items-center justify-center transform transition-transform duration-200 hover:scale-105`}
className={`px-2 gap-x-1 flex items-center justify-center transform transition-transform duration-200`}
>
<CaretUp weight="bold" size={20} />
<p className="text-xs text-white/50 w-[20px]">hide</p>
</td>
) : (
<td
className={`px-2 gap-x-1 flex items-center justify-center transform transition-transform duration-200 hover:scale-105`}
className={`px-2 gap-x-1 flex items-center justify-center transform transition-transform duration-200`}
>
<CaretDown weight="bold" size={20} />
<p className="text-xs text-white/50 w-[20px]">show</p>
</td>
)}
</>
</div>
)}
</tr>
<EventMetadata metadata={metadata} expanded={expanded} />
Expand Down Expand Up @@ -106,9 +106,9 @@ const EventBadge = ({ event }) => {
};

return (
<td className="px-6 py-4 font-medium whitespace-nowrap text-white flex items-center">
<td className="px-6 py-2 font-medium whitespace-nowrap text-white flex items-center">
<span
className={`rounded-full ${colorTheme.bg} px-2 py-0.5 text-sm font-medium ${colorTheme.text} shadow-sm`}
className={`rounded-full ${colorTheme.bg} px-2 py-0.5 text-xs font-medium ${colorTheme.text} shadow-sm`}
>
{event}
</span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Admin/Logging/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function LogsContainer({

return (
<>
<table className="w-full text-sm text-left rounded-lg min-w-[640px] border-spacing-0">
<table className="w-full text-xs text-left rounded-lg min-w-[640px] border-spacing-0">
<thead className="text-theme-text-secondary text-xs leading-[18px] font-bold uppercase border-white/10 border-b">
<tr>
<th scope="col" className="px-6 py-3 rounded-tl-lg">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ModalWrapper from "@/components/ModalWrapper";
import EditVariableModal from "./EditVariableModal";
import { titleCase } from "text-case";
import truncate from "truncate";
import { Trash } from "@phosphor-icons/react";

/**
* A row component for displaying a system prompt variable
Expand Down Expand Up @@ -63,40 +64,40 @@ export default function VariableRow({ variable, onRefresh }) {
<>
<tr
ref={rowRef}
className="bg-transparent text-white text-opacity-80 text-sm font-medium"
className="bg-transparent text-white text-opacity-80 text-xs font-medium border-b border-white/10 h-10"
>
<th scope="row" className="px-6 py-4 whitespace-nowrap">
<th scope="row" className="px-4 py-2 whitespace-nowrap">
{variable.key}
</th>
<td className="px-6 py-4">
<td className="px-4 py-2">
{typeof variable.value === "function"
? variable.value()
: truncate(variable.value, 50)}
</td>
<td className="px-6 py-4">
<td className="px-4 py-2">
{truncate(variable.description || "-", 50)}
</td>
<td className="px-6 py-4">
<td className="px-4 py-2">
<span
className={`rounded-full ${colorTheme.bg} px-2 py-0.5 text-xs leading-5 font-semibold ${colorTheme.text} shadow-sm`}
>
{titleCase(variable.type)}
</span>
</td>
<td className="px-6 py-4 flex items-center justify-end gap-x-6">
<td className="px-4 py-2 flex items-center justify-end gap-x-4">
{variable.type === "static" && (
<>
<button
onClick={openModal}
className="text-sm font-medium text-white/80 light:text-black/80 rounded-lg hover:text-white hover:light:text-gray-500 px-2 py-1 hover:bg-white hover:bg-opacity-10"
className="text-xs font-medium text-white/80 light:text-black/80 rounded-lg hover:text-white hover:light:text-gray-500 px-2 py-1 hover:bg-white hover:bg-opacity-10"
>
Edit
</button>
<button
onClick={handleDelete}
className="text-sm font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10"
className="text-xs font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10"
>
Delete
<Trash className="h-4 w-4" />
</button>
</>
)}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/Admin/SystemPromptVariables/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ export default function SystemPromptVariables() {
<table className="w-full text-sm text-left rounded-lg min-w-[640px] border-spacing-0">
<thead className="text-theme-text-secondary text-xs leading-[18px] font-bold uppercase border-white/10 border-b">
<tr>
<th scope="col" className="px-6 py-3 rounded-tl-lg">
<th scope="col" className="px-4 py-2 rounded-tl-lg">
Key
</th>
<th scope="col" className="px-6 py-3">
<th scope="col" className="px-4 py-2">
Value
</th>
<th scope="col" className="px-6 py-3">
<th scope="col" className="px-4 py-2">
Description
</th>
<th scope="col" className="px-6 py-3">
<th scope="col" className="px-4 py-2">
Type
</th>
</tr>
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/pages/Admin/Users/UserRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ export default function UserRow({ currUser, user }) {
<>
<tr
ref={rowRef}
className="bg-transparent text-white text-opacity-80 text-sm font-medium"
className="bg-transparent text-white text-opacity-80 text-xs font-medium border-b border-white/10 h-10"
>
<th scope="row" className="px-6 py-4 whitespace-nowrap">
<th scope="row" className="px-6 whitespace-nowrap">
{user.username}
</th>
<td className="px-6 py-4">{titleCase(user.role)}</td>
<td className="px-6 py-4">{user.createdAt}</td>
<td className="px-6 py-4 flex items-center gap-x-6">
<td className="px-6">{titleCase(user.role)}</td>
<td className="px-6">{user.createdAt}</td>
<td className="px-6 flex items-center gap-x-6 h-full mt-2">
{canModify && (
<button
onClick={openModal}
className="text-sm font-medium text-white/80 light:text-black/80 rounded-lg hover:text-white hover:light:text-gray-500 px-2 py-1 hover:bg-white hover:bg-opacity-10"
className="text-xs font-medium text-white/80 light:text-black/80 rounded-lg hover:text-white hover:light:text-gray-500 px-2 py-1 hover:bg-white hover:bg-opacity-10"
>
Edit
</button>
Expand All @@ -77,13 +77,13 @@ export default function UserRow({ currUser, user }) {
<>
<button
onClick={handleSuspend}
className="text-sm font-medium text-white/80 light:text-black/80 hover:light:text-orange-500 hover:text-orange-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-orange-50 hover:bg-opacity-10"
className="text-xs font-medium text-white/80 light:text-black/80 hover:light:text-orange-500 hover:text-orange-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-orange-50 hover:bg-opacity-10"
>
{suspended ? "Unsuspend" : "Suspend"}
</button>
<button
onClick={handleDelete}
className="text-sm font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10"
className="text-xs font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10"
>
Delete
</button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Admin/Users/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function UsersContainer() {
}

return (
<table className="w-full text-sm text-left rounded-lg min-w-[640px] border-spacing-0">
<table className="w-full text-xs text-left rounded-lg min-w-[640px] border-spacing-0">
<thead className="text-theme-text-secondary text-xs leading-[18px] font-bold uppercase border-white/10 border-b">
<tr>
<th scope="col" className="px-6 py-3 rounded-tl-lg">
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/pages/Admin/Workspaces/WorkspaceRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,34 @@ export default function WorkspaceRow({ workspace, users }) {
<>
<tr
ref={rowRef}
className="bg-transparent text-white text-opacity-80 text-sm font-medium"
className="bg-transparent text-white text-opacity-80 text-xs font-medium border-b border-white/10 h-10"
>
<th scope="row" className="px-6 py-4 whitespace-nowrap">
<th scope="row" className="px-6 whitespace-nowrap">
{workspace.name}
</th>
<td className="px-6 py-4 flex items-center">
<td className="px-6 flex items-center">
<a
href={paths.workspace.chat(workspace.slug)}
target="_blank"
rel="noreferrer"
className="text-white flex items-center hover:underline"
>
<LinkSimple className="mr-2 w-5 h-5" /> {workspace.slug}
<LinkSimple className="mr-2 w-4 h-4" /> {workspace.slug}
</a>
</td>
<td className="px-6 py-4">
<td className="px-6">
<a
href={paths.workspace.settings.members(workspace.slug)}
className="text-white flex items-center underline"
>
{workspace.userIds?.length}
</a>
</td>
<td className="px-6 py-4">{workspace.createdAt}</td>
<td className="px-6 py-4 flex items-center gap-x-6">
<td className="px-6">{workspace.createdAt}</td>
<td className="px-6 flex items-center gap-x-6 h-full mt-1">
<button
onClick={handleDelete}
className="border-none font-medium px-2 py-1 rounded-lg text-theme-text-primary hover:text-red-500"
className="text-xs font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10"
>
<Trash className="h-5 w-5" />
</button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Admin/Workspaces/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function WorkspacesContainer() {
}

return (
<table className="w-full text-sm text-left rounded-lg mt-6 min-w-[640px]">
<table className="w-full text-xs text-left rounded-lg mt-6 min-w-[640px] border-spacing-0">
<thead className="text-theme-text-secondary text-xs leading-[18px] font-bold uppercase border-white/10 border-b">
<tr>
<th scope="col" className="px-6 py-3 rounded-tl-lg">
Expand Down
16 changes: 7 additions & 9 deletions frontend/src/pages/GeneralSettings/ApiKeys/ApiKeyRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,24 @@ export default function ApiKeyRow({ apiKey }) {
<>
<tr
ref={rowRef}
className="bg-transparent text-white text-opacity-80 text-sm font-medium"
className="bg-transparent text-white text-opacity-80 text-xs font-medium border-b border-white/10 h-10"
>
<td scope="row" className="px-6 py-4 whitespace-nowrap">
<td scope="row" className="px-6 whitespace-nowrap">
{apiKey.secret}
</td>
<td className="px-6 py-4 text-center">
{apiKey.createdBy?.username || "--"}
</td>
<td className="px-6 py-4">{apiKey.createdAt}</td>
<td className="px-6 py-4 flex items-center gap-x-6">
<td className="px-6 text-left">{apiKey.createdBy?.username || "--"}</td>
<td className="px-6">{apiKey.createdAt}</td>
<td className="px-6 flex items-center gap-x-6 h-full mt-1">
<button
onClick={copyApiKey}
disabled={copied}
className="border-none font-medium text-blue-300 rounded-lg hover:text-white hover:light:text-blue-500 hover:text-opacity-60 hover:underline"
className="text-xs font-medium text-blue-300 rounded-lg hover:text-white hover:light:text-blue-500 hover:text-opacity-60 hover:underline"
>
{copied ? "Copied" : "Copy API Key"}
</button>
<button
onClick={handleDelete}
className="border-none font-medium px-2 py-1 rounded-lg text-theme-text-primary hover:text-red-500"
className="text-xs font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10"
>
<Trash className="h-5 w-5" />
</button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/GeneralSettings/ApiKeys/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function ApiKeysContainer() {
}

return (
<table className="w-full text-sm text-left rounded-lg min-w-[640px] border-spacing-0">
<table className="w-full text-xs text-left rounded-lg min-w-[640px] border-spacing-0">
<thead className="text-theme-text-secondary text-xs leading-[18px] font-bold uppercase border-white/10 border-b">
<tr>
<th scope="col" className="px-6 py-3 rounded-tl-lg">
Expand Down
Loading