├── .dockerignore ├── .husky └── pre-commit ├── .yamllint ├── docs └── en │ ├── assets │ └── development │ │ ├── env-is-ready.png │ │ ├── reopen-in-container.png │ │ └── command-reopen-in-container.png │ └── development.md ├── tsconfig.json ├── NOTICE ├── netlify.toml ├── .github ├── semantic.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature-request.md │ └── bug_report.yml ├── workflows │ ├── license-checker.yml │ └── gitleaks.yml ├── PULL_REQUEST_TEMPLATE └── dependabot.yml ├── .devcontainer ├── docker-compose.override.yml ├── docker-compose.yml ├── Dockerfile └── devcontainer.json ├── src ├── components │ ├── form-slice │ │ ├── FormSection │ │ │ └── style.module.css │ │ ├── FormPartService │ │ │ └── schema.ts │ │ ├── FormPartGlobalRules.tsx │ │ ├── FormPartUpstream │ │ │ ├── schema.ts │ │ │ ├── util.ts │ │ │ └── FormSectionDiscovery.tsx │ │ ├── FormPartPluginConfig.tsx │ │ ├── FormPartStreamRoute │ │ │ └── schema.ts │ │ ├── FormPartCredential.tsx │ │ ├── FormDisplayDate.tsx │ │ ├── FormPartRoute │ │ │ ├── schema.ts │ │ │ └── util.ts │ │ ├── FormPartSSL │ │ │ └── schema.ts │ │ ├── FormPartProto.tsx │ │ └── FormPartConsumer.tsx │ ├── Btn.tsx │ ├── form │ │ ├── Btn.tsx │ │ ├── util.ts │ │ ├── TextInput.tsx │ │ ├── TextArray.tsx │ │ ├── Switch.tsx │ │ ├── Textarea.tsx │ │ ├── NumberInput.tsx │ │ ├── PasswordInput.tsx │ │ ├── TagInput.tsx │ │ └── Select.tsx │ ├── Header │ │ ├── SettingModalBtn.tsx │ │ └── index.tsx │ ├── page-slice │ │ ├── stream_routes │ │ │ └── ErrorComponent.tsx │ │ └── consumers │ │ │ └── DetailCredentialsTabs.tsx │ ├── page │ │ ├── PageHeader.tsx │ │ ├── Tabs.tsx │ │ ├── ToAddPageBtn.tsx │ │ └── SettingsModal.tsx │ └── Navbar.tsx ├── assets │ └── apisix-logo.svg ├── types │ ├── router.d.ts │ ├── i18next.d.ts │ ├── schema │ │ ├── apisix │ │ │ ├── protos.ts │ │ │ ├── consumer_groups.ts │ │ │ ├── global_rules.ts │ │ │ ├── plugin_metadata.ts │ │ │ ├── plugin_configs.ts │ │ │ ├── credentials.ts │ │ │ ├── consumers.ts │ │ │ ├── plugins.ts │ │ │ ├── services.ts │ │ │ ├── common.ts │ │ │ ├── ssls.ts │ │ │ ├── routes.ts │ │ │ ├── index.ts │ │ │ ├── stream_routes.ts │ │ │ └── secrets.ts │ │ └── pageSearch.ts │ └── vite-env.d.ts ├── routes │ ├── index.tsx │ ├── consumers │ │ └── detail.$username.tsx │ ├── plugin_metadata │ │ └── index.tsx │ ├── services │ │ └── detail.$id │ │ │ ├── routes │ │ │ ├── detail.$routeId.tsx │ │ │ ├── add.tsx │ │ │ └── index.tsx │ │ │ └── stream_routes │ │ │ ├── detail.$routeId.tsx │ │ │ └── add.tsx │ └── __root.tsx ├── stores │ └── global.ts ├── config │ ├── global.ts │ ├── antdConfigProvider.tsx │ ├── i18n.ts │ ├── constant.ts │ └── navRoutes.ts ├── utils │ ├── useNamePrefix.ts │ ├── form-context.ts │ ├── monaco.ts │ ├── form-producer.ts │ ├── zod.ts │ ├── useSearchParams.ts │ ├── useTablePagination.ts │ └── producer.ts ├── styles │ └── global.css ├── apis │ ├── global_rules.ts │ ├── plugin_configs.ts │ ├── protos.ts │ ├── consumers.ts │ ├── credentials.ts │ ├── consumer_groups.ts │ └── ssls.ts └── main.tsx ├── .gitmodules ├── index.html ├── .gitignore ├── e2e ├── tsconfig.json ├── pom │ ├── type.ts │ ├── plugin_metadata.ts │ ├── ssls.ts │ ├── protos.ts │ ├── routes.ts │ ├── secrets.ts │ ├── upstreams.ts │ ├── consumers.ts │ ├── stream_routes.ts │ ├── global_rules.ts │ ├── consumer_groups.ts │ └── plugin_configs.ts ├── utils │ ├── ui │ │ ├── routes.ts │ │ └── labels.ts │ ├── env.ts │ └── common.ts └── server │ ├── Dockerfile │ ├── docker-compose.yml │ └── apisix_conf.yml ├── .licenserc.yaml ├── tsconfig.node.json ├── .actions └── ASFLicenseHeader.txt ├── tsconfig.app.json ├── .vscode └── settings.json ├── .markdownlint.yml ├── README.md ├── .asf.yaml └── playwright.config.ts /.dockerignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | pnpm lint-staged 2 | git update-index --again 3 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | extends: default 4 | 5 | rules: 6 | document-start: false 7 | line-length: false 8 | truthy: false 9 | -------------------------------------------------------------------------------- /docs/en/assets/development/env-is-ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix-dashboard/HEAD/docs/en/assets/development/env-is-ready.png -------------------------------------------------------------------------------- /docs/en/assets/development/reopen-in-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix-dashboard/HEAD/docs/en/assets/development/reopen-in-container.png -------------------------------------------------------------------------------- /docs/en/assets/development/command-reopen-in-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix-dashboard/HEAD/docs/en/assets/development/command-reopen-in-container.png -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { "path": "./tsconfig.app.json" }, 5 | { 6 | "path": "./tsconfig.node.json" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache APISIX 2 | Copyright 2019-2023 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [[redirects]] 2 | from = "/apisix/*" 3 | to = "http://139.217.190.60/apisix/:splat" 4 | status = 200 5 | 6 | [[redirects]] 7 | from = "/*" 8 | to = "/index.html" 9 | status = 200 10 | -------------------------------------------------------------------------------- /.github/semantic.yml: -------------------------------------------------------------------------------- 1 | titleOnly: true 2 | types: 3 | - feat 4 | - fix 5 | - docs 6 | - style 7 | - refactor 8 | - perf 9 | - test 10 | - build 11 | - ci 12 | - chore 13 | - revert 14 | - change 15 | - backport 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Visit Apache APISIX 4 | url: https://github.com/apache/apisix 5 | about: Ask questions or discuss with other community members about Apache APISIX 6 | -------------------------------------------------------------------------------- /.devcontainer/docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | services: 2 | apisix: 3 | ports: 4 | - '9180:9180/tcp' 5 | - '9080:9080/tcp' 6 | - '9091:9091/tcp' 7 | - '9443:9443/tcp' 8 | etcd: 9 | ports: 10 | - '2379:2379/tcp' 11 | -------------------------------------------------------------------------------- /src/components/form-slice/FormSection/style.module.css: -------------------------------------------------------------------------------- 1 | .root { 2 | margin-block: var(--mantine-font-size-md, 0); 3 | scroll-margin-top: calc(var(--appshell-header-height, 60px) + 20px); 4 | 5 | & > fieldset { 6 | margin-bottom: 0; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".github/actions/gitleaks-action"] 2 | path = .github/actions/gitleaks-action 3 | url = https://github.com/zricethezav/gitleaks-action 4 | [submodule ".github/actions/paths-filter"] 5 | path = .github/actions/paths-filter 6 | url = https://github.com/dorny/paths-filter.git 7 | [submodule ".github/actions/tmate-action"] 8 | path = .github/actions/tmate-action 9 | url = https://github.com/mxschmitt/action-tmate 10 | -------------------------------------------------------------------------------- /.devcontainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - path: 3 | - ../e2e/server/docker-compose.yml 4 | - docker-compose.override.yml 5 | services: 6 | apisix-dashboard: 7 | build: 8 | context: .. 9 | dockerfile: .devcontainer/Dockerfile 10 | command: sleep infinity 11 | volumes: 12 | - ..:/workspace:cached 13 | networks: 14 | - apisix 15 | ports: 16 | - '5173:5173' 17 | - '5174:5174' 18 | -------------------------------------------------------------------------------- /.github/workflows/license-checker.yml: -------------------------------------------------------------------------------- 1 | name: License checker 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | check-license: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v6 17 | 18 | - name: Check License Header 19 | uses: apache/skywalking-eyes/header@13c0e5b2689ef8f93eb4b7990b04c72fc293bb4f 20 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Apache APISIX Dashboard 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | /.pnpm-store 27 | 28 | # Playwright 29 | /test-results/ 30 | /playwright-report/ 31 | /blob-report/ 32 | /playwright/.cache/ 33 | 34 | .eslintcache 35 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VARIANT=22 2 | FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT} 3 | 4 | # [Optional] Uncomment this section to install additional OS packages. 5 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 6 | # && apt-get -y install --no-install-recommends 7 | 8 | # [Optional] Uncomment if you want to install an additional version of node using nvm 9 | # ARG EXTRA_NODE_VERSION=10 10 | # RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" 11 | 12 | # [Optional] Uncomment if you want to install more global node modules 13 | # RUN su node -c "npm install -g " 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Create a feature request for the Apache APISIX Dashboard 4 | labels: 'feature' 5 | --- 6 | 7 | # Feature request 8 | 9 | ## Please describe your feature 10 | 11 | A clear and concise description of what you want and what your use case is. 12 | 13 | ## Describe the solution you'd like 14 | 15 | A clear and concise description of what you want to happen. 16 | 17 | ## Describe alternatives you've considered 18 | 19 | A clear and concise description of any alternative solutions or features you've considered. 20 | 21 | ## Additional context 22 | 23 | Add any other context or screenshots about the feature request here. 24 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es2021", 5 | "dom" 6 | ], 7 | "allowJs": true, 8 | "sourceMap": false, 9 | "target": "ESNext", 10 | "module": "ESNext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "baseUrl": ".", 14 | "allowSyntheticDefaultImports": true, 15 | "esModuleInterop": true, 16 | "skipLibCheck": true, 17 | "noImplicitAny": false, 18 | "verbatimModuleSyntax": true, 19 | "paths": { 20 | "@e2e/*": [ 21 | "./*" 22 | ], 23 | "@/*": [ 24 | "../src/*" 25 | ] 26 | } 27 | }, 28 | "include": [ 29 | "./**/*.ts", 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /.licenserc.yaml: -------------------------------------------------------------------------------- 1 | header: 2 | license: 3 | spdx-id: Apache-2.0 4 | copyright-owner: Apache Software Foundation 5 | 6 | paths-ignore: 7 | - 'dist' 8 | - 'licenses' 9 | - '**/*.md' 10 | - 'LICENSE' 11 | - 'NOTICE' 12 | - '**/*.css' 13 | - '**/*.html' 14 | - '**/*.json' 15 | - '**/*.toml' 16 | - '**/*.yaml' 17 | - 'src/assets/**' 18 | - '.actions/**' 19 | - '.devcontainer/**' 20 | - '.github/**' 21 | - '.husky/**' 22 | - '.vscode/**' 23 | - '.dockerignore' 24 | - '.gitignore' 25 | - '.gitmodules' 26 | - '.yamllint' 27 | - 'eslint.config.js' 28 | - 'src/routeTree.gen.ts' 29 | 30 | comment: on-failure 31 | 32 | dependency: 33 | files: 34 | - package.json 35 | -------------------------------------------------------------------------------- /.github/workflows/gitleaks.yml: -------------------------------------------------------------------------------- 1 | # Scan git repos (or files) for secrets using regex and entropy 🔑 2 | 3 | name: gitLeaks 4 | 5 | on: 6 | push: 7 | branches: 8 | - master 9 | paths-ignore: 10 | - 'docs/**' 11 | pull_request: 12 | branches: 13 | - master 14 | paths-ignore: 15 | - 'docs/**' 16 | 17 | jobs: 18 | gitleaks: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v6 22 | with: 23 | fetch-depth: '1' 24 | submodules: recursive 25 | - name: wget 26 | shell: bash 27 | run: | 28 | wget https://raw.githubusercontent.com/ycjcl868/gitleaks/master/.gitleaks.toml 29 | - name: gitleaks-action 30 | uses: ./.github/actions/gitleaks-action 31 | -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 4 | "target": "ES2022", 5 | "lib": ["ES2023"], 6 | "module": "ESNext", 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "isolatedModules": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "noFallthroughCasesInSwitch": true, 21 | "noUncheckedSideEffectImports": true, 22 | "types": [ 23 | "node" 24 | ], 25 | }, 26 | "include": ["vite.config.ts", "vite-plugin-i18n-progress.ts"] 27 | } 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | Please answer these questions before submitting a pull request, **or your PR will get closed**. 2 | 3 | **Why submit this pull request?** 4 | 5 | - [ ] Bugfix 6 | - [ ] New feature provided 7 | - [ ] Improve performance 8 | - [ ] Backport patches 9 | 10 | **What changes will this PR take into?** 11 | 12 | Please update this section with detailed description. 13 | 14 | **Related issues** 15 | 16 | fix/resolve #0001 17 | 18 | **Checklist:** 19 | 20 | - [ ] Did you explain what problem does this PR solve? Or what new features have been added? 21 | - [ ] Have you added corresponding test cases? 22 | - [ ] Have you modified the corresponding document? 23 | - [ ] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first 24 | -------------------------------------------------------------------------------- /.actions/ASFLicenseHeader.txt: -------------------------------------------------------------------------------- 1 | Licensed to the Apache Software Foundation (ASF) under one or more 2 | contributor license agreements. See the NOTICE file distributed with 3 | this work for additional information regarding copyright ownership. 4 | The ASF licenses this file to You under the Apache License, Version 2.0 5 | (the "License"); you may not use this file except in compliance with 6 | the License. You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | 13 | - package-ecosystem: "npm" # See documentation for possible values 14 | directory: "/" # Location of package manifests 15 | schedule: 16 | interval: "daily" 17 | 18 | - package-ecosystem: "gomod" # See documentation for possible values 19 | directory: "/" # Location of package manifests 20 | schedule: 21 | interval: "daily" 22 | -------------------------------------------------------------------------------- /src/assets/apisix-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 4 | "target": "ES2020", 5 | "useDefineForClassFields": true, 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "module": "ESNext", 8 | "skipLibCheck": true, 9 | 10 | /* Bundler mode */ 11 | "moduleResolution": "bundler", 12 | "allowImportingTsExtensions": true, 13 | "isolatedModules": true, 14 | "moduleDetection": "force", 15 | "noEmit": true, 16 | "jsx": "react-jsx", 17 | 18 | /* Linting */ 19 | "strict": true, 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "noFallthroughCasesInSwitch": true, 23 | "noUncheckedSideEffectImports": true, 24 | "verbatimModuleSyntax": true, 25 | "paths": { 26 | "@/*": [ 27 | "./src/*" 28 | ], 29 | }, 30 | "types": [ 31 | "unplugin-icons/types/react", 32 | ] 33 | }, 34 | "include": [ 35 | "src", 36 | "e2e/utils/env.ts" 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "typescriptreact", 4 | "typescript", 5 | ], 6 | "files.readonlyInclude": { 7 | "**/routeTree.gen.ts": true 8 | }, 9 | "files.watcherExclude": { 10 | "**/routeTree.gen.ts": true 11 | }, 12 | "search.exclude": { 13 | "**/routeTree.gen.ts": true 14 | }, 15 | "cssVariables.lookupFiles": [ 16 | "**/*.css", 17 | "**/*.scss", 18 | "**/*.sass", 19 | "**/*.less", 20 | "node_modules/@mantine/core/styles.css" 21 | ], 22 | "i18n-ally.sortKeys": true, 23 | "i18n-ally.localesPaths": [ 24 | "src/locales", 25 | ], 26 | "i18n-ally.keystyle": "nested", 27 | "i18n-ally.enabledFrameworks": [ 28 | "react-i18next" 29 | ], 30 | "i18n-ally.pathMatcher": "{locale}/{namespaces}.json", 31 | "i18n-ally.editor.preferEditor": true, 32 | "i18n-ally.translate.saveAsCandidates": true, 33 | "typescript.tsdk": "node_modules/typescript/lib", 34 | "editor.codeActionsOnSave": { 35 | "source.fixAll.eslint": "always" 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /src/types/router.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { router } from '@/config/global'; 18 | 19 | declare module '@tanstack/react-router' { 20 | interface Register { 21 | router: typeof router; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | MD001: false 19 | MD004: false 20 | MD013: false 21 | MD014: false 22 | MD024: false 23 | MD026: false 24 | MD029: false 25 | MD033: false 26 | MD034: false 27 | MD040: false 28 | MD041: false 29 | -------------------------------------------------------------------------------- /src/types/i18next.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { defaultNS,Resources } from '@/config/i18n'; 18 | 19 | declare module 'i18next' { 20 | interface CustomTypeOptions { 21 | defaultNS: typeof defaultNS; 22 | resources: Resources['en']; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/components/form-slice/FormPartService/schema.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import type { z } from 'zod'; 18 | 19 | import { APISIXServices } from '@/types/schema/apisix/services'; 20 | 21 | export const ServicePostSchema = APISIXServices.ServicePost; 22 | 23 | export type ServicePostType = z.infer; 24 | -------------------------------------------------------------------------------- /src/routes/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { createFileRoute, redirect } from '@tanstack/react-router'; 18 | 19 | import { navRoutes } from '@/config/navRoutes'; 20 | 21 | export const Route = createFileRoute('/')({ 22 | beforeLoad: () => { 23 | return redirect({ 24 | to: navRoutes[0].to, 25 | }); 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /src/types/schema/apisix/protos.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { z } from 'zod'; 18 | 19 | import { APISIXCommon } from './common'; 20 | 21 | const Proto = z 22 | .object({ 23 | content: z.string(), 24 | }) 25 | .merge(APISIXCommon.Info); 26 | 27 | export const APISIXProtos = { 28 | Proto, 29 | ProtoPost: Proto.omit({ id: true, create_time: true, update_time: true }), 30 | }; 31 | -------------------------------------------------------------------------------- /src/types/schema/apisix/consumer_groups.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { APISIXPluginConfigs } from './plugin_configs'; 18 | 19 | const ConsumerGroup = APISIXPluginConfigs.PluginConfig.omit({ name: true }); 20 | 21 | export const APISIXConsumerGroups = { 22 | ConsumerGroup, 23 | ConsumerGroupPut: ConsumerGroup.omit({ 24 | create_time: true, 25 | update_time: true, 26 | }), 27 | }; 28 | -------------------------------------------------------------------------------- /src/components/form-slice/FormPartGlobalRules.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { t } from 'i18next'; 18 | 19 | import { FormItemPlugins } from './FormItemPlugins'; 20 | import { FormSection } from './FormSection'; 21 | 22 | export const FormPartGlobalRules = () => { 23 | return ( 24 | 25 | 26 | 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /src/stores/global.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { atom } from 'jotai'; 18 | import { atomWithStorage } from 'jotai/utils'; 19 | 20 | // Admin key with persistent storage 21 | export const adminKeyAtom = atomWithStorage( 22 | 'settings:adminKey', 23 | '', 24 | undefined, 25 | { 26 | getOnInit: true, 27 | } 28 | ); 29 | 30 | // Settings modal visibility state 31 | export const isSettingsOpenAtom = atom(false); 32 | -------------------------------------------------------------------------------- /src/types/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | /// 18 | /// 19 | 20 | declare module 'virtual:i18n-progress' { 21 | const progress: import('./../../vite-plugin-i18n-progress').LangProgress; 22 | export default progress; 23 | } 24 | 25 | type FilterKeys = { 26 | [K in keyof T as K extends `${string}${R}` ? K : never]: T[K]; 27 | }; 28 | -------------------------------------------------------------------------------- /src/config/global.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { QueryClient } from '@tanstack/react-query'; 18 | import { createRouter } from '@tanstack/react-router'; 19 | 20 | import { routeTree } from '@/routeTree.gen'; 21 | 22 | import { BASE_PATH } from './constant'; 23 | 24 | export const router = createRouter({ routeTree, basepath: BASE_PATH }); 25 | 26 | export type Router = typeof router; 27 | 28 | export const queryClient = new QueryClient({}); 29 | -------------------------------------------------------------------------------- /src/utils/useNamePrefix.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { createContext, useContext } from 'react'; 18 | 19 | const NamePrefixContext = createContext(''); 20 | 21 | export const useNamePrefix = () => { 22 | const prefix = useContext(NamePrefixContext) || ''; 23 | return (name: T) => 24 | (prefix ? [prefix, name].join('.') : name) as `${T}`; 25 | }; 26 | 27 | export const NamePrefixProvider = NamePrefixContext.Provider; 28 | -------------------------------------------------------------------------------- /src/types/schema/apisix/global_rules.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { z } from 'zod'; 18 | 19 | import { APISIXCommon } from './common'; 20 | import { APISIXPlugins } from './plugins'; 21 | 22 | const GlobalRule = z 23 | .object({ 24 | plugins: APISIXPlugins.Plugins, 25 | }) 26 | .merge(APISIXCommon.Info); 27 | 28 | export const APISIXGlobalRules = { 29 | GlobalRule, 30 | GlobalRulePut: GlobalRule.omit({ 31 | create_time: true, 32 | update_time: true, 33 | }), 34 | }; 35 | -------------------------------------------------------------------------------- /src/utils/form-context.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { createContext, use } from 'react'; 18 | 19 | import type { RoutePostType } from '../components/form-slice/FormPartRoute/schema'; 20 | 21 | export const CommonFormContext = createContext<{ 22 | readOnlyFields: (keyof RoutePostType)[]; 23 | }>({ 24 | readOnlyFields: [], 25 | }); 26 | 27 | export const useFormReadOnlyFields = () => { 28 | const { readOnlyFields } = use(CommonFormContext); 29 | return readOnlyFields || []; 30 | }; 31 | -------------------------------------------------------------------------------- /src/types/schema/apisix/plugin_metadata.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { APISIXCommon } from './common'; 18 | import { APISIXPlugins } from './plugins'; 19 | 20 | const PluginMetadata = APISIXPlugins.PluginMetadataSchema.merge( 21 | APISIXCommon.Info 22 | ).omit({ 23 | id: true, 24 | }); 25 | 26 | export const APISIXPluginMetadata = { 27 | PluginMetadata: PluginMetadata, 28 | PluginMetadataPut: PluginMetadata.omit({ 29 | create_time: true, 30 | update_time: true, 31 | }), 32 | }; 33 | -------------------------------------------------------------------------------- /src/components/Btn.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { Button, type ButtonProps } from '@mantine/core'; 18 | import { createLink } from '@tanstack/react-router'; 19 | import { forwardRef } from 'react'; 20 | 21 | const MantineBtnLinkComponent = forwardRef( 22 | (props, ref) => { 23 | return