create additional policy override and monthly patching

This commit is contained in:
sadnub
2020-09-10 21:04:06 -04:00
parent d586f44002
commit ff0a4dfb33
2 changed files with 152 additions and 22 deletions

View File

@@ -76,10 +76,38 @@
<!-- Installation Schedule -->
<div class="text-subtitle2">Installation Schedule</div>
<hr />
<q-card-section class="row">
<div class="col-3">Schedule Frequency:</div>
<div class="col-4"></div>
<q-select
dense
class="col-5"
outlined
v-model="winupdatepolicy.run_time_frequency"
:options="frequencyOptions"
emit-value
map-options
/>
</q-card-section>
<q-card-section class="row" v-if="winupdatepolicy.run_time_frequency === 'monthly'">
<div class="col-3">Day of month to run:</div>
<div class="col-4"></div>
<q-select
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
dense
class="col-5"
outlined
v-model="winupdatepolicy.run_time_day"
:options="monthDays"
emit-value
map-options
/>
</q-card-section>
<q-card-section class="row">
<div class="col-3">Scheduled Time:</div>
<div class="col-4"></div>
<q-select
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
dense
class="col-5"
outlined
@@ -89,43 +117,95 @@
map-options
/>
</q-card-section>
<q-card-section>
<q-card-section
v-if="winupdatepolicy.run_time_frequency === 'daily' || winupdatepolicy.run_time_frequency === 'inherit'"
>
<div class="q-gutter-sm">
<q-checkbox v-model="winupdatepolicy.run_time_days" :val="1" label="Monday" />
<q-checkbox v-model="winupdatepolicy.run_time_days" :val="2" label="Tuesday" />
<q-checkbox v-model="winupdatepolicy.run_time_days" :val="3" label="Wednesday" />
<q-checkbox v-model="winupdatepolicy.run_time_days" :val="4" label="Thursday" />
<q-checkbox v-model="winupdatepolicy.run_time_days" :val="5" label="Friday" />
<q-checkbox v-model="winupdatepolicy.run_time_days" :val="6" label="Saturday" />
<q-checkbox v-model="winupdatepolicy.run_time_days" :val="0" label="Sunday" />
<q-checkbox
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
v-model="winupdatepolicy.run_time_days"
:val="1"
label="Monday"
/>
<q-checkbox
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
v-model="winupdatepolicy.run_time_days"
:val="2"
label="Tuesday"
/>
<q-checkbox
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
v-model="winupdatepolicy.run_time_days"
:val="3"
label="Wednesday"
/>
<q-checkbox
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
v-model="winupdatepolicy.run_time_days"
:val="4"
label="Thursday"
/>
<q-checkbox
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
v-model="winupdatepolicy.run_time_days"
:val="5"
label="Friday"
/>
<q-checkbox
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
v-model="winupdatepolicy.run_time_days"
:val="6"
label="Saturday"
/>
<q-checkbox
:disabled="winupdatepolicy.run_time_frequency === 'inherit'"
v-model="winupdatepolicy.run_time_days"
:val="0"
label="Sunday"
/>
</div>
</q-card-section>
<!-- Reboot After Installation -->
<div class="text-subtitle2">Reboot After Installation</div>
<hr />
<q-card-section class="row">
<div class="q-gutter-sm">
<q-radio v-model="winupdatepolicy.reboot_after_install" val="never" label="Never" />
<q-radio
v-model="winupdatepolicy.reboot_after_install"
val="required"
label="When Required"
/>
<q-radio v-model="winupdatepolicy.reboot_after_install" val="always" label="Always" />
</div>
<div class="col-3"></div>
<div class="col-4"></div>
<q-select
dense
class="col-5"
outlined
v-model="winupdatepolicy.reboot_after_install"
:options="rebootOptions"
emit-value
map-options
/>
</q-card-section>
<!-- Failed Patches -->
<div class="text-subtitle2">Failed Patches</div>
<hr />
<q-card-section class="row" v-if="!policy">
<div class="col-5">
<q-checkbox
v-model="winupdatepolicy.reprocess_failed_inherit"
label="Inherit failed patch settings"
/>
</div>
</q-card-section>
<q-card-section class="row">
<div class="col-5">
<q-checkbox v-model="winupdatepolicy.reprocess_failed" label="Reprocess failed patches" />
<q-checkbox
:disabled="winupdatepolicy.reprocess_failed_inherit"
v-model="winupdatepolicy.reprocess_failed"
label="Reprocess failed patches"
/>
</div>
<div class="col-3">
<q-input
dense
v-model.number="winupdatepolicy.reprocess_failed_times"
:disabled="winupdatepolicy.reprocess_failed_inherit"
type="number"
filled
label="Times"
@@ -135,6 +215,7 @@
<div class="col-3"></div>
<q-checkbox
v-model="winupdatepolicy.email_if_fail"
:disabled="winupdatepolicy.reprocess_failed_inherit"
label="Send an email when patch installation fails"
/>
</q-card-section>
@@ -147,7 +228,7 @@
</template>
<script>
import { scheduledTimes } from "@/mixins/data";
import { scheduledTimes, monthDays } from "@/mixins/data";
import { notifySuccessConfig, notifyErrorConfig } from "@/mixins/mixins";
export default {
@@ -166,10 +247,11 @@ export default {
moderate: "ignore",
low: "ignore",
other: "ignore",
run_time_hour: 0,
repeat: 0,
run_time_hour: 3,
run_time_frequency: "daily",
run_time_days: [],
reboot_after_install: "never",
reprocess_failed_inherit: false,
reprocess_failed: false,
reprocess_failed_times: 5,
email_if_fail: false,
@@ -179,7 +261,17 @@ export default {
{ label: "Approve", value: "approve" },
{ label: "Ignore", value: "ignore" },
],
frequencyOptions: [
{ label: "Daily/Weekly", value: "daily" },
{ label: "Monthly", value: "monthly" },
],
rebootOptions: [
{ label: "Never", value: "never" },
{ label: "When Required", value: "required" },
{ label: "Always", value: "always" },
],
timeOptions: scheduledTimes,
monthDays,
};
},
methods: {
@@ -252,7 +344,11 @@ export default {
}
} else if (this.agent) {
this.winupdatepolicy = this.agent.winupdatepolicy[0];
// add agent inherit options
this.severityOptions.push({ label: "Inherit", value: "inherit" });
this.frequencyOptions.push({ label: "Inherit", value: "inherit" });
this.rebootOptions.push({ label: "Inherit", value: "inherit" });
}
},
};

View File

@@ -25,4 +25,38 @@ const scheduledTimes = [
{ label: "11 PM", value: 23 }
];
export { scheduledTimes };
const monthDays = [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31"
]
export { scheduledTimes, monthDays };