Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Move DataSourceMemberTable to a dedicated component

天舟f8632c33a1c7
diff --git a/frontend/src/components/DataSourceMemberTable.vue b/frontend/src/components/DataSourceMemberTable.vue
index 8896e09270..2e6e88048b 100644
--- a/frontend/src/components/DataSourceMemberTable.vue
+++ b/frontend/src/components/DataSourceMemberTable.vue
@@ -1,36 +1,49 @@
<template>
+ <h2 class="text-xl leading-7 font-bold text-main">User list</h2>
<BBTable
+ class="mt-2"
:columnList="columnList"
:dataSource="memberList"
:showHeader="true"
:rowClickable="false"
>
+ <template v-slot:header>
+ <BBTableHeaderCell
+ :leftPadding="4"
+ class="w-auto table-cell"
+ :title="columnList[0].title"
+ />
+ <BBTableHeaderCell class="w-8 table-cell" :title="columnList[1].title" />
+ <BBTableHeaderCell class="w-8 table-cell" :title="columnList[2].title" />
+ </template>
<template v-slot:body="{ rowData: member }">
- <BBTableCell :leftPadding="4" class="w-24">
- <BBAvatar :username="member.principal.name" />
- <div class="flex flex-col">
- <div class="flex flex-row items-center space-x-2">
- <router-link :to="`/u/${member.principal.id}`" class="normal-link"
- >{{ member.principal.name }}
- </router-link>
- <span
- v-if="currentUser.id == member.principal.id"
- class="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-green-100 text-green-800"
- >
- You
+ <BBTableCell :leftPadding="4" class="table-cell">
+ <div class="flex flex-row items-center space-x-2">
+ <BBAvatar :username="member.principal.name" />
+ <div class="flex flex-col">
+ <div class="flex flex-row items-center space-x-2">
+ <router-link :to="`/u/${member.principal.id}`" class="normal-link"
+ >{{ member.principal.name }}
+ </router-link>
+ <span
+ v-if="currentUser.id == member.principal.id"
+ class="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-green-100 text-green-800"
+ >
+ You
+ </span>
+ </div>
+ <span class="textlabel">
+ {{ member.principal.email }}
</span>
</div>
- <span class="textlabel">
- {{ member.principal.email }}
- </span>
</div>
</BBTableCell>
- <BBTableCell class="w-8">
+ <BBTableCell>
<router-link :to="`/task/${member.taskId}`" class="normal-link"
- >t/{{ member.taskId }}
+ >task/{{ member.taskId }}
</router-link>
</BBTableCell>
- <BBTableCell class="w-8">
+ <BBTableCell>
{{ humanizeTs(member.createdTs) }}
</BBTableCell>
</template>
diff --git a/frontend/src/views/DataSourceDetail.vue b/frontend/src/views/DataSourceDetail.vue
index 887d487625..113628c28d 100644
--- a/frontend/src/views/DataSourceDetail.vue
+++ b/frontend/src/views/DataSourceDetail.vue
@@ -24,143 +24,121 @@
}
```
-->
- <div class="bg-gray-100">
- <div class="flex-1 overflow-auto focus:outline-none" tabindex="0">
- <main class="flex-1 relative pb-8 z-0 overflow-y-auto">
- <!-- Page header -->
- <div class="bg-white shadow">
- <div class="px-4 sm:px-6 lg:max-w-6xl lg:mx-auto lg:px-8">
- <div class="py-6 md:flex md:items-center md:justify-between">
- <div class="flex-1 min-w-0">
- <!-- Profile -->
- <div class="flex items-center">
- <div>
- <div class="flex items-center">
- <h1
- class="ml-3 text-2xl font-bold leading-7 text-gray-900 sm:leading-9 sm:truncate"
- >
- {{ dataSource.name }} - {{ dataSource.type }}
- </h1>
- </div>
- <dl
- class="mt-6 flex flex-col sm:ml-3 sm:mt-1 sm:flex-row sm:flex-wrap"
- >
- <dt class="sr-only">Instance</dt>
- <dd
- class="flex items-center text-sm text-gray-500 font-medium capitalize sm:mr-6"
- >
- <!-- Heroicon name: solid/database -->
- <svg
- class="mr-1.5 w-6 h-6 text-control"
- fill="currentColor"
- viewBox="0 0 20 20"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- d="M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"
- ></path>
- <path
- d="M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"
- ></path>
- <path
- d="M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"
- ></path>
- </svg>
- <router-link
- :to="`/instance/${instanceSlug}`"
- class="normal-link"
- >
- {{ instance.name }}
- </router-link>
- </dd>
- <dt class="sr-only">Environment</dt>
- <dd
- class="mt-3 flex items-center text-sm text-gray-500 font-medium sm:mr-6 sm:mt-0 capitalize"
- >
- <!-- Heroicon name: solid/globle-alt -->
- <svg
- class="mr-1.5 w-6 h-6 text-control"
- fill="currentColor"
- viewBox="0 0 20 20"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- fill-rule="evenodd"
- d="M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z"
- clip-rule="evenodd"
- ></path>
- </svg>
- <router-link to="/environment" class="normal-link">
- {{ instance.environment.name }}
- </router-link>
- </dd>
- </dl>
- </div>
- </div>
+ <div class="flex-1 overflow-auto focus:outline-none" tabindex="0">
+ <main class="flex-1 relative pb-8 overflow-y-auto">
+ <!-- Highlight Panel -->
+ <div
+ class="px-4 pb-4 border-b border-block-border md:flex md:items-center md:justify-between"
+ >
+ <div class="flex-1 min-w-0">
+ <!-- Summary -->
+ <div class="flex items-center">
+ <div>
+ <div class="flex items-center">
+ <h1 class="text-xl font-bold leading-7 text-main truncate">
+ {{ dataSource.name }} - {{ dataSource.type }}
+ </h1>
</div>
- <div class="mt-6 flex space-x-3 md:mt-0 md:ml-4">
- <button
- type="button"
- class="btn-normal"
- @click.prevent="editUser"
+ <dl class="flex flex-col mt-2 sm:flex-row sm:flex-wrap">
+ <dt class="sr-only">Instance</dt>
+ <dd
+ class="flex items-center text-sm text-control-light font-medium sm:mr-6"
>
- <!-- Heroicon name: solid/pencil -->
+ <!-- Heroicon name: solid/database -->
<svg
- class="-ml-1 mr-2 h-5 w-5 text-control-light"
+ class="mr-1.5 w-5 h-5"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
- d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
+ d="M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"
+ ></path>
+ <path
+ d="M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"
+ ></path>
+ <path
+ d="M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"
></path>
</svg>
- <span>Edit</span>
- </button>
- </div>
+ <router-link
+ :to="`/instance/${instanceSlug}`"
+ class="normal-link"
+ >
+ {{ instance.name }}
+ </router-link>
+ </dd>
+ <dt class="sr-only">Environment</dt>
+ <dd
+ class="flex items-center text-sm text-control-light font-medium sm:mr-6"
+ >
+ <!-- Heroicon name: solid/globle-alt -->
+ <svg
+ class="mr-1.5 w-5 h-5"
+ fill="currentColor"
+ viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ fill-rule="evenodd"
+ d="M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z"
+ clip-rule="evenodd"
+ ></path>
+ </svg>
+ <router-link to="/environment" class="normal-link">
+ {{ instance.environment.name }}
+ </router-link>
+ </dd>
+ </dl>
</div>
</div>
</div>
+ <div class="mt-6 flex space-x-3 md:mt-0 md:ml-4">
+ <button type="button" class="btn-normal" @click.prevent="editUser">
+ <!-- Heroicon name: solid/pencil -->
+ <svg
+ class="-ml-1 mr-2 h-5 w-5 text-control-light"
+ fill="currentColor"
+ viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
+ ></path>
+ </svg>
+ <span>Edit</span>
+ </button>
+ </div>
+ </div>
- <div class="mt-8">
- <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
- <!-- Description list -->
- <div class="mt-6 max-w-5xl mx-auto px-4 sm:px-6 lg:px-8">
- <dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
- <div class="sm:col-span-1">
- <dt class="text-sm font-medium text-control-light">
- Username
- </dt>
- <dd class="mt-1 text-sm text-main">
- {{ dataSource.username }}
- </dd>
- </div>
+ <div class="mt-6">
+ <div class="max-w-6xl mx-auto px-4">
+ <!-- Description list -->
+ <div class="max-w-5xl mx-auto px-4 mb-6">
+ <dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
+ <div class="sm:col-span-1">
+ <dt class="text-sm font-medium text-control-light">Username</dt>
+ <dd class="mt-1 text-sm text-main">
+ {{ dataSource.username }}
+ </dd>
+ </div>
- <div class="sm:col-span-1">
- <dt class="text-sm font-medium text-control-light">
- Password
- </dt>
- <dd class="mt-1 text-sm text-main">
- {{ dataSource.password }}
- </dd>
- </div>
- </dl>
- </div>
+ <div class="sm:col-span-1">
+ <dt class="text-sm font-medium text-control-light">Password</dt>
+ <dd class="mt-1 text-sm text-main">
+ {{ dataSource.password }}
+ </dd>
+ </div>
+ </dl>
</div>
- <h2
- class="max-w-6xl mx-auto mt-8 px-4 text-lg leading-6 font-medium text-gray-900 sm:px-6 lg:px-8"
- >
- User list
- </h2>
-
<DataSourceMemberTable
:instanceId="instance.id"
:dataSourceId="dataSource.id"
/>
</div>
- </main>
- </div>
+ </div>
+ </main>
</div>
</template>