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 09:48:01 UTC

(incubator-devlake) branch main updated: fix(config-ui): dynamic api prefix (#6368)

This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 53a02f160 fix(config-ui): dynamic api prefix (#6368)
53a02f160 is described below

commit 53a02f160ff85685df5c7bc6185974b5038eeb3a
Author: 青湛 <0x...@gmail.com>
AuthorDate: Tue Oct 31 22:47:57 2023 +1300

    fix(config-ui): dynamic api prefix (#6368)
---
 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}