Frank 4 months ago
parent
commit
c9155c117a
1 changed files with 9 additions and 1 deletions
  1. 9 1
      packages/console/app/src/routes/workspace/[id]/index.tsx

+ 9 - 1
packages/console/app/src/routes/workspace/[id]/index.tsx

@@ -4,8 +4,14 @@ import { UsageSection } from "./usage-section"
 import { ModelSection } from "./model-section"
 import { ProviderSection } from "./provider-section"
 import { IconLogo } from "~/component/icon"
+import { createAsync, useParams } from "@solidjs/router"
+import { querySessionInfo } from "../common"
+import { Show } from "solid-js"
 
 export default function () {
+  const params = useParams()
+  const userInfo = createAsync(() => querySessionInfo(params.id))
+
   return (
     <div data-page="workspace-[id]">
       <section data-component="title-section">
@@ -22,7 +28,9 @@ export default function () {
       <div data-slot="sections">
         <NewUserSection />
         <ModelSection />
-        <ProviderSection />
+        <Show when={userInfo()?.isAdmin}>
+          <ProviderSection />
+        </Show>
         <UsageSection />
       </div>
     </div>