Skip to content

Commit

Permalink
fix:dbprovider maximum storage (#4459)
Browse files Browse the repository at this point in the history
Signed-off-by: jingyang <3161362058@qq.com>
  • Loading branch information
zjy365 committed Jan 4, 2024
1 parent 972784f commit 73b12c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Expand Up @@ -345,7 +345,7 @@ const Form = ({
<FormControl isInvalid={!!errors.storage} w={'500px'}>
<Flex alignItems={'center'}>
<Label w={80}>{t('Storage')}</Label>
<Tooltip label={`${t('Storage Range')}${minStorage}~200 Gi`}>
<Tooltip label={`${t('Storage Range')}${minStorage}~300 Gi`}>
<NumberInput
w={'180px'}
max={300}
Expand All @@ -365,13 +365,13 @@ const Form = ({
message: `${t('Storage Min')}${minStorage} Gi`
},
max: {
value: 200,
message: `${t('Storage Max')}200 Gi`
value: 300,
message: `${t('Storage Max')}300 Gi`
},
valueAsNumber: true
})}
min={minStorage}
max={200}
max={300}
/>
<NumberInputStepper>
<NumberIncrementStepper />
Expand Down
13 changes: 11 additions & 2 deletions frontend/providers/template/src/pages/api/updateRepo.ts
Expand Up @@ -42,12 +42,19 @@ export async function GetTemplateStatic() {
.readNamespacedConfigMap('template-static', 'template-frontend');

const inputString = result?.body?.data?.['install-count'] || '';

const installCountArray = inputString.split(/\n/).filter(Boolean);

const temp: { [key: string]: number } = {};
installCountArray.forEach((item) => {
const [count, name] = item.trim().split(/\s/);
temp[name] = parseInt(count, 10);
const match = item.trim().match(/^(\d+)\s(.+)$/);
if (match) {
const count = match[1];
const name = match[2];
temp[name] = parseInt(count, 10);
} else {
console.error(`Data format error: ${item}`);
}
});
return temp;
} catch (error) {
Expand Down Expand Up @@ -89,6 +96,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
readFileList(_targetPath, fileList);

const templateStaticMap: { [key: string]: number } = await GetTemplateStatic();
console.log(templateStaticMap);

let jsonObjArr: unknown[] = [];
fileList.forEach((item: any) => {
try {
Expand Down

0 comments on commit 73b12c5

Please sign in to comment.