mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
fix(task_params): remove extra params
This commit is contained in:
parent
3b3b29ee88
commit
c0491e7aed
@ -46,6 +46,15 @@
|
||||
<div class="text-no-wrap">{{ $t('Plan') }}</div>
|
||||
</template>
|
||||
</v-checkbox>
|
||||
<v-checkbox
|
||||
class="mt-0"
|
||||
:input-value="value.auto_approve"
|
||||
@change="updateValue('auto_approve', $event)"
|
||||
>
|
||||
<template v-slot:label>
|
||||
<div class="text-no-wrap">{{ $t('Auto Approve') }} <code>-auto-approve</code></div>
|
||||
</template>
|
||||
</v-checkbox>
|
||||
</div>
|
||||
<div v-else></div>
|
||||
</template>
|
||||
@ -55,6 +64,13 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
const APP_PARAMS = {
|
||||
ansible: ['debug', 'dry_run', 'diff'],
|
||||
terraform: ['plan', 'auto_approve'],
|
||||
tofu: ['plan', 'auto_approve'],
|
||||
};
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: Object,
|
||||
@ -63,7 +79,14 @@ export default {
|
||||
|
||||
methods: {
|
||||
updateValue(prop, value) {
|
||||
this.$emit('input', { ...this.value, [prop]: value });
|
||||
let input = { ...this.value, [prop]: value };
|
||||
|
||||
input = (APP_PARAMS[this.app] || []).reduce((res, param) => ({
|
||||
...res,
|
||||
[param]: input[param],
|
||||
}), {});
|
||||
|
||||
this.$emit('input', input);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user