feat: add database, role & privilege management
Add Admin sidebar tab with database/role management panels, role manager workspace tab, and privilege dialogs. Backend provides 10 new Tauri commands for CRUD on databases, roles, and privileges with read-only mode enforcement. Context menus on schema tree nodes allow dropping databases and viewing/granting table privileges. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,9 +2,10 @@ import { useState } from "react";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SchemaTree } from "@/components/schema/SchemaTree";
|
||||
import { HistoryPanel } from "@/components/history/HistoryPanel";
|
||||
import { AdminPanel } from "@/components/management/AdminPanel";
|
||||
import { Search } from "lucide-react";
|
||||
|
||||
type SidebarView = "schema" | "history";
|
||||
type SidebarView = "schema" | "history" | "admin";
|
||||
|
||||
export function Sidebar() {
|
||||
const [view, setView] = useState<SidebarView>("schema");
|
||||
@@ -33,6 +34,16 @@ export function Sidebar() {
|
||||
>
|
||||
History
|
||||
</button>
|
||||
<button
|
||||
className={`flex-1 px-3 py-1.5 font-medium ${
|
||||
view === "admin"
|
||||
? "bg-background text-foreground"
|
||||
: "text-muted-foreground hover:text-foreground"
|
||||
}`}
|
||||
onClick={() => setView("admin")}
|
||||
>
|
||||
Admin
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{view === "schema" ? (
|
||||
@@ -52,8 +63,10 @@ export function Sidebar() {
|
||||
<SchemaTree />
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
) : view === "history" ? (
|
||||
<HistoryPanel />
|
||||
) : (
|
||||
<AdminPanel />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user