[Improvement-12335][ui] Make the resources to be reactive in hivecli task (#12336)

This commit is contained in:
rickchengx 2022-11-07 18:05:51 +08:00 committed by GitHub
parent 9bba4b105c
commit 58721ba855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,8 @@ import type { IJsonItem } from '../types'
export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
const { t } = useI18n()
const hiveSqlScriptSpan = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0))
const resourcesRequired = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? false : true))
const resourcesLimit = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1))
return [
{
@ -56,7 +58,7 @@ export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
placeholder: t('project.node.hive_cli_options_tips')
}
},
useResources(),
useResources(24, resourcesRequired, resourcesLimit),
...useCustomParams({ model, field: 'localParams', isSimple: false })
]
}