This is an automated email from the ASF dual-hosted git repository. mintsweet pushed a commit to branch fix-api-path in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 2f54fed7fad92bc667921a74e89461739c39b15b Author: mintsweet <[email protected]> AuthorDate: Tue Oct 31 20:26:07 2023 +1300 fix(config-ui): dynamic api prefix --- config-ui/src/routes/api-keys/api-keys.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config-ui/src/routes/api-keys/api-keys.tsx b/config-ui/src/routes/api-keys/api-keys.tsx index fca5187a4..f2f9a4c4f 100644 --- a/config-ui/src/routes/api-keys/api-keys.tsx +++ b/config-ui/src/routes/api-keys/api-keys.tsx @@ -48,6 +48,7 @@ export const ApiKeys = () => { const { data, ready } = useRefreshData(() => API.apiKey.list({ page, pageSize }), [version, page, pageSize]); + const prefix = useMemo(() => `${window.location.origin}/api/rest/`, []); const [dataSource, total] = useMemo(() => [data?.apikeys ?? [], data?.count ?? 0], [data]); const hasError = useMemo(() => !form.name || !form.allowedPath, [form]); @@ -119,7 +120,7 @@ export const ApiKeys = () => { title: 'Allowed Path', dataIndex: 'allowedPath', key: 'allowedPath', - render: (val) => `http://localhost:4000/api/rest${val}`, + render: (val) => `${prefix}${val}`, }, { title: '', @@ -192,7 +193,7 @@ export const ApiKeys = () => { required > <S.InputContainer> - <span>http://localhost:4000/api/rest/</span> + <span>{prefix}</span> <InputGroup placeholder="" value={form.allowedPath}
