Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 committed Sep 4, 2024
1 parent 0202d6e commit 2a14e69
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Header = ({
const { t } = useTranslation();
const { copyData } = useCopyData();
const handleExportYaml = useCallback(async () => {
const exportYamlString = yamlList.map((i) => i.value).join('---\n');
const exportYamlString = yamlList?.map((i) => i.value).join('---\n');
if (!exportYamlString) return;
downLoadBold(
exportYamlString,
Expand Down Expand Up @@ -103,7 +103,7 @@ const Header = ({
}, [t, templateDetail?.spec?.deployCount]);

const usage = useMemo(() => {
const usage = getResourceUsage(yamlList.map((item) => item.value));
const usage = getResourceUsage(yamlList?.map((item) => item.value) || []);
return usage;
}, [yamlList]);

Expand Down
2 changes: 1 addition & 1 deletion frontend/providers/template/src/pages/deploy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function EditApp({
);

const usage = useMemo(() => {
const usage = getResourceUsage(yamlList.map((item) => item.value));
const usage = getResourceUsage(yamlList?.map((item) => item.value) || []);
return usage;
}, [yamlList]);

Expand Down
6 changes: 3 additions & 3 deletions frontend/providers/template/src/utils/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export const getTemplateInputDefaultValues = (templateSource: TemplateSourceType
};

export const getTemplateDefaultValues = (templateSource: TemplateSourceType | undefined) => {
return mapValues(templateSource?.source.defaults, (value) => value.value || '')
return mapValues(templateSource?.source.defaults, (value) => value.value || '');
};

export const getTemplateValues = (templateSource: TemplateSourceType | undefined) => {
return {
defaults: getTemplateDefaultValues(templateSource),
defaultInputs: getTemplateInputDefaultValues(templateSource),
}
defaultInputs: getTemplateInputDefaultValues(templateSource)
};
};

export function findTopKeyWords(keywordsList: string[][], topCount: number) {
Expand Down
6 changes: 3 additions & 3 deletions frontend/providers/template/src/utils/usage.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import JsYaml from 'js-yaml';

export interface ResourceUsage {
cpu: { min: number; max: number };
memory: { min: number; max: number };
storage: { min: number; max: number };
cpu: { min: number; max: number }; // m
memory: { min: number; max: number }; // Mi
storage: { min: number; max: number }; // Mi
nodeport: number;
}

Expand Down

0 comments on commit 2a14e69

Please sign in to comment.