add 'install patches now' feature

This commit is contained in:
wh1te909
2020-06-26 01:44:37 +00:00
parent 234f814675
commit c4874ccdb5
5 changed files with 51 additions and 0 deletions

View File

@@ -145,6 +145,14 @@
>
<q-item-section>Run Patch Status Scan</q-item-section>
</q-item>
<q-item
clickable
v-ripple
v-close-popup
@click.stop.prevent="installPatches(props.row.id)"
>
<q-item-section>Install Patches Now</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-item>
@@ -383,6 +391,19 @@ export default {
this.notifySuccess(`Scan will be run shortly on ${hostname}`);
});
},
installPatches(pk) {
this.$q.loading.show();
this.$axios
.get(`/winupdate/${pk}/installnow/`)
.then(r => {
this.$q.loading.hide();
this.notifySuccess(r.data);
})
.catch(e => {
this.$q.loading.hide();
this.notifyError(e.response.data, 5000);
});
},
agentEdited() {
this.$emit("refreshEdit");
},