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

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

commit f28986dcc9245d9db8f9897b52f3c5ecd54beda4
Author: mintsweet <[email protected]>
AuthorDate: Wed Nov 1 20:33:07 2023 +1300

    feat(config-ui): add two environment variables
---
 config-ui/env.example                   | 4 ++++
 config-ui/src/components/logo/index.tsx | 2 +-
 config-ui/src/routes/layout/layout.tsx  | 2 +-
 config-ui/src/vite-env.d.ts             | 2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/config-ui/env.example b/config-ui/env.example
index bf3d10d30..085d00bbb 100644
--- a/config-ui/env.example
+++ b/config-ui/env.example
@@ -1,3 +1,7 @@
+# About Basic Information
+# DEVLAKE_LOGO=
+# DEVLAKE_COPYRIGHT=
+
 # All plugins are loaded by default, optional plugins can be loaded
 # eg. DEVLAKE_PLUGINS=github,gitlab
 DEVLAKE_PLUGINS=
diff --git a/config-ui/src/components/logo/index.tsx 
b/config-ui/src/components/logo/index.tsx
index fcda11424..23362c9e4 100644
--- a/config-ui/src/components/logo/index.tsx
+++ b/config-ui/src/components/logo/index.tsx
@@ -28,7 +28,7 @@ const Wrapper = styled.div`
 export const Logo = () => {
   return (
     <Wrapper>
-      <img src={LogoImg} alt="Logo" />
+      <img src={import.meta.env.DEVLAKE_LOGO ?? LogoImg} alt="Logo" />
     </Wrapper>
   );
 };
diff --git a/config-ui/src/routes/layout/layout.tsx 
b/config-ui/src/routes/layout/layout.tsx
index fc3fd222c..514bc8054 100644
--- a/config-ui/src/routes/layout/layout.tsx
+++ b/config-ui/src/routes/layout/layout.tsx
@@ -114,7 +114,7 @@ export const Layout = () => {
                 })}
               </Menu>
               <div className="copyright">
-                <div>Apache 2.0 License</div>
+                <div>{import.meta.env.DEVLAKE_COPYRIGHT ?? 'Apache 2.0 
License'}</div>
                 <div className="version">{version}</div>
               </div>
             </S.Sider>
diff --git a/config-ui/src/vite-env.d.ts b/config-ui/src/vite-env.d.ts
index d52d9a2d7..57374a1d2 100644
--- a/config-ui/src/vite-env.d.ts
+++ b/config-ui/src/vite-env.d.ts
@@ -19,6 +19,8 @@
 /// <reference types="vite/client" />
 
 interface ImportMetaEnv {
+  readonly DEVLAKE_LOGO: string;
+  readonly DEVLAKE_COPYRIGHT: string;
   readonly DEVLAKE_PLUGINS: string;
 }
 

Reply via email to