Skip to content

Commit

Permalink
Merge pull request #1 from Dot-Liu/main
Browse files Browse the repository at this point in the history
APIPark-1.0-beta完成
  • Loading branch information
Dot-Liu authored Aug 16, 2024
2 parents 7190c32 + 2e3bfff commit 92a3abe
Show file tree
Hide file tree
Showing 111 changed files with 1,255 additions and 833 deletions.
63 changes: 63 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Bug Report"
description: Report a bug to help improve the project.
title: "bug: "
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report this bug!
_The more information you share, the faster we can identify and fix the bug._
Prior to opening the issue, please make sure that you:
- Use English to communicate.
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
description: Describe the issue you are facing.
placeholder: |
What is the issue with the current behavior?
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: Describe what you expected to happen.
placeholder: |
What did you expect to happen instead?
validations:
required: false
- type: textarea
id: error
attributes:
label: Error Logs
description: Paste the error logs if any.
validations:
required: false
- type: textarea
id: steps
attributes:
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.
placeholder: |
1. Run apinto via the Docker image.
2. Create a Route with the Admin API.
3. Try configuring ...
4. ...
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: Share your environment details. Reports without proper environment details will likely be closed.
value: |
- APINTO Dashboard version (run `apinto dashboard version`):
- Operating system (run `uname -a`):
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: APIPark Discussion Forum
url: https://github.com/APIParkLab/APIPark/discussions
about: Please ask and answer questions here.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/docs_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Documentation Issue"
description: Issues related to documentation.
title: "docs: "
labels: [doc]
body:
- type: markdown
attributes:
value: |
_The more information you share, the faster we can help you._
Prior to opening the issue, please make sure that you:
- Use English to communicate.
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
- type: textarea
id: current-state
attributes:
label: Current State
description: Describe the current state of the documentation.
placeholder: |
The documentation for the API in this page (url) is missing ...
validations:
required: true
- type: textarea
id: desired-state
attributes:
label: Desired State
description: Describe the desired state the documentation should be in.
placeholder: |
There should be line mentioning how the API behaves when ...
validations:
required: true
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Feature Request"
description: Suggest an enhancement to APINTO.
title: "feat: As a user, I want to ..., so that ..."
body:
- type: markdown
attributes:
value: |
_The more information you share, the faster we can help you._
Prior to opening the issue, please make sure that you:
- Use English to communicate.
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
- type: textarea
id: description
attributes:
label: Description
description: Describe the feature you would like to see.
placeholder: |
As a user, I want to ..., so that...
validations:
required: true
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/request_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Request Help"
description: Stuck? Ask for help!
title: "help request: "
body:
- type: markdown
attributes:
value: |
_The more information you share, the faster we can help you._
Prior to opening the issue, please make sure that you:
- Use English to communicate.
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
- type: textarea
id: description
attributes:
label: Description
description: Describe the issue you are facing and what you need help with.
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: Share your environment details. Reports without proper environment details will likely be closed.
value: |
- APIPark version (run `apinto dashboard version`):
- Operating system (run `uname -a`):
validations:
required: true
86 changes: 86 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: release
#触发机制,当创建tag时
on:
release:
types:
- published
jobs:
frontend-builder:
name: frontend-builder
runs-on: ubuntu-latest
steps:
- name: SetOutput
id: vars
run: echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
- name: Checkout #Checkout代码
uses: actions/checkout@v3
- name: Set up Node
uses: actions/[email protected]
with:
node-version: '18.12'
- name: Pnpm install and build
run: |
npm install -g pnpm
pnpm install --registry https://registry.npmmirror.com --dir ./frontend
echo "Build frontend..."
cd ./frontend && pnpm run build
- name: upload frontend release
uses: actions/upload-artifact@v2
with:
name: frontend-package
path: frontend/dist
release:
needs: [frontend-builder]
name: release
runs-on: ubuntu-latest
steps:
- name: SetOutput #处理Tag字符串并存进outputs
id: vars
run: |
echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
- name: Checkout #Checkout代码
uses: actions/checkout@v3
- name: download frontend release
uses: actions/download-artifact@v2
with:
name: frontend-package
path: frontend/dist
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21.1'
- name: Go tidy
run: |
go mod tidy
echo "GOVERSION=$(go version)" >> $GITHUB_ENV
- name: Create archives on Release #创建各种系统架构下的二进制包并上传至release assets
uses: goreleaser/[email protected]
with:
version: 1.9.2
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-push:
needs: [frontend-builder]
name: docker-push
runs-on: ubuntu-latest
steps:
- name: SetOutput
id: vars
run: echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3

- name: download frontend release
uses: actions/download-artifact@v2
with:
name: frontend-package
path: frontend/dist
- name: Login Docker #登录docker
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: build
run: cd scripts && ./docker_publish.sh ${{ secrets.DOCKER_USERNAME }} "backend"

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.DS_Store
/.idea/
/config.yml
/build/
/apipark
4 changes: 2 additions & 2 deletions controller/dynamic-module/dynamic-module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type IDynamicModuleController interface {
List(ctx *gin.Context, module string, keyword string, cluster string, page string, pageSize string) ([]map[string]interface{}, *dynamic_module_dto.PluginInfo, int64, error)
Render(ctx *gin.Context, module string) (*dynamic_module_dto.PluginBasic, map[string]interface{}, error)
ModuleDrivers(ctx *gin.Context, group string) ([]*dynamic_module_dto.ModuleDriver, error)
Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error
Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error
Online(ctx *gin.Context, module string, id string) error
Offline(ctx *gin.Context, module string, id string) error
//PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error)
//PartitionStatus(ctx *gin.Context, module string, id string) (*dynamic_module_dto.OnlineInfo, error)
}
Expand Down
8 changes: 4 additions & 4 deletions controller/dynamic-module/iml.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type imlDynamicModuleController struct {
module dynamic_module.IDynamicModuleModule `autowired:""`
}

func (i *imlDynamicModuleController) Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error {
return i.module.Online(ctx, module, id, partitionInput)
func (i *imlDynamicModuleController) Online(ctx *gin.Context, module string, id string) error {
return i.module.Online(ctx, module, id)
}

func (i *imlDynamicModuleController) Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error {
return i.module.Offline(ctx, module, id, partitionInput)
func (i *imlDynamicModuleController) Offline(ctx *gin.Context, module string, id string) error {
return i.module.Offline(ctx, module, id)
}

//func (i *imlDynamicModuleController) PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error) {
Expand Down
10 changes: 7 additions & 3 deletions controller/my_team/iml.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ type imlTeamController struct {
module my_team.ITeamModule `autowired:""`
}

func (c *imlTeamController) SimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error) {
return c.module.SimpleTeams(ctx, keyword)
}

func (c *imlTeamController) UpdateMemberRole(ctx *gin.Context, id string, input *team_dto.UpdateMemberRole) error {
return c.module.UpdateMemberRole(ctx, id, input)
}
Expand All @@ -23,16 +27,16 @@ func (c *imlTeamController) GetTeam(ctx *gin.Context, id string) (*team_dto.Team
}

func (c *imlTeamController) Search(ctx *gin.Context, keyword string) ([]*team_dto.Item, error) {

return c.module.Search(ctx, keyword)
}

func (c *imlTeamController) EditTeam(ctx *gin.Context, id string, team *team_dto.EditTeam) (*team_dto.Team, error) {
return c.module.Edit(ctx, id, team)
}

func (c *imlTeamController) SimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error) {
return c.module.SimpleTeams(ctx, keyword)
func (c *imlTeamController) MySimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error) {
return c.module.MySimpleTeams(ctx, keyword)
}

func (c *imlTeamController) AddMember(ctx *gin.Context, id string, users *team_dto.UserIDs) error {
Expand Down
3 changes: 2 additions & 1 deletion controller/my_team/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package my_team

import (
"reflect"

team_dto "github.com/APIParkLab/APIPark/module/my-team/dto"
"github.com/eolinker/go-common/autowire"
"github.com/gin-gonic/gin"
Expand All @@ -13,6 +13,7 @@ type ITeamController interface {
GetTeam(ctx *gin.Context, id string) (*team_dto.Team, error)
Search(ctx *gin.Context, keyword string) ([]*team_dto.Item, error)
EditTeam(ctx *gin.Context, id string, team *team_dto.EditTeam) (*team_dto.Team, error)
MySimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error)
SimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error)
AddMember(ctx *gin.Context, id string, users *team_dto.UserIDs) error
RemoveMember(ctx *gin.Context, id string, uuid string) error
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@vitejs/plugin-react": "^4.2.0",
"autoprefixer": "^10.4.16",
"dayjs": "^1.11.10",
"dompurify": "^3.1.6",
"js-base64": "^3.7.5",
"moment": "^2.29.4",
"postcss": "^8.4.31",
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/businessEntry/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@businessEntry/*": ["./src/*"],
},
},
"include": ["src", "public/iconpark_eolink.js", "public/iconpark_apinto.js", "../common/src/component/aoplatform/EditableTableWithModal.tsx", "../common/src/components/aoplatform/TransferTable.tsx", "../common/src/components/aoplatform/TreeWithMore.tsx", "../common/src/components/aoplatform/DatePicker.tsx", "../common/src/components/aoplatform/TimeRangeSelector.tsx", "../common/src/components/aoplatform/TimePicker.tsx", "../common/src/components/aoplatform/MemberTransfer.tsx", "../common/src/components/aoplatform/Navigation.tsx", "../common/src/components/aoplatform/PageList.tsx", "../common/src/components/aoplatform/GroupTree.tsx", "../common/src/components/aoplatform/ErrorBoundary.tsx", "../common/src/components/aoplatform/ScrollableSection.tsx", "../common/src/utils/postcat.tsx", "../common/src/utils/curl.ts", "../common/src/components/aoplatform/ResetPsw.tsx", "../common/src/components/aoplatform/SubscribeApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePageForHub.tsx", "src/components/aoplatform/RenderRoutes.tsx", "../common/src/components/aoplatform/PublishApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePage.tsx", "../common/src/const/type.ts", "../common/src/components/aoplatform/intelligent-plugin", "../common/src/const/domain"],
"include": ["src", "public/iconpark_eolink.js", "public/iconpark_apinto.js", "../common/src/component/aoplatform/EditableTableWithModal.tsx", "../common/src/components/aoplatform/TransferTable.tsx", "../common/src/components/aoplatform/TreeWithMore.tsx", "../common/src/components/aoplatform/DatePicker.tsx", "../common/src/components/aoplatform/TimeRangeSelector.tsx", "../common/src/components/aoplatform/TimePicker.tsx", "../common/src/components/aoplatform/MemberTransfer.tsx", "../common/src/components/aoplatform/Navigation.tsx", "../common/src/components/aoplatform/PageList.tsx", "../common/src/components/aoplatform/GroupTree.tsx", "../common/src/components/aoplatform/ErrorBoundary.tsx", "../common/src/components/aoplatform/ScrollableSection.tsx", "../common/src/utils/postcat.tsx", "../common/src/utils/curl.ts", "../common/src/components/aoplatform/ResetPsw.tsx", "../common/src/components/aoplatform/SubscribeApprovalModalContent.tsx", "src/components/aoplatform/RenderRoutes.tsx", "../common/src/components/aoplatform/PublishApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePage.tsx", "../common/src/const/type.ts", "../common/src/components/aoplatform/intelligent-plugin", "../common/src/const/domain"],
"references": [{ "path": "./tsconfig.node.json" }]
}
17 changes: 0 additions & 17 deletions frontend/packages/common/src/assets/avatar_default.svg

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/packages/common/src/assets/layout-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/packages/common/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 92a3abe

Please sign in to comment.