mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
Compare commits
141 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17b4ede566 | |||
| bbc3fea848 | |||
| 82e46b872b | |||
| 0f6a091c73 | |||
| 4e87adb4b3 | |||
| 320a2b6cf8 | |||
| b216556867 | |||
| 7fbb98a2a9 | |||
| 461a8edbea | |||
| cdef179bed | |||
| a067388d79 | |||
| 2d5e541593 | |||
| be40186ad3 | |||
| c9ae05b22e | |||
| 9da5e5d6c0 | |||
| a6bfce2a5f | |||
| 8cbeabe917 | |||
| 1db354077f | |||
| e31d41a276 | |||
| 21d2abf716 | |||
| 3a86a88870 | |||
| 6117a840e1 | |||
| 0e20987fb8 | |||
| 65e7cab772 | |||
| 935f2ac766 | |||
| 3e12d7eb9c | |||
| d6095269b7 | |||
| 0c415b4e32 | |||
| bc1819b368 | |||
| a9be016c87 | |||
| 11da5e9d26 | |||
| 2c6c194821 | |||
| aedd8b4cc6 | |||
| fa2607e9b8 | |||
| 3783e5ee5d | |||
| fd56b8ffed | |||
| 07e288be16 | |||
| 46143c3fe0 | |||
| 83e3cc85f2 | |||
| a4b50ae60a | |||
| a30d0c37eb | |||
| 64fdf59905 | |||
| 68e8cb72d3 | |||
| a86d3cd65a | |||
| a4b4cbf60f | |||
| 2dcb7ebd74 | |||
| 8fa1985feb | |||
| 451efb8d3e | |||
| d6bf3139ff | |||
| 309b9ea937 | |||
| 554bff38c6 | |||
| d5e6062ec9 | |||
| d588d43aa1 | |||
| f455cecb54 | |||
| b88c0a9305 | |||
| 9030cff8ba | |||
| 98f73f799a | |||
| d2e428ada8 | |||
| 74156ec84c | |||
| f9e6bc92d7 | |||
| 9884586cc9 | |||
| ac717a6efb | |||
| 2b7c1ded15 | |||
| daac27712d | |||
| 1080f33282 | |||
| cc5c0a0a89 | |||
| 85971447e1 | |||
| 256e8ef275 | |||
| c07e54ec03 | |||
| 70f834e1cf | |||
| c320c6f2a2 | |||
| 256eb60df8 | |||
| 5f03973bf2 | |||
| ab2a0d8ae2 | |||
| 7e48402591 | |||
| aa85f6fcd1 | |||
| cd441ccfe7 | |||
| 47f6519006 | |||
| 9679376cb2 | |||
| efa97c3bbc | |||
| 087e598be0 | |||
| 31aa8243ee | |||
| d3d05ef539 | |||
| d6062ea4e7 | |||
| 7949748951 | |||
| 94f7392060 | |||
| 0d737bad57 | |||
| 1225db50c9 | |||
| e5d85bb3df | |||
| 0f09e5c236 | |||
| 0f0204b647 | |||
| 94421d2622 | |||
| 44f0b70461 | |||
| f58768237b | |||
| 588cf839e3 | |||
| 76872b3a97 | |||
| d253d68a12 | |||
| 4de0d29f30 | |||
| 0f0480db63 | |||
| aa40b62e0a | |||
| 68309ac582 | |||
| 522183eb4d | |||
| 4f6fee4d73 | |||
| c5fecf73c8 | |||
| ee8e93d1e8 | |||
| 9d0fa5ea4a | |||
| b0b9affbe7 | |||
| 1d1c7c78e8 | |||
| d7f5b87e70 | |||
| 1048666972 | |||
| 217f5d61c7 | |||
| 2f1677f581 | |||
| afd7ea6a1c | |||
| 7155e14e64 | |||
| 68e5b49f46 | |||
| c01e95c716 | |||
| ffa7e5130e | |||
| 7ce33bfd4c | |||
| 0c64fa9986 | |||
| 07e8b347e1 | |||
| 38a402adef | |||
| 7ab2e29101 | |||
| b96796793b | |||
| 5567a65e4b | |||
| c0c43be6b9 | |||
| 9b6074318a | |||
| ada121015d | |||
| 335317bd86 | |||
| 396464c573 | |||
| 60ad6007e5 | |||
| ceee520102 | |||
| e7c14b0817 | |||
| 885cec57db | |||
| b3672b8c66 | |||
| 450e565718 | |||
| 00bd72c1e4 | |||
| 24c24c1307 | |||
| 08bd8a9942 | |||
| 6944260767 | |||
| 3ada2d1d9d | |||
| f83b8c74ca |
@@ -45,19 +45,18 @@ body:
|
|||||||
label: Steps to Reproduce
|
label: Steps to Reproduce
|
||||||
description: Share the steps you took so that we can reproduce the issue. Reports without proper steps details will likely be closed.
|
description: Share the steps you took so that we can reproduce the issue. Reports without proper steps details will likely be closed.
|
||||||
placeholder: |
|
placeholder: |
|
||||||
1. Run apinto via the Docker image.
|
1. Run APIPark via the Docker image.
|
||||||
2. Create a Route with the Admin API.
|
2. Try configuring ...
|
||||||
3. Try configuring ...
|
3. ...
|
||||||
4. ...
|
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: environment
|
id: environment
|
||||||
attributes:
|
attributes:
|
||||||
label: Environment
|
label: Environment
|
||||||
description: Share your environment details. Reports without proper environment details will likely be closed.
|
description: Share your environment details. Reports without proper environment details will likely be closed.
|
||||||
value: |
|
value: |
|
||||||
- APINTO Dashboard version (run `apinto dashboard version`):
|
- APINTO Dashboard version:
|
||||||
- Operating system (run `uname -a`):
|
- Operating system (run `uname -a`):
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
@@ -25,7 +25,7 @@ body:
|
|||||||
label: Environment
|
label: Environment
|
||||||
description: Share your environment details. Reports without proper environment details will likely be closed.
|
description: Share your environment details. Reports without proper environment details will likely be closed.
|
||||||
value: |
|
value: |
|
||||||
- APIPark version (run `apinto dashboard version`):
|
- APIPark version:
|
||||||
- Operating system (run `uname -a`):
|
- Operating system (run `uname -a`):
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
echo "Build frontend..."
|
echo "Build frontend..."
|
||||||
cd ./frontend && pnpm run build
|
cd ./frontend && pnpm run build
|
||||||
- name: upload frontend release
|
- name: upload frontend release
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: frontend-package
|
name: frontend-package
|
||||||
path: frontend/dist
|
path: frontend/dist
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
- name: Checkout #Checkout代码
|
- name: Checkout #Checkout代码
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: download frontend release
|
- name: download frontend release
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: frontend-package
|
name: frontend-package
|
||||||
path: frontend/dist
|
path: frontend/dist
|
||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: download frontend release
|
- name: download frontend release
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: frontend-package
|
name: frontend-package
|
||||||
path: frontend/dist
|
path: frontend/dist
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@
|
|||||||
/config.yml
|
/config.yml
|
||||||
/build/
|
/build/
|
||||||
/apipark
|
/apipark
|
||||||
/aoplatform
|
.gitlab-ci.yml
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
variables:
|
|
||||||
PATH: /opt/go-1.21/go/bin/:/opt/node/node/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
|
|
||||||
GOROOT: /opt/go-1.21/go
|
|
||||||
GOPROXY: https://goproxy.cn
|
|
||||||
VERSION: $CI_COMMIT_SHORT_SHA
|
|
||||||
APP: apipark
|
|
||||||
APP_PRE: ${APP}_${VERSION}
|
|
||||||
BUILD_DIR: ${APP}-build
|
|
||||||
DEPLOY_DESC: "DEV 环境"
|
|
||||||
VIEW_ADDR: http://172.18.166.219:8288
|
|
||||||
SAVE_DIR: /opt/${APP}
|
|
||||||
NODE_OPTIONS: --max_old_space_size=8192
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- notice
|
|
||||||
- prefix
|
|
||||||
- build
|
|
||||||
- deploy
|
|
||||||
- webhook
|
|
||||||
|
|
||||||
feishu-informer: # 飞书回调
|
|
||||||
stage: notice
|
|
||||||
variables:
|
|
||||||
DIFF_URL: "$CI_MERGE_REQUEST_PROJECT_URL/-/merge_requests/$CI_MERGE_REQUEST_IID/diffs"
|
|
||||||
rules:
|
|
||||||
- if: $CI_PIPELINE_SOURCE=="merge_request_event" && $CI_COMMIT_BRANCH =~ "main"
|
|
||||||
script:
|
|
||||||
- echo "merge request"
|
|
||||||
- |
|
|
||||||
curl -X POST -H "Content-Type: application/json" \
|
|
||||||
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"项目:${CI_PROJECT_NAME}\\n提交人:${GITLAB_USER_NAME}\\n提交信息:${CI_MERGE_REQUEST_TITLE}\\n合并分支信息:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} -> ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}\\n差异性地址:${DIFF_URL}\\n请及时review代码\"}}" \
|
|
||||||
https://open.feishu.cn/open-apis/bot/v2/hook/1c334752-2874-41a1-8f1b-3060f2d46b6c
|
|
||||||
|
|
||||||
prebuild:
|
|
||||||
stage: prefix
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == "main"
|
|
||||||
script:
|
|
||||||
- echo "prebuild"
|
|
||||||
- chmod +x ./scripts/prefix.sh
|
|
||||||
- ./scripts/prefix.sh
|
|
||||||
|
|
||||||
builder:
|
|
||||||
stage: build
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == "main"
|
|
||||||
script:
|
|
||||||
- set -e
|
|
||||||
- |
|
|
||||||
if [ ! -d "../artifacts" ]; then
|
|
||||||
mkdir -p ../artifacts
|
|
||||||
fi
|
|
||||||
if [ -d "../artifacts/dist" ]; then
|
|
||||||
cp -r ../artifacts/dist frontend/dist
|
|
||||||
fi
|
|
||||||
- |
|
|
||||||
if [ -n "$(git diff --name-status HEAD~1 HEAD -- frontend)" ]; then
|
|
||||||
./scripts/build.sh $BUILD_DIR ${VERSION} all ""
|
|
||||||
else
|
|
||||||
./scripts/build.sh $BUILD_DIR ${VERSION}
|
|
||||||
fi
|
|
||||||
if [ -d "frontend/dist" ]; then
|
|
||||||
echo "copy frontend/dist to artifacts/dist"
|
|
||||||
rm -fr ../artifacts/dist
|
|
||||||
cp -r frontend/dist ../artifacts/dist
|
|
||||||
fi
|
|
||||||
cp $BUILD_DIR/${APP_PRE}_linux_amd64.tar.gz ${SAVE_DIR}
|
|
||||||
|
|
||||||
deployer:
|
|
||||||
stage: deploy
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == "main"
|
|
||||||
variables:
|
|
||||||
APIPARK_GUEST_MODE: allow
|
|
||||||
APIPARK_GUEST_ID: dklejrfbhjqwdh
|
|
||||||
script:
|
|
||||||
- cd ${SAVE_DIR};mkdir -p ${APP_PRE};tar -zxvf ${APP_PRE}_linux_amd64.tar.gz -C ${APP_PRE};cd ${APP_PRE};./install.sh ${SAVE_DIR};./run.sh restart;cd ${SAVE_DIR} && ./clean.sh ${APP_PRE}
|
|
||||||
when: on_success
|
|
||||||
success:
|
|
||||||
stage: webhook
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == "main"
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
curl -X POST -H "Content-Type: application/json" \
|
|
||||||
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"最近一次提交:${CI_COMMIT_TITLE}\\n提交人:${GITLAB_USER_NAME}\\n项目:${CI_PROJECT_NAME}\\n环境:${DEPLOY_DESC}\\n更新部署完成.\\n访问地址:${VIEW_ADDR}\\n工作流地址:${CI_PIPELINE_URL}\"}}" \
|
|
||||||
https://open.feishu.cn/open-apis/bot/v2/hook/c3672932-4dfa-4989-8023-0128bae59338
|
|
||||||
when: on_success
|
|
||||||
failure:
|
|
||||||
stage: webhook
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == "main"
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
curl -X POST -H "Content-Type: application/json" \
|
|
||||||
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"最近一次提交:${CI_COMMIT_TITLE}\\n提交人:${GITLAB_USER_NAME}\\n项目:${CI_PROJECT_NAME}\\n环境:${DEPLOY_DESC}\\n更新部署失败,请及时到gitlab上查看\\n工作流地址:${CI_PIPELINE_URL}\"}}" \
|
|
||||||
https://open.feishu.cn/open-apis/bot/v2/hook/c3672932-4dfa-4989-8023-0128bae59338
|
|
||||||
when: on_failure
|
|
||||||
@@ -197,7 +197,7 @@ To achieve this goal, we plan to add new features to APIPark, including:
|
|||||||
<br>
|
<br>
|
||||||
|
|
||||||
# 📕 Documentation
|
# 📕 Documentation
|
||||||
Visit [APIPark Documentation](https://docs.apipark.com/docs/install) for detailed installation guides, API references, and usage instructions.
|
Visit [APIPark Documentation](https://docs.apipark.com/docs/deploy) for detailed installation guides, API references, and usage instructions.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|||||||
@@ -69,15 +69,6 @@ provider_credential_schema:
|
|||||||
placeholder:
|
placeholder:
|
||||||
zh_Hans: 在此输入您的 API Key
|
zh_Hans: 在此输入您的 API Key
|
||||||
en_US: Enter your API Key
|
en_US: Enter your API Key
|
||||||
- variable: openai_organization
|
|
||||||
label:
|
|
||||||
zh_Hans: 组织 ID
|
|
||||||
en_US: Organization
|
|
||||||
type: text-input
|
|
||||||
required: false
|
|
||||||
placeholder:
|
|
||||||
zh_Hans: 在此输入您的组织 ID
|
|
||||||
en_US: Enter your Organization ID
|
|
||||||
- variable: openai_api_base
|
- variable: openai_api_base
|
||||||
label:
|
label:
|
||||||
zh_Hans: API Base
|
zh_Hans: API Base
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ provider_credential_schema:
|
|||||||
placeholder:
|
placeholder:
|
||||||
zh_Hans: 在此输入您的 API Key
|
zh_Hans: 在此输入您的 API Key
|
||||||
en_US: Enter your API Key
|
en_US: Enter your API Key
|
||||||
address: https://api.openai.com
|
address: https://api.360.cn
|
||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These should be set via go build -ldflags -X 'xxxx'.
|
// These should be set via go build -ldflags -X 'xxxx'.
|
||||||
@@ -20,7 +20,7 @@ var profileInfo []byte
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
buffer := &bytes.Buffer{}
|
buffer := &bytes.Buffer{}
|
||||||
fmt.Fprintf(buffer, "Apinto version: %s\n", Version)
|
fmt.Fprintf(buffer, "APIPark version: %s\n", Version)
|
||||||
fmt.Fprintf(buffer, "Golang version: %s\n", goVersion)
|
fmt.Fprintf(buffer, "Golang version: %s\n", goVersion)
|
||||||
fmt.Fprintf(buffer, "Git commit hash: %s\n", gitCommit)
|
fmt.Fprintf(buffer, "Git commit hash: %s\n", gitCommit)
|
||||||
fmt.Fprintf(buffer, "Built on: %s\n", BuildTime)
|
fmt.Fprintf(buffer, "Built on: %s\n", BuildTime)
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/eolinker/eosc/log"
|
||||||
|
|
||||||
application_authorization "github.com/APIParkLab/APIPark/module/application-authorization"
|
application_authorization "github.com/APIParkLab/APIPark/module/application-authorization"
|
||||||
application_authorization_dto "github.com/APIParkLab/APIPark/module/application-authorization/dto"
|
application_authorization_dto "github.com/APIParkLab/APIPark/module/application-authorization/dto"
|
||||||
@@ -151,8 +154,9 @@ func (i *imlServiceController) createAIService(ctx *gin.Context, teamID string,
|
|||||||
Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}",
|
Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}",
|
||||||
}
|
}
|
||||||
aiModel := &ai_api_dto.AiModel{
|
aiModel := &ai_api_dto.AiModel{
|
||||||
Id: m.ID(),
|
Id: m.ID(),
|
||||||
Config: m.DefaultConfig(),
|
Config: m.DefaultConfig(),
|
||||||
|
Provider: *input.Provider,
|
||||||
}
|
}
|
||||||
name := "Demo Translation API"
|
name := "Demo Translation API"
|
||||||
description := "A demo that shows you how to use a prompt to create a Translation API."
|
description := "A demo that shows you how to use a prompt to create a Translation API."
|
||||||
@@ -211,10 +215,7 @@ func (i *imlServiceController) createAIService(ctx *gin.Context, teamID string,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
//_, err = i.upstreamModule.Save(ctx, info.Id, newAIUpstream(info.Id, *input.Provider, p.URI()))
|
|
||||||
//if err != nil {
|
|
||||||
// return err
|
|
||||||
//}
|
|
||||||
return i.docModule.SaveServiceDoc(ctx, info.Id, &service_dto.SaveServiceDoc{
|
return i.docModule.SaveServiceDoc(ctx, info.Id, &service_dto.SaveServiceDoc{
|
||||||
Doc: "The Translation API allows developers to translate text from one language to another. It supports multiple languages and enables easy integration of high-quality translation features into applications. With simple API requests, you can quickly translate content into different target languages.",
|
Doc: "The Translation API allows developers to translate text from one language to another. It supports multiple languages and enables easy integration of high-quality translation features into applications. With simple API requests, you can quickly translate content into different target languages.",
|
||||||
})
|
})
|
||||||
@@ -236,7 +237,12 @@ func (i *imlServiceController) SearchMyServices(ctx *gin.Context, teamId string,
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
func (i *imlServiceController) Get(ctx *gin.Context, id string) (*service_dto.Service, error) {
|
func (i *imlServiceController) Get(ctx *gin.Context, id string) (*service_dto.Service, error) {
|
||||||
|
now := time.Now()
|
||||||
|
defer func() {
|
||||||
|
log.Infof("get service %s cost %d ms", id, time.Since(now).Milliseconds())
|
||||||
|
}()
|
||||||
return i.module.Get(ctx, id)
|
return i.module.Get(ctx, id)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *imlServiceController) Search(ctx *gin.Context, teamID string, keyword string) ([]*service_dto.ServiceItem, error) {
|
func (i *imlServiceController) Search(ctx *gin.Context, teamID string, keyword string) ([]*service_dto.ServiceItem, error) {
|
||||||
@@ -278,6 +284,10 @@ type imlAppController struct {
|
|||||||
authModule application_authorization.IAuthorizationModule `autowired:""`
|
authModule application_authorization.IAuthorizationModule `autowired:""`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (i *imlAppController) SearchCanSubscribe(ctx *gin.Context, serviceId string) ([]*service_dto.SimpleAppItem, error) {
|
||||||
|
return i.module.SearchCanSubscribe(ctx, serviceId)
|
||||||
|
}
|
||||||
|
|
||||||
func (i *imlAppController) Search(ctx *gin.Context, teamId string, keyword string) ([]*service_dto.AppItem, error) {
|
func (i *imlAppController) Search(ctx *gin.Context, teamId string, keyword string) ([]*service_dto.AppItem, error) {
|
||||||
return i.module.Search(ctx, teamId, keyword)
|
return i.module.Search(ctx, teamId, keyword)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ type IAppController interface {
|
|||||||
// SimpleApps 获取简易项目列表
|
// SimpleApps 获取简易项目列表
|
||||||
SimpleApps(ctx *gin.Context, keyword string) ([]*service_dto.SimpleAppItem, error)
|
SimpleApps(ctx *gin.Context, keyword string) ([]*service_dto.SimpleAppItem, error)
|
||||||
MySimpleApps(ctx *gin.Context, keyword string) ([]*service_dto.SimpleAppItem, error)
|
MySimpleApps(ctx *gin.Context, keyword string) ([]*service_dto.SimpleAppItem, error)
|
||||||
|
SearchCanSubscribe(ctx *gin.Context, keyword string) ([]*service_dto.SimpleAppItem, error)
|
||||||
GetApp(ctx *gin.Context, appId string) (*service_dto.App, error)
|
GetApp(ctx *gin.Context, appId string) (*service_dto.App, error)
|
||||||
DeleteApp(ctx *gin.Context, appId string) error
|
DeleteApp(ctx *gin.Context, appId string) error
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,8 +381,9 @@ func (i *imlInitController) createAIService(ctx context.Context, teamID string,
|
|||||||
Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}",
|
Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}",
|
||||||
}
|
}
|
||||||
aiModel := &ai_api_dto.AiModel{
|
aiModel := &ai_api_dto.AiModel{
|
||||||
Id: m.ID(),
|
Id: m.ID(),
|
||||||
Config: m.DefaultConfig(),
|
Config: m.DefaultConfig(),
|
||||||
|
Provider: providerId,
|
||||||
}
|
}
|
||||||
name := "Demo Translation API"
|
name := "Demo Translation API"
|
||||||
description := "A demo that shows you how to use a prompt to create a Translation API."
|
description := "A demo that shows you how to use a prompt to create a Translation API."
|
||||||
|
|||||||
@@ -27,4 +27,5 @@ packages/core/public/tinymce/
|
|||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
|
||||||
/pnpm-lock.yaml
|
/pnpm-lock.yaml
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
/*
|
|
||||||
* @Date: 2024-05-10 14:19:56
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-05-10 15:55:29
|
|
||||||
* @FilePath: \frontend\jest.config.js
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
roots: ['<rootDir>/packages'],
|
roots: ['<rootDir>/packages'],
|
||||||
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
|
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
|
||||||
@@ -15,4 +8,4 @@ module.exports = {
|
|||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
||||||
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||||
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1 @@
|
|||||||
/*
|
// import '@testing-library/jest-dom/extend-expect';
|
||||||
* @Date: 2024-05-10 14:22:41
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-05-10 15:49:31
|
|
||||||
* @FilePath: \frontend\jest.setup.js
|
|
||||||
*/
|
|
||||||
// import '@testing-library/jest-dom/extend-expect';
|
|
||||||
|
|||||||
@@ -3,4 +3,5 @@
|
|||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"version": "independent"
|
"version": "independent"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@ yarn-debug.log*
|
|||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
dist-ssr
|
dist-ssr
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/frontend/favicon.ico" />
|
<link rel="icon" type="image/svg+xml" href="/frontend/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>APIPark - 企业API数据开放平台</title>
|
<title>2APIPark</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": " vite --port 5000 --strictPort",
|
"dev": " vite --port 5000 --strictPort",
|
||||||
"build": "vite build ",
|
"build": "vite build ",
|
||||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||||
"preview": "vite preview --port 5000 --strictPort",
|
"preview": "vite preview --port 5000 --strictPort",
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:54
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:42:18
|
|
||||||
* @FilePath: \frontend\packages\core\postcss.config.js
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
'postcss-import': {},
|
'postcss-import': {},
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2024-06-05 09:35:25
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:50:12
|
|
||||||
* @FilePath: \frontend\packages\core\start-vite.js
|
|
||||||
*/
|
|
||||||
// start-vite.js// start-vite.js
|
// start-vite.js// start-vite.js
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'child_process';
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:54
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2023-11-29 15:49:05
|
|
||||||
* @FilePath: \applatform\frontend\packages\core\postcss.config.js
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
'postcss-import': {},
|
'postcss-import': {},
|
||||||
|
|||||||
@@ -48,27 +48,27 @@ const themeToken = {
|
|||||||
getNavItem(<a>{$t('消费者')}</a>, 'consumer','/consumer',<Icon icon="ic:baseline-apps" width="18" height="18"/>,undefined,undefined,'all'),
|
getNavItem(<a>{$t('消费者')}</a>, 'consumer','/consumer',<Icon icon="ic:baseline-apps" width="18" height="18"/>,undefined,undefined,'all'),
|
||||||
getNavItem(<a>{$t('团队')}</a>, 'team','/team',<Icon icon="ic:baseline-people-alt" width="18" height="18"/>,undefined,undefined,'all'),
|
getNavItem(<a>{$t('团队')}</a>, 'team','/team',<Icon icon="ic:baseline-people-alt" width="18" height="18"/>,undefined,undefined,'all'),
|
||||||
]),
|
]),
|
||||||
getNavItem($t('API 市场'), 'serviceHub','/serviceHub',<Icon icon="ic:baseline-hub" width="18" height="18"/>,undefined,undefined,'system.workspace.api_market.view'),
|
getNavItem($t('API 市场'), 'serviceHub','/serviceHub',<Icon icon="ic:baseline-hub" width="18" height="18"/>,undefined,undefined,'system.api_portal.api_portal.view'),
|
||||||
|
|
||||||
getNavItem($t('仪表盘'), 'mainPage', APP_MODE === 'pro' ? '/analytics' : '/analytics/total',<Icon icon="ic:baseline-bar-chart" width="18" height="18"/>,[
|
getNavItem($t('仪表盘'), 'mainPage', APP_MODE === 'pro' ? '/analytics' : '/analytics/total',<Icon icon="ic:baseline-bar-chart" width="18" height="18"/>,[
|
||||||
getNavItem(<a >{$t('运行视图')}</a>, 'analytics',APP_MODE === 'pro' ? '/analytics' : '/analytics/total' ,<ProjectFilled />,undefined,undefined,'system.dashboard.run_view.view'),
|
getNavItem(<a >{$t('运行视图')}</a>, 'analytics',APP_MODE === 'pro' ? '/analytics' : '/analytics/total' ,<ProjectFilled />,undefined,undefined,'system.analysis.run_view.view'),
|
||||||
APP_MODE === 'pro' ? getNavItem(<a >{$t('系统拓扑图')}</a>, 'systemrunning','/systemrunning',<ProjectFilled />,undefined,undefined,'system.dashboard.systemrunning.view') : null,
|
APP_MODE === 'pro' ? getNavItem(<a >{$t('系统拓扑图')}</a>, 'systemrunning','/systemrunning',<ProjectFilled />,undefined,undefined,'system.dashboard.systemrunning.view') : null,
|
||||||
],undefined,'system.dashboard.run_view.view'),
|
],undefined,'system.analysis.run_view.view'),
|
||||||
|
|
||||||
getNavItem($t('系统设置'), 'operationCenter','/commonsetting',<Icon icon="ic:baseline-settings" width="18" height="18"/>, [
|
getNavItem($t('系统设置'), 'operationCenter','/commonsetting',<Icon icon="ic:baseline-settings" width="18" height="18"/>, [
|
||||||
getNavItem($t('系统'), 'serviceHubSetting','/commonsetting',null,[
|
getNavItem($t('系统'), 'serviceHubSetting','/commonsetting',null,[
|
||||||
getNavItem(<a>{$t('常规')}</a>, 'commonsetting','/commonsetting',<Icon icon="ic:baseline-hub" width="18" height="18"/>,undefined,undefined,'system.api_market.service_classification.view'),
|
getNavItem(<a>{$t('常规')}</a>, 'commonsetting','/commonsetting',<Icon icon="ic:baseline-hub" width="18" height="18"/>,undefined,undefined,'system.api_market.service_classification.view'),
|
||||||
getNavItem(<a>{$t('API 网关')}</a>, 'cluster','/cluster',<Icon icon="ic:baseline-device-hub" width="18" height="18"/>,undefined,undefined,'system.devops.cluster.view'),
|
getNavItem(<a>{$t('API 网关')}</a>, 'cluster','/cluster',<Icon icon="ic:baseline-device-hub" width="18" height="18"/>,undefined,undefined,'system.settings.api_gateway.view'),
|
||||||
getNavItem(<a>{$t('AI 模型')}</a>, 'aisetting','/aisetting',<Icon icon="hugeicons:ai-network" width="18" height="18"/>,undefined,undefined,'system.devops.cluster.view'),
|
getNavItem(<a>{$t('AI 模型')}</a>, 'aisetting','/aisetting',<Icon icon="hugeicons:ai-network" width="18" height="18"/>,undefined,undefined,'system.settings.api_gateway.view'),
|
||||||
],undefined,'system.api_market.service_classification.view'),
|
],undefined,'system.api_market.service_classification.view'),
|
||||||
getNavItem($t('用户'), 'organization','/member',null,[
|
getNavItem($t('用户'), 'organization','/member',null,[
|
||||||
getNavItem(<a>{$t('账号')}</a>, 'member','/member',<Icon icon="ic:baseline-people-alt" width="18" height="18"/>,undefined,undefined,'system.organization.member.view'),
|
getNavItem(<a>{$t('账号')}</a>, 'member','/member',<Icon icon="ic:baseline-people-alt" width="18" height="18"/>,undefined,undefined,'system.settings.account.view'),
|
||||||
getNavItem(<a>{$t('角色')}</a>, 'role','/role',<Icon icon="ic:baseline-verified-user" width="18" height="18"/>,undefined,undefined,'system.organization.role.view'),
|
getNavItem(<a>{$t('角色')}</a>, 'role','/role',<Icon icon="ic:baseline-verified-user" width="18" height="18"/>,undefined,undefined,'system.organization.role.view'),
|
||||||
],undefined,''),
|
],undefined,''),
|
||||||
getNavItem($t('集成'), 'maintenanceCenter','/datasourcing', null, [
|
getNavItem($t('集成'), 'maintenanceCenter','/datasourcing', null, [
|
||||||
getNavItem(<a>{$t('数据源')}</a>, 'datasourcing','/datasourcing',<Icon icon="ic:baseline-monitor-heart" width="18" height="18"/>,undefined,undefined,'system.devops.data_source.view'),
|
getNavItem(<a>{$t('数据源')}</a>, 'datasourcing','/datasourcing',<Icon icon="ic:baseline-monitor-heart" width="18" height="18"/>,undefined,undefined,'system.settings.data_source.view'),
|
||||||
getNavItem(<a>{$t('证书')}</a>, 'cert','/cert',<Icon icon="ic:baseline-security" width="18" height="18"/>,undefined,undefined,'system.devops.ssl_certificate.view'),
|
getNavItem(<a>{$t('证书')}</a>, 'cert','/cert',<Icon icon="ic:baseline-security" width="18" height="18"/>,undefined,undefined,'system.settings.ssl_certificate.view'),
|
||||||
getNavItem(<a>{$t('日志')}</a>, 'logsettings','/logsettings',<Icon icon="ic:baseline-sticky-note-2" width="18" height="18"/>,undefined,undefined,'system.devops.log_configuration.view'),
|
getNavItem(<a>{$t('日志')}</a>, 'logsettings','/logsettings',<Icon icon="ic:baseline-sticky-note-2" width="18" height="18"/>,undefined,undefined,'system.settings.log_configuration.view'),
|
||||||
APP_MODE === 'pro' ? getNavItem(<a>{$t('资源')}</a>, 'resourcesettings','/resourcesettings',null,undefined,undefined,'system.partition.self.view'):null,
|
APP_MODE === 'pro' ? getNavItem(<a>{$t('资源')}</a>, 'resourcesettings','/resourcesettings',null,undefined,undefined,'system.partition.self.view'):null,
|
||||||
APP_MODE === 'pro' ? getNavItem(<a>{$t('Open API')}</a>, 'openapi','/openapi',null,undefined,undefined,'system.openapi.self.view'):null,
|
APP_MODE === 'pro' ? getNavItem(<a>{$t('Open API')}</a>, 'openapi','/openapi',null,undefined,undefined,'system.openapi.self.view'):null,
|
||||||
]),
|
]),
|
||||||
@@ -243,7 +243,7 @@ const themeToken = {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
logo={Logo}
|
logo={Logo}
|
||||||
pageTitleRender={()=>$t('APIPark - 企业API数据开放平台')}
|
pageTitleRender={()=>$t('APIPark')}
|
||||||
menuFooterRender={(props) => {
|
menuFooterRender={(props) => {
|
||||||
if (props?.collapsed) return undefined;
|
if (props?.collapsed) return undefined;
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,27 +1,23 @@
|
|||||||
|
|
||||||
import { GetProp, TransferProps, TreeDataNode, theme, Transfer, Tree, Spin } from "antd";
|
import { TransferProps, TreeDataNode, Tree, Spin, Input, Empty } from "antd";
|
||||||
import { DataNode, TreeProps } from "antd/es/tree";
|
import { DataNode } from "antd/es/tree";
|
||||||
import { Ref, forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
import { Ref, forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
||||||
import { ApartmentOutlined, LoadingOutlined, UserOutlined } from "@ant-design/icons";
|
import { ApartmentOutlined, LoadingOutlined, UserOutlined } from "@ant-design/icons";
|
||||||
import { cloneDeep, debounce } from "lodash-es";
|
|
||||||
import { ColumnsType } from "antd/es/table";
|
import { ColumnsType } from "antd/es/table";
|
||||||
import { $t } from "@common/locales";
|
import { $t } from "@common/locales";
|
||||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
||||||
|
|
||||||
type TransferItem = GetProp<TransferProps, 'dataSource'>[number];
|
|
||||||
|
|
||||||
export type TransferTableProps<T> = {
|
export type TransferTableProps<T> = {
|
||||||
request?:(k?:string)=>Promise<{data:T[],success:boolean}>
|
request?:(k?:string)=>Promise<{data:T[],success:boolean}>
|
||||||
columns: ColumnsType<T>
|
columns: ColumnsType<T>
|
||||||
primaryKey:string
|
primaryKey:string
|
||||||
onSelect:(selectedData:T[])=>void
|
onSelect:(selectedData:string[])=>void
|
||||||
tableType?:'member'|'api'
|
tableType?:'member'|'api'
|
||||||
disabledData:string[]
|
disabledData:string[]
|
||||||
searchPlaceholder?:string
|
searchPlaceholder?:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TransferTableHandle<T> = {
|
export type TransferTableHandle<T> = {
|
||||||
selectedData: () => T[];
|
|
||||||
selectedRowKeys: () => React.Key[];
|
selectedRowKeys: () => React.Key[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,10 +27,6 @@ interface TreeTransferProps {
|
|||||||
onChange: TransferProps['onChange'];
|
onChange: TransferProps['onChange'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Customize Table Transfer
|
|
||||||
const isChecked = (selectedKeys: React.Key[], eventKey: React.Key) =>
|
|
||||||
selectedKeys.includes(eventKey);
|
|
||||||
|
|
||||||
const generateTree = (
|
const generateTree = (
|
||||||
treeNodes: TreeDataNode[] = [],
|
treeNodes: TreeDataNode[] = [],
|
||||||
checkedKeys: TreeTransferProps['targetKeys'] = [],
|
checkedKeys: TreeTransferProps['targetKeys'] = [],
|
||||||
@@ -73,200 +65,104 @@ const generateTree = (
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
const TransferTree = (props)=>{
|
|
||||||
const { direction, token, tableHeight, dataSource, targetKeys, onItemSelect, onItemSelectAll,checkedKey,selectedKeys, filteredItems ,disabledData} = props;
|
|
||||||
const [expandedKeys, setExpandedKeys] = useState<string[]>([]);
|
|
||||||
|
|
||||||
const getExpandedKeys = (newData:TreeDataNode[], expandedSet:Set<string> = new Set())=>{
|
|
||||||
newData.forEach((item)=>{
|
|
||||||
if(item.children && item.children.length > 0){
|
|
||||||
expandedSet.add(item.key)
|
|
||||||
getExpandedKeys(item.children,expandedSet)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return expandedSet
|
|
||||||
}
|
|
||||||
|
|
||||||
const treeData:TreeDataNode[] = useMemo(()=>{
|
|
||||||
const filteredSet = filteredItems && filteredItems.length > 0 ? new Set(filteredItems.map((x)=>x.id)) : new Set()
|
|
||||||
const res = dataSource && dataSource.length > 0 ? generateTree(dataSource, targetKeys,direction === 'right',disabledData,filteredSet) : []
|
|
||||||
setExpandedKeys(Array.from(getExpandedKeys(res)))
|
|
||||||
return res
|
|
||||||
},[
|
|
||||||
dataSource, targetKeys,direction ,disabledData,filteredItems
|
|
||||||
])
|
|
||||||
|
|
||||||
const onExpand: TreeProps['onExpand'] = (expandedKeysValue) => {
|
|
||||||
setExpandedKeys(expandedKeysValue as string[]);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
|
|
||||||
<div style={{ padding: token.paddingXS }}>
|
|
||||||
<Tree
|
|
||||||
className="icon-tree"
|
|
||||||
blockNode
|
|
||||||
checkable
|
|
||||||
showIcon
|
|
||||||
checkedKeys={direction === 'left' ? Array.from(new Set([...checkedKey,...disabledData])) : selectedKeys }
|
|
||||||
defaultExpandAll
|
|
||||||
expandedKeys={expandedKeys}
|
|
||||||
onExpand={onExpand}
|
|
||||||
height={tableHeight}
|
|
||||||
icon={(props)=> { return (props.type === 'member' ? <UserOutlined /> :<ApartmentOutlined /> )} }
|
|
||||||
treeData={treeData}
|
|
||||||
onCheck={(_checkedKeys, e:{checked: boolean, checkedNodes, node, event, halfCheckedKeys}) => {
|
|
||||||
if(e.checked){
|
|
||||||
onItemSelectAll( _checkedKeys, e.checked);
|
|
||||||
}else{
|
|
||||||
const checkedKeyArrFromTree = e.checkedNodes.map(node => node.key)
|
|
||||||
onItemSelectAll((checkedKey as string[]).filter(key => checkedKeyArrFromTree.indexOf(key) === -1),e.checked)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onSelect={(_, { node: { key } }) => {
|
|
||||||
onItemSelect(key as string, !isChecked(checkedKey, key));
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const MemberTransfer= forwardRef<TransferTableHandle<{[k:string]:unknown}>, TransferTableProps<{[k:string]:unknown}>>(
|
const MemberTransfer= forwardRef<TransferTableHandle<{[k:string]:unknown}>, TransferTableProps<{[k:string]:unknown}>>(
|
||||||
<T extends {[k:string]:unknown}>(props: TransferTableProps<T>, ref:Ref<TransferTableHandle<T>>) => {
|
<T extends {[k:string]:unknown}>(props: TransferTableProps<T>, ref:Ref<TransferTableHandle<T>>) => {
|
||||||
const {request,columns,primaryKey,onSelect,tableType,disabledData = [],searchPlaceholder} = props
|
const {request,columns,primaryKey,onSelect,tableType,disabledData = [],searchPlaceholder} = props
|
||||||
const [tableHeight, setTableHeight] = useState(window.innerHeight * 80 / 100 - 64 - 72 - 56 - 16 -3);
|
|
||||||
const [targetKeys, setTargetKeys] = useState<TreeTransferProps['targetKeys']>([]);
|
const [targetKeys, setTargetKeys] = useState<TreeTransferProps['targetKeys']>([]);
|
||||||
const [dataSource, setDataSource] = useState<DataNode[] >([])
|
const [dataSource, setDataSource] = useState<DataNode[] >([])
|
||||||
const parentRef = useRef<HTMLDivElement>(null);
|
const parentRef = useRef<HTMLDivElement>(null);
|
||||||
const [loading, setLoading] = useState<boolean>(false)
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
const {state} = useGlobalContext()
|
const {state} = useGlobalContext()
|
||||||
|
const [expandedKeys, setExpandedKeys] = useState<string[]>([]);
|
||||||
|
const [searchWord, setSearchWord] = useState<string>('')
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setTargetKeys(disabledData)
|
setTargetKeys(disabledData)
|
||||||
},[disabledData])
|
},[disabledData])
|
||||||
|
|
||||||
useImperativeHandle(ref, () =>({
|
useImperativeHandle(ref, () =>({
|
||||||
selectedData: () => dataSource,
|
|
||||||
selectedRowKeys: () => targetKeys,}))
|
selectedRowKeys: () => targetKeys,}))
|
||||||
|
|
||||||
const onChange: TreeTransferProps['onChange'] = (keys) => {
|
const translatedDataSource = useMemo(()=>{
|
||||||
onSelect?.(new Set(keys))
|
|
||||||
setTargetKeys(Array.from(new Set(keys)));
|
const loop = (data: DataNode[]): DataNode[] =>
|
||||||
};
|
data?.map((item) => {
|
||||||
|
const strTitle:string = item.name === '所有成员' ? $t(item.name) as string : item.name as string;
|
||||||
|
const index = strTitle.indexOf(searchWord);
|
||||||
|
const beforeStr = strTitle.substring(0, index);
|
||||||
|
const afterStr = strTitle.slice(index + searchWord.length);
|
||||||
|
const title =
|
||||||
|
index > -1 ? (
|
||||||
|
<span className='w-[calc(100%-16px)] truncate' title={strTitle}>
|
||||||
|
{beforeStr}
|
||||||
|
<span className="text-theme">{searchWord}</span>
|
||||||
|
{afterStr}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className='w-[calc(100%-16px)] truncate' title={`${strTitle}`}>{strTitle}</span>
|
||||||
|
)
|
||||||
|
if (item.children) {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
title,
|
||||||
|
disableCheckbox:disabledData.indexOf(item.key as string) !== -1,
|
||||||
|
icon:<ApartmentOutlined />,
|
||||||
|
children: loop(item.children as T[]) };
|
||||||
|
}
|
||||||
|
|
||||||
const { token } = theme.useToken();
|
return {
|
||||||
|
...item,
|
||||||
const transferDataSource: TransferItem[] = useMemo(()=>{
|
title,
|
||||||
function flatten(list: TreeDataNode[] = [], res:TransferItem[]) {
|
icon:<UserOutlined />,
|
||||||
list.forEach((item) => {
|
isLeaf:true,
|
||||||
res.push({...item, title:item.title === '所有成员' ? $t((item as unknown as {title:string}).title):item.title }as TransferItem);
|
disableCheckbox:disabledData.indexOf(item.key as string) !== -1
|
||||||
flatten(item.children,res);
|
};
|
||||||
});
|
|
||||||
}
|
|
||||||
const res:TransferItem[] =[]
|
|
||||||
flatten(dataSource,res);
|
|
||||||
return res
|
|
||||||
},[
|
|
||||||
dataSource, state.language
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
const translatedDataSource = useMemo(()=>dataSource.map((item)=>({
|
|
||||||
...item,
|
|
||||||
name:item.name === '所有成员' ? $t((item as unknown as {name:string}).name):item.name,
|
|
||||||
})),[dataSource, state.language])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let memo: Record<string, boolean> = {};
|
|
||||||
|
|
||||||
const handlerFilterOption = (inputValue: string, item: any, parentResult: boolean = false, childrenSet: Set<string> = new Set()): boolean => {
|
|
||||||
const cacheKey = `${inputValue}_${item.key}`;
|
|
||||||
if (memo[cacheKey]) {
|
|
||||||
return memo[cacheKey];
|
|
||||||
}
|
|
||||||
|
|
||||||
childrenSet.add(item.key);
|
|
||||||
let result = item.title.includes(inputValue) || parentResult
|
|
||||||
if (item.children) {
|
|
||||||
for (const child of item.children) {
|
|
||||||
if (handlerFilterOption(inputValue, child, result,childrenSet)) {
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result) {
|
|
||||||
memo[cacheKey] = result;
|
|
||||||
childrenSet.forEach((key) => {
|
|
||||||
memo[`${inputValue}_${key}`] = result;
|
|
||||||
});
|
});
|
||||||
}
|
return loop(dataSource);
|
||||||
return result;
|
},[dataSource, state.language, searchWord])
|
||||||
};
|
|
||||||
|
|
||||||
|
const getInitExpandKeys = (data:T[], expandKeys:string[] = [])=>{
|
||||||
|
data.forEach((item)=>{
|
||||||
|
if(item.children?.length){
|
||||||
|
expandKeys.push(item.key as string)
|
||||||
|
getInitExpandKeys(item.children,expandKeys)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return expandKeys
|
||||||
|
}
|
||||||
|
|
||||||
const getDataSource = ()=>{
|
const getDataSource = ()=>{
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
request && request().then((res)=>{
|
request && request().then((res)=>{
|
||||||
const {data,success} = res
|
const {data,success} = res
|
||||||
setDataSource(success? data : [])
|
setDataSource(success? data : [])
|
||||||
|
setExpandedKeys(getInitExpandKeys(success? data:[]))
|
||||||
}).finally(()=>{setLoading(false)})
|
}).finally(()=>{setLoading(false)})
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getDataSource()
|
|
||||||
const handleResize = () => {
|
|
||||||
setTableHeight(window.innerHeight * 80 / 100 - 64 - 72 - 56 - 16 -3)
|
|
||||||
};
|
|
||||||
|
|
||||||
const debouncedHandleResize = debounce(handleResize, 200);
|
useEffect(() => {
|
||||||
|
getDataSource()
|
||||||
// 监听窗口大小变化
|
}, []);
|
||||||
window.addEventListener('resize', debouncedHandleResize);
|
|
||||||
handleResize();
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener('resize', debouncedHandleResize);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={parentRef}>
|
<div ref={parentRef}>
|
||||||
<Spin indicator={<LoadingOutlined style={{ fontSize: 24 }} spin />} spinning={loading} className=''>
|
<Spin indicator={<LoadingOutlined style={{ fontSize: 24 }} spin />} spinning={loading} className=''>
|
||||||
<Transfer
|
<Input className="mb-[10px]" placeholder={searchPlaceholder} onChange={(e)=>setSearchWord(e.target.value)} value={searchWord} />
|
||||||
showSearch
|
<>{ translatedDataSource && translatedDataSource.length > 0 ? <Tree
|
||||||
onSearch={(dir)=>{
|
checkable
|
||||||
memo = {};
|
expandedKeys={expandedKeys}
|
||||||
}}
|
checkedKeys={targetKeys}
|
||||||
listStyle={{width:'408px'}}
|
selectable={false}
|
||||||
disabledData={disabledData}
|
onCheck={(e)=>{setTargetKeys(e);
|
||||||
filterOption={(inputValue: string, item: any) => handlerFilterOption(inputValue, item)}
|
onSelect(((e as string[])?.filter(x=>disabledData.indexOf(x as string) === -1))||[])}}
|
||||||
targetKeys={targetKeys}
|
onExpand={setExpandedKeys}
|
||||||
dataSource={transferDataSource}
|
treeData={translatedDataSource}
|
||||||
className="tree-transfer"
|
blockNode
|
||||||
render={(item) => item.title!}
|
showIcon
|
||||||
showSelectAll={false}
|
/>
|
||||||
onChange={onChange}
|
: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/> }</>
|
||||||
titles={['','']}
|
|
||||||
>
|
|
||||||
{({ direction, onItemSelect, selectedKeys,onItemSelectAll ,filteredItems}) => {
|
|
||||||
const treeProps = {
|
|
||||||
dataSource:translatedDataSource, direction, onItemSelect, selectedKeys,onItemSelectAll ,filteredItems,token,tableHeight,targetKeys,disabledData
|
|
||||||
}
|
|
||||||
if (direction === 'left') {
|
|
||||||
const checkedKey = [...selectedKeys, ...targetKeys as string[]];
|
|
||||||
return (
|
|
||||||
<TransferTree {...treeProps} checkedKey={checkedKey} />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if(direction === 'right'){
|
|
||||||
const checkedKey = [...selectedKeys,...targetKeys as string[]];
|
|
||||||
return (
|
|
||||||
<TransferTree {...treeProps} checkedKey={checkedKey} />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
</Transfer>
|
|
||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -219,12 +219,12 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
|
|||||||
/></Row>
|
/></Row>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
<Form.Item
|
{/* <Form.Item
|
||||||
label={$t("备注")}
|
label={$t("备注")}
|
||||||
name="remark"
|
name="remark"
|
||||||
>
|
>
|
||||||
<Input.TextArea className="w-INPUT_NORMAL" disabled={type !== 'add' && type !== 'publish'} placeholder={$t(PLACEHOLDER.input)} />
|
<Input.TextArea className="w-INPUT_NORMAL" disabled={type !== 'add' && type !== 'publish'} placeholder={$t(PLACEHOLDER.input)} />
|
||||||
</Form.Item>
|
</Form.Item> */}
|
||||||
{/*
|
{/*
|
||||||
{type !== 'add' && type !== 'publish' && <Form.Item
|
{type !== 'add' && type !== 'publish' && <Form.Item
|
||||||
label={$t("审核意见"
|
label={$t("审核意见"
|
||||||
|
|||||||
@@ -145,12 +145,20 @@ export const TranslateWord = ()=>{
|
|||||||
{$t('非等匹配')}
|
{$t('非等匹配')}
|
||||||
{$t('空值匹配')}
|
{$t('空值匹配')}
|
||||||
{$t('存在匹配')}
|
{$t('存在匹配')}
|
||||||
|
{$t('不存在匹配')}
|
||||||
{$t('区分大小写的正则匹配')}
|
{$t('区分大小写的正则匹配')}
|
||||||
{$t('不区分大小写的正则匹配')}
|
{$t('不区分大小写的正则匹配')}
|
||||||
{$t('任意匹配')}
|
{$t('任意匹配')}
|
||||||
{$t('驳回')}
|
{$t('驳回')}
|
||||||
{$t('已订阅')}
|
{$t('已订阅')}
|
||||||
{$t('取消申请')}
|
{$t('取消申请')}
|
||||||
|
{$t('透传客户端请求 Host')}
|
||||||
|
{$t('使用上游服务 Host')}
|
||||||
|
{$t('重写 Host')}
|
||||||
|
{$t('动态服务发现')}
|
||||||
|
{$t('地址')}
|
||||||
|
{$t('新增')}
|
||||||
|
{$t('申请方消费者')}
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const WithPermission = ({access, tooltip, children,disabled, showDisabled = true
|
|||||||
{ cloneElement(children, {disabled:true})}
|
{ cloneElement(children, {disabled:true})}
|
||||||
</Tooltip>}
|
</Tooltip>}
|
||||||
{!editAccess && (children?.type !== Button && children?.type !== Upload && showDisabled) && <Tooltip title={tooltip ?? $t("暂无操作权限,请联系管理员分配。")}>
|
{!editAccess && (children?.type !== Button && children?.type !== Upload && showDisabled) && <Tooltip title={tooltip ?? $t("暂无操作权限,请联系管理员分配。")}>
|
||||||
{ cloneElement(children, {disabled:true,okButtonProps:{disabled:true}})}
|
{ cloneElement(children, {disabled:true, onClick:(e)=>e.preventDefault(),okButtonProps:{disabled:true}})}
|
||||||
</Tooltip>}
|
</Tooltip>}
|
||||||
|
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -343,11 +343,6 @@ export const PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN : PageProColumns<Publish
|
|||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
ellipsis:true,
|
ellipsis:true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title:('备注'),
|
|
||||||
dataIndex: 'comments',
|
|
||||||
ellipsis:true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title:('申请人'),
|
title:('申请人'),
|
||||||
dataIndex: ['applicant','name'],
|
dataIndex: ['applicant','name'],
|
||||||
|
|||||||
@@ -4,84 +4,84 @@
|
|||||||
|
|
||||||
export const PERMISSION_DEFINITION = [
|
export const PERMISSION_DEFINITION = [
|
||||||
{
|
{
|
||||||
"system.organization.member.view": {
|
"system.settings.account.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.view"] }]
|
"anyOf": [{ "backend": ["system.settings.account.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.add": {
|
"system.organization.member.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.edit": {
|
"system.organization.member.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.remove": {
|
"system.organization.member.remove": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.delete": {
|
"system.organization.member.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.block": {
|
"system.organization.member.block": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.department.add": {
|
"system.organization.member.department.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.department.edit": {
|
"system.organization.member.department.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.member.department.delete": {
|
"system.organization.member.department.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.member.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.account.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.team.view": {
|
"system.workspace.team.view_all": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.team.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.view_all"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.team.add": {
|
"system.organization.team.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.team.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.create"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.team.edit": {
|
"system.organization.team.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.team.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.team.delete": {
|
"system.organization.team.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.team.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.team.running": {
|
"system.organization.team.running": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.team.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.role.view": {
|
"system.organization.role.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.role.view_system_role","system.organization.role.view_team_role"] }]
|
"anyOf": [{ "backend": ["system.settings.role.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.role.system.view": {
|
"system.organization.role.system.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.role.view_system_role"] }]
|
"anyOf": [{ "backend": ["system.settings.role.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.role.system.add": {
|
"system.organization.role.system.add": {
|
||||||
@@ -101,7 +101,7 @@ export const PERMISSION_DEFINITION = [
|
|||||||
},
|
},
|
||||||
"system.organization.role.team.view": {
|
"system.organization.role.team.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.organization.role.view_team_role"] }]
|
"anyOf": [{ "backend": ["system.settings.role.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.organization.role.team.add": {
|
"system.organization.role.team.add": {
|
||||||
@@ -121,22 +121,22 @@ export const PERMISSION_DEFINITION = [
|
|||||||
},
|
},
|
||||||
"system.api_market.service_classification.view": {
|
"system.api_market.service_classification.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.settings.service_classification.view"] }]
|
"anyOf": [{ "backend": ["system.settings.general.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.api_market.service_classification.add": {
|
"system.api_market.service_classification.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.settings.service_classification.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.general.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.api_market.service_classification.edit": {
|
"system.api_market.service_classification.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.settings.service_classification.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.general.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.api_market.service_classification.delete": {
|
"system.api_market.service_classification.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.settings.service_classification.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.general.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.system_setting.view": {
|
"system.devops.system_setting.view": {
|
||||||
@@ -149,94 +149,94 @@ export const PERMISSION_DEFINITION = [
|
|||||||
"anyOf": [{ "backend": ["system.settings.general.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.general.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.dashboard.run_view.view":{
|
"system.analysis.run_view.view":{
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ['system.dashboard.run_view.view'] }]
|
"anyOf": [{ "backend": ['system.analysis.run_view.view'] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.data_source.view":{
|
"system.settings.data_source.view":{
|
||||||
"granted":{
|
"granted":{
|
||||||
"anyOf":[{"backend":['system.devops.data_source.view']}]
|
"anyOf":[{"backend":['system.settings.data_source.view']}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.data_source.edit":{
|
"system.devops.data_source.edit":{
|
||||||
"granted":{
|
"granted":{
|
||||||
"anyOf":[{"backend":['system.devops.data_source.manager']}]
|
"anyOf":[{"backend":['system.settings.data_source.manager']}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.cluster.view": {
|
"system.settings.api_gateway.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.cluster.view"] }]
|
"anyOf": [{ "backend": ["system.settings.api_gateway.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.cluster.add": {
|
"system.devops.cluster.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.cluster.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.api_gateway.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.cluster.edit": {
|
"system.devops.cluster.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.cluster.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.api_gateway.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.cluster.delete": {
|
"system.devops.cluster.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.cluster.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.api_gateway.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.ai_provider.view": {
|
"system.settings.ai_provider.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.ai_provider.view"] }]
|
"anyOf": [{ "backend": ["system.settings.ai_provider.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.ai_provider.edit": {
|
"system.devops.ai_provider.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.ai_provider.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.ai_provider.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.ssl_certificate.view": {
|
"system.settings.ssl_certificate.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.ssl_certificate.view"] }]
|
"anyOf": [{ "backend": ["system.settings.ssl_certificate.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.ssl_certificate.add": {
|
"system.devops.ssl_certificate.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.ssl_certificate.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.ssl_certificate.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.ssl_certificate.edit": {
|
"system.devops.ssl_certificate.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.ssl_certificate.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.ssl_certificate.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.ssl_certificate.delete": {
|
"system.devops.ssl_certificate.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.ssl_certificate.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.ssl_certificate.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.log_configuration.view": {
|
"system.settings.log_configuration.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.log_configuration.view"] }]
|
"anyOf": [{ "backend": ["system.settings.log_configuration.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.log_configuration.add": {
|
"system.devops.log_configuration.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.log_configuration.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.log_configuration.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.log_configuration.edit": {
|
"system.devops.log_configuration.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.log_configuration.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.log_configuration.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.log_configuration.publish": {
|
"system.devops.log_configuration.publish": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.log_configuration.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.log_configuration.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.devops.log_configuration.delete": {
|
"system.devops.log_configuration.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.devops.log_configuration.manager"] }]
|
"anyOf": [{ "backend": ["system.settings.log_configuration.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.workspace.application.view_all": {
|
"system.workspace.application.view_all": {
|
||||||
@@ -244,19 +244,24 @@ export const PERMISSION_DEFINITION = [
|
|||||||
"anyOf": [{ "backend": ["system.workspace.application.view_all"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.view_all"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"system.workspace.application.edit": {
|
||||||
|
"granted": {
|
||||||
|
"anyOf": [{ "backend": ["system.workspace.application.manager_all"] }]
|
||||||
|
}
|
||||||
|
},
|
||||||
"system.workspace.service.view_all": {
|
"system.workspace.service.view_all": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.workspace.service.view_all"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.view_all"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.workspace.team.view_all": {
|
"system.workspace.service.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.workspace.team.view_all"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.workspace.api_market.view": {
|
"system.api_portal.api_portal.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["system.workspace.api_market.view"] }]
|
"anyOf": [{ "backend": ["system.api_portal.api_portal.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system.dashboard.dashboard.view": {
|
"system.dashboard.dashboard.view": {
|
||||||
@@ -271,237 +276,252 @@ export const PERMISSION_DEFINITION = [
|
|||||||
},
|
},
|
||||||
"team.service.api_doc.view": {
|
"team.service.api_doc.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.api_doc.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.view_all","team.service.api_doc.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.api_doc.add": {
|
"team.service.api_doc.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.api_doc.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.api_doc.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.api_doc.edit": {
|
"team.service.api_doc.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.api_doc.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.api_doc.manager"] }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"team.service.service_intro.view": {
|
||||||
|
"granted": {
|
||||||
|
"anyOf": [{ "backend": ["system.workspace.service.view_all","team.service.service_intro.view"] }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"team.service.service_intro.add": {
|
||||||
|
"granted": {
|
||||||
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.service_intro.manager"] }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"team.service.service_intro.edit": {
|
||||||
|
"granted": {
|
||||||
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.service_intro.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.api_doc.import": {
|
"team.service.api_doc.import": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.api_doc.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.api_doc.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.router.view": {
|
"team.service.router.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.router.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.view_all","team.service.api.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.router.add": {
|
"team.service.router.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.router.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.api.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.router.edit": {
|
"team.service.router.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.router.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.api.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.router.delete": {
|
"team.service.router.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.router.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.api.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.upstream.view": {
|
"team.service.upstream.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.upstream.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.view_all","team.service.upstream.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.upstream.add": {
|
"team.service.upstream.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.upstream.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.upstream.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.upstream.edit": {
|
"team.service.upstream.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.upstream.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.upstream.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.upstream.delete": {
|
"team.service.upstream.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.upstream.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.upstream.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.view": {
|
"team.service.release.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.view_all","team.service.release.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.add": {
|
"team.service.release.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.release.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.online": {
|
"team.service.release.online": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.release.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.stop": {
|
"team.service.release.stop": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.release.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.cancel": {
|
"team.service.release.cancel": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.release.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.rollback": {
|
"team.service.release.rollback": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.release.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.delete": {
|
"team.service.release.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.release.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.release.approval": {
|
"team.service.release.approval": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.release.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.release.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.subscription.view": {
|
"team.service.subscription.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.subscription.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.view_all","team.service.subscription.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.subscription.approval": {
|
"team.service.subscription.approval": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.subscription.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.subscription.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.subscription.add": {
|
"team.service.subscription.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.subscription.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.subscription.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.subscription.delete": {
|
"team.service.subscription.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.subscription.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.service.subscription.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.service.view": {
|
"team.service.service.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": [""] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","system.workspace.service.view_all","team.team.service.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.service.add": {
|
"team.service.service.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.service.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.team.service.manager","team.service.service.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.service.edit": {
|
"team.service.service.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.service.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.team.service.manager","team.service.service.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.service.service.delete": {
|
"team.service.service.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.service.service.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.service.manager_all","team.team.service.manager","team.service.service.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.subscription.view": {
|
"team.application.subscription.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.subscription.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.view_all","team.consumer.subscription.view_subscribed_service"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.subscription.add": {
|
"team.application.subscription.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.subscription.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.subscription.subscribe"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.subscription.edit": {
|
"team.application.subscription.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.subscription.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.subscription.manager_subscribed_services"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.subscription.delete": {
|
"team.application.subscription.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.subscription.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.team.consumer.subscription.manager_subscribed_services"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.application.view": {
|
"team.application.application.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.application.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.view_all","team.team.consumer.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.application.add": {
|
"team.application.application.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.application.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al",'team.team.consumer.manager',"team.consumer.application.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.application.edit": {
|
"team.application.application.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.application.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al",'team.team.consumer.manager',"team.consumer.application.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.application.delete": {
|
"team.application.application.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.application.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al",'team.team.consumer.manager',"team.consumer.application.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.authorization.view": {
|
"team.consumer.authorization.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.authorization.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","system.workspace.application.view_all","team.consumer.authorization.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.authorization.add": {
|
"team.application.authorization.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.authorization.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.authorization.edit": {
|
"team.application.authorization.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.authorization.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.authorization.delete": {
|
"team.application.authorization.delete": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.authorization.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.authorization.cancelSubApply": {
|
"team.application.authorization.cancelSubApply": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.authorization.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.application.authorization.cancelSub": {
|
"team.application.authorization.cancelSub": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.application.authorization.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.team.team.view": {
|
"team.team.team.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.team.team.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.view_all","team.team.team.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.team.team.edit": {
|
"team.team.team.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.team.team.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.manager","team.team.team.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.team.member.view": {
|
"team.team.member.view": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.team.member.view"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.view_all","team.team.member.view"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.team.member.add": {
|
"team.team.member.add": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.team.member.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.manager","team.team.member.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"team.team.member.edit": {
|
"team.team.member.edit": {
|
||||||
"granted": {
|
"granted": {
|
||||||
"anyOf": [{ "backend": ["team.team.member.manager"] }]
|
"anyOf": [{ "backend": ["system.workspace.team.manager","team.team.member.manager"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"project.mySystem.topology.view": {
|
"project.mySystem.topology.view": {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ system:
|
|||||||
cname: '成员'
|
cname: '成员'
|
||||||
value: 'member'
|
value: 'member'
|
||||||
access:
|
access:
|
||||||
- system.organization.member.view
|
- system.settings.account.view
|
||||||
- system.organization.member.add
|
- system.organization.member.add
|
||||||
- system.organization.member.edit
|
- system.organization.member.edit
|
||||||
- system.organization.member.delete
|
- system.organization.member.delete
|
||||||
@@ -18,7 +18,7 @@ system:
|
|||||||
- name: team_manager
|
- name: team_manager
|
||||||
cname: '团队管理'
|
cname: '团队管理'
|
||||||
desc: '团队管理'
|
desc: '团队管理'
|
||||||
- system.organization.team.view
|
- system.workspace.team.view_all
|
||||||
- system.organization.team.add
|
- system.organization.team.add
|
||||||
- system.organization.team.edit
|
- system.organization.team.edit
|
||||||
- system.organization.team.delete
|
- system.organization.team.delete
|
||||||
@@ -55,7 +55,7 @@ system:
|
|||||||
cname: 集群
|
cname: 集群
|
||||||
value: 'cluster'
|
value: 'cluster'
|
||||||
children:
|
children:
|
||||||
- system.devops.cluster.view
|
- system.settings.api_gateway.view
|
||||||
- system.devops.cluster.add
|
- system.devops.cluster.add
|
||||||
- system.devops.cluster.edit
|
- system.devops.cluster.edit
|
||||||
- system.devops.cluster.delete
|
- system.devops.cluster.delete
|
||||||
@@ -63,7 +63,7 @@ system:
|
|||||||
cname: 证书
|
cname: 证书
|
||||||
value: 'ssl_certificate'
|
value: 'ssl_certificate'
|
||||||
children:
|
children:
|
||||||
- system.devops.ssl_certificate.view
|
- system.settings.ssl_certificate.view
|
||||||
- system.devops.ssl_certificate.add
|
- system.devops.ssl_certificate.add
|
||||||
- system.devops.ssl_certificate.edit
|
- system.devops.ssl_certificate.edit
|
||||||
- system.devops.ssl_certificate.delete
|
- system.devops.ssl_certificate.delete
|
||||||
@@ -71,7 +71,7 @@ system:
|
|||||||
cname: 日志
|
cname: 日志
|
||||||
value: 'log_configuration'
|
value: 'log_configuration'
|
||||||
children:
|
children:
|
||||||
- system.devops.log_configuration.view
|
- system.settings.log_configuration.view
|
||||||
- system.devops.log_configuration.add
|
- system.devops.log_configuration.add
|
||||||
- system.devops.log_configuration.edit
|
- system.devops.log_configuration.edit
|
||||||
- system.devops.log_configuration.publish
|
- system.devops.log_configuration.publish
|
||||||
@@ -99,7 +99,7 @@ system:
|
|||||||
cname: API市场
|
cname: API市场
|
||||||
value: 'api_market'
|
value: 'api_market'
|
||||||
children:
|
children:
|
||||||
- system.workspace.api_market.view
|
- system.api_portal.api_portal.view
|
||||||
team:
|
team:
|
||||||
- name: service
|
- name: service
|
||||||
cname: 服务
|
cname: 服务
|
||||||
@@ -172,8 +172,8 @@ team:
|
|||||||
cname: 访问授权
|
cname: 访问授权
|
||||||
value: 'authorization'
|
value: 'authorization'
|
||||||
children:
|
children:
|
||||||
- team.application.authorization.view
|
- team.consumer.authorization.view
|
||||||
- team.application.authorization.manager
|
- team.consumer.authorization.manager
|
||||||
- team.application.authorization.add
|
- team.application.authorization.add
|
||||||
- team.application.authorization.edit
|
- team.application.authorization.edit
|
||||||
- team.application.authorization.delete
|
- team.application.authorization.delete
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Date: 2024-01-31 15:00:11
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-05-10 17:03:03
|
|
||||||
* @FilePath: \frontend\packages\core\src\hooks\crypto.ts
|
|
||||||
*/
|
|
||||||
// import CryptoJS from 'crypto-js';
|
|
||||||
|
|
||||||
// export const useCrypto = () => {
|
|
||||||
// const key = '1e42=7838a1vfc6n';
|
|
||||||
|
|
||||||
// const encryptByEnAES = (secretKey: string, data: string, initializationVector?: string): string => {
|
|
||||||
// const iv = CryptoJS.enc.Latin1.parse(initializationVector || key);
|
|
||||||
// const keyForEncryption = CryptoJS.enc.Latin1.parse(CryptoJS.MD5(secretKey).toString());
|
|
||||||
|
|
||||||
// const cipher = CryptoJS.AES.encrypt(data, keyForEncryption, {
|
|
||||||
// iv,
|
|
||||||
// mode: CryptoJS.mode.CBC,
|
|
||||||
// padding: CryptoJS.pad.Pkcs7,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// return CryptoJS.enc.Base64.stringify(cipher.ciphertext);
|
|
||||||
// };
|
|
||||||
|
|
||||||
// return { encryptByEnAES };
|
|
||||||
// };
|
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2024-06-04 14:58:33
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-04 15:39:24
|
|
||||||
* @FilePath: \frontend\packages\common\src\index.css
|
|
||||||
*/
|
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
@@ -220,12 +220,20 @@
|
|||||||
"非等匹配": "K30b2e44f",
|
"非等匹配": "K30b2e44f",
|
||||||
"空值匹配": "Kb1587991",
|
"空值匹配": "Kb1587991",
|
||||||
"存在匹配": "K1e97dbd8",
|
"存在匹配": "K1e97dbd8",
|
||||||
|
"不存在匹配": "Kc8ee3e62",
|
||||||
"区分大小写的正则匹配": "K87c5a801",
|
"区分大小写的正则匹配": "K87c5a801",
|
||||||
"不区分大小写的正则匹配": "K95f062f1",
|
"不区分大小写的正则匹配": "K95f062f1",
|
||||||
"任意匹配": "Kfbd230a5",
|
"任意匹配": "Kfbd230a5",
|
||||||
"驳回": "Kd85208a3",
|
"驳回": "Kd85208a3",
|
||||||
"已订阅": "Kad6aa439",
|
"已订阅": "Kad6aa439",
|
||||||
"取消申请": "K9a68443b",
|
"取消申请": "K9a68443b",
|
||||||
|
"透传客户端请求 Host": "Kaeba0229",
|
||||||
|
"使用上游服务 Host": "K6d7e2fd0",
|
||||||
|
"重写 Host": "K31332633",
|
||||||
|
"动态服务发现": "K2c2bc64f",
|
||||||
|
"地址": "K78b1ca25",
|
||||||
|
"新增": "K1644b775",
|
||||||
|
"申请方消费者": "Kec91f0db",
|
||||||
"暂无操作权限,请联系管理员分配。": "K23fda291",
|
"暂无操作权限,请联系管理员分配。": "K23fda291",
|
||||||
"微信小程序": "K4618cb0a",
|
"微信小程序": "K4618cb0a",
|
||||||
"获取文件,需填路径": "Ka854f511",
|
"获取文件,需填路径": "Ka854f511",
|
||||||
@@ -538,7 +546,7 @@
|
|||||||
"移除成员": "K395acc14",
|
"移除成员": "K395acc14",
|
||||||
"添加成员": "Kec46a57f",
|
"添加成员": "Kec46a57f",
|
||||||
"输入姓名查找": "K48724410",
|
"输入姓名查找": "K48724410",
|
||||||
"搜索用户名、邮箱": "Kb9052305",
|
"输入名称查找用户": "Kf5fd27ed",
|
||||||
"设置团队和成员,然后你可以在团队内创建服务和消费者、订阅API,成员只能看到所属团队内的服务和消费者。": "K4c72fb6f",
|
"设置团队和成员,然后你可以在团队内创建服务和消费者、订阅API,成员只能看到所属团队内的服务和消费者。": "K4c72fb6f",
|
||||||
"添加团队": "K510cdd27",
|
"添加团队": "K510cdd27",
|
||||||
"输入名称、ID、负责人查找团队": "K9244ae14",
|
"输入名称、ID、负责人查找团队": "K9244ae14",
|
||||||
|
|||||||
@@ -319,7 +319,7 @@
|
|||||||
"Ka46b9b24": "Data Source Type",
|
"Ka46b9b24": "Data Source Type",
|
||||||
"Kbb0cdcd0": "Data Source Address",
|
"Kbb0cdcd0": "Data Source Address",
|
||||||
"Kd9dfb884": "Organization",
|
"Kd9dfb884": "Organization",
|
||||||
"K3e770a75": "Authentication Token",
|
"K3e770a75": "Credentials Token",
|
||||||
"K8ef69ee2": "Key",
|
"K8ef69ee2": "Key",
|
||||||
"Kba3507d6": "Upload Key",
|
"Kba3507d6": "Upload Key",
|
||||||
"K93ac0f23": "Key file suffix is usually .key",
|
"K93ac0f23": "Key file suffix is usually .key",
|
||||||
@@ -365,7 +365,7 @@
|
|||||||
"Kcef64f4d": "Default AI Provider",
|
"Kcef64f4d": "Default AI Provider",
|
||||||
"Kcab588a9": "No AI model provider set,",
|
"Kcab588a9": "No AI model provider set,",
|
||||||
"Kb9b56111": "Set Now",
|
"Kb9b56111": "Set Now",
|
||||||
"Kcf756b7a": "API Call Prefix",
|
"Kcf756b7a": "API Request Prefix",
|
||||||
"K13edc043": "As a prefix for all APIs in the service, e.g., host/{service_name}/{api_path}, cannot be modified once saved.",
|
"K13edc043": "As a prefix for all APIs in the service, e.g., host/{service_name}/{api_path}, cannot be modified once saved.",
|
||||||
"Kf52a584d": "Service Category",
|
"Kf52a584d": "Service Category",
|
||||||
"K72b21be5": "Set the category in which the service will be displayed in the service marketplace",
|
"K72b21be5": "Set the category in which the service will be displayed in the service marketplace",
|
||||||
@@ -391,8 +391,8 @@
|
|||||||
"K813e1c0a": "Team Name",
|
"K813e1c0a": "Team Name",
|
||||||
"K692f5aa6": "Team ID",
|
"K692f5aa6": "Team ID",
|
||||||
"K5de0bc2": "Team ID can be used to retrieve the team, cannot be modified once saved.",
|
"K5de0bc2": "Team ID can be used to retrieve the team, cannot be modified once saved.",
|
||||||
"Ka63dd985": "Team Leader",
|
"Ka63dd985": "Team Administrator",
|
||||||
"Ka6bcd272": "The leader has management authority over the team, services, and members within the team",
|
"Ka6bcd272": "The Administrator has management authority over the team, services, and members within the team",
|
||||||
"Ka2012bdd": "Delete Team",
|
"Ka2012bdd": "Delete Team",
|
||||||
"Kbde1f3d": "Service data must be cleared before deletion",
|
"Kbde1f3d": "Service data must be cleared before deletion",
|
||||||
"K395acc14": "Remove",
|
"K395acc14": "Remove",
|
||||||
@@ -463,7 +463,7 @@
|
|||||||
"Kd59290a2": "Search Category or Tag",
|
"Kd59290a2": "Search Category or Tag",
|
||||||
"K6b75bdbc": "No API Data",
|
"K6b75bdbc": "No API Data",
|
||||||
"K4b15d6f5": "Application Reason",
|
"K4b15d6f5": "Application Reason",
|
||||||
"Kb71b5a13": "Authentication Type",
|
"Kb71b5a13": "Credentials Type",
|
||||||
"K4d1465ee": "ISS",
|
"K4d1465ee": "ISS",
|
||||||
"K5dcd7ed8": "Signature Algorithm",
|
"K5dcd7ed8": "Signature Algorithm",
|
||||||
"K5b0eedd3": "Secret",
|
"K5b0eedd3": "Secret",
|
||||||
@@ -475,10 +475,10 @@
|
|||||||
"K31418470": "SK",
|
"K31418470": "SK",
|
||||||
"Kbfeb5297": "API Key",
|
"Kbfeb5297": "API Key",
|
||||||
"K1a78e6f0": "Expiration Time",
|
"K1a78e6f0": "Expiration Time",
|
||||||
"Ke64e43a": "Hide Authentication Info",
|
"Ke64e43a": "Hide Credentials Info",
|
||||||
"K217cb125": "Authentication Details",
|
"K217cb125": "Credentials Details",
|
||||||
"K2bb63eca": "Add Authentication",
|
"K2bb63eca": "Add Credentials",
|
||||||
"Kd74d69b7": "Edit Authentication",
|
"Kd74d69b7": "Edit Credentials",
|
||||||
"K9cbe1e0": "Modify",
|
"K9cbe1e0": "Modify",
|
||||||
"Kb6e9328f": "Authorization",
|
"Kb6e9328f": "Authorization",
|
||||||
"Kd23d1716": "Add Authorization",
|
"Kd23d1716": "Add Authorization",
|
||||||
@@ -656,5 +656,28 @@
|
|||||||
"K9eaa2eb6": "List",
|
"K9eaa2eb6": "List",
|
||||||
"Kfaec39e9": "Block",
|
"Kfaec39e9": "Block",
|
||||||
"Kc3b7bfa8": "No Consumer Description",
|
"Kc3b7bfa8": "No Consumer Description",
|
||||||
"K3a6f905d": "Enter Name, ID to Search Consumer"
|
"K3a6f905d": "Enter Name, ID to Search Consumer",
|
||||||
|
"K76036e25": "HTTP Request Header",
|
||||||
|
"K44607e3f": "Exact Match",
|
||||||
|
"Kc287500a": "Prefix Match",
|
||||||
|
"Kfc0b1147": "Suffix Match",
|
||||||
|
"Ka4a92043": "Substring Match",
|
||||||
|
"K30b2e44f": "Non-Exact Match",
|
||||||
|
"Kb1587991": "Null Match",
|
||||||
|
"K87c5a801": "Case-Sensitive Regex Match",
|
||||||
|
"K95f062f1": "Case-Insensitive Regex Match",
|
||||||
|
"Kfbd230a5": "Any Match",
|
||||||
|
"Kd85208a3": "Reject",
|
||||||
|
"Kad6aa439": "Subscribed",
|
||||||
|
"K9a68443b": "Cancel Request",
|
||||||
|
"Kaeba0229": "Pass-through Client Request Host",
|
||||||
|
"K6d7e2fd0": "Use Upstream Service Host",
|
||||||
|
"K31332633": "Rewrite Host",
|
||||||
|
"K2c2bc64f": "Dynamic Service Discovery",
|
||||||
|
"K78b1ca25": "Address",
|
||||||
|
"K1644b775": "Add",
|
||||||
|
"Kc8ee3e62": "Non-Existence",
|
||||||
|
"K1e97dbd8": "Existence",
|
||||||
|
"Kec91f0db": "Applicant Consumer",
|
||||||
|
"Kf5fd27ed": "Enter Name to Search User"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -678,5 +678,28 @@
|
|||||||
"K5c4e2865": "コンシューマーエンティティを作成および管理し、各コンシューマーは複数の API サービスにサブスクライブできます。呼び出し前に適切な権限が付与されていることを確認してください。コンシューマー用に API キーなどの認証方法を生成して、安全に API サービスを呼び出せます。",
|
"K5c4e2865": "コンシューマーエンティティを作成および管理し、各コンシューマーは複数の API サービスにサブスクライブできます。呼び出し前に適切な権限が付与されていることを確認してください。コンシューマー用に API キーなどの認証方法を生成して、安全に API サービスを呼び出せます。",
|
||||||
"K84c4dc71": "コンシューマーを追加",
|
"K84c4dc71": "コンシューマーを追加",
|
||||||
"Kc3b7bfa8": "コンシューマーの説明がありません",
|
"Kc3b7bfa8": "コンシューマーの説明がありません",
|
||||||
"K3a6f905d": "名前、IDを入力してコンシューマーを検索"
|
"K3a6f905d": "名前、IDを入力してコンシューマーを検索",
|
||||||
|
"K76036e25": "HTTPリクエストヘッダー",
|
||||||
|
"K44607e3f": "完全一致",
|
||||||
|
"Kc287500a": "プレフィックス一致",
|
||||||
|
"Kfc0b1147": "サフィックス一致",
|
||||||
|
"Ka4a92043": "部分一致",
|
||||||
|
"K30b2e44f": "非完全一致",
|
||||||
|
"Kb1587991": "ヌル一致",
|
||||||
|
"K87c5a801": "大文字小文字を区別する正規表現一致",
|
||||||
|
"K95f062f1": "大文字小文字を区別しない正規表現一致",
|
||||||
|
"Kfbd230a5": "任意一致",
|
||||||
|
"Kd85208a3": "拒否",
|
||||||
|
"Kad6aa439": "申し込み済み",
|
||||||
|
"K9a68443b": "申し込み取消",
|
||||||
|
"Kaeba0229": "クライアントリクエストホストのパススルー",
|
||||||
|
"K6d7e2fd0": "上位サービスホストの使用",
|
||||||
|
"K31332633": "ホストの書き換え",
|
||||||
|
"K2c2bc64f": "動的サービス発見",
|
||||||
|
"K78b1ca25": "アドレス",
|
||||||
|
"K1644b775": "追加",
|
||||||
|
"Kc8ee3e62": "存在しない",
|
||||||
|
"K1e97dbd8": "存在する",
|
||||||
|
"Kec91f0db": "申請側コンシューマー",
|
||||||
|
"Kf5fd27ed": "名前を入力してユーザーを検索"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,3 @@
|
|||||||
{
|
{
|
||||||
"K76036e25": "HTTP 请求头",
|
"Kf5fd27ed": "输入名称查找用户"
|
||||||
"K44607e3f": "全等匹配",
|
|
||||||
"Kc287500a": "前缀匹配",
|
|
||||||
"Kfc0b1147": "后缀匹配",
|
|
||||||
"Ka4a92043": "子串匹配",
|
|
||||||
"K30b2e44f": "非等匹配",
|
|
||||||
"Kb1587991": "空值匹配",
|
|
||||||
"K1e97dbd8": "存在匹配",
|
|
||||||
"K87c5a801": "区分大小写的正则匹配",
|
|
||||||
"K95f062f1": "不区分大小写的正则匹配",
|
|
||||||
"Kfbd230a5": "任意匹配",
|
|
||||||
"Kd85208a3": "驳回",
|
|
||||||
"Kad6aa439": "已订阅",
|
|
||||||
"K9a68443b": "取消申请"
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,3 @@
|
|||||||
{
|
{
|
||||||
"K76036e25": "HTTP 请求头",
|
"Kf5fd27ed": "输入名称查找用户"
|
||||||
"K44607e3f": "全等匹配",
|
|
||||||
"Kc287500a": "前缀匹配",
|
|
||||||
"Kfc0b1147": "后缀匹配",
|
|
||||||
"Ka4a92043": "子串匹配",
|
|
||||||
"K30b2e44f": "非等匹配",
|
|
||||||
"Kb1587991": "空值匹配",
|
|
||||||
"K1e97dbd8": "存在匹配",
|
|
||||||
"K87c5a801": "区分大小写的正则匹配",
|
|
||||||
"K95f062f1": "不区分大小写的正则匹配",
|
|
||||||
"Kfbd230a5": "任意匹配",
|
|
||||||
"Kd85208a3": "驳回",
|
|
||||||
"Kad6aa439": "已订阅",
|
|
||||||
"K9a68443b": "取消申请"
|
|
||||||
}
|
}
|
||||||
@@ -7,12 +7,21 @@
|
|||||||
"K30b2e44f": "非等匹配",
|
"K30b2e44f": "非等匹配",
|
||||||
"Kb1587991": "空值匹配",
|
"Kb1587991": "空值匹配",
|
||||||
"K1e97dbd8": "存在匹配",
|
"K1e97dbd8": "存在匹配",
|
||||||
|
"Kc8ee3e62": "不存在匹配",
|
||||||
"K87c5a801": "区分大小写的正则匹配",
|
"K87c5a801": "区分大小写的正则匹配",
|
||||||
"K95f062f1": "不区分大小写的正则匹配",
|
"K95f062f1": "不区分大小写的正则匹配",
|
||||||
"Kfbd230a5": "任意匹配",
|
"Kfbd230a5": "任意匹配",
|
||||||
"Kd85208a3": "驳回",
|
"Kd85208a3": "驳回",
|
||||||
"Kad6aa439": "已订阅",
|
"Kad6aa439": "已订阅",
|
||||||
"K9a68443b": "取消申请",
|
"K9a68443b": "取消申请",
|
||||||
|
"Kaeba0229": "透传客户端请求 Host",
|
||||||
|
"K6d7e2fd0": "使用上游服务 Host",
|
||||||
|
"K31332633": "重写 Host",
|
||||||
|
"K2c2bc64f": "动态服务发现",
|
||||||
|
"K78b1ca25": "地址",
|
||||||
|
"K1644b775": "新增",
|
||||||
|
"Kec91f0db": "申请方消费者",
|
||||||
|
"Kf5fd27ed": "输入名称查找用户",
|
||||||
"Kc3b7bfa8": "暂无消费者描述",
|
"Kc3b7bfa8": "暂无消费者描述",
|
||||||
"K3a6f905d": "输入名称、ID 查找消费者"
|
"K3a6f905d": "输入名称、ID 查找消费者"
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,3 @@
|
|||||||
{
|
{
|
||||||
"K76036e25": "HTTP 请求头",
|
"Kf5fd27ed": "输入名称查找用户"
|
||||||
"K44607e3f": "全等匹配",
|
|
||||||
"Kc287500a": "前缀匹配",
|
|
||||||
"Kfc0b1147": "后缀匹配",
|
|
||||||
"Ka4a92043": "子串匹配",
|
|
||||||
"K30b2e44f": "非等匹配",
|
|
||||||
"Kb1587991": "空值匹配",
|
|
||||||
"K1e97dbd8": "存在匹配",
|
|
||||||
"K87c5a801": "区分大小写的正则匹配",
|
|
||||||
"K95f062f1": "不区分大小写的正则匹配",
|
|
||||||
"Kfbd230a5": "任意匹配",
|
|
||||||
"Kd85208a3": "驳回",
|
|
||||||
"Kad6aa439": "已订阅",
|
|
||||||
"K9a68443b": "取消申请"
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
|
"Kb9052305": "Search Username, Email",
|
||||||
"K40a89bd8": "Enter Name, ID to Search Member"
|
"K40a89bd8": "Enter Name, ID to Search Member"
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
"K9bdd8403": "API を安全に呼び出すためには、アプリケーションとトークンを作成する必要があります。",
|
"K9bdd8403": "API を安全に呼び出すためには、アプリケーションとトークンを作成する必要があります。",
|
||||||
"Kc8239422": "チームにはユーザー、アプリケーション、サービスが含まれ、異なるチームのアプリケーションとサービスのデータは分離されています。企業内の部門/プロジェクトグループ/チームの管理に使用できます。",
|
"Kc8239422": "チームにはユーザー、アプリケーション、サービスが含まれ、異なるチームのアプリケーションとサービスのデータは分離されています。企業内の部門/プロジェクトグループ/チームの管理に使用できます。",
|
||||||
"Ka0a8840a": "他のアプリケーションのサブスクリプション申請をレビューし、承認後に API リクエストが発行できます。",
|
"Ka0a8840a": "他のアプリケーションのサブスクリプション申請をレビューし、承認後に API リクエストが発行できます。",
|
||||||
|
"Kb9052305": "ユーザー名またはメールを検索",
|
||||||
"K5ece3bac": "チームとメンバーを設定してから、チーム内でサービスとアプリケーションを作成し、API をサブスクライブできます。メンバーは所属チーム内のサービスとアプリケーションのみを表示できます。",
|
"K5ece3bac": "チームとメンバーを設定してから、チーム内でサービスとアプリケーションを作成し、API をサブスクライブできます。メンバーは所属チーム内のサービスとアプリケーションのみを表示できます。",
|
||||||
"K1512e983": "アプリケーション呼び出し統計",
|
"K1512e983": "アプリケーション呼び出し統計",
|
||||||
"Kb4d2007f": "Application を選択",
|
"Kb4d2007f": "Application を選択",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"K9bdd8403": "为了安全地调用 API,你需要创建一个消费者以及Token。",
|
"K9bdd8403": "为了安全地调用 API,你需要创建一个消费者以及Token。",
|
||||||
"Kc8239422": "团队中包含了人员、消费者和服务,不同团队之间的消费者和服务数据是隔离的,可用于管理企业内部不同的部门/项目组/团队。",
|
"Kc8239422": "团队中包含了人员、消费者和服务,不同团队之间的消费者和服务数据是隔离的,可用于管理企业内部不同的部门/项目组/团队。",
|
||||||
"Ka0a8840a": "审核其他消费者的订阅申请,审核通过后的才可发起 API 请求。",
|
"Ka0a8840a": "审核其他消费者的订阅申请,审核通过后的才可发起 API 请求。",
|
||||||
|
"Kb9052305": "搜索用户名、邮箱",
|
||||||
"K5ece3bac": "设置团队和成员,然后你可以在团队内创建服务和消费者、订阅API,成员只能看到所属团队内的服务和消费者。",
|
"K5ece3bac": "设置团队和成员,然后你可以在团队内创建服务和消费者、订阅API,成员只能看到所属团队内的服务和消费者。",
|
||||||
"K1512e983": "消费者调用统计",
|
"K1512e983": "消费者调用统计",
|
||||||
"Kb4d2007f": "请选择消费者",
|
"Kb4d2007f": "请选择消费者",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"K9bdd8403": "為了安全地調用 API,你需要創建一個應用以及Token。",
|
"K9bdd8403": "為了安全地調用 API,你需要創建一個應用以及Token。",
|
||||||
"Kc8239422": "團隊中包含了人員、應用程式和服務,不同團隊之間的應用程式和服務數據是隔離的,可用於管理企業內部不同的部門/項目組/團隊。",
|
"Kc8239422": "團隊中包含了人員、應用程式和服務,不同團隊之間的應用程式和服務數據是隔離的,可用於管理企業內部不同的部門/項目組/團隊。",
|
||||||
"Ka0a8840a": "審核其他應用程式的訂閱申請,審核通過後的才可發起 API 請求。",
|
"Ka0a8840a": "審核其他應用程式的訂閱申請,審核通過後的才可發起 API 請求。",
|
||||||
|
"Kb9052305": "搜索用戶名、電郵",
|
||||||
"K5ece3bac": "設置團隊和成員,然後你可以在團隊內創建服務和應用程式、訂閱API,成員只能看到所屬團隊內的服務和應用程式。",
|
"K5ece3bac": "設置團隊和成員,然後你可以在團隊內創建服務和應用程式、訂閱API,成員只能看到所屬團隊內的服務和應用程式。",
|
||||||
"K1512e983": "應用程式調用統計",
|
"K1512e983": "應用程式調用統計",
|
||||||
"Kb4d2007f": "請選擇應用程式",
|
"Kb4d2007f": "請選擇應用程式",
|
||||||
|
|||||||
@@ -676,5 +676,7 @@
|
|||||||
"K6e32a344": "订阅服务数量",
|
"K6e32a344": "订阅服务数量",
|
||||||
"Ka701316": "鉴权数量",
|
"Ka701316": "鉴权数量",
|
||||||
"K9eaa2eb6": "列表",
|
"K9eaa2eb6": "列表",
|
||||||
"Kfaec39e9": "块"
|
"Kfaec39e9": "块",
|
||||||
|
"Kc3b7bfa8": "暂无消费者描述",
|
||||||
|
"K3a6f905d": "输入名称、ID 查找消费者"
|
||||||
}
|
}
|
||||||
@@ -678,5 +678,28 @@
|
|||||||
"Kba74f26d": "接入消費者",
|
"Kba74f26d": "接入消費者",
|
||||||
"K70b79760": "接入消費者數量",
|
"K70b79760": "接入消費者數量",
|
||||||
"Kc3b7bfa8": "暫無消費者描述",
|
"Kc3b7bfa8": "暫無消費者描述",
|
||||||
"K3a6f905d": "輸入名稱、ID 查找消費者"
|
"K3a6f905d": "輸入名稱、ID 查找消費者",
|
||||||
|
"K76036e25": "HTTP請求頭",
|
||||||
|
"K44607e3f": "全等匹配",
|
||||||
|
"Kc287500a": "前綴匹配",
|
||||||
|
"Kfc0b1147": "後綴匹配",
|
||||||
|
"Ka4a92043": "子串匹配",
|
||||||
|
"K30b2e44f": "非等匹配",
|
||||||
|
"Kb1587991": "空值匹配",
|
||||||
|
"K87c5a801": "區分大小寫的正則匹配",
|
||||||
|
"K95f062f1": "不區分大小寫的正則匹配",
|
||||||
|
"Kfbd230a5": "任意匹配",
|
||||||
|
"Kd85208a3": "駁回",
|
||||||
|
"Kad6aa439": "已訂閱",
|
||||||
|
"K9a68443b": "取消申請",
|
||||||
|
"Kaeba0229": "透傳客戶端請求Host",
|
||||||
|
"K6d7e2fd0": "使用上游服務Host",
|
||||||
|
"K31332633": "重寫Host",
|
||||||
|
"K2c2bc64f": "動態服務發現",
|
||||||
|
"K78b1ca25": "位址",
|
||||||
|
"K1644b775": "新增",
|
||||||
|
"Kc8ee3e62": "不存在匹配",
|
||||||
|
"K1e97dbd8": "存在匹配",
|
||||||
|
"Kec91f0db": "申請方消費者",
|
||||||
|
"Kf5fd27ed": "輸入名稱查找使用者"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,15 @@ export const checkAccess:(access:AccessDataType, accessData:Map<string,string[]>
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const neededBackendAccessArr = PERMISSION_DEFINITION[0]?.[access]?.granted?.anyOf[0].backend || []
|
const neededBackendAccessArr = PERMISSION_DEFINITION[0]?.[access]?.granted?.anyOf[0].backend || []
|
||||||
return accessData?.has(accLevel)&& accessData.get(accLevel)!.length > 0 ? hasIntersection(neededBackendAccessArr, accessData.get(accLevel)!) : false
|
let accessSet = new Set(accessData.get('system'))
|
||||||
|
if(accLevel === 'team'){
|
||||||
|
accessSet = new Set(Array.from(accessSet).concat(accessData?.get('team') || []))
|
||||||
|
}
|
||||||
|
return accessSet!.size > 0 ? hasIntersection(neededBackendAccessArr, accessSet) : false
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasIntersection = (arr1:string[], arr2:string[])=> {
|
const hasIntersection = (arr1:string[], set1:Set<string>)=> {
|
||||||
|
const arr2 = Array.from(set1)
|
||||||
const set = new Set(arr1.length > arr2.length ? arr2:arr1)
|
const set = new Set(arr1.length > arr2.length ? arr2:arr1)
|
||||||
const arr = arr1.length > arr2.length ? arr1:arr2
|
const arr = arr1.length > arr2.length ? arr1:arr2
|
||||||
for (const item of arr) {
|
for (const item of arr) {
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2024-06-04 15:05:05
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-08-01 17:59:56
|
|
||||||
* @FilePath: \frontend\packages\common\tailwind.config.js
|
|
||||||
*/
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
important:true,
|
important:true,
|
||||||
|
|||||||
@@ -1,16 +1,36 @@
|
|||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head id="head">
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/frontend/favicon.ico" />
|
<link id="favicon" rel="icon" type="image/svg+xml" href="/frontend/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>APIPark - 企业API数据开放平台</title>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body id="eo-body">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
<script async src="/frontend/iconpark_eolink.js"></script>
|
<script>
|
||||||
<script async src="/frontend/iconpark_apinto.js"></script>
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const eoBody = document.getElementById('eo-body');
|
||||||
|
const favicon = document.getElementById('favicon');
|
||||||
|
|
||||||
|
const createScript = (id, src) => {
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.id = id;
|
||||||
|
script.async = true;
|
||||||
|
script.src = src;
|
||||||
|
return script;
|
||||||
|
};
|
||||||
|
|
||||||
|
const iconparkApintoSrc = window.location.hostname === 'localhost' ? '/iconpark_apinto.js' : '/frontend/iconpark_apinto.js';
|
||||||
|
const iconparkEolinkSrc = window.location.hostname === 'localhost' ? '/iconpark_eolink.js' : '/frontend/iconpark_eolink.js';
|
||||||
|
const faviconSrc = window.location.hostname === 'localhost' ? '/favicon.ico' : '/frontend/favicon.ico';
|
||||||
|
|
||||||
|
favicon.href = faviconSrc;
|
||||||
|
|
||||||
|
eoBody.appendChild(createScript('iconpark_apinto', iconparkApintoSrc));
|
||||||
|
eoBody.appendChild(createScript('iconpark_eolink', iconparkEolinkSrc));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:54
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:42:18
|
|
||||||
* @FilePath: \frontend\packages\core\postcss.config.js
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
'postcss-import': {},
|
'postcss-import': {},
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -290,3 +290,13 @@ a{
|
|||||||
transition: background-color 0s 600000s, color 0s 600000s !important;
|
transition: background-color 0s 600000s, color 0s 600000s !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-select-selection-overflow-item:first-child {
|
||||||
|
max-width: calc(100% - 60px);
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a[disabled]:hover {
|
||||||
|
color: #BBB;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
@@ -35,6 +35,7 @@ export type MemberDropdownModalFieldType = {
|
|||||||
parent?:string
|
parent?:string
|
||||||
email?:string
|
email?:string
|
||||||
departmentIds?:string[]
|
departmentIds?:string[]
|
||||||
|
password:string
|
||||||
};
|
};
|
||||||
|
|
||||||
export type MemberDropdownModalProps = {
|
export type MemberDropdownModalProps = {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ const ServiceInsideDocument = ()=>{
|
|||||||
<div className=" pl-[8px] py-btnbase ">
|
<div className=" pl-[8px] py-btnbase ">
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<p className="text-[14px] leading-[20px] text-[#999999]"><span className="mr-[20px]">{$t('最近一次更新者')}:{updater || '-'}</span><span>{$t('最近一次更新时间')}:{updateTime || '-'}</span></p>
|
<p className="text-[14px] leading-[20px] text-[#999999]"><span className="mr-[20px]">{$t('最近一次更新者')}:{updater || '-'}</span><span>{$t('最近一次更新时间')}:{updateTime || '-'}</span></p>
|
||||||
<WithPermission access="team.service.service.edit"><Button type="primary" className="mr-btnbase" onClick={save}>{$t('保存')}</Button></WithPermission>
|
<WithPermission access="team.service.service_intro.edit"><Button type="primary" className="mr-btnbase" onClick={save}>{$t('保存')}</Button></WithPermission>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>)
|
</div>)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ const AiServiceInsidePage:FC = ()=> {
|
|||||||
|
|
||||||
|
|
||||||
const getApiDefine = ()=>{
|
const getApiDefine = ()=>{
|
||||||
|
console.log('@@@@@@@')
|
||||||
setApiPrefix('')
|
setApiPrefix('')
|
||||||
setPrefixForce(false)
|
setPrefixForce(false)
|
||||||
fetchData<BasicResponse<{ prefix:string, force:boolean }>>('service/router/define',{method:'GET',eoParams:{service:serviceId,team:teamId}}).then(response=>{
|
fetchData<BasicResponse<{ prefix:string, force:boolean }>>('service/router/define',{method:'GET',eoParams:{service:serviceId,team:teamId}}).then(response=>{
|
||||||
@@ -62,7 +63,7 @@ const AiServiceInsidePage:FC = ()=> {
|
|||||||
[
|
[
|
||||||
getItem(<Link to="./route">{$t('API 路由')}</Link>, 'route',undefined,undefined,undefined,'team.service.router.view'),
|
getItem(<Link to="./route">{$t('API 路由')}</Link>, 'route',undefined,undefined,undefined,'team.service.router.view'),
|
||||||
getItem(<Link to="./api">{$t('API 文档')}</Link>, 'api',undefined,undefined,undefined,'team.service.api_doc.view'),
|
getItem(<Link to="./api">{$t('API 文档')}</Link>, 'api',undefined,undefined,undefined,'team.service.api_doc.view'),
|
||||||
getItem(<Link to="./document">{$t('使用说明')}</Link>, 'document',undefined,undefined,undefined,''),
|
getItem(<Link to="./document">{$t('使用说明')}</Link>, 'document',undefined,undefined,undefined,'team.service.service_intro.view'),
|
||||||
getItem(<Link to="./publish">{$t('发布')}</Link>, 'publish',undefined,undefined,undefined,'team.service.release.view'),
|
getItem(<Link to="./publish">{$t('发布')}</Link>, 'publish',undefined,undefined,undefined,'team.service.release.view'),
|
||||||
],
|
],
|
||||||
'group'),
|
'group'),
|
||||||
@@ -84,19 +85,22 @@ const AiServiceInsidePage:FC = ()=> {
|
|||||||
const filterMenu = (menu:MenuItemGroupType<MenuItemType>[])=>{
|
const filterMenu = (menu:MenuItemGroupType<MenuItemType>[])=>{
|
||||||
const newMenu = cloneDeep(menu)
|
const newMenu = cloneDeep(menu)
|
||||||
return newMenu!.filter((m:MenuItemGroupType )=>{
|
return newMenu!.filter((m:MenuItemGroupType )=>{
|
||||||
if(m.children && m.children.length > 0){
|
if(m&&m.children && m.children.length > 0){
|
||||||
m.children = m.children.filter(
|
m.children = m.children.filter(
|
||||||
(c)=>(c&&(c as MenuItemType&{access:string} ).access ?
|
(c)=>{
|
||||||
|
if(!c) return false
|
||||||
|
return (((c as MenuItemType&{access:string} ).access ?
|
||||||
checkPermission((c as MenuItemType&{access:string} ).access as keyof typeof PERMISSION_DEFINITION[0]):
|
checkPermission((c as MenuItemType&{access:string} ).access as keyof typeof PERMISSION_DEFINITION[0]):
|
||||||
true))
|
true))})
|
||||||
}
|
}
|
||||||
return m.children && m.children.length > 0
|
return m.children && m.children.length > 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const filteredMenu = filterMenu(SYSTEM_PAGE_MENU_ITEMS as MenuItemGroupType<MenuItemType>[])
|
const filteredMenu = filterMenu(SYSTEM_PAGE_MENU_ITEMS as MenuItemGroupType<MenuItemType>[])
|
||||||
setActiveMenu((pre)=>{
|
const menu = activeMenu ?? filteredMenu[0]?.children ? filteredMenu[0]?.children?.[0]?.key : filteredMenu[0]?.key
|
||||||
return pre ?? 'route'
|
if(menu && currentUrl.split('/')[-1] !== menu){
|
||||||
})
|
navigateTo(`/service/${teamId}/aiInside/${serviceId}/${menu}`)
|
||||||
|
}
|
||||||
return filteredMenu || []
|
return filteredMenu || []
|
||||||
},[accessData,accessInit, SYSTEM_PAGE_MENU_ITEMS])
|
},[accessData,accessInit, SYSTEM_PAGE_MENU_ITEMS])
|
||||||
|
|
||||||
@@ -116,7 +120,7 @@ const AiServiceInsidePage:FC = ()=> {
|
|||||||
}, [currentUrl]);
|
}, [currentUrl]);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(accessData && accessData.get('team') && accessData.get('team')?.indexOf('team.service.router.view') !== -1){
|
if(accessData && checkPermission('team.service.router.view')){
|
||||||
getApiDefine()
|
getApiDefine()
|
||||||
}
|
}
|
||||||
},[accessData])
|
},[accessData])
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export type AiServiceRouterModelConfigProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AiServiceRouterModelConfigField = {
|
type AiServiceRouterModelConfigField = {
|
||||||
|
provider:string
|
||||||
id:string
|
id:string
|
||||||
config:string
|
config:string
|
||||||
}
|
}
|
||||||
@@ -70,6 +71,10 @@ const AiServiceRouterModelConfig = forwardRef<AiServiceRouterModelConfigHandle,
|
|||||||
getLlmList(provider)
|
getLlmList(provider)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
getLlmList(entity.provider)
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
layout='vertical'
|
layout='vertical'
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ const AiSettingList = ()=>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<WithPermission access="system.devops.ai_provider.view">
|
<WithPermission access="system.settings.ai_provider.view">
|
||||||
<Button block icon={<Icon icon="ic:outline-settings" width={18} height={18}/>} onClick={()=>openModal(provider)} classNames={{icon:'h-[18px]'}}>{$t('设置')}</Button>
|
<Button block icon={<Icon icon="ic:outline-settings" width={18} height={18}/>} onClick={()=>openModal(provider)} classNames={{icon:'h-[18px]'}}>{$t('设置')}</Button>
|
||||||
</WithPermission>
|
</WithPermission>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,22 +21,22 @@ export default function Guide(){
|
|||||||
{
|
{
|
||||||
title: $t("配置你的 AI 模型"),
|
title: $t("配置你的 AI 模型"),
|
||||||
description: $t('通过 APIPark 快速接入各种 AI 模型,使用统一的格式来调用API,并且可以随意切换模型。'),
|
description: $t('通过 APIPark 快速接入各种 AI 模型,使用统一的格式来调用API,并且可以随意切换模型。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/pre-work/team'
|
link: 'https://docs.apipark.com/docs/system_setting/ai_model_providers'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("创建 AI 服务和 API"),
|
title: $t("创建 AI 服务和 API"),
|
||||||
description: $t('创建 AI 类型的服务,并且你可以将 Prompt 提示词设置为一个 API,简化使用 AI 的流程。'),
|
description: $t('创建 AI 类型的服务,并且你可以将 Prompt 提示词设置为一个 API,简化使用 AI 的流程。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/provider/service'
|
link: 'https://docs.apipark.com/docs/services/ai_services'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("创建调用 Token"),
|
title: $t("创建调用 Token"),
|
||||||
description: $t('为了安全地调用 API,你需要创建一个消费者以及Token。'),
|
description: $t('为了安全地调用 API,你需要创建一个消费者以及Token。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/suberscriber/application'
|
link: 'https://docs.apipark.com/docs/consumers'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("调用"),
|
title: $t("调用"),
|
||||||
description: $t('现在你可以通过 Token 来调用这些 API。'),
|
description: $t('现在你可以通过 Token 来调用这些 API。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/suberscriber/application'
|
link: 'https://docs.apipark.com/docs/call_api'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -46,17 +46,17 @@ export default function Guide(){
|
|||||||
{
|
{
|
||||||
title: $t("创建 REST 服务和 API"),
|
title: $t("创建 REST 服务和 API"),
|
||||||
description: $t('创建 AI 类型的服务,并且你可以将 Prompt 提示词设置为一个 API,简化使用 AI 的流程。'),
|
description: $t('创建 AI 类型的服务,并且你可以将 Prompt 提示词设置为一个 API,简化使用 AI 的流程。'),
|
||||||
link: 'https://docs.apipark.com/docs/tutorials/api-market/service'
|
link: 'https://docs.apipark.com/docs/services/rest_services'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("创建调用 Token"),
|
title: $t("创建调用 Token"),
|
||||||
description: $t('为了安全地调用 API,你需要创建一个消费者以及Token。'),
|
description: $t('为了安全地调用 API,你需要创建一个消费者以及Token。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/suberscriber/subscribe'
|
link: 'https://docs.apipark.com/docs/consumers'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("调用"),
|
title: $t("调用"),
|
||||||
description: $t('现在你可以通过 Token 来调用这些 API。'),
|
description: $t('现在你可以通过 Token 来调用这些 API。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/provider/approve'
|
link: 'https://docs.apipark.com/docs/call_api'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -66,7 +66,7 @@ export default function Guide(){
|
|||||||
{
|
{
|
||||||
title: $t("统计 API 调用情况"),
|
title: $t("统计 API 调用情况"),
|
||||||
description: $t('仪表盘中提供了多种统计图表,帮助我们了解 API 的运行情况。'),
|
description: $t('仪表盘中提供了多种统计图表,帮助我们了解 API 的运行情况。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/pre-work/monitor'
|
link: 'https://docs.apipark.com/docs/analysis'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -78,17 +78,17 @@ export default function Guide(){
|
|||||||
{
|
{
|
||||||
title: $t("账号与角色"),
|
title: $t("账号与角色"),
|
||||||
description: $t('邀请你的团队成员加入 APIPark,共同管理和调用 API。'),
|
description: $t('邀请你的团队成员加入 APIPark,共同管理和调用 API。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/pre-work/team'
|
link: 'https://docs.apipark.com/docs/system_setting/account_role'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("团队"),
|
title: $t("团队"),
|
||||||
description: $t('团队中包含了人员、消费者和服务,不同团队之间的消费者和服务数据是隔离的,可用于管理企业内部不同的部门/项目组/团队。'),
|
description: $t('团队中包含了人员、消费者和服务,不同团队之间的消费者和服务数据是隔离的,可用于管理企业内部不同的部门/项目组/团队。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/provider/service'
|
link: 'https://docs.apipark.com/docs/teams'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("服务"),
|
title: $t("服务"),
|
||||||
description: $t('服务内包含一组 API,并且可以发布到 API 市场被其他团队使用。'),
|
description: $t('服务内包含一组 API,并且可以发布到 API 市场被其他团队使用。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/suberscriber/application'
|
link: 'https://docs.apipark.com/docs/category/-%E6%9C%8D%E5%8A%A1'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -98,12 +98,12 @@ export default function Guide(){
|
|||||||
{
|
{
|
||||||
title: $t("订阅服务"),
|
title: $t("订阅服务"),
|
||||||
description: $t('如果需要调用某个服务的 API,需要先订阅该服务,并且等待提供服务的团队审核后才可发起 API 请求。'),
|
description: $t('如果需要调用某个服务的 API,需要先订阅该服务,并且等待提供服务的团队审核后才可发起 API 请求。'),
|
||||||
link: 'https://docs.apipark.com/docs/tutorials/api-market/service'
|
link: 'https://docs.apipark.com/docs/developer_portal'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t("审核订阅申请"),
|
title: $t("审核订阅申请"),
|
||||||
description: $t('提供服务的团队可以审核来自其他团队的订阅申请,审核通过后的消费者才可发起 API 请求。'),
|
description: $t('提供服务的团队可以审核来自其他团队的订阅申请,审核通过后的消费者才可发起 API 请求。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/suberscriber/subscribe'
|
link: 'https://docs.apipark.com/docs/services/review_consumers'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -113,7 +113,7 @@ export default function Guide(){
|
|||||||
{
|
{
|
||||||
title: $t("日志"),
|
title: $t("日志"),
|
||||||
description: $t('APIPark 提供详尽的 API 调用日志,帮助企业监控、分析和审计 API 的运行状况。'),
|
description: $t('APIPark 提供详尽的 API 调用日志,帮助企业监控、分析和审计 API 的运行状况。'),
|
||||||
link: 'https://docs.apipark.com/docs/quick/pre-work/monitor'
|
link: 'https://docs.apipark.com/docs/system_setting/log/'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const LogSettings = ()=>{
|
|||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
'system.devops.log_configuration.view')
|
'system.settings.log_configuration.view')
|
||||||
})
|
})
|
||||||
return newMenu
|
return newMenu
|
||||||
},[state.language,menuItems])
|
},[state.language,menuItems])
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
import WithPermission from "@common/components/aoplatform/WithPermission";
|
||||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext";
|
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext";
|
||||||
import { $t } from "@common/locales";
|
import { $t } from "@common/locales";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -24,7 +25,7 @@ export default function LogSettingsInstruction() {
|
|||||||
<div className="h-[208px] w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG mr-[24px]">
|
<div className="h-[208px] w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG mr-[24px]">
|
||||||
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">环境配置</p>
|
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">环境配置</p>
|
||||||
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">新增集群的地址、名称、描述和其他相关属性,以确保插件能够正确识别和连接到集群</p>
|
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">新增集群的地址、名称、描述和其他相关属性,以确保插件能够正确识别和连接到集群</p>
|
||||||
<p><Link to="/cluster">添加集群地址</Link></p>
|
<p><WithPermission access="system.settings.api_gateway.view" ><Link to="/cluster">添加集群地址</Link></WithPermission></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import {App, Form, Input, TreeSelect} from "antd";
|
import {App, Form, Input, TreeSelect} from "antd";
|
||||||
import {forwardRef, useEffect, useImperativeHandle, useState} from "react";
|
import {forwardRef, useEffect, useImperativeHandle, useMemo, useState} from "react";
|
||||||
import {BasicResponse, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE, VALIDATE_MESSAGE} from "@common/const/const.tsx";
|
import {BasicResponse, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE, VALIDATE_MESSAGE} from "@common/const/const.tsx";
|
||||||
import {useFetch} from "@common/hooks/http.ts";
|
import {useFetch} from "@common/hooks/http.ts";
|
||||||
import { MemberDropdownModalHandle, MemberDropdownModalProps, DepartmentListItem, MemberDropdownModalFieldType, MemberTableListItem } from "../../const/member/type.ts";
|
import { MemberDropdownModalHandle, MemberDropdownModalProps, DepartmentListItem, MemberDropdownModalFieldType, MemberTableListItem } from "../../const/member/type.ts";
|
||||||
import WithPermission from "@common/components/aoplatform/WithPermission.tsx";
|
import WithPermission from "@common/components/aoplatform/WithPermission.tsx";
|
||||||
import { $t } from "@common/locales/index.ts";
|
import { $t } from "@common/locales/index.ts";
|
||||||
|
import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx";
|
||||||
|
|
||||||
export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDropdownModalProps>((props,ref)=>{
|
export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDropdownModalProps>((props,ref)=>{
|
||||||
const { message} = App.useApp()
|
const { message} = App.useApp()
|
||||||
@@ -12,6 +13,7 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
|||||||
const {type,entity,selectedMemberGroupId} = props
|
const {type,entity,selectedMemberGroupId} = props
|
||||||
const {fetchData} = useFetch()
|
const {fetchData} = useFetch()
|
||||||
const [departmentList, setDepartmentList] = useState<DepartmentListItem[]>([])
|
const [departmentList, setDepartmentList] = useState<DepartmentListItem[]>([])
|
||||||
|
const { state } = useGlobalContext()
|
||||||
|
|
||||||
const save:()=>Promise<boolean | string> = ()=>{
|
const save:()=>Promise<boolean | string> = ()=>{
|
||||||
let url:string
|
let url:string
|
||||||
@@ -78,6 +80,15 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const generateRandomString = () =>{
|
||||||
|
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||||
|
let result = '';
|
||||||
|
for (let i = 0; i < 8; i++) {
|
||||||
|
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
switch(type){
|
switch(type){
|
||||||
case 'addChild':
|
case 'addChild':
|
||||||
@@ -87,7 +98,7 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
|||||||
form.setFieldsValue({id:entity!.id,name:entity!.name})
|
form.setFieldsValue({id:entity!.id,name:entity!.name})
|
||||||
break
|
break
|
||||||
case 'addMember':
|
case 'addMember':
|
||||||
form.setFieldsValue('-1' === selectedMemberGroupId ? {} : {departmentIds:selectedMemberGroupId})
|
form.setFieldsValue({...('-1' === selectedMemberGroupId ? {} : {departmentIds:selectedMemberGroupId}), password:generateRandomString()})
|
||||||
break
|
break
|
||||||
case 'editMember':
|
case 'editMember':
|
||||||
form.setFieldsValue({...entity,departmentIds:(entity as MemberTableListItem )?.department?.map(x=>x.id)})
|
form.setFieldsValue({...entity,departmentIds:(entity as MemberTableListItem )?.department?.map(x=>x.id)})
|
||||||
@@ -97,6 +108,23 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
|||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
const treeData = useMemo(() => {
|
||||||
|
const loop = (data: DepartmentListItem[]): unknown[] =>
|
||||||
|
data?.map((item) => {
|
||||||
|
const title = ['unknown','disable'].indexOf(item.id) === -1 ?item.name : $t(item.name) as string;
|
||||||
|
if (item.children) {
|
||||||
|
return {...item,name:title, children:loop(item.children)}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
name: title
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return loop(departmentList);
|
||||||
|
}, [departmentList,state.language]);
|
||||||
|
|
||||||
|
|
||||||
return (<WithPermission access="">
|
return (<WithPermission access="">
|
||||||
<Form
|
<Form
|
||||||
@@ -163,6 +191,13 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
|||||||
>
|
>
|
||||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item<MemberDropdownModalFieldType>
|
||||||
|
label={$t("密码")}
|
||||||
|
name="password"
|
||||||
|
rules={[{required: type === 'addMember',whitespace:true }]}
|
||||||
|
>
|
||||||
|
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
|
||||||
|
</Form.Item>
|
||||||
<Form.Item<MemberDropdownModalFieldType>
|
<Form.Item<MemberDropdownModalFieldType>
|
||||||
label={$t("部门")}
|
label={$t("部门")}
|
||||||
name="departmentIds"
|
name="departmentIds"
|
||||||
@@ -175,7 +210,7 @@ export const MemberDropdownModal = forwardRef<MemberDropdownModalHandle,MemberDr
|
|||||||
placeholder={$t(PLACEHOLDER.select)}
|
placeholder={$t(PLACEHOLDER.select)}
|
||||||
allowClear
|
allowClear
|
||||||
treeDefaultExpandAll
|
treeDefaultExpandAll
|
||||||
treeData={departmentList}
|
treeData={treeData}
|
||||||
multiple
|
multiple
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ const MemberList = ()=>{
|
|||||||
<WithPermission access="system.organization.member.edit">
|
<WithPermission access="system.organization.member.edit">
|
||||||
<Select
|
<Select
|
||||||
className="w-full"
|
className="w-full"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
value={entity.roles?.map((x:EntityItem)=>x.id)}
|
value={entity.roles?.map((x:EntityItem)=>x.id)}
|
||||||
options={roleSelectableList?.map((x:{id:string,name:string})=>({label:(x.name), value:x.id}))}
|
options={roleSelectableList?.map((x:{id:string,name:string})=>({label:(x.name), value:x.id}))}
|
||||||
onChange={(value)=>{
|
onChange={(value)=>{
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const LogSettings = ()=>{
|
|||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
'system.devops.log_configuration.view')
|
'system.settings.log_configuration.view')
|
||||||
})
|
})
|
||||||
return newMenu
|
return newMenu
|
||||||
},[state.language,menuItems])
|
},[state.language,menuItems])
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import WithPermission from "@common/components/aoplatform/WithPermission";
|
||||||
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext";
|
import { useBreadcrumb } from "@common/contexts/BreadcrumbContext";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
@@ -24,7 +25,7 @@ export default function ResourceSettingsInstruction() {
|
|||||||
<div className="h-[208px] w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG mr-[24px]">
|
<div className="h-[208px] w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG mr-[24px]">
|
||||||
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">集群配置</p>
|
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">集群配置</p>
|
||||||
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">新增集群地址、描述和其他相关属性,以确保插件能够正确识别和连接到集群</p>
|
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">新增集群地址、描述和其他相关属性,以确保插件能够正确识别和连接到集群</p>
|
||||||
<p><Link to="/cluster">配置集群地址</Link></p>
|
<p><WithPermission access="system.settings.data_source.view" ><Link to="/cluster">配置集群地址</Link></WithPermission></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|||||||
@@ -176,13 +176,17 @@ const RoleConfig = ()=>{
|
|||||||
},[permissionInfo, state.language])
|
},[permissionInfo, state.language])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getPermissionTemplate()
|
|
||||||
form.setFieldsValue({name:'',permits:[]})
|
form.setFieldsValue({name:'',permits:[]})
|
||||||
if(roleId){
|
if(roleId){
|
||||||
getPermissionInfo()
|
getPermissionInfo()
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
getPermissionTemplate()
|
||||||
|
|
||||||
|
},[state.language])
|
||||||
|
|
||||||
const onFinish =async() => {
|
const onFinish =async() => {
|
||||||
const body = await form.validateFields()
|
const body = await form.validateFields()
|
||||||
|
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<WithPermission access={onEdit ? 'team.service.service.edit' :''}>
|
<WithPermission access={onEdit ? ['team.service.service.edit'] :''}>
|
||||||
<Form
|
<Form
|
||||||
layout='vertical'
|
layout='vertical'
|
||||||
labelAlign='left'
|
labelAlign='left'
|
||||||
@@ -460,7 +460,7 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
|||||||
<Row className="mb-[10px]"
|
<Row className="mb-[10px]"
|
||||||
// wrapperCol={{ offset: 5, span: 19 }}
|
// wrapperCol={{ offset: 5, span: 19 }}
|
||||||
>
|
>
|
||||||
<WithPermission access={onEdit ? 'team.service.service.edit' :''}>
|
<WithPermission access={onEdit ? ['team.service.service.edit'] :''}>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
{$t('保存')}
|
{$t('保存')}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -468,11 +468,11 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_,ref) => {
|
|||||||
</Row></>}
|
</Row></>}
|
||||||
</div>
|
</div>
|
||||||
{onEdit && <>
|
{onEdit && <>
|
||||||
<WithPermission access="team.service.service.delete" showDisabled={false}>
|
<WithPermission access={["team.service.service.delete"]} showDisabled={false}>
|
||||||
<div className="bg-[rgb(255_120_117_/_5%)] rounded-[10px] mt-[50px] p-btnrbase pb-0">
|
<div className="bg-[rgb(255_120_117_/_5%)] rounded-[10px] mt-[50px] p-btnrbase pb-0">
|
||||||
<p className="text-left"><span className="font-bold">{$t('删除服务')}:</span>{$t('删除操作不可恢复,请谨慎操作!')}</p>
|
<p className="text-left"><span className="font-bold">{$t('删除服务')}:</span>{$t('删除操作不可恢复,请谨慎操作!')}</p>
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<WithPermission access="team.service.service.delete">
|
<WithPermission access={["team.service.service.delete"]}>
|
||||||
<Button className="m-auto mt-[16px] mb-[20px]" type="default" danger={true} onClick={deleteSystemModal}>{$t('删除服务')}</Button>
|
<Button className="m-auto mt-[16px] mb-[20px]" type="default" danger={true} onClick={deleteSystemModal}>{$t('删除服务')}</Button>
|
||||||
</WithPermission>
|
</WithPermission>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ const ServiceInsideDocument = ()=>{
|
|||||||
<div className=" pl-[8px] py-btnbase ">
|
<div className=" pl-[8px] py-btnbase ">
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<p className="text-[14px] leading-[20px] text-[#999999]"><span className="mr-[20px]">{$t('最近一次更新者')}:{updater || '-'}</span><span>{$t('最近一次更新时间')}:{updateTime || '-'}</span></p>
|
<p className="text-[14px] leading-[20px] text-[#999999]"><span className="mr-[20px]">{$t('最近一次更新者')}:{updater || '-'}</span><span>{$t('最近一次更新时间')}:{updateTime || '-'}</span></p>
|
||||||
<WithPermission access="team.service.service.edit"><Button type="primary" className="mr-btnbase" onClick={save}>{$t('保存')}</Button></WithPermission>
|
<WithPermission access="team.service.service_intro.edit"><Button type="primary" className="mr-btnbase" onClick={save}>{$t('保存')}</Button></WithPermission>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>)
|
</div>)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const SystemInsidePage:FC = ()=> {
|
|||||||
getItem(<Link to="./route">{$t('API 路由')}</Link>, 'route',undefined,undefined,undefined,'team.service.router.view'),
|
getItem(<Link to="./route">{$t('API 路由')}</Link>, 'route',undefined,undefined,undefined,'team.service.router.view'),
|
||||||
getItem(<Link to="./api">{$t('API 文档')}</Link>, 'api',undefined,undefined,undefined,'team.service.api_doc.view'),
|
getItem(<Link to="./api">{$t('API 文档')}</Link>, 'api',undefined,undefined,undefined,'team.service.api_doc.view'),
|
||||||
getItem(<Link to="./upstream">{$t('上游')}</Link>, 'upstream',undefined,undefined,undefined,'team.service.upstream.view'),
|
getItem(<Link to="./upstream">{$t('上游')}</Link>, 'upstream',undefined,undefined,undefined,'team.service.upstream.view'),
|
||||||
getItem(<Link to="./document">{$t('使用说明')}</Link>, 'document',undefined,undefined,undefined,''),
|
getItem(<Link to="./document">{$t('使用说明')}</Link>, 'document',undefined,undefined,undefined,'team.service.service_intro.view'),
|
||||||
getItem(<Link to="./publish">{$t('发布')}</Link>, 'publish',undefined,undefined,undefined,'team.service.release.view'),
|
getItem(<Link to="./publish">{$t('发布')}</Link>, 'publish',undefined,undefined,undefined,'team.service.release.view'),
|
||||||
],
|
],
|
||||||
'group'),
|
'group'),
|
||||||
@@ -84,19 +84,20 @@ const SystemInsidePage:FC = ()=> {
|
|||||||
const filterMenu = (menu:MenuItemGroupType<MenuItemType>[])=>{
|
const filterMenu = (menu:MenuItemGroupType<MenuItemType>[])=>{
|
||||||
const newMenu = cloneDeep(menu)
|
const newMenu = cloneDeep(menu)
|
||||||
return newMenu!.filter((m:MenuItemGroupType )=>{
|
return newMenu!.filter((m:MenuItemGroupType )=>{
|
||||||
if(m.children && m.children.length > 0){
|
if(m&&m.children && m.children.length > 0){
|
||||||
m.children = m.children.filter(
|
m.children = m.children.filter(
|
||||||
(c)=>(c&&(c as MenuItemType&{access:string} ).access ?
|
(c)=>{
|
||||||
|
if(!c) return false
|
||||||
|
return (((c as MenuItemType&{access:string} ).access ?
|
||||||
checkPermission((c as MenuItemType&{access:string} ).access as keyof typeof PERMISSION_DEFINITION[0]):
|
checkPermission((c as MenuItemType&{access:string} ).access as keyof typeof PERMISSION_DEFINITION[0]):
|
||||||
true))
|
true))})
|
||||||
}
|
}
|
||||||
return m.children && m.children.length > 0
|
return m.children && m.children.length > 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const filteredMenu = filterMenu(SYSTEM_PAGE_MENU_ITEMS as MenuItemGroupType<MenuItemType>[])
|
const filteredMenu = filterMenu(SYSTEM_PAGE_MENU_ITEMS as MenuItemGroupType<MenuItemType>[])
|
||||||
setActiveMenu((pre)=>{
|
const menu = activeMenu ?? filteredMenu[0]?.children ? filteredMenu[0]?.children?.[0]?.key : filteredMenu[0]?.key
|
||||||
return pre ?? 'route'
|
if(menu && currentUrl.split('/')[-1] !== menu) navigateTo(`/service/${teamId}/inside/${serviceId}/${menu}`)
|
||||||
})
|
|
||||||
return filteredMenu || []
|
return filteredMenu || []
|
||||||
},[accessData,accessInit, SYSTEM_PAGE_MENU_ITEMS])
|
},[accessData,accessInit, SYSTEM_PAGE_MENU_ITEMS])
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ const SystemInsidePage:FC = ()=> {
|
|||||||
}, [currentUrl]);
|
}, [currentUrl]);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(accessData && accessData.get('team') && accessData.get('team')?.indexOf('team.service.router.view') !== -1){
|
if(accessData && checkPermission('team.service.router.view')){
|
||||||
getApiDefine()
|
getApiDefine()
|
||||||
}
|
}
|
||||||
},[accessData])
|
},[accessData])
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {App, Button, Form, Input, Row, Select} from "antd";
|
|||||||
import {Link, useLocation, useNavigate, useParams} from "react-router-dom";
|
import {Link, useLocation, useNavigate, useParams} from "react-router-dom";
|
||||||
import {RouterParams} from "@core/components/aoplatform/RenderRoutes.tsx";
|
import {RouterParams} from "@core/components/aoplatform/RenderRoutes.tsx";
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import {BasicResponse, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE, VALIDATE_MESSAGE} from "@common/const/const.tsx";
|
import {BasicResponse, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE} from "@common/const/const.tsx";
|
||||||
import {MemberItem} from "@common/const/type.ts";
|
import {MemberItem} from "@common/const/type.ts";
|
||||||
import {useFetch} from "@common/hooks/http.ts";
|
import {useFetch} from "@common/hooks/http.ts";
|
||||||
import {DefaultOptionType} from "antd/es/cascader";
|
import {DefaultOptionType} from "antd/es/cascader";
|
||||||
@@ -34,10 +34,10 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
|||||||
const [managerOption, setManagerOption] = useState<DefaultOptionType[]>([])
|
const [managerOption, setManagerOption] = useState<DefaultOptionType[]>([])
|
||||||
const { setBreadcrumb} = useBreadcrumb()
|
const { setBreadcrumb} = useBreadcrumb()
|
||||||
const { setTeamInfo } =useTeamContext()
|
const { setTeamInfo } =useTeamContext()
|
||||||
const {checkPermission,accessInit} = useGlobalContext()
|
const {checkPermission,accessInit,state} = useGlobalContext()
|
||||||
const pageType= useMemo(()=>{
|
const pageType= useMemo(()=>{
|
||||||
if(!accessInit) return 'myteam'
|
if(!accessInit) return 'myteam'
|
||||||
return checkPermission('system.organization.team.view') ? 'manage' : 'myteam'
|
return checkPermission('system.workspace.team.view_all') ? 'manage' : 'myteam'
|
||||||
},[checkPermission,accessInit])
|
},[checkPermission,accessInit])
|
||||||
|
|
||||||
const [canDelete, setCanDelete] = useState<boolean>(false)
|
const [canDelete, setCanDelete] = useState<boolean>(false)
|
||||||
@@ -128,7 +128,10 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
|||||||
getTeamInfo();
|
getTeamInfo();
|
||||||
} else {
|
} else {
|
||||||
setOnEdit(false);
|
setOnEdit(false);
|
||||||
form.setFieldsValue({id:uuidv4()}); // 清空 initialValues
|
form.setFieldsValue(
|
||||||
|
{id:uuidv4(),
|
||||||
|
master:state?.userData?.uid
|
||||||
|
}); // 清空 initialValues
|
||||||
}
|
}
|
||||||
return (form.setFieldsValue({}))
|
return (form.setFieldsValue({}))
|
||||||
}, [teamId]);
|
}, [teamId]);
|
||||||
@@ -197,7 +200,7 @@ const TeamConfig= forwardRef<TeamConfigHandle,TeamConfigProps>((props,ref) => {
|
|||||||
<p className="text-left"><span className="font-bold">{$t('删除团队')}:</span>{$t('删除操作不可恢复,请谨慎操作!')}</p>
|
<p className="text-left"><span className="font-bold">{$t('删除团队')}:</span>{$t('删除操作不可恢复,请谨慎操作!')}</p>
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<WithPermission access="system.organization.team.delete" disabled={!canDelete} tooltip={canDelete ? '':$t('服务数据清除后,方可删除')}>
|
<WithPermission access="system.organization.team.delete" disabled={!canDelete} tooltip={canDelete ? '':$t('服务数据清除后,方可删除')}>
|
||||||
<Button className="m-auto mt-[16px] mb-[20px]" type="default" danger onClick={()=>deleteTeam(entity!)}>{$t('删除')}</Button>
|
<Button className="m-auto mt-[16px] mb-[20px]" type="default" danger onClick={()=>deleteTeam()}>{$t('删除')}</Button>
|
||||||
</WithPermission>
|
</WithPermission>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import WithPermission from "@common/components/aoplatform/WithPermission.tsx";
|
|||||||
import { $t } from "@common/locales/index.ts";
|
import { $t } from "@common/locales/index.ts";
|
||||||
|
|
||||||
export const getDepartmentWithMember = (department:(DepartmentListItem & {type?:'department'|'member'})[],departmentMap:Map<string, (MemberItem & {type:'department'|'member'})[]>) : (DepartmentWithMemberItem | undefined)[] =>{
|
export const getDepartmentWithMember = (department:(DepartmentListItem & {type?:'department'|'member'})[],departmentMap:Map<string, (MemberItem & {type:'department'|'member'})[]>) : (DepartmentWithMemberItem | undefined)[] =>{
|
||||||
return department.map((x:DepartmentListItem & {type?:'department'|'member'})=>{
|
return department?.map((x:DepartmentListItem & {type?:'department'|'member'})=>{
|
||||||
const res = ({
|
const res = ({
|
||||||
...x,
|
...x,
|
||||||
key:x.id,
|
key:x.id,
|
||||||
@@ -28,7 +28,7 @@ export const getDepartmentWithMember = (department:(DepartmentListItem & {type?:
|
|||||||
type: x.type || 'department',
|
type: x.type || 'department',
|
||||||
children:((x.type === 'member' || (!x.children||x.children.length === 0 )&& (!departmentMap.get(x.id) || departmentMap.get(x.id)!.length === 0))? undefined : [...(x.children && x.children.length > 0 ? getDepartmentWithMember(x.children,departmentMap) : []),...departmentMap.get(x.id) || []])
|
children:((x.type === 'member' || (!x.children||x.children.length === 0 )&& (!departmentMap.get(x.id) || departmentMap.get(x.id)!.length === 0))? undefined : [...(x.children && x.children.length > 0 ? getDepartmentWithMember(x.children,departmentMap) : []),...departmentMap.get(x.id) || []])
|
||||||
});
|
});
|
||||||
return res}).filter(node=>node.type === 'member' ||( node.children && node.children.length > 0))
|
return res})?.filter(node=>node.type === 'member' ||( node.children && node.children.length > 0)) || []
|
||||||
}
|
}
|
||||||
|
|
||||||
export const addMemberToDepartment = (departmentMap: Map<string, (MemberItem & {type:'department'|'member'})[]>, departmentId: string, member: MemberItem) => {
|
export const addMemberToDepartment = (departmentMap: Map<string, (MemberItem & {type:'department'|'member'})[]>, departmentId: string, member: MemberItem) => {
|
||||||
@@ -84,6 +84,7 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
addMemberToDepartment(departmentMap, '_withoutDepartment', member);
|
addMemberToDepartment(departmentMap, '_withoutDepartment', member);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const finalData = departmentResponse.data.department
|
const finalData = departmentResponse.data.department
|
||||||
? [
|
? [
|
||||||
@@ -93,30 +94,33 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
name: departmentResponse.data.department.name,
|
name: departmentResponse.data.department.name,
|
||||||
title:departmentResponse.data.department.name,
|
title:departmentResponse.data.department.name,
|
||||||
children: [
|
children: [
|
||||||
...getDepartmentWithMember(departmentResponse.data.department.children, departmentMap),
|
...getDepartmentWithMember(departmentResponse.data.department?.children || [], departmentMap),
|
||||||
...departmentMap.get('_withoutDepartment') || []
|
...departmentMap.get('_withoutDepartment') || []
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
: [...departmentMap.get('_withoutDepartment') || []];
|
: [...departmentMap.get('_withoutDepartment') || []];
|
||||||
|
|
||||||
|
let allMemberSelectedFlag:boolean = true
|
||||||
for(const [k,v] of departmentMap){
|
for(const [k,v] of departmentMap){
|
||||||
if(k !== '_withoutDepartment' && allMemberIds.length > 0 ){
|
if(k !== '_withoutDepartment' && allMemberIds.length > 0 ){
|
||||||
// 筛选出部门内没被勾选的用户,如果不存在没勾选用户,需要将部门id放入ids中
|
// 筛选出部门内没被勾选的用户,如果不存在没勾选用户,需要将部门id放入ids中
|
||||||
if(v.filter(m => allMemberIds.indexOf(m.id) === -1).length === 0){
|
if(v.filter(m => allMemberIds.indexOf(m.id) === -1).length === 0){
|
||||||
setAllMemberSelectedDepartIds((pre)=>[...pre, k])
|
setAllMemberSelectedDepartIds((pre)=>[...pre, k])
|
||||||
|
}else if(['unknown','disable'].indexOf(k) === -1){
|
||||||
|
allMemberSelectedFlag = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!finalData[0].children || finalData[0].children.filter(m => allMemberIds.indexOf(m.id) === -1).length === 0){
|
if(departmentMap.get('_withoutDepartment')?.filter(x=>allMemberIds.indexOf(x)!==-1).length === 0 && allMemberSelectedFlag){
|
||||||
setAllMemberSelectedDepartIds((pre)=>[...pre, topDepartmentId])
|
setAllMemberSelectedDepartIds((pre)=>[...pre, topDepartmentId])
|
||||||
}
|
}
|
||||||
|
|
||||||
return {data:finalData, success: true}
|
return {data:finalData, success: true}
|
||||||
}).catch(()=>({data:[], success:false}))
|
}).catch(()=>({data:[], success:false}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const getMemberList = ()=>{
|
const getMemberList = ()=>{
|
||||||
return fetchData<BasicResponse<{members:TeamMemberTableListItem}>>('team/members',{method:'GET',eoParams:{keyword:searchWord, team:teamId},eoTransformKeys:['attach_time','is_delete']}).then(response=>{
|
return fetchData<BasicResponse<{members:TeamMemberTableListItem}>>('team/members',{method:'GET',eoParams:{keyword:searchWord, team:teamId},eoTransformKeys:['attach_time','is_delete']}).then(response=>{
|
||||||
@@ -214,7 +218,6 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
|
|
||||||
|
|
||||||
const changeMemberInfo = (value:string[],entity:TeamMemberTableListItem )=>{
|
const changeMemberInfo = (value:string[],entity:TeamMemberTableListItem )=>{
|
||||||
//console.log(value)
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
fetchData<BasicResponse<null>>(`team/member/role`, {method: 'PUT',eoBody:({roles:value, users:[entity.user.id]}), eoParams: {team:teamId}}).then(response => {
|
fetchData<BasicResponse<null>>(`team/member/role`, {method: 'PUT',eoBody:({roles:value, users:[entity.user.id]}), eoParams: {team:teamId}}).then(response => {
|
||||||
const {code, msg} = response
|
const {code, msg} = response
|
||||||
@@ -252,6 +255,7 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
<Select
|
<Select
|
||||||
className="w-full"
|
className="w-full"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
|
maxTagCount="responsive"
|
||||||
value={entity.roles?.map((x:EntityItem)=>x.id)}
|
value={entity.roles?.map((x:EntityItem)=>x.id)}
|
||||||
options={roleList?.map((x:{id:string,name:string})=>({label:(x.name), value:x.id}))}
|
options={roleList?.map((x:{id:string,name:string})=>({label:(x.name), value:x.id}))}
|
||||||
onChange={(value)=>{
|
onChange={(value)=>{
|
||||||
@@ -272,7 +276,6 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
},[ state.language,roleList])
|
},[ state.language,roleList])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getRoleList()
|
|
||||||
setBreadcrumb([
|
setBreadcrumb([
|
||||||
{title:<Link to="/team/list">{$t('团队')}</Link>},
|
{title:<Link to="/team/list">{$t('团队')}</Link>},
|
||||||
{title:$t('成员')}
|
{title:$t('成员')}
|
||||||
@@ -280,6 +283,11 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
manualReloadTable()
|
manualReloadTable()
|
||||||
}, [teamId]);
|
}, [teamId]);
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
getRoleList()
|
||||||
|
},[state.language])
|
||||||
|
|
||||||
const treeDisabledData = useMemo(()=>{ return [...allMemberIds,...allMemberSelectedDepartIds]},[allMemberIds,allMemberSelectedDepartIds])
|
const treeDisabledData = useMemo(()=>{ return [...allMemberIds,...allMemberSelectedDepartIds]},[allMemberIds,allMemberSelectedDepartIds])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -302,7 +310,7 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
title={$t("添加成员")}
|
title={$t("添加成员")}
|
||||||
open={modalVisible}
|
open={modalVisible}
|
||||||
destroyOnClose={true}
|
destroyOnClose={true}
|
||||||
width={900}
|
width={600}
|
||||||
onCancel={() => cleanModalData()}
|
onCancel={() => cleanModalData()}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
footer={[
|
footer={[
|
||||||
@@ -329,7 +337,7 @@ const TeamInsideMember:FC = ()=>{
|
|||||||
const memberKeyFromModal = Array.from(selectedData)?.filter(x => allMemberIds.indexOf(x) === -1 &&selectableMemberIds.has(x)) || [];
|
const memberKeyFromModal = Array.from(selectedData)?.filter(x => allMemberIds.indexOf(x) === -1 &&selectableMemberIds.has(x)) || [];
|
||||||
setAddMemberBtnDisabled((memberKeyFromModal.length === 0));
|
setAddMemberBtnDisabled((memberKeyFromModal.length === 0));
|
||||||
}}
|
}}
|
||||||
searchPlaceholder={$t("搜索用户名、邮箱")}
|
searchPlaceholder={$t("输入名称查找用户")}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
|
|
||||||
import PageList, { PageProColumns } from "@common/components/aoplatform/PageList.tsx"
|
import PageList from "@common/components/aoplatform/PageList.tsx"
|
||||||
import {ActionType} from "@ant-design/pro-components";
|
import {ActionType} from "@ant-design/pro-components";
|
||||||
import {FC, useEffect, useMemo, useRef, useState} from "react";
|
import {FC, useEffect, useMemo, useRef, useState} from "react";
|
||||||
import {useLocation, useNavigate} from "react-router-dom";
|
import {useLocation, useNavigate} from "react-router-dom";
|
||||||
import {useBreadcrumb} from "@common/contexts/BreadcrumbContext.tsx";
|
import {useBreadcrumb} from "@common/contexts/BreadcrumbContext.tsx";
|
||||||
import {App, Divider, Modal} from "antd";
|
import {App, Modal} from "antd";
|
||||||
import {BasicResponse, COLUMNS_TITLE, DELETE_TIPS, RESPONSE_TIPS, STATUS_CODE} from "@common/const/const.tsx";
|
import {BasicResponse, DELETE_TIPS, RESPONSE_TIPS, STATUS_CODE} from "@common/const/const.tsx";
|
||||||
import { SimpleMemberItem } from "@common/const/type.ts";
|
import { SimpleMemberItem } from "@common/const/type.ts";
|
||||||
import {useFetch} from "@common/hooks/http.ts";
|
import {useFetch} from "@common/hooks/http.ts";
|
||||||
import { TEAM_TABLE_COLUMNS } from "../../const/team/const.tsx";
|
import { TEAM_TABLE_COLUMNS } from "../../const/team/const.tsx";
|
||||||
import { TeamConfigFieldType, TeamConfigHandle, TeamTableListItem } from "../../const/team/type.ts";
|
import { TeamConfigFieldType, TeamConfigHandle, TeamTableListItem } from "../../const/team/type.ts";
|
||||||
import TableBtnWithPermission from "@common/components/aoplatform/TableBtnWithPermission.tsx";
|
|
||||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx";
|
import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx";
|
||||||
import { checkAccess } from "@common/utils/permission.ts";
|
import { checkAccess } from "@common/utils/permission.ts";
|
||||||
import TeamConfig from "./TeamConfig.tsx";
|
import TeamConfig from "./TeamConfig.tsx";
|
||||||
@@ -131,21 +130,6 @@ const TeamList:FC = ()=>{
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const operation:PageProColumns<TeamTableListItem>[] =[
|
|
||||||
{
|
|
||||||
title: COLUMNS_TITLE.operate,
|
|
||||||
key: 'option',
|
|
||||||
fixed:'right',
|
|
||||||
btnNums:2,
|
|
||||||
valueType: 'option',
|
|
||||||
render: (_: React.ReactNode, entity: TeamTableListItem) => [
|
|
||||||
<TableBtnWithPermission access="" key="view" btnType="view" navigateTo={`../inside/${entity.id}/setting`} btnTitle="查看"/>,
|
|
||||||
<Divider type="vertical" className="mx-0" key="div2"/>,
|
|
||||||
<TableBtnWithPermission access="system.organization.team.delete" key="delete" btnType="delete" disabled={!entity.canDelete} tooltip="服务数据清除后,方可删除" onClick={()=>{openModal('delete',entity)}} btnTitle="删除"/>,
|
|
||||||
],
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setBreadcrumb([
|
setBreadcrumb([
|
||||||
{title: $t('团队')}
|
{title: $t('团队')}
|
||||||
@@ -173,7 +157,7 @@ const TeamList:FC = ()=>{
|
|||||||
id="global_team"
|
id="global_team"
|
||||||
className="pl-btnbase"
|
className="pl-btnbase"
|
||||||
ref={pageListRef}
|
ref={pageListRef}
|
||||||
columns = {[...columns,...operation]}
|
columns = {[...columns]}
|
||||||
request = {()=>getTeamList()}
|
request = {()=>getTeamList()}
|
||||||
showPagination={false}
|
showPagination={false}
|
||||||
addNewBtnTitle={$t('添加团队')}
|
addNewBtnTitle={$t('添加团队')}
|
||||||
@@ -207,7 +191,7 @@ const TeamList:FC = ()=>{
|
|||||||
}
|
}
|
||||||
return res})}
|
return res})}
|
||||||
>
|
>
|
||||||
<TeamConfig ref={teamConfigRef} inModal entity={modalType === 'add' ? undefined : curTeam} />
|
<TeamConfig ref={teamConfigRef} entity={modalType === 'add' ? undefined : curTeam} />
|
||||||
</Modal>
|
</Modal>
|
||||||
</InsidePage>
|
</InsidePage>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2024-06-05 09:35:25
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:50:12
|
|
||||||
* @FilePath: \frontend\packages\core\start-vite.js
|
|
||||||
*/
|
|
||||||
// start-vite.js// start-vite.js
|
// start-vite.js// start-vite.js
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'child_process';
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:44
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:36:46
|
|
||||||
* @FilePath: \frontend\packages\core\tailwind.config.js
|
|
||||||
*/
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:54
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2023-11-29 15:49:05
|
|
||||||
* @FilePath: \applatform\frontend\packages\core\postcss.config.js
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
'postcss-import': {},
|
'postcss-import': {},
|
||||||
|
|||||||
@@ -231,9 +231,9 @@ const MonitorTotalPage = (props:MonitorTotalPageProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`h-full overflow-hidden pb-btnybase flex flex-col bg-[#fff]`}>
|
<div className={`h-full overflow-hidden pb-btnybase flex flex-col bg-[#fff] `}>
|
||||||
<ScrollableSection>
|
<ScrollableSection>
|
||||||
<div className="flex items-center flex-wrap pb-[10px] px-btnbase content-before bg-MAIN_BG">
|
<div className="flex items-center flex-wrap pb-[10px] px-btnbase content-before bg-MAIN_BG pr-PAGE_INSIDE_X ">
|
||||||
<TimeRangeSelector
|
<TimeRangeSelector
|
||||||
labelSize="small"
|
labelSize="small"
|
||||||
initialTimeButton={timeButton}
|
initialTimeButton={timeButton}
|
||||||
@@ -247,7 +247,7 @@ const MonitorTotalPage = (props:MonitorTotalPageProps) => {
|
|||||||
</div>
|
</div>
|
||||||
<Spin wrapperClassName={`flex-1 ${totalEmpty ?'':'overflow-auto'}`} indicator={<LoadingOutlined style={{ fontSize: 24 }} spin/>} spinning={queryBtnLoading}>
|
<Spin wrapperClassName={`flex-1 ${totalEmpty ?'':'overflow-auto'}`} indicator={<LoadingOutlined style={{ fontSize: 24 }} spin/>} spinning={queryBtnLoading}>
|
||||||
{totalEmpty ?<Empty className="mt-[100px]" image={Empty.PRESENTED_IMAGE_SIMPLE} />:
|
{totalEmpty ?<Empty className="mt-[100px]" image={Empty.PRESENTED_IMAGE_SIMPLE} />:
|
||||||
<div className=" h-full scroll-area">
|
<div className=" h-full scroll-area pr-PAGE_INSIDE_X ">
|
||||||
{/* 图表区域 */}
|
{/* 图表区域 */}
|
||||||
<div className=" px-btnbase mt-[12px] mb-[16px] grid gap-[20px]" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(570px, 1fr))'}}>
|
<div className=" px-btnbase mt-[12px] mb-[16px] grid gap-[20px]" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(570px, 1fr))'}}>
|
||||||
{/* 请求统计饼图 */}
|
{/* 请求统计饼图 */}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { reject } from "lodash-es";
|
|||||||
import { EntityItem } from "@common/const/type";
|
import { EntityItem } from "@common/const/type";
|
||||||
import { LoadingOutlined } from "@ant-design/icons";
|
import { LoadingOutlined } from "@ant-design/icons";
|
||||||
import DashboardInstruction from "./DashboardInstruction";
|
import DashboardInstruction from "./DashboardInstruction";
|
||||||
import cluster from "cluster";
|
|
||||||
|
|
||||||
export default function Dashboard(){
|
export default function Dashboard(){
|
||||||
const { setBreadcrumb } = useBreadcrumb()
|
const { setBreadcrumb } = useBreadcrumb()
|
||||||
@@ -47,7 +46,7 @@ export default function Dashboard(){
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Spin wrapperClassName="h-full w-full pr-PAGE_INSIDE_X pb-PAGE_INSIDE_B " indicator={<LoadingOutlined style={{ fontSize: 24 }} spin/>} spinning={loading}>
|
<Spin wrapperClassName="h-full w-full pb-PAGE_INSIDE_B " indicator={<LoadingOutlined style={{ fontSize: 24 }} spin/>} spinning={loading}>
|
||||||
{
|
{
|
||||||
!loading && <>
|
!loading && <>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
import WithPermission from "@common/components/aoplatform/WithPermission";
|
||||||
import { $t } from "@common/locales";
|
import { $t } from "@common/locales";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
@@ -15,13 +16,13 @@ export default function DashboardInstruction({showClusterIns, showMonitorIns}:{s
|
|||||||
{showClusterIns && <div className="h-[208px] w-[50%] max-w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG mr-[24px] justify-around">
|
{showClusterIns && <div className="h-[208px] w-[50%] max-w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG mr-[24px] justify-around">
|
||||||
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">{$t('集群配置')}</p>
|
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">{$t('集群配置')}</p>
|
||||||
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">{$t('配置集群地址,以确保监控系统能够正确识别和连接到集群')}</p>
|
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">{$t('配置集群地址,以确保监控系统能够正确识别和连接到集群')}</p>
|
||||||
<p><a href="/cluster" target="_blank">{$t('配置集群信息')}</a></p>
|
<p><WithPermission access="system.settings.api_gateway.view" ><a href="/cluster" target="_blank">{$t('配置集群信息')}</a></WithPermission></p>
|
||||||
</div>}
|
</div>}
|
||||||
{showMonitorIns &&
|
{showMonitorIns &&
|
||||||
<div className="h-[208px] w-[50%] max-w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG justify-around">
|
<div className="h-[208px] w-[50%] max-w-[384px] flex flex-col items-center py-[32px] px-[24px] gap-[16px] rounded-DEFAULT bg-MENU_BG justify-around">
|
||||||
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">{$t('监控设置')}</p>
|
<p className="text-[20px] font-medium leading-[32px] text-MAIN_TEXT">{$t('监控设置')}</p>
|
||||||
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">{$t('设置监控报表的数据来源,设置完成之后即可获得详细的API调用统计图表。')}</p>
|
<p className="text-[12px] font-normal leading-[20px] text-DESC_TEXT">{$t('设置监控报表的数据来源,设置完成之后即可获得详细的API调用统计图表。')}</p>
|
||||||
<p><a href="/datasourcing" target="_blank">{$t('配置监控信息')}</a></p>
|
<p><WithPermission access="system.settings.data_source.view" ><a href="/datasourcing" target="_blank">{$t('配置监控信息')}</a></WithPermission></p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:44
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:36:11
|
|
||||||
* @FilePath: \frontend\packages\market\tailwind.config.js
|
|
||||||
*/
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:54
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:42:18
|
|
||||||
* @FilePath: \frontend\packages\core\postcss.config.js
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
'postcss-import': {},
|
'postcss-import': {},
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export const SERVICE_HUB_TABLE_COLUMNS: PageProColumns<ServiceHubTableListItem>[
|
|||||||
title:('团队'),
|
title:('团队'),
|
||||||
dataIndex: ['team','name'],
|
dataIndex: ['team','name'],
|
||||||
ellipsis:true,
|
ellipsis:true,
|
||||||
renderText:(_,entity:ServiceHubTableListItem)=>entity.tags?.map(x=>x.name).join(',') || '-'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:('订阅服务数量'),
|
title:('订阅服务数量'),
|
||||||
|
|||||||
@@ -89,10 +89,10 @@ const ServiceHubDetail = ()=>{
|
|||||||
|
|
||||||
const getMySelectList = ()=>{
|
const getMySelectList = ()=>{
|
||||||
setMySystemOptionList([])
|
setMySystemOptionList([])
|
||||||
fetchData<BasicResponse<{ apps: SimpleSystemItem[] }>>('simple/apps/mine',{method:'GET'}).then(response=>{
|
fetchData<BasicResponse<{ app: EntityItem[] }>>('apps/can_subscribe',{method:'GET'}).then(response=>{
|
||||||
const {code,data,msg} = response
|
const {code,data,msg} = response
|
||||||
if(code === STATUS_CODE.SUCCESS){
|
if(code === STATUS_CODE.SUCCESS){
|
||||||
setMySystemOptionList(data.apps?.map((x:SimpleSystemItem)=>{return {
|
setMySystemOptionList(data.app?.map((x:EntityItem)=>{return {
|
||||||
label:x.name, value:x.id
|
label:x.name, value:x.id
|
||||||
}}))
|
}}))
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ import { useFetch } from "@common/hooks/http";
|
|||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useTenantManagementContext } from "@market/contexts/TenantManagementContext";
|
import { useTenantManagementContext } from "@market/contexts/TenantManagementContext";
|
||||||
import { $t } from "@common/locales";
|
import { $t } from "@common/locales";
|
||||||
|
import Select, { DefaultOptionType } from "antd/es/select";
|
||||||
|
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
||||||
|
import { SimpleTeamItem, MemberItem } from "@common/const/type";
|
||||||
|
|
||||||
export type ManagementConfigFieldType = {
|
export type ManagementConfigFieldType = {
|
||||||
name:string
|
name:string
|
||||||
@@ -21,6 +24,7 @@ type ManagementConfigProps = {
|
|||||||
type:'add'|'edit'
|
type:'add'|'edit'
|
||||||
teamId:string
|
teamId:string
|
||||||
appId?:string
|
appId?:string
|
||||||
|
dataShowType?:'block'|'list'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ManagementConfigHandle = {
|
export type ManagementConfigHandle = {
|
||||||
@@ -30,16 +34,18 @@ export type ManagementConfigHandle = {
|
|||||||
|
|
||||||
const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps>((props, ref) => {
|
const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps>((props, ref) => {
|
||||||
const { message,modal } = App.useApp()
|
const { message,modal } = App.useApp()
|
||||||
const {type,teamId,appId} = props
|
const {type,teamId,appId,dataShowType} = props
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const {fetchData} = useFetch()
|
const {fetchData} = useFetch()
|
||||||
const [delBtnLoading, setDelBtnLoading] = useState<boolean>(false)
|
const [delBtnLoading, setDelBtnLoading] = useState<boolean>(false)
|
||||||
const {setAppName} = type === 'edit' ? useTenantManagementContext():{setAppName:()=>{}}
|
const {setAppName} = type === 'edit' ? useTenantManagementContext():{setAppName:()=>{}}
|
||||||
const navigate = type === 'edit' ? useNavigate() : ()=>{}
|
const navigate = type === 'edit' ? useNavigate() : ()=>{}
|
||||||
|
const [teamOptionList, setTeamOptionList] = useState<DefaultOptionType[]>()
|
||||||
|
const {checkPermission,accessInit, getGlobalAccessData} = useGlobalContext()
|
||||||
const save:()=>Promise<boolean | string> = ()=>{
|
const save:()=>Promise<boolean | string> = ()=>{
|
||||||
return new Promise((resolve, reject)=>{
|
return new Promise((resolve, reject)=>{
|
||||||
form.validateFields().then((value)=>{
|
form.validateFields().then((value)=>{
|
||||||
fetchData<BasicResponse<{apps:ManagementConfigFieldType}>>(type === 'add'? 'team/app' : 'app/info',{method:type === 'add'? 'POST' : 'PUT',eoBody:(value), eoParams:type === 'add' ? {team:teamId}:{app:appId,team:teamId}}).then(response=>{
|
fetchData<BasicResponse<{apps:ManagementConfigFieldType}>>(type === 'add'? 'team/app' : 'app/info',{method:type === 'add'? 'POST' : 'PUT',eoBody:(value), eoParams:type === 'add' ? {team:dataShowType === 'list' ? value.team : teamId}:{app:appId,team:teamId}}).then(response=>{
|
||||||
const {code,data,msg} = response
|
const {code,data,msg} = response
|
||||||
if(code === STATUS_CODE.SUCCESS){
|
if(code === STATUS_CODE.SUCCESS){
|
||||||
message.success(msg || $t(RESPONSE_TIPS.success))
|
message.success(msg || $t(RESPONSE_TIPS.success))
|
||||||
@@ -68,6 +74,24 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getTeamOptionList = ()=>{
|
||||||
|
setTeamOptionList([])
|
||||||
|
|
||||||
|
fetchData<BasicResponse<{ teams: SimpleTeamItem[] }>>(!checkPermission('system.workspace.team.view_all') ?'simple/teams/mine' :'simple/teams',{method:'GET',eoTransformKeys:[]}).then(response=>{
|
||||||
|
const {code,data,msg} = response
|
||||||
|
if(code === STATUS_CODE.SUCCESS){
|
||||||
|
setTeamOptionList(data.teams?.map((x:MemberItem)=>{return {...x,
|
||||||
|
label:x.name, value:x.id
|
||||||
|
}}))
|
||||||
|
if(form.getFieldValue('team') === undefined&&data.teams?.length){
|
||||||
|
form.setFieldValue('team',data.teams[0].id);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const deleteApplicationModal = async ()=>{
|
const deleteApplicationModal = async ()=>{
|
||||||
setDelBtnLoading(true)
|
setDelBtnLoading(true)
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
@@ -112,7 +136,17 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
|||||||
if(type === 'edit'){
|
if(type === 'edit'){
|
||||||
appId && getApplicationInfo()
|
appId && getApplicationInfo()
|
||||||
}else{
|
}else{
|
||||||
form.setFieldValue('id',uuidv4())
|
form.setFieldsValue({
|
||||||
|
'id':uuidv4()})
|
||||||
|
}
|
||||||
|
if(type !== 'edit' && dataShowType === 'list'){
|
||||||
|
if(accessInit){
|
||||||
|
getTeamOptionList()
|
||||||
|
}else{
|
||||||
|
getGlobalAccessData()?.then?.(()=>{
|
||||||
|
getTeamOptionList()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [appId]);
|
}, [appId]);
|
||||||
|
|
||||||
@@ -146,6 +180,16 @@ const ManagementConfig = forwardRef<ManagementConfigHandle,ManagementConfigProps
|
|||||||
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} disabled={type === 'edit'}/>
|
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} disabled={type === 'edit'}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
|
||||||
|
{dataShowType === 'list' && <Form.Item<ManagementConfigFieldType>
|
||||||
|
label={$t("所属团队")}
|
||||||
|
name="team"
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
>
|
||||||
|
<Select className="w-INPUT_NORMAL" disabled={type === 'edit'} placeholder={$t(PLACEHOLDER.input)} options={teamOptionList} >
|
||||||
|
</Select>
|
||||||
|
</Form.Item>}
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={$t("描述")}
|
label={$t("描述")}
|
||||||
name="description"
|
name="description"
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ import { ManagementConfigFieldType } from "./ManagementConfig";
|
|||||||
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
|
||||||
import { $t } from "@common/locales";
|
import { $t } from "@common/locales";
|
||||||
import { getItem } from "@common/utils/navigation";
|
import { getItem } from "@common/utils/navigation";
|
||||||
import { MenuItemType } from "antd/es/menu/interface";
|
import { MenuItemGroupType, MenuItemType } from "antd/es/menu/interface";
|
||||||
|
import { PERMISSION_DEFINITION } from "@common/const/permissions";
|
||||||
|
import { cloneDeep } from "lodash-es";
|
||||||
|
|
||||||
export default function ManagementInsidePage(){
|
export default function ManagementInsidePage(){
|
||||||
const { message } = App.useApp()
|
const { message } = App.useApp()
|
||||||
@@ -27,17 +29,29 @@ export default function ManagementInsidePage(){
|
|||||||
const [openKeys, setOpenKeys] = useState<string[]>([])
|
const [openKeys, setOpenKeys] = useState<string[]>([])
|
||||||
const [loading, setLoading] = useState<boolean>(false)
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
const {appName,setAppName} = useTenantManagementContext()
|
const {appName,setAppName} = useTenantManagementContext()
|
||||||
const {getTeamAccessData,cleanTeamAccessData,state} = useGlobalContext()
|
const {getTeamAccessData,cleanTeamAccessData,state,accessData,checkPermission,accessInit} = useGlobalContext()
|
||||||
|
|
||||||
const TENANT_MANAGEMENT_APP_MENU: MenuProps['items'] = useMemo(()=>[
|
const TENANT_MANAGEMENT_APP_MENU: MenuProps['items'] = useMemo(()=>[
|
||||||
getItem($t('订阅的服务'), 'service'),
|
getItem($t('订阅的服务'), 'service',undefined, undefined, undefined, 'team.application.subscription.view'),
|
||||||
getItem($t('访问授权'), 'authorization'),
|
getItem($t('访问授权'), 'authorization',undefined, undefined, undefined, 'team.consumer.authorization.view'),
|
||||||
getItem($t('消费者管理'), 'setting'),
|
getItem($t('消费者管理'), 'setting',undefined, undefined, undefined, 'team.application.application.view'),
|
||||||
],[state.language])
|
],[state.language])
|
||||||
|
|
||||||
|
|
||||||
const menuData = useMemo(()=>{
|
const menuData = useMemo(()=>{
|
||||||
return TENANT_MANAGEMENT_APP_MENU
|
const filterMenu = (menu:(MenuItemType&{access:string})[])=>{
|
||||||
},[])
|
const newMenu = cloneDeep(menu)
|
||||||
|
return newMenu!.filter((c:MenuItemType&{access:string} )=>{
|
||||||
|
if(!c) return false
|
||||||
|
return (((c as MenuItemType&{access:string} ).access ?
|
||||||
|
checkPermission((c as MenuItemType&{access:string} ).access as keyof typeof PERMISSION_DEFINITION[0]):
|
||||||
|
true))
|
||||||
|
})}
|
||||||
|
const filteredMenu = filterMenu(TENANT_MANAGEMENT_APP_MENU as (MenuItemType&{access:string})[])
|
||||||
|
const menu = activeMenu ?? filteredMenu[0]?.children ? filteredMenu[0]?.children?.[0]?.key : filteredMenu[0]?.key
|
||||||
|
if(menu && currentUrl.split('/')[-1] !== menu) navigateTo(`/consumer/${teamId}/inside/${appId}/${menu}`)
|
||||||
|
return filteredMenu || []
|
||||||
|
},[accessData,accessInit, TENANT_MANAGEMENT_APP_MENU])
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setActiveMenu(currentUrl.split('/').pop() || 'service')
|
setActiveMenu(currentUrl.split('/').pop() || 'service')
|
||||||
|
|||||||
+110
-42
@@ -1,5 +1,5 @@
|
|||||||
import { MenuProps, Menu, App, Avatar, Card, Tooltip, Empty, Button, Radio } from "antd";
|
import { MenuProps, Menu, App, Avatar, Card, Tooltip, Empty, Button, Radio } from "antd";
|
||||||
import { useState, forwardRef, useEffect, useRef, useMemo, memo } from "react";
|
import { useState, forwardRef, useEffect, useRef, useMemo, memo, Ref, useImperativeHandle } from "react";
|
||||||
import { VirtuosoGrid } from "react-virtuoso";
|
import { VirtuosoGrid } from "react-virtuoso";
|
||||||
import { BasicResponse, DATA_SHOW_TYPE_OPTIONS, RESPONSE_TIPS, STATUS_CODE } from "@common/const/const";
|
import { BasicResponse, DATA_SHOW_TYPE_OPTIONS, RESPONSE_TIPS, STATUS_CODE } from "@common/const/const";
|
||||||
import { ServiceHubAppListItem } from "../../../const/serviceHub/type";
|
import { ServiceHubAppListItem } from "../../../const/serviceHub/type";
|
||||||
@@ -17,6 +17,7 @@ import WithPermission from "@common/components/aoplatform/WithPermission";
|
|||||||
import InsidePage from "@common/components/aoplatform/InsidePage";
|
import InsidePage from "@common/components/aoplatform/InsidePage";
|
||||||
import PageList from "@common/components/aoplatform/PageList";
|
import PageList from "@common/components/aoplatform/PageList";
|
||||||
import { SERVICE_HUB_TABLE_COLUMNS } from "@market/const/serviceHub/const";
|
import { SERVICE_HUB_TABLE_COLUMNS } from "@market/const/serviceHub/const";
|
||||||
|
import { ActionType } from "@ant-design/pro-components";
|
||||||
|
|
||||||
export default function ServiceHubManagement() {
|
export default function ServiceHubManagement() {
|
||||||
const { message ,modal} = App.useApp()
|
const { message ,modal} = App.useApp()
|
||||||
@@ -36,23 +37,25 @@ export default function ServiceHubManagement() {
|
|||||||
const [tableHttpReload, setTableHttpReload] = useState(true);
|
const [tableHttpReload, setTableHttpReload] = useState(true);
|
||||||
const [tableListDataSource, setTableListDataSource] = useState<ServiceHubAppListItem[]>([]);
|
const [tableListDataSource, setTableListDataSource] = useState<ServiceHubAppListItem[]>([]);
|
||||||
const [tableSearchWord, setTableSearchWord] = useState<string>('')
|
const [tableSearchWord, setTableSearchWord] = useState<string>('')
|
||||||
|
const tableRef = useRef<TableAreaHandle>(null)
|
||||||
|
|
||||||
const getServiceList = ()=>{
|
const getServiceList = (dataType?:'block'|'list')=>{
|
||||||
if(!accessInit){
|
dataType = dataType ?? dataShowType
|
||||||
getGlobalAccessData()?.then?.(()=>{getServiceList()})
|
if(!accessInit){
|
||||||
return Promise.resolve({data:[], success:false})
|
getGlobalAccessData()?.then?.(()=>{getServiceList(dataType)})
|
||||||
}
|
return Promise.resolve({data:[], success:false})
|
||||||
|
}
|
||||||
|
|
||||||
|
if(dataType === 'list' && !tableHttpReload){
|
||||||
|
setTableHttpReload(true)
|
||||||
|
return Promise.resolve({
|
||||||
|
data: tableListDataSource,
|
||||||
|
success: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if(dataShowType === 'list' && !tableHttpReload){
|
setServiceLoading(true)
|
||||||
setTableHttpReload(true)
|
return fetchData<BasicResponse<{apps:ServiceHubAppListItem}>>(!checkPermission('system.workspace.application.view_all') ? 'my_apps':'apps',{method:'GET',eoParams:{ team: dataType === 'list' ? undefined : teamId,keyword:tableSearchWord},eoTransformKeys:['api_num','subscribe_num','subscribe_verify_num','auth_num','create_time','can_delete']}).then(response=>{
|
||||||
return Promise.resolve({
|
|
||||||
data: tableListDataSource,
|
|
||||||
success: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
setServiceLoading(true)
|
|
||||||
return fetchData<BasicResponse<{apps:ServiceHubAppListItem}>>(!checkPermission('system.workspace.application.view_all') ? 'my_apps':'apps',{method:'GET',eoParams:{ team:teamId,keyword:tableSearchWord},eoTransformKeys:['api_num','subscribe_num','subscribe_verify_num','auth_num']}).then(response=>{
|
|
||||||
const {code,data,msg} = response
|
const {code,data,msg} = response
|
||||||
if(code === STATUS_CODE.SUCCESS){
|
if(code === STATUS_CODE.SUCCESS){
|
||||||
setServiceList([...data.apps,{type:'addNewItem'}])
|
setServiceList([...data.apps,{type:'addNewItem'}])
|
||||||
@@ -75,36 +78,78 @@ const getServiceList = ()=>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const getTeamsList = ()=>{
|
const getTeamsList = () => {
|
||||||
if(!accessInit){
|
setPageLoading(true);
|
||||||
getGlobalAccessData()?.then?.(()=>{getTeamsList()})
|
|
||||||
return
|
const fetchTeams = () => {
|
||||||
}
|
fetchData<BasicResponse<{ teams: SimpleTeamItem[] }>>(
|
||||||
setPageLoading(true)
|
!checkPermission('system.workspace.team.view_all')
|
||||||
fetchData<BasicResponse<{ teams: SimpleTeamItem[] }>>(!checkPermission('system.workspace.team.view_all') ?'simple/teams/mine' :'simple/teams',{method:'GET',eoTransformKeys:['app_num','subscribe_num']}).then(response=>{
|
? 'simple/teams/mine'
|
||||||
const {code,data,msg} = response
|
: 'simple/teams',
|
||||||
if(code === STATUS_CODE.SUCCESS){
|
{
|
||||||
setTeamList(data.teams.map((x:SimpleTeamItem)=>({label:<div className="flex items-center justify-between "><span className="w-[calc(100%-42px)] truncate" title={x.name}>{x.name}</span><span className="bg-[#fff] rounded-[5px] h-[20px] w-[30px] flex items-center justify-center">{x.appNum || 0}</span></div>, key:x.id})))
|
method: 'GET',
|
||||||
if(!teamId && data.teams?.[0]?.id){
|
eoTransformKeys: ['app_num', 'subscribe_num'],
|
||||||
navigateTo(data.teams[0].id)
|
|
||||||
}
|
}
|
||||||
}else{
|
)
|
||||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
.then(response => {
|
||||||
}
|
const { code, data, msg } = response;
|
||||||
}).finally(()=>{
|
if (code === STATUS_CODE.SUCCESS) {
|
||||||
setPageLoading(false)
|
setTeamList(
|
||||||
})
|
data.teams.map((x: SimpleTeamItem) => ({
|
||||||
}
|
label: (
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<span className="w-[calc(100%-42px)] truncate" title={x.name}>
|
||||||
|
{x.name}
|
||||||
|
</span>
|
||||||
|
<span className="bg-[#fff] rounded-[5px] h-[20px] w-[30px] flex items-center justify-center">
|
||||||
|
{x.appNum || 0}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
key: x.id,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
if (!teamId && data.teams?.[0]?.id) {
|
||||||
|
navigateTo(data.teams[0].id);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
message.error(msg || $t(RESPONSE_TIPS.error));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setPageLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!accessInit) {
|
||||||
|
const checkAccessData = () => {
|
||||||
|
const accessInitd = getGlobalAccessData();
|
||||||
|
if (!accessInitd) {
|
||||||
|
setTimeout(checkAccessData, 100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof accessInitd.then === 'function') {
|
||||||
|
accessInitd.then(fetchTeams);
|
||||||
|
} else {
|
||||||
|
fetchTeams();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
checkAccessData();
|
||||||
|
} else {
|
||||||
|
fetchTeams();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const openModal = async (type:'add'|'edit'|'delete')=>{
|
const openModal = async (type:'add'|'edit'|'delete')=>{
|
||||||
|
|
||||||
let title:string = ''
|
let title:string = ''
|
||||||
let content:string|React.ReactNode = ''
|
let content:string|React.ReactNode = ''
|
||||||
switch (type){
|
switch (type){
|
||||||
case 'add':
|
case 'add':
|
||||||
title=$t('添加消费者')
|
title=$t('添加消费者')
|
||||||
content=<ManagementConfig ref={addManagementRef} type={type} teamId={teamId!} />
|
content=<ManagementConfig ref={addManagementRef} dataShowType={dataShowType} type={type} teamId={teamId!} />
|
||||||
break;
|
break;
|
||||||
// case 'edit':{
|
// case 'edit':{
|
||||||
// title='配置 Open Api'
|
// title='配置 Open Api'
|
||||||
@@ -130,7 +175,15 @@ const getServiceList = ()=>{
|
|||||||
onOk:()=> {
|
onOk:()=> {
|
||||||
switch (type){
|
switch (type){
|
||||||
case 'add':
|
case 'add':
|
||||||
return addManagementRef.current?.save().then((res)=>{if(res === true) getTeamsList();getServiceList()})
|
return addManagementRef.current?.save().then((res)=>{if(res === true) {
|
||||||
|
getTeamsList();
|
||||||
|
if(dataShowType === 'list'){
|
||||||
|
setTableHttpReload(true)
|
||||||
|
tableRef.current?.manualReloadTable()
|
||||||
|
}else{
|
||||||
|
getServiceList()
|
||||||
|
}
|
||||||
|
}})
|
||||||
// case 'edit':
|
// case 'edit':
|
||||||
// return editManagementRef.current?.save().then((res)=>{if(res === true) manualReloadTable()})
|
// return editManagementRef.current?.save().then((res)=>{if(res === true) manualReloadTable()})
|
||||||
// case 'delete':
|
// case 'delete':
|
||||||
@@ -241,13 +294,13 @@ useEffect(() => {
|
|||||||
customBtn={
|
customBtn={
|
||||||
<Radio.Group
|
<Radio.Group
|
||||||
options={dataShowTypeOptions}
|
options={dataShowTypeOptions}
|
||||||
onChange={(e)=>setDataShowType(e.target.value)}
|
onChange={(e)=>{setDataShowType(e.target.value); setTableHttpReload(true); if(e.target.value === 'block'){getServiceList(e.target.value)}}}
|
||||||
value={dataShowType}
|
value={dataShowType}
|
||||||
optionType="button"
|
optionType="button"
|
||||||
buttonStyle="solid"
|
buttonStyle="solid"
|
||||||
/>}
|
/>}
|
||||||
>{
|
>{
|
||||||
dataShowType === 'block' ? <BlockArea /> : <TableArea language={state.language} getServiceList={getServiceList} addNewApp={()=>openModal('add')} setTableHttpReload={setTableHttpReload} setTableSearchWord={setTableSearchWord} editApp={(row:ServiceHubAppListItem)=>{setAppName(row.name);navigateTo(`/consumer/${row.team.id}/inside/${row.id}/service`)}}/>
|
dataShowType === 'block' ? <BlockArea /> : <TableArea language={state.language} getServiceList={()=>getServiceList('list')} ref={tableRef} addNewApp={()=>openModal('add')} setTableHttpReload={setTableHttpReload} setTableSearchWord={setTableSearchWord} editApp={(row:ServiceHubAppListItem)=>{setAppName(row.name);navigateTo(`/consumer/${row.team.id}/inside/${row.id}/service`)}}/>
|
||||||
}
|
}
|
||||||
</InsidePage> :
|
</InsidePage> :
|
||||||
<Empty className="mt-[100px]" image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
<Empty className="mt-[100px]" image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||||
@@ -281,16 +334,31 @@ type TableAreaProps = {
|
|||||||
editApp:(item:ServiceHubAppListItem)=>void
|
editApp:(item:ServiceHubAppListItem)=>void
|
||||||
}
|
}
|
||||||
|
|
||||||
const TableArea = memo(({language, getServiceList, addNewApp, setTableHttpReload, setTableSearchWord, editApp}:TableAreaProps)=>{
|
type TableAreaHandle = {
|
||||||
|
manualReloadTable:()=>void
|
||||||
|
}
|
||||||
|
|
||||||
|
const TableArea = memo(forwardRef((props:TableAreaProps, ref:Ref<TableAreaHandle>)=>{
|
||||||
|
const {language, getServiceList, addNewApp, setTableHttpReload, setTableSearchWord, editApp} = props
|
||||||
|
const pageListRef = useRef<ActionType>(null);
|
||||||
const columns = useMemo(()=>{
|
const columns = useMemo(()=>{
|
||||||
const res = SERVICE_HUB_TABLE_COLUMNS.map(x=>{
|
const res = SERVICE_HUB_TABLE_COLUMNS.map(x=>{
|
||||||
return {...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
return {...x,title:typeof x.title === 'string' ? $t(x.title as string) : x.title}})
|
||||||
return res
|
return res
|
||||||
},[language])
|
},[language])
|
||||||
|
|
||||||
|
const manualReloadTable = ()=>{
|
||||||
|
pageListRef.current?.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
useImperativeHandle(ref, () =>({
|
||||||
|
manualReloadTable}))
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageList
|
<PageList
|
||||||
id="service_hub_list"
|
id="service_hub_list"
|
||||||
|
ref={pageListRef}
|
||||||
columns={[...columns]}
|
columns={[...columns]}
|
||||||
request={()=>getServiceList()}
|
request={()=>getServiceList()}
|
||||||
addNewBtnTitle={$t("添加消费者")}
|
addNewBtnTitle={$t("添加消费者")}
|
||||||
@@ -304,4 +372,4 @@ const TableArea = memo(({language, getServiceList, addNewApp, setTableHttpReload
|
|||||||
}}
|
}}
|
||||||
onRowClick={(row:ServiceHubAppListItem)=>editApp(row)}
|
onRowClick={(row:ServiceHubAppListItem)=>editApp(row)}
|
||||||
/>
|
/>
|
||||||
)})
|
)}))
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:54
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2023-11-29 15:49:05
|
|
||||||
* @FilePath: \applatform\frontend\packages\core\postcss.config.js
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
'postcss-import': {},
|
'postcss-import': {},
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:44
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:36:11
|
|
||||||
* @FilePath: \frontend\packages\market\tailwind.config.js
|
|
||||||
*/
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:54
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2023-11-29 15:49:05
|
|
||||||
* @FilePath: \applatform\frontend\packages\core\postcss.config.js
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
plugins: {
|
plugins: {
|
||||||
'postcss-import': {},
|
'postcss-import': {},
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:44
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-05 10:36:11
|
|
||||||
* @FilePath: \frontend\packages\market\tailwind.config.js
|
|
||||||
*/
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
packages:
|
packages:
|
||||||
- "packages/*"
|
- "packages/*"
|
||||||
|
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
/*
|
|
||||||
* @Date: 2023-11-27 17:31:44
|
|
||||||
* @LastEditors: maggieyyy
|
|
||||||
* @LastEditTime: 2024-06-04 15:03:36
|
|
||||||
* @FilePath: \frontend\tailwind.config.js
|
|
||||||
*/
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -11,4 +11,5 @@
|
|||||||
},
|
},
|
||||||
"include": ["**/*.test.ts", "**/*.test.tsx", "jest.setup.js"],
|
"include": ["**/*.test.ts", "**/*.test.tsx", "jest.setup.js"],
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules"]
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,15 +5,15 @@ go 1.21
|
|||||||
//toolchain go1.21.1
|
//toolchain go1.21.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/eolinker/ap-account v1.0.13
|
github.com/eolinker/ap-account v1.0.15
|
||||||
github.com/eolinker/eosc v0.17.3
|
github.com/eolinker/eosc v0.17.3
|
||||||
github.com/eolinker/go-common v1.1.0
|
github.com/eolinker/go-common v1.1.1
|
||||||
github.com/gabriel-vasile/mimetype v1.4.4
|
github.com/gabriel-vasile/mimetype v1.4.4
|
||||||
github.com/getkin/kin-openapi v0.127.0
|
github.com/getkin/kin-openapi v0.127.0
|
||||||
github.com/gin-gonic/gin v1.10.0
|
github.com/gin-gonic/gin v1.10.0
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/influxdata/influxdb-client-go/v2 v2.14.0
|
github.com/influxdata/influxdb-client-go/v2 v2.14.0
|
||||||
github.com/urfave/cli/v2 v2.27.2
|
github.com/urfave/cli v1.22.16
|
||||||
golang.org/x/crypto v0.24.0
|
golang.org/x/crypto v0.24.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
gorm.io/gorm v1.25.5
|
gorm.io/gorm v1.25.5
|
||||||
@@ -26,7 +26,7 @@ require (
|
|||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/cloudwego/base64x v0.1.4 // indirect
|
github.com/cloudwego/base64x v0.1.4 // indirect
|
||||||
github.com/cloudwego/iasm v0.2.0 // indirect
|
github.com/cloudwego/iasm v0.2.0 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||||
github.com/ghodss/yaml v1.0.0 // indirect
|
github.com/ghodss/yaml v1.0.0 // indirect
|
||||||
@@ -62,7 +62,6 @@ require (
|
|||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||||
github.com/ugorji/go/codec v1.2.12 // indirect
|
github.com/ugorji/go/codec v1.2.12 // indirect
|
||||||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
|
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect
|
go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect
|
||||||
go.uber.org/atomic v1.7.0 // indirect
|
go.uber.org/atomic v1.7.0 // indirect
|
||||||
go.uber.org/multierr v1.6.0 // indirect
|
go.uber.org/multierr v1.6.0 // indirect
|
||||||
@@ -76,4 +75,6 @@ require (
|
|||||||
gorm.io/driver/mysql v1.5.2 // indirect
|
gorm.io/driver/mysql v1.5.2 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
//replace github.com/eolinker/ap-account => ../../eolinker/ap-account
|
//replace github.com/eolinker/ap-account => ../aoaccount
|
||||||
|
//
|
||||||
|
//replace github.com/eolinker/go-common => ../go-common
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
|
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
|
||||||
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
|
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
|
||||||
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
|
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
|
||||||
@@ -18,8 +19,8 @@ github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/
|
|||||||
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
||||||
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
|
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
|
||||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
|
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
@@ -27,12 +28,12 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r
|
|||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||||
github.com/eolinker/ap-account v1.0.13 h1:6iWdyxLAIkJfgw9JvkHEq0t2m8Levpg30kSx5pTK2wY=
|
github.com/eolinker/ap-account v1.0.15 h1:n6DJeL6RHZ8eLlZUcY2U3H4d/GPaA5oelAx3R0E6yL8=
|
||||||
github.com/eolinker/ap-account v1.0.13/go.mod h1:qLKg4xervGHTNBWaGckfPkQb+FZT0XfhwPEdNpzvsjE=
|
github.com/eolinker/ap-account v1.0.15/go.mod h1:zm/Ivs6waJ/M/nEszhpPmM6g50y/MKO+5eABFAdeD0g=
|
||||||
github.com/eolinker/eosc v0.17.3 h1:sr2yT+v/AsqEdciRaaZZj0zL9pTufR5RvDW6+65hraQ=
|
github.com/eolinker/eosc v0.17.3 h1:sr2yT+v/AsqEdciRaaZZj0zL9pTufR5RvDW6+65hraQ=
|
||||||
github.com/eolinker/eosc v0.17.3/go.mod h1:xgq816hpanlMXFtZw7Ztdctb1eEk9UPHchY4NfFO6Cw=
|
github.com/eolinker/eosc v0.17.3/go.mod h1:xgq816hpanlMXFtZw7Ztdctb1eEk9UPHchY4NfFO6Cw=
|
||||||
github.com/eolinker/go-common v1.1.0 h1:n/XXK7yVRen3jhNG/SfZGXJA+KNnaYf0XTDfMeviaBw=
|
github.com/eolinker/go-common v1.1.1 h1:3WqqecGqcHDgpa8Ljp156c1uWeZKP1CKScdU+6sOfcc=
|
||||||
github.com/eolinker/go-common v1.1.0/go.mod h1:Kb/jENMN1mApnodvRgV4YwO9FJby1Jkt2EUjrBjvSX4=
|
github.com/eolinker/go-common v1.1.1/go.mod h1:Kb/jENMN1mApnodvRgV4YwO9FJby1Jkt2EUjrBjvSX4=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I=
|
github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s=
|
github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s=
|
||||||
github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY=
|
github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY=
|
||||||
@@ -139,10 +140,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
|
|||||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||||
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
|
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
|
||||||
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||||
github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI=
|
github.com/urfave/cli v1.22.16 h1:MH0k6uJxdwdeWQTwhSO42Pwr4YLrNLwBtg1MRgTqPdQ=
|
||||||
github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM=
|
github.com/urfave/cli v1.22.16/go.mod h1:EeJR6BKodywf4zciqrdw6hpCPk68JO9z5LazXZMn5Po=
|
||||||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw=
|
|
||||||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk=
|
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.13 h1:RVZSAnWWWiI5IrYAXjQorajncORbS0zI48LQlE2kQWg=
|
go.etcd.io/etcd/client/pkg/v3 v3.5.13 h1:RVZSAnWWWiI5IrYAXjQorajncORbS0zI48LQlE2kQWg=
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.13/go.mod h1:XxHT4u1qU12E2+po+UVPrEeL94Um6zL58ppuJWXSAB8=
|
go.etcd.io/etcd/client/pkg/v3 v3.5.13/go.mod h1:XxHT4u1qU12E2+po+UVPrEeL94Um6zL58ppuJWXSAB8=
|
||||||
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
// init module
|
||||||
import (
|
import (
|
||||||
_ "github.com/APIParkLab/APIPark/frontend"
|
_ "github.com/APIParkLab/APIPark/frontend"
|
||||||
_ "github.com/APIParkLab/APIPark/gateway/apinto"
|
_ "github.com/APIParkLab/APIPark/gateway/apinto"
|
||||||
_ "github.com/APIParkLab/APIPark/plugins/core"
|
_ "github.com/APIParkLab/APIPark/plugins/core"
|
||||||
_ "github.com/APIParkLab/APIPark/plugins/permit"
|
_ "github.com/APIParkLab/APIPark/plugins/permit"
|
||||||
_ "github.com/APIParkLab/APIPark/plugins/publish_flow"
|
_ "github.com/APIParkLab/APIPark/plugins/publish_flow"
|
||||||
|
_ "github.com/APIParkLab/APIPark/resources/locale"
|
||||||
_ "github.com/eolinker/ap-account/plugin"
|
_ "github.com/eolinker/ap-account/plugin"
|
||||||
_ "github.com/eolinker/go-common/cache/cache_redis"
|
_ "github.com/eolinker/go-common/cache/cache_redis"
|
||||||
_ "github.com/eolinker/go-common/log-init"
|
_ "github.com/eolinker/go-common/log-init"
|
||||||
|
|||||||
@@ -9,5 +9,4 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func doCheck() {
|
func doCheck() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-14
@@ -6,6 +6,11 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/csv"
|
"encoding/csv"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"sort"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
_ "github.com/APIParkLab/APIPark/resources/access"
|
_ "github.com/APIParkLab/APIPark/resources/access"
|
||||||
_ "github.com/APIParkLab/APIPark/resources/permit"
|
_ "github.com/APIParkLab/APIPark/resources/permit"
|
||||||
_ "github.com/APIParkLab/APIPark/resources/plugin"
|
_ "github.com/APIParkLab/APIPark/resources/plugin"
|
||||||
@@ -14,19 +19,15 @@ import (
|
|||||||
"github.com/eolinker/go-common/permit"
|
"github.com/eolinker/go-common/permit"
|
||||||
"github.com/eolinker/go-common/pm3"
|
"github.com/eolinker/go-common/pm3"
|
||||||
"github.com/eolinker/go-common/utils"
|
"github.com/eolinker/go-common/utils"
|
||||||
"os"
|
|
||||||
"sort"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const unsetValue = "-"
|
const unsetValue = "-"
|
||||||
|
|
||||||
func doCheck() {
|
func doCheck() {
|
||||||
accessConf, unset := loadAccess()
|
accessConf, unset := loadAccess()
|
||||||
|
|
||||||
drivers := pm3.List()
|
drivers := pm3.List()
|
||||||
|
|
||||||
newAccess := 0
|
newAccess := 0
|
||||||
for _, p := range drivers {
|
for _, p := range drivers {
|
||||||
if ac, ok := p.(pm3.AccessConfig); ok {
|
if ac, ok := p.(pm3.AccessConfig); ok {
|
||||||
@@ -39,9 +40,9 @@ func doCheck() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
for asKey := range permit.All() {
|
for asKey := range permit.All() {
|
||||||
key := strings.ToLower(asKey)
|
key := strings.ToLower(asKey)
|
||||||
@@ -53,12 +54,11 @@ func doCheck() {
|
|||||||
if newAccess > 0 || unset > 0 {
|
if newAccess > 0 || unset > 0 {
|
||||||
f := accessFile()
|
f := accessFile()
|
||||||
fmt.Printf("%d access need set, see : %s and %s", newAccess+unset, saveTemplate(accessConf, f), saveCsv(accessConf, f))
|
fmt.Printf("%d access need set, see : %s and %s", newAccess+unset, saveTemplate(accessConf, f), saveCsv(accessConf, f))
|
||||||
|
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
func accessFile() string {
|
func accessFile() string {
|
||||||
|
|
||||||
if version == "" {
|
if version == "" {
|
||||||
return time.Now().Format("20060102-150405")
|
return time.Now().Format("20060102-150405")
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ func saveCsv(as map[string]*Access, key string) string {
|
|||||||
err = os.WriteFile(filePath, buf.Bytes(), 0666)
|
err = os.WriteFile(filePath, buf.Bytes(), 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
||||||
}
|
}
|
||||||
return filePath
|
return filePath
|
||||||
}
|
}
|
||||||
@@ -111,9 +111,9 @@ func (ls AccessListSort) Swap(i, j int) {
|
|||||||
|
|
||||||
func saveTemplate(as map[string]*Access, key string) string {
|
func saveTemplate(as map[string]*Access, key string) string {
|
||||||
out := make(map[string][]access.Access)
|
out := make(map[string][]access.Access)
|
||||||
|
|
||||||
for _, a := range as {
|
for _, a := range as {
|
||||||
|
|
||||||
out[a.Group] = append(out[a.Group], access.Access{
|
out[a.Group] = append(out[a.Group], access.Access{
|
||||||
Name: a.Name,
|
Name: a.Name,
|
||||||
CName: a.Cname,
|
CName: a.Cname,
|
||||||
@@ -130,7 +130,7 @@ func saveTemplate(as map[string]*Access, key string) string {
|
|||||||
err = os.WriteFile(filePath, buf.Bytes(), 0666)
|
err = os.WriteFile(filePath, buf.Bytes(), 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
||||||
}
|
}
|
||||||
return filePath
|
return filePath
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/eolinker/eosc/log"
|
"github.com/eolinker/eosc/log"
|
||||||
"github.com/eolinker/go-common/autowire"
|
"github.com/eolinker/go-common/autowire"
|
||||||
"github.com/eolinker/go-common/cftool"
|
"github.com/eolinker/go-common/cftool"
|
||||||
"github.com/eolinker/go-common/permit"
|
"github.com/eolinker/go-common/permit"
|
||||||
"github.com/eolinker/go-common/server"
|
"github.com/eolinker/go-common/server"
|
||||||
"net"
|
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -54,7 +55,6 @@ func main() {
|
|||||||
for access, paths := range srv.Permits() {
|
for access, paths := range srv.Permits() {
|
||||||
permit.AddPermitRule(access, paths...)
|
permit.AddPermitRule(access, paths...)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = http.Serve(ln, srv)
|
err = http.Serve(ln, srv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package permit_middleware
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
permit_identity "github.com/APIParkLab/APIPark/middleware/permit/identity"
|
permit_identity "github.com/APIParkLab/APIPark/middleware/permit/identity"
|
||||||
"github.com/eolinker/eosc/log"
|
"github.com/eolinker/eosc/log"
|
||||||
"github.com/eolinker/go-common/autowire"
|
"github.com/eolinker/go-common/autowire"
|
||||||
@@ -42,11 +42,11 @@ func (p *PermitMiddleware) Sort() int {
|
|||||||
func (p *PermitMiddleware) Check(method string, path string) (bool, []gin.HandlerFunc) {
|
func (p *PermitMiddleware) Check(method string, path string) (bool, []gin.HandlerFunc) {
|
||||||
// 当前路径是否有配置权限
|
// 当前路径是否有配置权限
|
||||||
accessRules, has := permit.GetPathRule(method, path)
|
accessRules, has := permit.GetPathRule(method, path)
|
||||||
|
|
||||||
if !has || len(accessRules) == 0 {
|
if !has || len(accessRules) == 0 {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return true, []gin.HandlerFunc{
|
return true, []gin.HandlerFunc{
|
||||||
func(ginCtx *gin.Context) {
|
func(ginCtx *gin.Context) {
|
||||||
userId := utils.UserId(ginCtx)
|
userId := utils.UserId(ginCtx)
|
||||||
@@ -56,19 +56,14 @@ func (p *PermitMiddleware) Check(method string, path string) (bool, []gin.Handle
|
|||||||
ginCtx.Abort()
|
ginCtx.Abort()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//if userId == "admin" {
|
|
||||||
// // 超级管理员不校验
|
|
||||||
// return
|
|
||||||
//}
|
|
||||||
|
|
||||||
for _, group := range checkSort {
|
for _, group := range checkSort {
|
||||||
accessList, has := accessRules[group]
|
accessList, has := accessRules[group]
|
||||||
if !has {
|
if !has {
|
||||||
// 当前分组没有配置权限
|
// 当前分组没有配置权限
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
domainHandler, has := permit.SelectDomain(group)
|
domainHandler, has := permit.SelectDomain(group)
|
||||||
if !has {
|
if !has {
|
||||||
// 当前分组没有配置身份handler
|
// 当前分组没有配置身份handler
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user