Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:template git err & terminal insufficient balance (#3755)
* fix: catch template git error Signed-off-by: jingyang <3161362058@qq.com> * fix:template yaml tool Signed-off-by: jingyang <3161362058@qq.com> * Insufficient balance Signed-off-by: jingyang <3161362058@qq.com> --------- Signed-off-by: jingyang <3161362058@qq.com>
- Loading branch information
Showing
6 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
16 changes: 15 additions & 1 deletion
16
frontend/providers/template/src/pages/api/platform/getEnv.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
import { authSession } from '@/services/backend/auth'; | ||
import { getK8s } from '@/services/backend/kubernetes'; | ||
import { jsonRes } from '@/services/backend/response'; | ||
import { ApiResp } from '@/services/kubernet'; | ||
import type { NextApiRequest, NextApiResponse } from 'next'; | ||
|
||
export default async function handler(req: NextApiRequest, res: NextApiResponse<ApiResp>) { | ||
let user_namespace = ''; | ||
|
||
try { | ||
const { namespace } = await getK8s({ | ||
kubeconfig: await authSession(req.headers) | ||
}); | ||
user_namespace = namespace; | ||
} catch (error) { | ||
console.log(error, 'errpr-'); | ||
} | ||
|
||
jsonRes(res, { | ||
data: { | ||
SEALOS_CLOUD_DOMAIN: process.env.SEALOS_CLOUD_DOMAIN || 'cloud.sealos.io', | ||
SEALOS_CERT_SECRET_NAME: process.env.SEALOS_CERT_SECRET_NAME || 'wildcard-cert', | ||
TEMPLATE_REPO_URL: | ||
process.env.TEMPLATE_REPO_URL || 'https://github.com/labring-actions/templates' | ||
process.env.TEMPLATE_REPO_URL || 'https://github.com/labring-actions/templates', | ||
SEALOS_NAMESPACE: user_namespace || '' | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Box } from '@chakra-ui/react'; | ||
|
||
export default function ErrPage() { | ||
return <Box h="100%" w="100%" background={'#2b2b2b'}></Box>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters