Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofill available images in the new accounting dialog #511

Merged
merged 2 commits into from
Jun 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions frontend/admin/vue-components/accounting/NewAccountingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<vue-form :state="formstate" v-model="formstate" @submit.prevent="createNewAccounting">
<validate auto-label class="form-group required-field" :class="fieldClassName(formstate.image_name)">
<label class="control-label">Image Name</label>
<input type="text" name="image_name" class="form-control" required v-model="model.image_name">
<select name="image_name" class="form-control" required v-model="model.image_name">
<option v-for="imageName in imageNames">
{{imageName}}
</option>
</select>
<field-messages name="image_name" show="$dirty || $submitted">
<span class="help-block" slot="required">Image Name cannot be empty</span>
</field-messages>
Expand Down Expand Up @@ -74,10 +78,22 @@
volume_target: '',
volume_readonly: false,
volume_source_target: []
}
},
imageNames: []
};
},

mounted: function() {
resources.Application.items()
.done((identifiers, items) => {
this.imageNames = [];
identifiers.forEach((id) => {
let item = items[id];
this.imageNames.push(item.image_name);
});
});
},

methods: {
close: function () {
this.$emit('closed');
Expand Down