feat:api
parent
1a3d4b65d1
commit
748ca2faca
|
|
@ -8,6 +8,7 @@ from (select application."id"::text, application."name",
|
|||
application."folder_id",
|
||||
application."user_id",
|
||||
"user"."nick_name" as "nick_name",
|
||||
"user"."username" as "username",
|
||||
application."create_time",
|
||||
application."update_time",
|
||||
application."publish_time",
|
||||
|
|
@ -16,4 +17,4 @@ from (select application."id"::text, application."name",
|
|||
left join "user" on user_id = "user".id
|
||||
${application_custom_sql}
|
||||
) temp
|
||||
${application_query_set}
|
||||
${application_query_set}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from (select application."id"::text, application."name",
|
|||
application."folder_id",
|
||||
application."user_id",
|
||||
"user"."nick_name" as "nick_name",
|
||||
"user"."username" as "username",
|
||||
application."create_time",
|
||||
application."update_time",
|
||||
application."publish_time",
|
||||
|
|
@ -17,4 +18,4 @@ from (select application."id"::text, application."name",
|
|||
where application."id"::text in (select target
|
||||
from workspace_user_resource_permission ${workspace_user_resource_permission_query_set}
|
||||
and 'VIEW' = any (permission_list))) temp
|
||||
${application_query_set}
|
||||
${application_query_set}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from (select application."id"::text, application."name",
|
|||
application."folder_id",
|
||||
application."user_id",
|
||||
"user"."nick_name" as "nick_name",
|
||||
"user"."username" as "username",
|
||||
application."create_time",
|
||||
application."update_time",
|
||||
application."publish_time",
|
||||
|
|
@ -34,4 +35,4 @@ from (select application."id"::text, application."name",
|
|||
else
|
||||
'VIEW' = any (permission_list)
|
||||
end)) temp
|
||||
${application_query_set}
|
||||
${application_query_set}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ FROM (SELECT "temp_knowledge".id::text, "temp_knowledge".name,
|
|||
"temp_knowledge".folder_id,
|
||||
"temp_knowledge".user_id,
|
||||
"user"."nick_name" as nick_name,
|
||||
"user"."username" as username,
|
||||
"temp_knowledge".create_time,
|
||||
"temp_knowledge".update_time,
|
||||
"temp_knowledge".file_size_limit,
|
||||
|
|
@ -29,4 +30,4 @@ FROM (SELECT "temp_knowledge".id::text, "temp_knowledge".name,
|
|||
ON temp_knowledge."id" = "app_knowledge_temp".knowledge_id
|
||||
left join "user" on "user".id = temp_knowledge.user_id
|
||||
) temp
|
||||
${default_sql}
|
||||
${default_sql}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ FROM (SELECT "temp_knowledge".id::text, "temp_knowledge".name,
|
|||
"temp_knowledge".folder_id,
|
||||
"temp_knowledge".user_id,
|
||||
"user"."nick_name" as nick_name,
|
||||
"user"."username" as username,
|
||||
"temp_knowledge".create_time,
|
||||
"temp_knowledge".update_time,
|
||||
"temp_knowledge".file_size_limit,
|
||||
|
|
@ -34,4 +35,4 @@ FROM (SELECT "temp_knowledge".id::text, "temp_knowledge".name,
|
|||
ON temp_knowledge."id" = "app_knowledge_temp".knowledge_id
|
||||
left join "user" on "user".id = temp_knowledge.user_id
|
||||
) temp
|
||||
${default_sql}
|
||||
${default_sql}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ FROM (SELECT "temp_knowledge".id::text, "temp_knowledge".name,
|
|||
"temp_knowledge".folder_id,
|
||||
"temp_knowledge".user_id,
|
||||
"user"."nick_name" as nick_name,
|
||||
"user"."username" as username,
|
||||
"temp_knowledge".create_time,
|
||||
"temp_knowledge".update_time,
|
||||
"temp_knowledge".file_size_limit,
|
||||
|
|
@ -48,4 +49,4 @@ FROM (SELECT "temp_knowledge".id::text, "temp_knowledge".name,
|
|||
ON temp_knowledge."id" = "app_knowledge_temp".knowledge_id
|
||||
left join "user" on "user".id = temp_knowledge.user_id
|
||||
) temp
|
||||
${default_sql}
|
||||
${default_sql}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ SELECT model."id"::text, model."name",
|
|||
model.update_time,
|
||||
model.user_id,
|
||||
"user"."nick_name" as "nick_name",
|
||||
"user"."username" as "username",
|
||||
model.workspace_id
|
||||
from model
|
||||
left join "user" on user_id = "user".id
|
||||
${model_query_set}
|
||||
${model_query_set}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ FROM (SELECT model."id"::text, model."name",
|
|||
model.update_time,
|
||||
model.user_id,
|
||||
"user"."nick_name" as "nick_name",
|
||||
"user"."username" as "username",
|
||||
model.workspace_id
|
||||
from model
|
||||
left join "user" on user_id = "user".id
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ FROM (SELECT model."id"::text, model."name",
|
|||
model.update_time,
|
||||
model.user_id,
|
||||
"user"."nick_name" as "nick_name",
|
||||
"user"."username" as "username",
|
||||
model.workspace_id
|
||||
from model
|
||||
left join "user" on user_id = "user".id
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from (select tool."id"::text,
|
|||
tool."folder_id",
|
||||
tool."user_id",
|
||||
"user".nick_name as "nick_name",
|
||||
"user".username as "username",
|
||||
tool."icon",
|
||||
tool.label,
|
||||
tool."template_id"::text,
|
||||
|
|
@ -21,4 +22,4 @@ from (select tool."id"::text,
|
|||
from tool
|
||||
left join "user" on "user".id = user_id ${tool_query_set}
|
||||
) temp
|
||||
${default_query_set}
|
||||
${default_query_set}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ FROM (SELECT tool."id"::text,
|
|||
tool."folder_id",
|
||||
tool."user_id",
|
||||
"user".nick_name AS "nick_name",
|
||||
"user".username AS "username",
|
||||
tool."icon",
|
||||
tool.label,
|
||||
tool."template_id"::text,
|
||||
|
|
@ -26,4 +27,4 @@ FROM (SELECT tool."id"::text,
|
|||
AND 'VIEW' = ANY (permission_list))) AS tool
|
||||
LEFT JOIN "user" ON "user".id = user_id
|
||||
) temp
|
||||
${default_query_set}
|
||||
${default_query_set}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ FROM (SELECT tool."id"::text,
|
|||
tool."folder_id",
|
||||
tool."user_id",
|
||||
"user".nick_name AS "nick_name",
|
||||
"user".username AS "username",
|
||||
tool."icon",
|
||||
tool.label,
|
||||
tool."template_id"::text,
|
||||
|
|
@ -37,4 +38,4 @@ FROM (SELECT tool."id"::text,
|
|||
)) AS tool
|
||||
LEFT JOIN "user" ON "user".id = user_id
|
||||
) temp
|
||||
${default_query_set}
|
||||
${default_query_set}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,24 @@ export function i18n_name(name: string) {
|
|||
return key ? t(key) : name
|
||||
}
|
||||
|
||||
const builtinCreatorNameMap: Record<string, string> = {
|
||||
'layout.about.inner_admin': '系统管理员',
|
||||
'layout.about.inner_wsm': '工作空间管理员',
|
||||
'layout.about.inner_user': '普通用户',
|
||||
}
|
||||
|
||||
export function creatorName(nickName?: string, username?: string) {
|
||||
const name = (nickName || '').trim()
|
||||
const account = (username || '').trim()
|
||||
if (name && !name.startsWith('layout.about.')) {
|
||||
return name
|
||||
}
|
||||
if (account) {
|
||||
return account
|
||||
}
|
||||
return builtinCreatorNameMap[name] || name || '-'
|
||||
}
|
||||
|
||||
|
||||
// 截取文件名
|
||||
export function cutFilename(filename: string, num: number) {
|
||||
|
|
|
|||
|
|
@ -118,11 +118,9 @@
|
|||
<el-text style="width: 80px">Base URL:</el-text>
|
||||
</span>
|
||||
|
||||
<span class="vertical-middle lighter break-all ellipsis-1">{{
|
||||
baseUrl + id
|
||||
}}</span>
|
||||
<span class="vertical-middle lighter break-all ellipsis-1">{{ baseUrl }}</span>
|
||||
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
|
||||
<el-button type="primary" text @click="copyClick(baseUrl + id)">
|
||||
<el-button type="primary" text @click="copyClick(baseUrl)">
|
||||
<AppIcon iconName="app-copy"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
|
@ -232,7 +230,7 @@ const permissionPrecise = computed(() => {
|
|||
|
||||
const apiUrl = window.location.origin + `${window.MaxKB.chatPrefix}/api-doc/`
|
||||
|
||||
const baseUrl = window.location.origin + `${window.MaxKB.chatPrefix}/api/`
|
||||
const baseUrl = window.location.origin + `${window.MaxKB.chatPrefix}/api/${id}/chat/completions`
|
||||
|
||||
const APIKeyDialogRef = ref()
|
||||
const EmbedDialogRef = ref()
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
{{ $t('common.creator') }}: {{ creatorName(item.nick_name, item.username) }}
|
||||
</el-text>
|
||||
</template>
|
||||
</CardBox>
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
<auto-tooltip :content="item.username">
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
{{ $t('common.creator') }}: {{ creatorName(item.nick_name, item.username) }}
|
||||
</auto-tooltip>
|
||||
</el-text>
|
||||
</template>
|
||||
|
|
@ -345,7 +345,7 @@ import ApplicationApi from '@/api/application/application'
|
|||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||
import useStore from '@/stores'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import { creatorName } from '@/utils/common'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { resetUrl } from '@/utils/common'
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
{{ $t('common.creator') }}: {{ creatorName(item.nick_name, item.username) }}
|
||||
</el-text>
|
||||
</template>
|
||||
</CardBox>
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
{{ $t('common.creator') }}: {{ creatorName(item.nick_name, item.username) }}
|
||||
</el-text>
|
||||
</template>
|
||||
<template #tag>
|
||||
|
|
@ -383,7 +383,7 @@ import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
|||
import useStore from '@/stores'
|
||||
import { numberFormat } from '@/utils/common'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import { creatorName } from '@/utils/common'
|
||||
import { SourceTypeEnum } from '@/enums/common'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||
import permissionMap from '@/permission'
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ i18n_name(model.nick_name) }}
|
||||
{{ $t('common.creator') }}: {{ creatorName(model.nick_name, model.username) }}
|
||||
</el-text>
|
||||
</template>
|
||||
<template #tag>
|
||||
|
|
@ -146,7 +146,7 @@ import AuthorizedWorkspace from '@/views/system-shared/AuthorizedWorkspaceDialog
|
|||
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
|
||||
import { SourceTypeEnum } from '@/enums/common'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import { creatorName } from '@/utils/common'
|
||||
import permissionMap from '@/permission'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||
|
|
|
|||
|
|
@ -215,7 +215,11 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="nick_name" :label="$t('common.creator')" show-overflow-tooltip/>
|
||||
<el-table-column :label="$t('common.creator')" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ creatorName(row.nick_name, row.username) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('views.application.publishTime')" width="180">
|
||||
<template #default="{ row }">
|
||||
{{ datetimeFormat(row.update_time) }}
|
||||
|
|
@ -315,7 +319,7 @@ import {useRouter, useRoute} from 'vue-router'
|
|||
import ApplicationResourceApi from '@/api/system-resource-management/application'
|
||||
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
|
||||
import {t} from '@/locales'
|
||||
import {isAppIcon, resetUrl} from '@/utils/common'
|
||||
import {creatorName, isAppIcon, resetUrl} from '@/utils/common'
|
||||
import useStore from '@/stores'
|
||||
import {datetimeFormat} from '@/utils/time'
|
||||
import {loadPermissionApi} from '@/utils/dynamics-api/permission-api.ts'
|
||||
|
|
|
|||
|
|
@ -145,7 +145,11 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nick_name" :label="$t('common.creator')" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('common.creator')" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ creatorName(row.nick_name, row.username) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('views.document.table.updateTime')" width="180">
|
||||
<template #default="{ row }">
|
||||
{{ datetimeFormat(row.update_time) }}
|
||||
|
|
@ -288,6 +292,7 @@ import { loadPermissionApi } from '@/utils/dynamics-api/permission-api.ts'
|
|||
import permissionMap from '@/permission'
|
||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||
import { SourceTypeEnum } from '@/enums/common'
|
||||
import { creatorName } from '@/utils/common'
|
||||
import { t } from '@/locales'
|
||||
import useStore from '@/stores'
|
||||
const router = useRouter()
|
||||
|
|
|
|||
|
|
@ -164,7 +164,11 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nick_name" :label="$t('common.creator')" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('common.creator')" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ creatorName(row.nick_name, row.username) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('views.document.table.updateTime')" width="180">
|
||||
<template #default="{ row }">
|
||||
{{ datetimeFormat(row.update_time) }}
|
||||
|
|
@ -259,6 +263,7 @@ import ParamSettingDialog from '@/views/model/component/ParamSettingDialog.vue'
|
|||
import ModelResourceApi from '@/api/system-resource-management/model'
|
||||
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
|
||||
import { SourceTypeEnum } from '@/enums/common'
|
||||
import { creatorName } from '@/utils/common'
|
||||
import { modelTypeList } from '@/views/model/component/data'
|
||||
import { modelType } from '@/enums/model'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -173,7 +173,11 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nick_name" :label="$t('common.creator')" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('common.creator')" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ creatorName(row.nick_name, row.username) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('views.document.table.updateTime')" width="180">
|
||||
<template #default="{ row }">
|
||||
{{ datetimeFormat(row.update_time) }}
|
||||
|
|
@ -340,7 +344,7 @@ import McpToolFormDrawer from '@/views/tool/McpToolFormDrawer.vue'
|
|||
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
|
||||
import { t } from '@/locales'
|
||||
import { SourceTypeEnum } from '@/enums/common'
|
||||
import { resetUrl } from '@/utils/common'
|
||||
import { creatorName, resetUrl } from '@/utils/common'
|
||||
import { ToolType } from '@/enums/tool'
|
||||
import useStore from '@/stores'
|
||||
import { datetimeFormat } from '@/utils/time'
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
{{ $t('common.creator') }}: {{ creatorName(item.nick_name, item.username) }}
|
||||
</el-text>
|
||||
</template>
|
||||
</CardBox>
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
{{ $t('common.creator') }}: {{ creatorName(item.nick_name, item.username) }}
|
||||
</el-text>
|
||||
</template>
|
||||
<template #tag="{ hoverShow }">
|
||||
|
|
@ -282,7 +282,7 @@ import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
|||
import permissionMap from '@/permission'
|
||||
import useStore from '@/stores'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import { creatorName } from '@/utils/common'
|
||||
import ToolStoreApi from '@/api/tool/store.ts'
|
||||
import ToolStoreDescDrawer from "@/views/tool/component/ToolStoreDescDrawer.vue";
|
||||
import bus from "@/bus"
|
||||
|
|
|
|||
Loading…
Reference in New Issue