Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat(frontend): migrate workspace subscription page to React (#19750)

Danny Xu6313e2efef69
diff --git a/frontend/.gitignore b/frontend/.gitignore
index 5f52ec2b9a..9f58ea1be1 100644
--- a/frontend/.gitignore
+++ b/frontend/.gitignore
@@ -3,6 +3,9 @@
node_modules
/dist
components.d.ts
+# Generated by vue-tsc --build (composite mode)
+src/react/**/*.d.ts
+!src/react/react-env.d.ts
src/types/plan.yaml
src/types/iam/*.yaml
src/types/iam/permission-generated.ts
diff --git a/frontend/package.json b/frontend/package.json
index c1d70c7259..c671a6c6ad 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -13,7 +13,7 @@
"fix": "eslint --cache --fix src && biome check --write .",
"bundle-visualize": "export NODE_OPTIONS=--max_old_space_size=80000 && vite-bundle-visualizer -c vite.config.ts",
"pretype-check": "pnpm run prepare:artifacts",
- "type-check": "export NODE_OPTIONS=--max_old_space_size=8000 && vue-tsc --build --force",
+ "type-check": "export NODE_OPTIONS=--max_old_space_size=8000 && vue-tsc --build --force && tsc --project tsconfig.react.json --noEmit",
"pretest": "pnpm run prepare:artifacts",
"test": "vitest run --passWithNoTests",
"precoverage": "pnpm run prepare:artifacts",
@@ -22,6 +22,7 @@
"generate:openapi-index": "node scripts/generate_openapi_index.js"
},
"dependencies": {
+ "@base-ui/react": "^1.3.0",
"@buf/googleapis_googleapis.bufbuild_es": "2.10.2-20251126203132-004180b77378.1",
"@bufbuild/protobuf": "2.11.0",
"@codingame/monaco-vscode-api": "26.2.1",
@@ -48,11 +49,13 @@
"highlight.js": "11.11.1",
"html-query-plan": "^2.6.1",
"html-to-image": "^1.11.13",
+ "i18next": "^25.10.10",
"is-chinese": "^2.0.0",
"js-yaml": "4.1.1",
"jszip": "^3.10.1",
"lodash-es": "4.17.23",
"lossless-json": "^4.3.0",
+ "lucide-react": "^1.7.0",
"lucide-static": "^0.577.0",
"lucide-vue-next": "^0.577.0",
"markdown-it": "^14.1.0",
@@ -65,6 +68,9 @@
"pouchdb": "^9.0.0",
"pouchdb-find": "^9.0.0",
"qs": "6.15.0",
+ "react": "^19.2.4",
+ "react-dom": "^19.2.4",
+ "react-i18next": "^16.6.6",
"regenerator-runtime": "^0.14.1",
"rxjs": "^7.8.2",
"scroll-into-view-if-needed": "^3.1.0",
@@ -107,6 +113,8 @@
"@types/pouchdb": "^6.4.2",
"@types/pouchdb-find": "^7.3.3",
"@types/qs": "6.14.0",
+ "@types/react": "^19.2.14",
+ "@types/react-dom": "^19.2.3",
"@types/scrollparent": "^2.0.3",
"@types/semver": "7.7.1",
"@types/slug": "5.0.9",
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
index af7ec1bd55..76cfbefd1a 100644
--- a/frontend/pnpm-lock.yaml
+++ b/frontend/pnpm-lock.yaml
@@ -15,6 +15,9 @@ importers:
.:
dependencies:
+ '@base-ui/react':
+ specifier: ^1.3.0
'@buf/googleapis_googleapis.bufbuild_es':
specifier: 2.10.2-20251126203132-004180b77378.1
version: 2.10.2-20251126203132-004180b77378.1(@bufbuild/[email protected])
@@ -50,7 +53,7 @@ importers:
version: 2.1.1(@bufbuild/[email protected])(@connectrpc/[email protected](@bufbuild/[email protected]))
'@markdoc/markdoc':
specifier: 0.5.5
- version: 0.5.5
+ version: 0.5.5(@types/[email protected])([email protected])
'@vueuse/core':
specifier: 14.2.1
@@ -93,6 +96,9 @@ importers:
html-to-image:
specifier: ^1.11.13
version: 1.11.13
+ i18next:
+ specifier: ^25.10.10
+ version: 25.10.10([email protected])
is-chinese:
specifier: ^2.0.0
version: 2.0.0
@@ -108,6 +114,9 @@ importers:
lossless-json:
specifier: ^4.3.0
version: 4.3.0
+ lucide-react:
+ specifier: ^1.7.0
+ version: 1.7.0([email protected])
lucide-static:
specifier: ^0.577.0
version: 0.577.0
@@ -131,7 +140,7 @@ importers:
version: 1.0.1
pev2:
specifier: 1.20.2
- version: 1.20.2(@popperjs/[email protected])([email protected])
pinia:
specifier: 3.0.4
@@ -144,6 +153,15 @@ importers:
qs:
specifier: 6.15.0
version: 6.15.0
+ react:
+ specifier: ^19.2.4
+ version: 19.2.4
+ react-dom:
+ specifier: ^19.2.4
+ version: 19.2.4([email protected])
+ react-i18next:
+ specifier: ^16.6.6
regenerator-runtime:
specifier: ^0.14.1
version: 0.14.1
@@ -265,6 +283,12 @@ importers:
'@types/qs':
specifier: 6.14.0
version: 6.14.0
+ '@types/react':
+ specifier: ^19.2.14
+ version: 19.2.14
+ '@types/react-dom':
+ specifier: ^19.2.3
+ version: 19.2.3(@types/[email protected])
'@types/scrollparent':
specifier: ^2.0.3
version: 2.0.3
@@ -901,6 +925,10 @@ packages:
resolution: {integrity: sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==}
engines: {node: '>=6.9.0'}
@@ -913,6 +941,27 @@ packages:
resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
engines: {node: '>=6.9.0'}
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-FwpKqZbPz14AITp1CVgf4AjhKPe1OeeVKSBMdgD10zbFlj3QSWelmtCMLi2+/PFZZcIm3l87G7rwtCZJwHyXWA==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ '@types/react': ^17 || ^18 || ^19
+ react: ^17 || ^18 || ^19
+ react-dom: ^17 || ^18 || ^19
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-yQ+qeuqohwhsNpoYDqqXaLllYAkPCP4vYdDrVo8FQXaAPfHWm1pG/Vm+jmGTA5JFS0BAIjookyapuJFY8F9PIw==}
+ peerDependencies:
+ '@types/react': ^17 || ^18 || ^19
+ react: ^17 || ^18 || ^19
+ react-dom: ^17 || ^18 || ^19
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
'@biomejs/[email protected]':
resolution: {integrity: sha512-QnHe81PMslpy3mnpL8DnO2M4S4ZnYPkjlGCLWBZT/3R9M6b5daArWMMtEfP52/n174RKnwRIf3oT8+wc9ihSfQ==}
engines: {node: '>=14.21.3'}
@@ -935,24 +984,28 @@ packages:
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
+ libc: [musl]
'@biomejs/[email protected]':
resolution: {integrity: sha512-kMLaI7OF5GN1Q8Doymjro1P8rVEoy7BKQALNz6fiR8IC1WKduoNyteBtJlHT7ASIL0Cx2jR6VUOBIbcB1B8pew==}
engines: {node: '>=14.21.3'}
cpu: [arm64]
os: [linux]
+ libc: [glibc]
'@biomejs/[email protected]':
resolution: {integrity: sha512-C9s98IPDu7DYarjlZNuzJKTjVHN03RUnmHV5htvqsx6vEUXCDSJ59DNwjKVD5XYoSS4N+BYhq3RTBAL8X6svEg==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
+ libc: [musl]
'@biomejs/[email protected]':
resolution: {integrity: sha512-oHXmUFEoH8Lql1xfc3QkFLiC1hGR7qedv5eKNlC185or+o4/4HiaU7vYODAH3peRCfsuLr1g6v2fK9dFFOYdyw==}
engines: {node: '>=14.21.3'}
cpu: [x64]
os: [linux]
+ libc: [glibc]
'@biomejs/[email protected]':
resolution: {integrity: sha512-xzThn87Pf3YrOGTEODFGONmqXpTwUNxovQb72iaUOdcw8sBSY3+3WD8Hm9IhMYLnPi0n32s3L3NWU6+eSjfqFg==}
@@ -1584,6 +1637,21 @@ packages:
'@noble/hashes':
optional: true
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==}
+
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==}
+
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==}
+
'@fortawesome/[email protected]':
resolution: {integrity: sha512-Zs+YeHUC5fkt7Mg1l6XTniei3k4bwG/yo3iFUtZWd/pMx9g3fdvkSK9E0FOC+++phXOka78uJcYb8JaFkW52Xg==}
engines: {node: '>=6'}
@@ -1817,66 +1885,79 @@ packages:
resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==}
cpu: [arm]
os: [linux]
+ libc: [glibc]
'@rollup/[email protected]':
resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==}
cpu: [arm]
os: [linux]
+ libc: [musl]
'@rollup/[email protected]':
resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==}
cpu: [arm64]
os: [linux]
+ libc: [glibc]
'@rollup/[email protected]':
resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==}
cpu: [arm64]
os: [linux]
+ libc: [musl]
'@rollup/[email protected]':
resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==}
cpu: [loong64]
os: [linux]
+ libc: [glibc]
'@rollup/[email protected]':
resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==}
cpu: [loong64]
os: [linux]
+ libc: [musl]
'@rollup/[email protected]':
resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==}
cpu: [ppc64]
os: [linux]
+ libc: [glibc]
'@rollup/[email protected]':
resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==}
cpu: [ppc64]
os: [linux]
+ libc: [musl]
'@rollup/[email protected]':
resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==}
cpu: [riscv64]
os: [linux]
+ libc: [glibc]
'@rollup/[email protected]':
resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==}
cpu: [riscv64]
os: [linux]
+ libc: [musl]
'@rollup/[email protected]':
resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==}
cpu: [s390x]
os: [linux]
+ libc: [glibc]
'@rollup/[email protected]':
resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==}
cpu: [x64]
os: [linux]
+ libc: [glibc]
'@rollup/[email protected]':
resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==}
cpu: [x64]
os: [linux]
+ libc: [musl]
'@rollup/[email protected]':
resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==}
@@ -1954,24 +2035,28 @@ packages:
engines: {node: '>= 20'}
cpu: [arm64]
os: [linux]
+ libc: [glibc]
'@tailwindcss/[email protected]':
resolution: {integrity: sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ==}
engines: {node: '>= 20'}
cpu: [arm64]
os: [linux]
+ libc: [musl]
'@tailwindcss/[email protected]':
resolution: {integrity: sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g==}
engines: {node: '>= 20'}
cpu: [x64]
os: [linux]
+ libc: [glibc]
'@tailwindcss/[email protected]':
resolution: {integrity: sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g==}
engines: {node: '>= 20'}
cpu: [x64]
os: [linux]
+ libc: [musl]
'@tailwindcss/[email protected]':
resolution: {integrity: sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q==}
@@ -2152,6 +2237,14 @@ packages:
resolution: {integrity: sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==}
+ peerDependencies:
+ '@types/react': ^19.2.0
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==}
+
resolution: {integrity: sha512-hnZEChVDSDCVngnl8j+Dq0/sOzRuoHyqqR5Wc1dF7TFsWO4uQtIKBkrzTb+lakIH+XrR8mlLMHfWR8hfjqc/WA==}
@@ -3300,6 +3393,9 @@ packages:
resolution: {integrity: sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==}
engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0}
+ resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==}
+
resolution: {integrity: sha512-8LoHDSOFGu4RKXit8we3ydE5W5qJFYg/hKtCfrV+hUnqhOssVDAgaxoJ2NNyF+eDkeXaicbJ/FBhz2/NmI4KuQ==}
@@ -3317,6 +3413,14 @@ packages:
resolution: {integrity: sha512-K7Ny/ULO1hDm2nnhvAY+SJV1skxFb61fd073SG1IWJl+D44ULrruCuTyjHKjBVVcSuTlnY99DKtgEG39CM5QOQ==}
+ resolution: {integrity: sha512-cqUW2Z3EkRx7NqSyywjkgCLK7KLCL6IFVFcONG7nVYIJ3ekZ1/N5jUsihHV6Bq37NfhgtczxJcxduELtjTwkuQ==}
+ peerDependencies:
+ typescript: ^5 || ^6
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
@@ -3600,24 +3704,28 @@ packages:
engines: {node: '>= 12.0.0'}
cpu: [arm64]
os: [linux]
+ libc: [glibc]
resolution: {integrity: sha512-mVZ7Pg2zIbe3XlNbZJdjs86YViQFoJSpc41CbVmKBPiGmC4YrfeOyz65ms2qpAobVd7WQsbW4PdsSJEMymyIMg==}
engines: {node: '>= 12.0.0'}
cpu: [arm64]
os: [linux]
+ libc: [musl]
resolution: {integrity: sha512-xGlFWRMl+0KvUhgySdIaReQdB4FNudfUTARn7q0hh/V67PVGCs3ADFjw+6++kG1RNd0zdGRlEKa+T13/tQjPMA==}
engines: {node: '>= 12.0.0'}
cpu: [x64]
os: [linux]
+ libc: [glibc]
resolution: {integrity: sha512-eowF8PrKHw9LpoZii5tdZwnBcYDxRw2rRCyvAXLi34iyeYfqCQNA9rmUM0ce62NlPhCvof1+9ivRaTY6pSKDaA==}
engines: {node: '>= 12.0.0'}
cpu: [x64]
os: [linux]
+ libc: [musl]
resolution: {integrity: sha512-aJReEbSEQzx1uBlQizAOBSjcmr9dCdL3XuC/6HLXAxmtErsj2ICo5yYggg1qOODQMtnjNQv2UHb9NpOuFtYe4w==}
@@ -3674,6 +3782,11 @@ packages:
resolution: {integrity: sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==}
+ resolution: {integrity: sha512-yI7BeItCLZJTXikmK4KNUGCKoGzSvbKlfCvw44bU4fXAL6v3gYS4uHD1jzsLkfwODYwI6Drw5Tu9Z5ulDe0TSg==}
+ peerDependencies:
+ react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
+
resolution: {integrity: sha512-hx39J5Tq4JWF2ALY+5YRg+SxQLpeAmLJDXNcqiBJH/UuVwp43it9fyki/onZO7AVFgG5ZbB+fWwZR9mwGHE2XQ==}
@@ -4151,6 +4264,31 @@ packages:
resolution: {integrity: sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==}
engines: {node: '>=0.12'}
+ resolution: {integrity: sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==}
+ peerDependencies:
+ react: ^19.2.4
+
+ resolution: {integrity: sha512-ZgL2HUoW34UKUkOV7uSQFE1CDnRPD+tCR3ywSuWH7u2iapnz86U8Bi3Vrs620qNDzCf1F47NxglCEkchCTDOHw==}
+ peerDependencies:
+ i18next: '>= 25.10.9'
+ react: '>= 16.8.0'
+ react-dom: '*'
+ react-native: '*'
+ typescript: ^5 || ^6
+ peerDependenciesMeta:
+ react-dom:
+ optional: true
+ react-native:
+ optional: true
+ typescript:
+ optional: true
+
+ resolution: {integrity: sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-azrivNydKRYt7zwLV5wWUK7YzKTWs3q87xSmY6DlHapPrCvaT6ZrukvM5erV+yCSSPmZT8zkSdttOHQpWWm9zw==}
@@ -4209,6 +4347,9 @@ packages:
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
+ resolution: {integrity: sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==}
+
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
@@ -4272,6 +4413,9 @@ packages:
resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
engines: {node: '>=v12.22.7'}
+ resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==}
+
resolution: {integrity: sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==}
@@ -4422,6 +4566,9 @@ packages:
resolution: {integrity: sha512-Nk8c4lXvMB98MtbmjX7JwJRgJOL8fluecYCfCeYBznwmpOs8Bf15hLM6z4z71EDAhQVrQrI+wt1aLWSXZq+hXA==}
+ resolution: {integrity: sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==}
+
resolution: {integrity: sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==}
@@ -4631,6 +4778,11 @@ packages:
resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
+ resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
@@ -4735,6 +4887,10 @@ packages:
jsdom:
optional: true
+ resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-iox0I3RZzxtKlcgYaStQYKEzWWGAduMmq+jS7OrNdQo1FgGfPMubGL3uGHOU9n97NIvfFDBGnpSvkWyb/NSn/Q==}
peerDependencies:
@@ -5624,6 +5780,8 @@ snapshots:
'@babel/[email protected]': {}
+ '@babel/[email protected]': {}
+
dependencies:
'@babel/code-frame': 7.29.0
@@ -5647,6 +5805,30 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.28.5
+ dependencies:
+ '@babel/runtime': 7.28.6
+ '@floating-ui/react-dom': 2.1.8([email protected]([email protected]))([email protected])
+ '@floating-ui/utils': 0.2.11
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ tabbable: 6.4.0
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.14
+
+ dependencies:
+ '@babel/runtime': 7.28.6
+ '@floating-ui/utils': 0.2.11
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ reselect: 5.1.1
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.14
+
'@biomejs/[email protected]':
optionalDependencies:
'@biomejs/cli-darwin-arm64': 2.4.6
@@ -6258,6 +6440,23 @@ snapshots:
'@exodus/[email protected]': {}
+ '@floating-ui/[email protected]':
+ dependencies:
+ '@floating-ui/utils': 0.2.11
+
+ '@floating-ui/[email protected]':
+ dependencies:
+ '@floating-ui/core': 1.7.5
+ '@floating-ui/utils': 0.2.11
+
+ dependencies:
+ '@floating-ui/dom': 1.7.6
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ '@floating-ui/[email protected]': {}
+
'@fortawesome/[email protected]': {}
'@fortawesome/[email protected]':
@@ -6423,10 +6622,12 @@ snapshots:
'@juggle/[email protected]': {}
- '@markdoc/[email protected]':
optionalDependencies:
'@types/linkify-it': 3.0.5
'@types/markdown-it': 12.2.3
+ '@types/react': 19.2.14
+ react: 19.2.4
'@nodelib/[email protected]':
dependencies:
@@ -6802,6 +7003,14 @@ snapshots:
'@types/[email protected]': {}
+ dependencies:
+ '@types/react': 19.2.14
+
+ '@types/[email protected]':
+ dependencies:
+ csstype: 3.2.3
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -8028,11 +8237,14 @@ snapshots:
dependencies:
motion-dom: 12.34.5
motion-utils: 12.29.2
tslib: 2.8.1
+ optionalDependencies:
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
optional: true
@@ -8108,6 +8320,10 @@ snapshots:
transitivePeerDependencies:
- '@noble/hashes'
+ dependencies:
+ void-elements: 3.1.0
+
@@ -8128,6 +8344,12 @@ snapshots:
+ dependencies:
+ '@babel/runtime': 7.29.2
+ optionalDependencies:
+ typescript: 6.0.2
+
dependencies:
safer-buffer: 2.1.2
@@ -8453,6 +8675,10 @@ snapshots:
+ dependencies:
+ react: 19.2.4
+
@@ -8864,10 +9090,13 @@ snapshots:
dependencies:
- framer-motion: 12.34.5
tslib: 2.8.1
+ optionalDependencies:
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
@@ -8990,7 +9219,7 @@ snapshots:
dependencies:
'@fortawesome/fontawesome-svg-core': 6.7.2
'@fortawesome/free-solid-svg-icons': 6.7.2
@@ -9002,7 +9231,7 @@ snapshots:
highlight.js: 11.11.1
humanize-duration: 3.33.2
lodash: 4.17.23
- motion: 12.34.5
vue: 3.5.29([email protected])
vue-clipboard3: 2.0.0
@@ -9175,6 +9404,24 @@ snapshots:
discontinuous-range: 1.0.0
ret: 0.1.15
+ dependencies:
+ react: 19.2.4
+ scheduler: 0.27.0
+
+ dependencies:
+ '@babel/runtime': 7.29.2
+ html-parse-stringify: 3.0.1
+ i18next: 25.10.10([email protected])
+ react: 19.2.4
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ react-dom: 19.2.4([email protected])
+ typescript: 6.0.2
+
+
@@ -9257,6 +9504,8 @@ snapshots:
+
@@ -9333,6 +9582,8 @@ snapshots:
dependencies:
xmlchars: 2.2.0
+
dependencies:
compute-scroll-into-view: 3.1.1
@@ -9469,6 +9720,8 @@ snapshots:
+
@@ -9678,6 +9931,10 @@ snapshots:
querystringify: 2.2.0
requires-port: 1.0.0
+ dependencies:
+ react: 19.2.4
+
@@ -9766,6 +10023,8 @@ snapshots:
- tsx
- yaml
+
dependencies:
evtd: 0.2.4
diff --git a/frontend/src/react/ReactBridge.vue b/frontend/src/react/ReactBridge.vue
new file mode 100644
index 0000000000..1f27695125
--- /dev/null
+++ b/frontend/src/react/ReactBridge.vue
@@ -0,0 +1,173 @@
+<template>
+ <div ref="container" />
+ <WeChatQRModal
+ v-if="showQRCodeModal"
+ :title="$t('subscription.request-with-qr')"
+ @close="showQRCodeModal = false"
+ />
+ <InstanceAssignment
+ :show="showInstanceAssignmentDrawer"
+ @dismiss="showInstanceAssignmentDrawer = false"
+ />
+</template>
+
+<script lang="ts" setup>
+import { storeToRefs } from "pinia";
+import { onMounted, onUnmounted, ref, watch } from "vue";
+import { useI18n } from "vue-i18n";
+import InstanceAssignment from "@/components/InstanceAssignment.vue";
+import WeChatQRModal from "@/components/WeChatQRModal.vue";
+import {
+ getWorkspaceId,
+ pushNotification,
+ useActuatorV1Store,
+ useSubscriptionV1Store,
+} from "@/store";
+import { ENTERPRISE_INQUIRE_LINK } from "@/types";
+import { PlanType } from "@/types/proto-es/v1/subscription_service_pb";
+import { hasWorkspacePermissionV2 } from "@/utils";
+
+const props = defineProps<{
+ allowEdit: boolean;
+}>();
+
+const { t, locale } = useI18n();
+const subscriptionStore = useSubscriptionV1Store();
+const actuatorStore = useActuatorV1Store();
+
+const container = ref<HTMLElement>();
+// biome-ignore lint/suspicious/noExplicitAny: React Root type from dynamic import
+let root: any = null; // eslint-disable-line @typescript-eslint/no-explicit-any
+
+const { expireAt, isTrialing, isExpired } = storeToRefs(subscriptionStore);
+
+const showQRCodeModal = ref(false);
+const showInstanceAssignmentDrawer = ref(false);
+
+const handleRequireEnterprise = () => {
+ if (locale.value === "zh-CN") {
+ showQRCodeModal.value = true;
+ } else {
+ window.open(ENTERPRISE_INQUIRE_LINK, "_blank");
+ }
+};
+
+function getPlanType(): "FREE" | "TEAM" | "ENTERPRISE" {
+ switch (subscriptionStore.currentPlan) {
+ case PlanType.TEAM:
+ return "TEAM";
+ case PlanType.ENTERPRISE:
+ return "ENTERPRISE";
+ default:
+ return "FREE";
+ }
+}
+
+function getCurrentPlanLabel(): string {
+ switch (subscriptionStore.currentPlan) {
+ case PlanType.TEAM:
+ return t("subscription.plan.team.title");
+ case PlanType.ENTERPRISE:
+ return t("subscription.plan.enterprise.title");
+ default:
+ return t("subscription.plan.free.title");
+ }
+}
+
+function buildData() {
+ return {
+ currentPlan: getCurrentPlanLabel(),
+ planType: getPlanType(),
+ isFreePlan: subscriptionStore.isFreePlan,
+ isTrialing: isTrialing.value,
+ isExpired: isExpired.value,
+ isSelfHostLicense: subscriptionStore.isSelfHostLicense,
+ showTrial: subscriptionStore.showTrial,
+ trialingDays: subscriptionStore.trialingDays,
+ expireAt: expireAt.value,
+ instanceCountLimit: subscriptionStore.instanceCountLimit,
+ instanceLicenseCount: subscriptionStore.instanceLicenseCount,
+ userCountLimit: subscriptionStore.userCountLimit,
+ activeUserCount: actuatorStore.activeUserCount,
+ activatedInstanceCount: actuatorStore.activatedInstanceCount,
+ workspaceId: getWorkspaceId(actuatorStore.workspaceResourceName),
+ };
+}
+
+async function handleUploadLicense(license: string): Promise<boolean> {
+ try {
+ await subscriptionStore.patchSubscription(license);
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: t("subscription.update.success.title"),
+ description: t("subscription.update.success.description"),
+ });
+ return true;
+ } catch {
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: t("subscription.update.failure.title"),
+ description: t("subscription.update.failure.description"),
+ });
+ return false;
+ }
+}
+
+async function renderReact() {
+ if (!container.value) return;
+ const [{ mountSubscriptionPage, updateSubscriptionPage }, i18nModule] =
+ await Promise.all([import("./mount"), import("./i18n")]);
+ // Sync Vue locale to React i18next
+ if (i18nModule.default.language !== locale.value) {
+ await i18nModule.default.changeLanguage(locale.value);
+ }
+ const opts = {
+ data: buildData(),
+ allowEdit: props.allowEdit,
+ allowManageInstanceLicenses:
+ props.allowEdit && hasWorkspacePermissionV2("bb.instances.list"),
+ onUploadLicense: handleUploadLicense,
+ onRequireEnterprise: handleRequireEnterprise,
+ onManageInstanceLicenses: () => {
+ showInstanceAssignmentDrawer.value = true;
+ },
+ };
+ if (!root) {
+ root = await mountSubscriptionPage(container.value, opts);
+ } else {
+ await updateSubscriptionPage(root, opts);
+ }
+}
+
+onMounted(() => {
+ renderReact();
+});
+
+// Re-render when reactive data changes
+watch(
+ () => [
+ subscriptionStore.currentPlan,
+ subscriptionStore.isFreePlan,
+ isTrialing.value,
+ isExpired.value,
+ expireAt.value,
+ subscriptionStore.instanceCountLimit,
+ subscriptionStore.instanceLicenseCount,
+ subscriptionStore.userCountLimit,
+ actuatorStore.activeUserCount,
+ actuatorStore.activatedInstanceCount,
+ props.allowEdit,
+ locale.value,
+ ],
+ () => {
+ renderReact();
+ }
+);
+
+onUnmounted(() => {
+ root?.unmount();
+ root = null;
+});
+</script>
diff --git a/frontend/src/react/i18n.ts b/frontend/src/react/i18n.ts
new file mode 100644
index 0000000000..8e5226a60a
--- /dev/null
+++ b/frontend/src/react/i18n.ts
@@ -0,0 +1,58 @@
+// Virtual module that reads raw JSON at build time, bypassing vue-i18n AST compilation
+// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+// @ts-ignore -- virtual module provided by vite.config.ts react-raw-locales plugin
+import rawLocales from "virtual:react-locales";
+import i18next from "i18next";
+import { merge } from "lodash-es";
+import { initReactI18next } from "react-i18next";
+
+const STORAGE_KEY_LANGUAGE = "bb.language";
+
+function getLocale(): string {
+ const stored = localStorage.getItem(STORAGE_KEY_LANGUAGE) ?? "";
+ if (stored) {
+ try {
+ const parsed = JSON.parse(stored);
+ if (typeof parsed === "string" && parsed) return parsed;
+ } catch {
+ if (stored) return stored;
+ }
+ }
+ const nav = navigator.language;
+ const mapping: Record<string, string> = {
+ en: "en-US",
+ ja: "ja-JP",
+ es: "es-ES",
+ vi: "vi-VN",
+ };
+ return mapping[nav] ?? (nav.includes("-") ? nav : "en-US");
+}
+
+function buildResources() {
+ const resources: Record<string, { translation: Record<string, unknown> }> =
+ {};
+ for (const [locale, data] of Object.entries(
+ rawLocales as Record<string, { main: string; sub: string }>
+ )) {
+ const main = JSON.parse(data.main);
+ const sub = JSON.parse(data.sub);
+ resources[locale] = {
+ translation: merge({}, main, { subscription: sub }),
+ };
+ }
+ return resources;
+}
+
+const i18n: import("i18next").i18n = i18next.createInstance();
+
+export const i18nReady = i18n.use(initReactI18next).init({
+ resources: buildResources(),
+ lng: getLocale(),
+ fallbackLng: "en-US",
+ interpolation: {
+ escapeValue: false,
+ },
+ initImmediate: false,
+});
+
+export default i18n;
diff --git a/frontend/src/react/mount.ts b/frontend/src/react/mount.ts
new file mode 100644
index 0000000000..ae7c9c4244
--- /dev/null
+++ b/frontend/src/react/mount.ts
@@ -0,0 +1,88 @@
+import type { SubscriptionData } from "@/react/types";
+
+export type { SubscriptionData };
+
+export interface MountOptions {
+ data: SubscriptionData;
+ allowEdit: boolean;
+ allowManageInstanceLicenses: boolean;
+ onUploadLicense: (license: string) => Promise<boolean>;
+ onRequireEnterprise: () => void;
+ onManageInstanceLicenses: () => void;
+}
+
+// Use import.meta.glob so vue-tsc does not follow the import into React .tsx files.
+// Vite resolves the glob at build time and creates a lazy chunk for the matched module.
+const pageLoaders = import.meta.glob("./pages/settings/SubscriptionPage.tsx");
+const loadSubscriptionPage = pageLoaders[
+ "./pages/settings/SubscriptionPage.tsx"
+] as () => Promise<{
+ // biome-ignore lint/suspicious/noExplicitAny: Component type checked by tsconfig.react.json
+ SubscriptionPage: (props: any) => any; // eslint-disable-line @typescript-eslint/no-explicit-any
+}>;
+
+async function loadDeps() {
+ const [
+ { createElement, StrictMode },
+ { createRoot },
+ { I18nextProvider },
+ i18nModule,
+ { SubscriptionPage },
+ ] = await Promise.all([
+ import("react"),
+ import("react-dom/client"),
+ import("react-i18next"),
+ import("@/react/i18n"),
+ loadSubscriptionPage(),
+ ]);
+ // Ensure i18n is fully initialized before rendering
+ await i18nModule.i18nReady;
+ return {
+ createElement,
+ StrictMode,
+ createRoot,
+ I18nextProvider,
+ i18n: i18nModule.default,
+ SubscriptionPage,
+ };
+}
+
+// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+// @ts-ignore -- React createElement types conflict with Vue JSX in vue-tsc; checked by tsconfig.react.json
+function buildTree(
+ deps: Awaited<ReturnType<typeof loadDeps>>,
+ opts: MountOptions
+) {
+ const { createElement, StrictMode, I18nextProvider, i18n, SubscriptionPage } =
+ deps;
+ return createElement(
+ StrictMode,
+ null,
+ createElement(
+ I18nextProvider,
+ { i18n },
+ createElement(SubscriptionPage, opts)
+ )
+ );
+}
+
+let cached: Awaited<ReturnType<typeof loadDeps>> | null = null;
+
+export async function mountSubscriptionPage(
+ container: HTMLElement,
+ opts: MountOptions
+) {
+ cached = await loadDeps();
+ const root = cached.createRoot(container);
+ root.render(buildTree(cached, opts));
+ return root;
+}
+
+export async function updateSubscriptionPage(
+ // biome-ignore lint/suspicious/noExplicitAny: React Root type from dynamic import
+ root: any, // eslint-disable-line @typescript-eslint/no-explicit-any
+ opts: MountOptions
+) {
+ if (!cached) cached = await loadDeps();
+ root.render(buildTree(cached, opts));
+}
diff --git a/frontend/src/react/pages/settings/SubscriptionPage.tsx b/frontend/src/react/pages/settings/SubscriptionPage.tsx
new file mode 100644
index 0000000000..e884c80fcd
--- /dev/null
+++ b/frontend/src/react/pages/settings/SubscriptionPage.tsx
@@ -0,0 +1,283 @@
+import { Copy, Pencil } from "lucide-react";
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
+import type { SubscriptionData } from "@/react/types";
+
+interface SubscriptionPageProps {
+ data: SubscriptionData;
+ allowEdit: boolean;
+ allowManageInstanceLicenses: boolean;
+ onUploadLicense: (license: string) => Promise<boolean>;
+ onRequireEnterprise: () => void;
+ onManageInstanceLicenses: () => void;
+}
+
+export function SubscriptionPage({
+ data,
+ allowEdit,
+ allowManageInstanceLicenses,
+ onUploadLicense,
+ onRequireEnterprise,
+ onManageInstanceLicenses,
+}: SubscriptionPageProps) {
+ const { t } = useTranslation();
+ const [license, setLicense] = useState("");
+ const [loading, setLoading] = useState(false);
+ const [copied, setCopied] = useState(false);
+
+ const disabled = loading || !license;
+
+ const userLimit =
+ data.userCountLimit === Number.MAX_VALUE
+ ? t("common.unlimited")
+ : `${data.userCountLimit}`;
+
+ const totalLicenseCount =
+ data.instanceLicenseCount === Number.MAX_VALUE
+ ? t("common.unlimited")
+ : `${data.instanceLicenseCount}`;
+
+ const handleUpload = async () => {
+ if (disabled) return;
+ setLoading(true);
+ try {
+ const success = await onUploadLicense(license);
+ if (success) {
+ setLicense("");
+ }
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const handleCopy = async () => {
+ try {
+ await navigator.clipboard.writeText(data.workspaceId);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ } catch {
+ // Clipboard API not available
+ }
+ };
+
+ return (
+ <div className="w-full px-4 py-4 mx-auto">
+ {/* Plan stats grid */}
+ <div className="w-full grid grid-cols-2 gap-6 lg:grid-cols-3 3xl:grid-cols-4 my-4">
+ {/* Current plan */}
+ <div className="flex flex-col text-left">
+ <div className="flex items-center text-main">
+ {t("subscription.current")}
+ {data.isExpired && (
+ <span className="ml-2 inline-flex items-center px-3 py-0.5 rounded-full text-base font-sm bg-red-100 text-red-800 h-6">
+ {t("subscription.expired")}
+ </span>
+ )}
+ {!data.isExpired && data.isTrialing && (
+ <span className="ml-2 inline-flex items-center px-3 py-0.5 rounded-full text-base font-sm bg-indigo-100 text-indigo-800 h-6">
+ {t("subscription.trialing")}
+ </span>
+ )}
+ </div>
+ <div className="text-indigo-600 mt-1 text-3xl lg:text-4xl">
+ {data.currentPlan}
+ </div>
+ </div>
+
+ {/* Expires at */}
+ {!data.isFreePlan && (
+ <div className="flex flex-col text-left">
+ <div className="text-main">{t("subscription.expires-at")}</div>
+ <dd className="mt-1 text-3xl lg:text-4xl">
+ {data.expireAt || "N/A"}
+ </dd>
+ </div>
+ )}
+
+ {/* Free trial */}
+ {data.showTrial && allowEdit && (
+ <div className="flex flex-col text-left">
+ <div className="text-main">{t("subscription.try-for-free")}</div>
+ <div className="mt-1">
+ <button
+ className="rounded-md bg-indigo-600 px-4 py-2 text-white text-lg hover:bg-indigo-700"
+ onClick={onRequireEnterprise}
+ >
+ {t("subscription.enterprise-free-trial", {
+ days: data.trialingDays,
+ })}
+ </button>
+ </div>
+ </div>
+ )}
+
+ {/* Inquire enterprise */}
+ {data.isTrialing && data.planType === "ENTERPRISE" && (
+ <div className="flex flex-col text-left">
+ <div className="text-main">
+ {t("subscription.inquire-enterprise-plan")}
+ </div>
+ <div className="mt-1 ml-auto">
+ <button
+ className="rounded-md bg-indigo-600 px-4 py-2 text-white text-lg hover:bg-indigo-700"
+ onClick={onRequireEnterprise}
+ >
+ {t("subscription.contact-us")}
+ </button>
+ </div>
+ </div>
+ )}
+
+ {/* Instance license stats */}
+ {allowManageInstanceLicenses && (
+ <InstanceLicenseStats
+ planType={data.planType}
+ instanceCountLimit={data.instanceCountLimit}
+ activatedCount={data.activatedInstanceCount}
+ totalLicenseCount={totalLicenseCount}
+ onManageInstanceLicenses={onManageInstanceLicenses}
+ />
+ )}
+
+ {/* User count */}
+ <div className="flex flex-col text-left">
+ <div className="text-main">
+ {t("subscription.instance-assignment.used-and-total-user")}
+ </div>
+ <div className="mt-1 text-4xl flex items-center gap-2">
+ {data.activeUserCount}
+ <span className="font-mono text-gray-500">/</span>
+ {userLimit}
+ </div>
+ </div>
+ </div>
+
+ {/* Divider */}
+ <hr className="my-6 border-t border-gray-200" />
+
+ {/* Workspace ID */}
+ <div>
+ <label className="flex items-center gap-x-2">
+ <span className="text-main">
+ {t("settings.general.workspace.id")}
+ </span>
+ </label>
+ <div className="mb-3 text-sm text-gray-400">
+ {t("settings.general.workspace.id-description")}
+ </div>
+ <div className="mb-4 flex items-center gap-x-2">
+ <input
+ className="w-full rounded-md border border-gray-300 px-3 py-2 text-sm bg-gray-50 cursor-default focus:outline-none"
+ readOnly
+ value={data.workspaceId}
+ onClick={(e) => (e.target as HTMLInputElement).select()}
+ />
+ <button
+ className="inline-flex items-center justify-center rounded-md p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100"
+ onClick={handleCopy}
+ title={t("common.copy")}
+ >
+ <Copy className="h-4 w-4" />
+ </button>
+ {copied && (
+ <span className="text-sm text-green-600">{t("common.copied")}</span>
+ )}
+ </div>
+ </div>
+
+ {/* Upload license */}
+ {data.isSelfHostLicense && (
+ <div className="w-full mt-4 flex flex-col">
+ <label className="flex items-center gap-x-2">
+ <span className="text-main">
+ {t("subscription.upload-license")}
+ </span>
+ </label>
+ <div className="mb-3 text-sm text-gray-400">
+ {t("subscription.description")} {t("subscription.plan-compare")}{" "}
+ <a
+ href="https://www.bytebase.com/pricing?source=console"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-indigo-600 hover:underline"
+ >
+ {t("common.learn-more")} &gt;
+ </a>
+ {data.showTrial && allowEdit && (
+ <button
+ className="ml-1 text-indigo-600 hover:underline text-sm"
+ onClick={onRequireEnterprise}
+ >
+ {t("subscription.plan.try")}
+ </button>
+ )}
+ </div>
+ <textarea
+ className="w-full rounded-md border border-gray-300 px-3 py-2 text-sm min-h-[100px] focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 disabled:bg-gray-100 disabled:cursor-not-allowed"
+ value={license}
+ onChange={(e) => setLicense(e.target.value)}
+ disabled={!allowEdit}
+ placeholder={t("common.sensitive-placeholder")}
+ />
+ <div className="ml-auto mt-3">
+ <button
+ className="rounded-md bg-indigo-600 px-4 py-2 text-white capitalize hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed"
+ disabled={disabled || !allowEdit}
+ onClick={handleUpload}
+ >
+ {t("subscription.upload-license")}
+ </button>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
+
+function InstanceLicenseStats({
+ planType,
+ instanceCountLimit,
+ activatedCount,
+ totalLicenseCount,
+ onManageInstanceLicenses,
+}: {
+ planType: string;
+ instanceCountLimit: number;
+ activatedCount: number;
+ totalLicenseCount: string;
+ onManageInstanceLicenses: () => void;
+}) {
+ const { t } = useTranslation();
+
+ if (planType === "FREE") {
+ return (
+ <div className="flex flex-col text-left">
+ <dt className="text-main">{t("subscription.max-instance-count")}</dt>
+ <div className="mt-1 text-4xl">{instanceCountLimit}</div>
+ </div>
+ );
+ }
+
+ return (
+ <>
+ <div className="flex flex-col text-left">
+ <dt className="text-main">
+ {t("subscription.instance-assignment.used-and-total-license")}
+ </dt>
+ <div className="mt-1 text-4xl flex items-center gap-2">
+ <span>
+ {activatedCount}
+ <span className="font-mono text-gray-500"> / </span>
+ {totalLicenseCount}
+ </span>
+ <button
+ className="text-gray-500 hover:text-gray-700"
+ onClick={onManageInstanceLicenses}
+ >
+ <Pencil className="h-8 w-8" />
+ </button>
+ </div>
+ </div>
+ </>
+ );
+}
diff --git a/frontend/src/react/react-env.d.ts b/frontend/src/react/react-env.d.ts
new file mode 100644
index 0000000000..11f02fe2a0
--- /dev/null
+++ b/frontend/src/react/react-env.d.ts
@@ -0,0 +1 @@
+/// <reference types="vite/client" />
diff --git a/frontend/src/react/types.ts b/frontend/src/react/types.ts
new file mode 100644
index 0000000000..acaa32971d
--- /dev/null
+++ b/frontend/src/react/types.ts
@@ -0,0 +1,17 @@
+export interface SubscriptionData {
+ currentPlan: string;
+ planType: "FREE" | "TEAM" | "ENTERPRISE";
+ isFreePlan: boolean;
+ isTrialing: boolean;
+ isExpired: boolean;
+ isSelfHostLicense: boolean;
+ showTrial: boolean;
+ trialingDays: number;
+ expireAt: string;
+ instanceCountLimit: number;
+ instanceLicenseCount: number;
+ userCountLimit: number;
+ activeUserCount: number;
+ activatedInstanceCount: number;
+ workspaceId: string;
+}
diff --git a/frontend/src/router/dashboard/workspaceSetting.ts b/frontend/src/router/dashboard/workspaceSetting.ts
index 26db41a65d..082041666a 100644
--- a/frontend/src/router/dashboard/workspaceSetting.ts
+++ b/frontend/src/router/dashboard/workspaceSetting.ts
@@ -56,7 +56,7 @@ const workspaceSettingRoutes: RouteRecordRaw[] = [
title: () => t("settings.sidebar.subscription"),
requiredPermissionList: () => ["bb.settings.get"],
},
- component: () => import("@/views/SettingWorkspaceSubscription.vue"),
+ component: () => import("@/react/ReactBridge.vue"),
props: true,
},
],
diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json
index 0a9cd74491..5cd276d579 100644
--- a/frontend/tsconfig.app.json
+++ b/frontend/tsconfig.app.json
@@ -7,7 +7,7 @@
"src/**/*.tsx",
"src/**/*.vue"
],
- "exclude": ["src/**/__tests__/*"],
+ "exclude": ["src/**/__tests__/*", "src/react/**/*.tsx"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
diff --git a/frontend/tsconfig.react.json b/frontend/tsconfig.react.json
new file mode 100644
index 0000000000..503b87a802
--- /dev/null
+++ b/frontend/tsconfig.react.json
@@ -0,0 +1,17 @@
+{
+ "compilerOptions": {
+ "target": "ES2025",
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "lib": ["ES2025", "DOM", "DOM.Iterable"],
+ "jsx": "react-jsx",
+ "jsxImportSource": "react",
+ "types": ["react", "react-dom", "vite/client"],
+ "strict": true,
+ "noEmit": true,
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ },
+ "include": ["src/react/**/*.ts", "src/react/**/*.tsx", "src/react/react-env.d.ts"]
+}
diff --git a/frontend/tsconfig.vitest.json b/frontend/tsconfig.vitest.json
index 548813dd3c..cca836aa5b 100644
--- a/frontend/tsconfig.vitest.json
+++ b/frontend/tsconfig.vitest.json
@@ -7,7 +7,7 @@
"src/**/*.tsx",
"src/**/*.vue"
],
- "exclude": [],
+ "exclude": ["src/react/**/*.tsx"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 7f27b8c254..aca798df8d 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -1,4 +1,7 @@
+import { readFileSync } from "node:fs";
import { fileURLToPath, URL } from "node:url";
+// @ts-ignore -- esbuild is a transitive dependency via vite
+import { transform as esbuildTransform } from "esbuild";
import importMetaUrlPlugin from "@codingame/esbuild-import-meta-url-plugin";
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
import yaml from "@rollup/plugin-yaml";
@@ -28,8 +31,50 @@ export default defineConfig({
targets: ["> 0.08%, not dead"],
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
}),
+ {
+ name: "react-raw-locales",
+ resolveId(id) {
+ if (id === "virtual:react-locales") return "\0virtual:react-locales";
+ return undefined;
+ },
+ load(id) {
+ if (id !== "\0virtual:react-locales") return undefined;
+ const localesDir = resolve(__dirname, "src/locales");
+ const locales = ["en-US", "zh-CN", "es-ES", "ja-JP", "vi-VN"];
+ const data: Record<string, { main: string; sub: string }> = {};
+ for (const locale of locales) {
+ data[locale] = {
+ main: readFileSync(`${localesDir}/${locale}.json`, "utf-8"),
+ sub: readFileSync(
+ `${localesDir}/subscription/${locale}.json`,
+ "utf-8"
+ ),
+ };
+ }
+ return `export default ${JSON.stringify(data)};`;
+ },
+ },
+ {
+ name: "react-tsx-transform",
+ enforce: "pre",
+ async transform(code, id) {
+ if (!/\/src\/react\/.+\.tsx$/.test(id)) return undefined;
+ const result = await esbuildTransform(code, {
+ loader: "tsx",
+ jsx: "automatic",
+ jsxImportSource: "react",
+ tsconfigRaw: { compilerOptions: {} },
+ sourcemap: true,
+ sourcefile: id,
+ });
+ return { code: result.code, map: result.map || null };
+ },
+ },
vue(),
- vueJsx(),
+ vueJsx({
+ include: /\.tsx$/,
+ exclude: /src\/react\//,
+ }),
// https://github.com/intlify/vite-plugin-vue-i18n
VueI18nPlugin({
include: [resolve(__dirname, "src/locales/**")],
@@ -54,6 +99,7 @@ export default defineConfig({
: [
CodeInspectorPlugin({
bundler: "vite",
+ exclude: [/src\/react\//],
}),
]),
// Export CSP hashes from @vitejs/plugin-legacy for backend to use