fixed reboot later modal and allowed only certain pending actions to be deleted
This commit is contained in:
@@ -346,7 +346,7 @@
|
||||
<span v-else>{{ props.row.logged_username }}</span>
|
||||
</q-td>
|
||||
<q-td :props="props" key="patchespending">
|
||||
<q-icon v-if="props.row.has_patches_pending" name="far fa-clock" color="primary">
|
||||
<q-icon v-if="props.row.has_patches_pending" name="verified_user" size="1.5em" color="primary">
|
||||
<q-tooltip>Patches Pending</q-tooltip>
|
||||
</q-icon>
|
||||
</q-td>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<export-table-btn v-show="false" class="q-ml-sm" :columns="columns" :data="events" />
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td>{{ props.row.eventType }}</q-td>
|
||||
<q-td>{{ props.row.source }}</q-td>
|
||||
<q-td>{{ props.row.eventID }}</q-td>
|
||||
|
||||
@@ -47,14 +47,18 @@
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-menu context-menu>
|
||||
<q-menu context-menu auto-close>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="killProcess(props.row.pid, props.row.name)">
|
||||
<q-item-section thumbnail>
|
||||
<q-item clickable @click="killProcess(props.row.pid, props.row.name)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt" size="xs" />
|
||||
</q-item-section>
|
||||
<q-item-section>End Process</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable>
|
||||
<q-item-section>Close</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<q-td>{{ props.row.name }}</q-td>
|
||||
|
||||
@@ -26,21 +26,25 @@
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer" @dblclick="showServiceDetail(props.row)">
|
||||
<q-menu context-menu>
|
||||
<q-menu context-menu auto-close>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="sendServiceAction(props.row, 'start')">
|
||||
<q-item clickable @click="sendServiceAction(props.row, 'start')">
|
||||
<q-item-section>Start</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="sendServiceAction(props.row, 'stop')">
|
||||
<q-item clickable @click="sendServiceAction(props.row, 'stop')">
|
||||
<q-item-section>Stop</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="sendServiceAction(props.row, 'restart')">
|
||||
<q-item clickable @click="sendServiceAction(props.row, 'restart')">
|
||||
<q-item-section>Restart</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="showServiceDetail(props.row)">
|
||||
<q-item clickable @click="showServiceDetail(props.row)">
|
||||
<q-item-section>Service Details</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable>
|
||||
<q-item-section>Close</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<q-td key="display_name" :props="props">
|
||||
|
||||
@@ -39,6 +39,24 @@
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr class="cursor-pointer">
|
||||
<q-menu context-menu auto-close>
|
||||
<q-list dense>
|
||||
<q-item
|
||||
:disable="props.row.status === 'completed' || props.row.action_type !== 'schedreboot'"
|
||||
clickable
|
||||
@click="cancelPendingAction(props.row)"
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt" size="xs" />
|
||||
</q-item-section>
|
||||
<q-item-section>Cancel Action</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section>Close</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<q-td v-if="props.row.action_type === 'schedreboot'">
|
||||
<q-icon name="power_settings_new" size="sm" />
|
||||
</q-td>
|
||||
@@ -150,7 +168,7 @@ export default {
|
||||
}).onOk(async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const result = await deletePendingAction(action.pk);
|
||||
const result = await deletePendingAction(action.id);
|
||||
notifySuccess(result);
|
||||
await getPendingActions();
|
||||
} catch (e) {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<script>
|
||||
// composition imports
|
||||
import { ref } from "vue";
|
||||
import { useDialogPluginComponent } from "quasar";
|
||||
import { useQuasar, useDialogPluginComponent } from "quasar";
|
||||
import { scheduleAgentReboot } from "@/api/agents";
|
||||
import { date } from "quasar";
|
||||
|
||||
@@ -51,6 +51,7 @@ export default {
|
||||
setup(props) {
|
||||
// setup quasar dialog plugin
|
||||
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
||||
const $q = useQuasar();
|
||||
|
||||
// setup reboot later logic
|
||||
const state = ref({
|
||||
@@ -64,7 +65,7 @@ export default {
|
||||
try {
|
||||
const result = await scheduleAgentReboot(props.agent.agent_id, { datetime: state.value.datetime });
|
||||
|
||||
this.$q.dialog({
|
||||
$q.dialog({
|
||||
title: "Reboot pending",
|
||||
style: "width: 40vw",
|
||||
message: `A reboot has been scheduled for <strong>${state.value.datetime}</strong> on ${props.agent.agent_id}.
|
||||
|
||||
Reference in New Issue
Block a user