ENV
to pass
- environment variables to ansible-playbook.
+ Environment must be valid JSON.
Example:
{ "var_available_in_playbook_1": 1245, "var_available_in_playbook_2": "test", - "ENV": { - "VAR1": "Read by lookup('env', 'VAR1')" - } }diff --git a/web2/src/components/ItemFormBase.js b/web2/src/components/ItemFormBase.js index 85004b86..ca2acf2a 100644 --- a/web2/src/components/ItemFormBase.js +++ b/web2/src/components/ItemFormBase.js @@ -167,7 +167,9 @@ export default { }); } catch (err) { this.formError = getErrorMessage(err); - this.$emit('error', {}); + this.$emit('error', { + message: this.formError, + }); } finally { this.formSaving = false; } diff --git a/web2/src/components/ItemListPageBase.js b/web2/src/components/ItemListPageBase.js index be361e71..b37cb373 100644 --- a/web2/src/components/ItemListPageBase.js +++ b/web2/src/components/ItemListPageBase.js @@ -2,12 +2,15 @@ import axios from 'axios'; import EventBus from '@/event-bus'; import EditDialog from '@/components/EditDialog.vue'; import YesNoDialog from '@/components/YesNoDialog.vue'; +import ObjectRefsDialog from '@/components/ObjectRefsDialog.vue'; + import { getErrorMessage } from '@/lib/error'; export default { components: { YesNoDialog, EditDialog, + ObjectRefsDialog, }, props: { @@ -19,9 +22,13 @@ export default { return { headers: this.getHeaders(), items: null, + itemId: null, editDialog: null, deleteItemDialog: null, + + itemRefs: null, + itemRefsDialog: null, }; }, @@ -32,7 +39,8 @@ export default { methods: { // eslint-disable-next-line no-empty-function - async beforeLoadItems() { }, + async beforeLoadItems() { + }, getSingleItemUrl() { throw new Error('Not implemented'); @@ -54,8 +62,27 @@ export default { await this.loadItems(); }, - askDeleteItem(itemId) { + async askDeleteItem(itemId) { this.itemId = itemId; + + try { + this.itemRefs = (await axios({ + method: 'get', + url: `${this.getSingleItemUrl()}/refs`, + responseType: 'json', + })).data; + + if (this.itemRefs.templates.length > 0 + || this.itemRefs.repositories.length > 0 + || this.itemRefs.inventories.length > 0 + || this.itemRefs.schedules.length > 0) { + this.itemRefsDialog = true; + return; + } + } catch (e) { + // Do nothing + } + this.deleteItemDialog = true; }, diff --git a/web2/src/components/KeyForm.vue b/web2/src/components/KeyForm.vue index 8d186409..052f77ed 100644 --- a/web2/src/components/KeyForm.vue +++ b/web2/src/components/KeyForm.vue @@ -31,22 +31,6 @@ :disabled="formSaving || !canEditSecrets" /> -
{{ item.git_branch }}
+
+
{{ keys.find((k) => k.id === item.ssh_key_id).name }}
diff --git a/web2/src/views/project/Settings.vue b/web2/src/views/project/Settings.vue
index 65dff562..7bf9d116 100644
--- a/web2/src/views/project/Settings.vue
+++ b/web2/src/views/project/Settings.vue
@@ -21,7 +21,7 @@