Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
chore: template schema api
Browse files Browse the repository at this point in the history
  • Loading branch information
hibig committed Apr 23, 2024
1 parent c80bea2 commit c618c39
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 64 deletions.
21 changes: 7 additions & 14 deletions src/views/operation-hub/catalogs/components/catalog-basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
spec: {
...props.formData.spec,
vcsSource: {
...props.formData.spec.vcsSource,
token: ''
...props.formData.spec.vcsSource
}
}
});
Expand Down Expand Up @@ -161,14 +160,8 @@
show-word-limit
></seal-textarea>
</a-form-item>
<GroupTitle
style={{ marginBottom: 0 }}
title="Storage"
bordered={false}
flexStart
></GroupTitle>
<a-form-item
label={t('operation.templates.form.StorageType')}
field="spec.vcsSource.platform"
hide-asterisk
hide-label={true}
Expand All @@ -188,7 +181,7 @@
}
});
}}
label={t('operation.templates.form.StorageType')}
label={t('common.table.type')}
required={true}
style={{ width: `${InputWidth.LARGE}px` }}
v-slots={{
Expand Down Expand Up @@ -247,7 +240,7 @@
style={{ width: `${InputWidth.LARGE}px` }}
></seal-input>
</a-form-item>
<a-form-item
{/* <a-form-item
label={t('operation.templates.form.authentication')}
field="spec.vcsSource.secretRef"
hide-asterisk
Expand All @@ -264,8 +257,8 @@
style={{ width: `${InputWidth.LARGE}px` }}
options={AuthenticationOptions}
></seal-select>
</a-form-item>
{authentication.value === 'bearer' && (
</a-form-item> */}
{/* {authentication.value === 'bearer' && (
<a-form-item
label="Token"
field="spec.vcsSource.token"
Expand Down Expand Up @@ -293,7 +286,7 @@
style={{ width: `${InputWidth.LARGE}px` }}
></seal-input>
</a-form-item>
)}
)} */}
</>
);
}
Expand Down
6 changes: 2 additions & 4 deletions src/views/operation-hub/catalogs/components/catalog-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@
description: '',
vcsSource: {
platform: 'Github',
url: '',
token: ''
url: ''
},
filtering: {
excludeFilter: '',
Expand Down Expand Up @@ -157,8 +156,7 @@
description: '',
vcsSource: {
platform: 'Github',
url: '',
token: ''
url: ''
},
filtering: {
excludeFilter: '',
Expand Down
50 changes: 10 additions & 40 deletions src/views/operation-hub/templates/components/template-basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
value: 'Github'
},
{
label: 'OCI',
value: 'OCI'
label: 'GitLab',
value: 'Gitlab'
},
{
label: 'Download URL',
value: 'DownloadURL'
label: 'Gitee',
value: 'Gitee'
}
];
Expand All @@ -62,30 +62,13 @@
spec: {
...props.formData.spec,
vcsRepository: {
...props.formData.spec.vcsRepository,
token: ''
...props.formData.spec.vcsRepository
}
}
});
};
const renderProviderExtra = () => {
if (props.formData.spec.vcsRepository.platform === 'DownloadURL') {
return (
<div>
URL of helm chart tgz file,
e.g.:https://stefanprodan.github.io/podinfo/podinfo-6.6.0.tgz
</div>
);
}
if (props.formData.spec.vcsRepository.platform === 'OCI') {
return (
<div>
OCI image of helm chart, e.g.:oci://podinfo/podinfo?version=6.6.0
</div>
);
}
return (
<>
<div
Expand All @@ -108,12 +91,6 @@
return () => (
<>
{/* <GroupTitle
style={{ marginBottom: 0 }}
title={t('common.title.basicInfo')}
bordered={false}
flexStart
></GroupTitle> */}
<a-form-item
label={t('operation.connectors.table.name')}
field="metadata.name"
Expand Down Expand Up @@ -199,14 +176,7 @@
show-word-limit
></seal-textarea>
</a-form-item>
<GroupTitle
style={{ marginBottom: 0 }}
title="Storage"
bordered={false}
flexStart
></GroupTitle>
<a-form-item
label={t('operation.templates.form.StorageType')}
field="spec.vcsRepository.platform"
hide-asterisk
hide-label={true}
Expand All @@ -226,7 +196,7 @@
}
});
}}
label={t('operation.templates.form.StorageType')}
label={t('common.table.type')}
required={true}
style={{ width: `${InputWidth.LARGE}px` }}
v-slots={{
Expand Down Expand Up @@ -277,7 +247,7 @@
style={{ width: `${InputWidth.LARGE}px` }}
></seal-input>
</a-form-item>
<a-form-item
{/* <a-form-item
label={t('operation.templates.form.authentication')}
field="spec.vcsRepository.secretRef"
hide-asterisk
Expand All @@ -294,8 +264,8 @@
style={{ width: `${InputWidth.LARGE}px` }}
options={AuthenticationOptions}
></seal-select>
</a-form-item>
{authentication.value === 'bearer' && (
</a-form-item> */}
{/* {authentication.value === 'bearer' && (
<a-form-item
label="Token"
field="spec.vcsRepository.token"
Expand Down Expand Up @@ -323,7 +293,7 @@
style={{ width: `${InputWidth.LARGE}px` }}
></seal-input>
</a-form-item>
)}
)} */}
</>
);
}
Expand Down
11 changes: 5 additions & 6 deletions src/views/operation-hub/templates/pages/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@
description: '',
vcsRepository: {
platform: 'Github',
url: '',
token: ''
url: ''
}
}
});
Expand Down Expand Up @@ -304,13 +303,13 @@
});
const getTemplateSchema = async (versionData) => {
if (!versionData) {
if (!versionData || !versionData.templateSchemaName) {
templateSchema.value = {};
return;
}
try {
const { data } = await queryTemplateSchema({
name: versionData.schemaRef?.name,
name: versionData.templateSchemaName,
namespace: templateNameSpace
});
templateSchema.value = data.status?.value;
Expand All @@ -321,13 +320,13 @@
};
const getTemplateUISchema = async (versionData) => {
if (!versionData) {
if (!versionData || !versionData.uiSchemaName) {
templateUISchema.value = {};
return;
}
try {
const { data } = await queryTemplateSchema({
name: versionData.uiSchemaRef?.name,
name: versionData.uiSchemaName,
namespace: templateNameSpace
});
templateUISchema.value = data.status?.value;
Expand Down

0 comments on commit c618c39

Please sign in to comment.