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

feat: launchpad api createApp with extra parameters #4598

Merged
merged 2 commits into from Mar 19, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -203,7 +203,7 @@ const AppBaseInfo = ({ app = MOCK_APP_DETAIL }: { app: AppDetailType }) => {
))}
{/* env */}
<Accordion allowToggle defaultIndex={0} mt={4}>
<AccordionItem borderBottom={0}>
<AccordionItem borderBottom={0} borderColor={'#EFF0F1'}>
<AccordionButton
py={4}
display={'flex'}
Expand Down Expand Up @@ -249,7 +249,7 @@ const AppBaseInfo = ({ app = MOCK_APP_DETAIL }: { app: AppDetailType }) => {
</Accordion>
{/* configMap */}
<Accordion allowToggle defaultIndex={0}>
<AccordionItem borderBottom={0}>
<AccordionItem borderBottom={0} borderColor={'#EFF0F1'}>
<AccordionButton
display={'flex'}
textAlign={'left'}
Expand Down Expand Up @@ -300,7 +300,7 @@ const AppBaseInfo = ({ app = MOCK_APP_DETAIL }: { app: AppDetailType }) => {
</Accordion>
{/* store */}
<Accordion allowToggle defaultIndex={0}>
<AccordionItem borderBottom={0}>
<AccordionItem borderBottom={0} borderColor={'#EFF0F1'}>
<AccordionButton
display={'flex'}
textAlign={'left'}
Expand Down
Expand Up @@ -947,7 +947,7 @@ const Form = ({
</Flex>
</FormControl>

<Divider my={'30px'} bg={'myGray.100'} />
<Divider my={'30px'} borderColor={'#EFF0F1'} />

{/* env */}
<Box w={'100%'} maxW={'600px'}>
Expand Down Expand Up @@ -994,7 +994,7 @@ const Form = ({
</Box>
</Box>

<Divider my={'30px'} bg={'myGray.100'} />
<Divider my={'30px'} borderColor={'#EFF0F1'} />

<Box>
<Flex alignItems={'center'}>
Expand Down Expand Up @@ -1051,7 +1051,7 @@ const Form = ({
</Box>
</Box>

<Divider my={'30px'} bg={'myGray.100'} />
<Divider my={'30px'} borderColor={'#EFF0F1'} />

<Box>
<Flex alignItems={'center'} mb={'10px'}>
Expand Down
12 changes: 6 additions & 6 deletions frontend/providers/applaunchpad/src/pages/app/edit/index.tsx
Expand Up @@ -306,12 +306,12 @@ const EditApp = ({ appName, tabType }: { appName?: string; tabType: string }) =>
const parseYamls = formData2Yamls(data);
setYamlList(parseYamls);
// balance check
if (balance <= 0) {
return toast({
status: 'warning',
title: t('user.Insufficient account balance')
});
}
// if (balance <= 0) {
// return toast({
// status: 'warning',
// title: t('user.Insufficient account balance')
// });
// }

// gpu inventory check
if (data.gpu?.type) {
Expand Down
17 changes: 11 additions & 6 deletions frontend/providers/applaunchpad/src/store/app.ts
Expand Up @@ -75,15 +75,17 @@ export const useAppStore = create<State>()(
return 'success';
},
loadAvgMonitorData: async (appName) => {
const pods = await getAppPodsByAppName(appName);
const queryName = pods[0].podName || appName;
const [averageCpu, averageMemory] = await Promise.all([
getAppMonitorData({
queryKey: 'average_cpu',
queryName: appName,
queryName: queryName,
step: '2m'
}),
getAppMonitorData({
queryKey: 'average_memory',
queryName: appName,
queryName: queryName,
step: '2m'
})
]);
Expand All @@ -98,6 +100,8 @@ export const useAppStore = create<State>()(
},
loadDetailMonitorData: async (appName) => {
const pods = await getAppPodsByAppName(appName);
const queryName = pods[0].podName || appName;

set((state) => {
state.appDetailPods = pods.map((pod) => {
const oldPod = state.appDetailPods.find((item) => item.podName === pod.podName);
Expand All @@ -110,11 +114,12 @@ export const useAppStore = create<State>()(
});

const [cpuData, memoryData, averageCpuData, averageMemoryData] = await Promise.all([
getAppMonitorData({ queryKey: 'cpu', queryName: appName, step: '2m' }),
getAppMonitorData({ queryKey: 'memory', queryName: appName, step: '2m' }),
getAppMonitorData({ queryKey: 'average_cpu', queryName: appName, step: '2m' }),
getAppMonitorData({ queryKey: 'average_memory', queryName: appName, step: '2m' })
getAppMonitorData({ queryKey: 'cpu', queryName: queryName, step: '2m' }),
getAppMonitorData({ queryKey: 'memory', queryName: queryName, step: '2m' }),
getAppMonitorData({ queryKey: 'average_cpu', queryName: queryName, step: '2m' }),
getAppMonitorData({ queryKey: 'average_memory', queryName: queryName, step: '2m' })
]);

set((state) => {
if (state?.appDetail?.appName === appName && state.appDetail?.isPause !== true) {
state.appDetail.usedCpu = averageCpuData[0]
Expand Down
3 changes: 0 additions & 3 deletions frontend/providers/cronjob/.env.template
@@ -1,6 +1,3 @@
NEXT_PUBLIC_MOCK_USER=
SEALOS_DOMAIN="cloud.sealos.io"
FASTGPT_KEY=
STORAGE_CLASSNAME=choosable
MONITOR_URL=""
APPLAUNCHPAD_URL=""
1 change: 0 additions & 1 deletion frontend/providers/dbprovider/deploy/Kubefile
Expand Up @@ -15,6 +15,5 @@ ENV minioSecretKey=""
ENV minioPort=""
ENV migrateFileImage=""
ENV minioBucketName=""
ENV BACKUP_ENABLED="false"

CMD ["kubectl apply -f manifests"]
Expand Up @@ -44,16 +44,20 @@ spec:
value: "{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}"
- name: MONITOR_URL
value: {{ .monitorUrl }}
- name: MINIO_URL
value: {{ .minioUrl }}
- name: MINIO_ACCESS_KEY
value: {{ .minioAccessKey }}
- name: MINIO_SECRET_KEY
value: {{ .minioSecretKey }}
- name: MIGRATE_FILE_IMAGE
value: {{ .migrateFileImage }}
- name: MINIO_PORT
value: {{ .minioPort }}
value: '{{ .minioPort }}'
- name: MINIO_BUCKET_NAME
value: {{ .minioBucketName }}
- name: BACKUP_ENABLED
value: "false"
securityContext:
runAsNonRoot: true
runAsUser: 1001
Expand Down
4 changes: 2 additions & 2 deletions frontend/providers/dbprovider/src/utils/json2Yaml.ts
Expand Up @@ -111,9 +111,9 @@ export const json2CreateCluster = (data: DBEditType, backupInfo?: BackupItemType
spec: {
affinity: {
nodeLabels: {},
podAntiAffinity: 'Required',
podAntiAffinity: 'Preferred',
tenancy: 'SharedNode',
topologyKeys: ['kubernetes.io/hostname']
topologyKeys: []
},
clusterDefinitionRef: 'apecloud-mysql',
clusterVersionRef: data.dbVersion,
Expand Down