You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2023/10/31 07:26:19 UTC
(incubator-devlake) branch fix-api-path created (now 2f54fed7f)
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a change to branch fix-api-path
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at 2f54fed7f fix(config-ui): dynamic api prefix
This branch includes the following new commits:
new 2f54fed7f fix(config-ui): dynamic api prefix
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-devlake) 01/01: fix(config-ui): dynamic api prefix
Posted by mi...@apache.org.
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 <0x...@gmail.com>
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}