Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:license add CUSTOM_BASE_PATH env #4654

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions service/license/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CUSTOM_BASE_PATH="https://raw.githubusercontent.com/labring/sealos/main/scripts/cloud/install.sh"
1 change: 1 addition & 0 deletions service/license/.env.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PUBLIC_URL=.
NEXT_PUBLIC_SERVICE=/service/
SEALOS_CLOUD_DOMAIN="cloud.sealos.io"
CUSTOM_BASE_PATH=""

# GITHUB_CLIENT_ID=
# GITHUB_CLIENT_SECRET=
Expand Down
9 changes: 7 additions & 2 deletions service/license/src/pages/cluster/components/Tutorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ import ConfigForm from './ConfigForm';
const TAB_QUERY_PARAM = 'tab';
const TAB_QUERY_ARR = ['tutorial', 'cluster', 'license'];

export default function Tutorial({ ossFileUrl }: { ossFileUrl: string }) {
export type TutorialProps = {
ossFileUrl: string;
customBasePatch: string;
};

export default function Tutorial({ ossFileUrl, customBasePatch }: TutorialProps) {
const { t } = useTranslation();
const { clusterDetail } = useClusterDetail();
const { copyData } = useCopyData();
Expand Down Expand Up @@ -241,7 +246,7 @@ export default function Tutorial({ ossFileUrl }: { ossFileUrl: string }) {
</AccordionButton>
<AccordionPanel py="20px" px="0px">
<ConfigForm
basePath={`curl -sfL https://mirror.ghproxy.com/https://raw.githubusercontent.com/labring/sealos/main/scripts/cloud/install.sh -o /tmp/install.sh && bash /tmp/install.sh --zh `}
basePath={`curl -sfL ${customBasePatch} -o /tmp/install.sh && bash /tmp/install.sh --zh `}
cloudVersion={ossVersion}
/>
</AccordionPanel>
Expand Down
7 changes: 4 additions & 3 deletions service/license/src/pages/cluster/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import ClusterList from './components/List';
import Tutorial from './components/Tutorial';
import Tutorial, { TutorialProps } from './components/Tutorial';

// Activation field systemId
// Cluster recharge callback clusterId
export default function MyCluster({ ossFileUrl }: { ossFileUrl: string }) {
export default function MyCluster({ ossFileUrl, customBasePatch }: TutorialProps) {
const { t } = useTranslation();
const { clusterDetail, setClusterDetail, clearClusterDetail } = useClusterDetail();
const [isLargerThanLG] = useMediaQuery(['(min-width: 992px)', '(display-mode: browser)']);
Expand Down Expand Up @@ -152,7 +152,7 @@ export default function MyCluster({ ossFileUrl }: { ossFileUrl: string }) {
<Layout>
<Flex flex={1} h={0} bg="#fefefe" position={'relative'}>
<ClusterList />
<Tutorial ossFileUrl={ossFileUrl} />
<Tutorial ossFileUrl={ossFileUrl} customBasePatch={customBasePatch} />
</Flex>
<Modal isOpen={isOpen} onClose={onClose} autoFocus={false}>
<ModalOverlay />
Expand Down Expand Up @@ -248,6 +248,7 @@ export async function getServerSideProps({ req, res, locales }: any) {
return {
props: {
ossFileUrl: process.env.OSS_FILE_URL,
customBasePatch: process.env.CUSTOM_BASE_PATH,
...(await serverSideTranslations(local, undefined, null, locales || []))
}
};
Expand Down
Loading