mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-26 16:01:56 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66bb45e2c0 | |||
| 9897b6e9dc | |||
| 9af6963901 | |||
| 87b8dda97b | |||
| e7facf5686 | |||
| 1f8e089e51 | |||
| 0e3568b584 | |||
| 613a47c181 | |||
| 943a77f718 | |||
| b70a1f9a51 | |||
| df50e13db0 |
@@ -45,13 +45,13 @@ export type GlobalAction =
|
|||||||
{
|
{
|
||||||
"name": "工作空间",
|
"name": "工作空间",
|
||||||
"key": "workspace",
|
"key": "workspace",
|
||||||
"path": "/guide/page",
|
"path": "/guide",
|
||||||
"icon": "ic:baseline-space-dashboard",
|
"icon": "ic:baseline-space-dashboard",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"name": "首页",
|
"name": "首页",
|
||||||
"key": "guide",
|
"key": "guide",
|
||||||
"path": "/guide/page",
|
"path": "/guide",
|
||||||
"icon": "ic:baseline-home",
|
"icon": "ic:baseline-home",
|
||||||
"access": "all"
|
"access": "all"
|
||||||
},
|
},
|
||||||
@@ -179,7 +179,7 @@ export type GlobalAction =
|
|||||||
"name": "全局策略",
|
"name": "全局策略",
|
||||||
"key": "globalpolicy",
|
"key": "globalpolicy",
|
||||||
"path": "/globalpolicy",
|
"path": "/globalpolicy",
|
||||||
"icon": "uil:comment-shield",
|
"icon": "icon-park-solid:exchange-three",
|
||||||
"access": "system.settings.data_source.view"
|
"access": "system.settings.data_source.view"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
import { RESPONSE_TIPS } from '@common/const/const';
|
import { RESPONSE_TIPS } from '@common/const/const';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
|
import { $t } from "@common/locales"
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
const useCopyToClipboard = () => {
|
const useCopyToClipboard = () => {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const DataMasking = (props: any) => {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...x,
|
...x,
|
||||||
title: <span title={$t(x.title as string)}>{$t(x.title as string)}</span>
|
title: (<span title={$t(x.title as string)}>{$t(x.title as string)}</span>)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const DATA_MASKING_TABLE_COLUMNS: PageProColumns<any>[] = [
|
|||||||
{
|
{
|
||||||
title: ('优先级'),
|
title: ('优先级'),
|
||||||
dataIndex: 'priority',
|
dataIndex: 'priority',
|
||||||
width: 140,
|
width: 90,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
sorter: (a: any, b: any) => {
|
sorter: (a: any, b: any) => {
|
||||||
return (a.priority as number) - (b.priority as number)
|
return (a.priority as number) - (b.priority as number)
|
||||||
@@ -26,6 +26,7 @@ export const DATA_MASKING_TABLE_COLUMNS: PageProColumns<any>[] = [
|
|||||||
dataIndex: 'publishStatus',
|
dataIndex: 'publishStatus',
|
||||||
filters: true,
|
filters: true,
|
||||||
onFilter: false ,
|
onFilter: false ,
|
||||||
|
ellipsis: true,
|
||||||
width: 140,
|
width: 140,
|
||||||
valueEnum: new Map(
|
valueEnum: new Map(
|
||||||
Object.keys(StrategyStatusEnum).map(key=>
|
Object.keys(StrategyStatusEnum).map(key=>
|
||||||
@@ -38,6 +39,7 @@ export const DATA_MASKING_TABLE_COLUMNS: PageProColumns<any>[] = [
|
|||||||
dataIndex: 'isStop',
|
dataIndex: 'isStop',
|
||||||
filters: true,
|
filters: true,
|
||||||
onFilter: false ,
|
onFilter: false ,
|
||||||
|
ellipsis: true,
|
||||||
valueEnum: {
|
valueEnum: {
|
||||||
false: { text: <span className="text-status_success">{$t('启用')}</span> },
|
false: { text: <span className="text-status_success">{$t('启用')}</span> },
|
||||||
true: { text: <span className="text-status_fail">{$t('禁用')}</span> }
|
true: { text: <span className="text-status_fail">{$t('禁用')}</span> }
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ const ServiceHubDetail = () => {
|
|||||||
key: 'api-integrate',
|
key: 'api-integrate',
|
||||||
label: $t('集成'),
|
label: $t('集成'),
|
||||||
children: <div className={`p-btnbase ${serviceBasicInfo?.serviceKind?.toLocaleLowerCase() === 'ai' ? 'ai-service-api-preview' : ''}`}><Integrate service={service!} /></div>,
|
children: <div className={`p-btnbase ${serviceBasicInfo?.serviceKind?.toLocaleLowerCase() === 'ai' ? 'ai-service-api-preview' : ''}`}><Integrate service={service!} /></div>,
|
||||||
icon: <BgColorsOutlined />
|
icon: <Icon icon="icon-park-solid:whole-site-accelerator" width="15" height="15" />,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { BasicResponse, RESPONSE_TIPS, STATUS_CODE } from '@common/const/const'
|
|||||||
import { useParams } from "react-router-dom"
|
import { useParams } from "react-router-dom"
|
||||||
import { useState, useEffect } from "react"
|
import { useState, useEffect } from "react"
|
||||||
import { RouterParams } from "@common/const/type"
|
import { RouterParams } from "@common/const/type"
|
||||||
|
import useCopyToClipboard from "@common/hooks/copy.ts";
|
||||||
import { useFetch } from "@common/hooks/http"
|
import { useFetch } from "@common/hooks/http"
|
||||||
|
|
||||||
const Integrate = ({ service }: { service: ServiceDetailType }) => {
|
const Integrate = ({ service }: { service: ServiceDetailType }) => {
|
||||||
@@ -12,6 +13,7 @@ const Integrate = ({ service }: { service: ServiceDetailType }) => {
|
|||||||
const [url, setUrl] = useState('');
|
const [url, setUrl] = useState('');
|
||||||
const { serviceId} = useParams<RouterParams>()
|
const { serviceId} = useParams<RouterParams>()
|
||||||
const {fetchData} = useFetch()
|
const {fetchData} = useFetch()
|
||||||
|
const { copyToClipboard } = useCopyToClipboard();
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setUrl(`${service?.basic?.sitePrefix || window.location?.origin}/api/v1/service/swagger/${serviceId}` )
|
setUrl(`${service?.basic?.sitePrefix || window.location?.origin}/api/v1/service/swagger/${serviceId}` )
|
||||||
@@ -28,8 +30,7 @@ const Integrate = ({ service }: { service: ServiceDetailType }) => {
|
|||||||
* 复制代码
|
* 复制代码
|
||||||
*/
|
*/
|
||||||
const copyURL = async (): Promise<void> => {
|
const copyURL = async (): Promise<void> => {
|
||||||
await navigator.clipboard.writeText(url)
|
copyToClipboard(url)
|
||||||
message.success($t(RESPONSE_TIPS.copySuccess))
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
@@ -55,8 +56,8 @@ const Integrate = ({ service }: { service: ServiceDetailType }) => {
|
|||||||
<p className={stepClass}>{$t('步骤二:导入 API 文档数据')}</p>
|
<p className={stepClass}>{$t('步骤二:导入 API 文档数据')}</p>
|
||||||
<div className='my-[10px]'>{$t('可通过以下 URL 或 下载 Json 文件,导入 API 文档数据到 Agent 平台中。')}</div>
|
<div className='my-[10px]'>{$t('可通过以下 URL 或 下载 Json 文件,导入 API 文档数据到 Agent 平台中。')}</div>
|
||||||
<div className="flex w-full items-center gap-[30px]">
|
<div className="flex w-full items-center gap-[30px]">
|
||||||
<Space.Compact className=" flex-1 ">
|
<Space.Compact className="w-[700px]">
|
||||||
<Input disabled value={url} />
|
<Input className="truncate" disabled title={url} value={url} />
|
||||||
<Button type="primary" onClick={copyURL}>{$t('复制 URL')}</Button>
|
<Button type="primary" onClick={copyURL}>{$t('复制 URL')}</Button>
|
||||||
</Space.Compact>
|
</Space.Compact>
|
||||||
<span className="text-[14px] font-bold">OR</span>
|
<span className="text-[14px] font-bold">OR</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user