dense options ui

This commit is contained in:
wh1te909
2020-08-30 09:52:04 +00:00
parent 35c0ae1ebe
commit cb8339126c
20 changed files with 160 additions and 106 deletions

View File

@@ -4,6 +4,7 @@
<div class="col-2">
<q-select
dense
options-dense
outlined
v-model="days"
:options="lastDays"
@@ -88,15 +89,15 @@ export default {
pagination: {
rowsPerPage: 0,
sortBy: "record",
descending: true
descending: true,
},
columns: [
{ name: "eventType", label: "Type", field: "eventType", align: "left", sortable: true },
{ name: "source", label: "Source", field: "source", align: "left", sortable: true },
{ name: "eventID", label: "Event ID", field: "eventID", align: "left", sortable: true },
{ name: "time", label: "Time", field: "time", align: "left", sortable: true },
{ name: "message", label: "Message (click to view full)", field: "message", align: "left", sortable: true }
]
{ name: "message", label: "Message (click to view full)", field: "message", align: "left", sortable: true },
],
};
},
computed: {
@@ -105,7 +106,7 @@ export default {
},
showDays() {
return `Show last ${this.days} days`;
}
},
},
methods: {
formatMessage(msg) {
@@ -115,7 +116,7 @@ export default {
this.$q.dialog({
message: `<pre>${msg}</pre>`,
html: true,
fullWidth: true
fullWidth: true,
});
},
getEventLog() {
@@ -131,10 +132,10 @@ export default {
this.$q.loading.hide();
this.notifyError(e.response.data);
});
}
},
},
created() {
this.getEventLog();
}
},
};
</script>

View File

@@ -101,6 +101,7 @@
<q-select
@input="startupTypeChanged"
dense
options-dense
outlined
v-model="startupType"
:options="startupOptions"
@@ -182,7 +183,7 @@ export default {
pagination: {
rowsPerPage: 9999,
sortBy: "display_name",
descending: false
descending: false,
},
columns: [
{
@@ -190,37 +191,37 @@ export default {
label: "Name",
field: "display_name",
align: "left",
sortable: true
sortable: true,
},
{
name: "start_type",
label: "Startup",
field: "start_type",
align: "left",
sortable: true
sortable: true,
},
{
name: "pid",
label: "PID",
field: "pid",
align: "left",
sortable: true
sortable: true,
},
{
name: "status",
label: "Status",
field: "status",
align: "left",
sortable: true
sortable: true,
},
{
name: "username",
label: "Log On As",
field: "username",
align: "left",
sortable: true
}
]
sortable: true,
},
],
};
},
methods: {
@@ -245,7 +246,7 @@ export default {
const data = {
pk: this.pk,
sv_name: name,
edit_action: changed
edit_action: changed,
};
this.serviceDetailVisible = true;
axios
@@ -309,7 +310,7 @@ export default {
const data = {
pk: this.pk,
sv_name: name,
sv_action: action
sv_action: action,
};
axios
.post("/services/serviceaction/", data)
@@ -343,10 +344,10 @@ export default {
this.$q.loading.hide();
this.notifyError(e.response.data);
});
}
},
},
created() {
this.getServices();
}
},
};
</script>

View File

@@ -29,6 +29,7 @@
<q-select
@input="agent.site = sites[0]"
dense
options-dense
outlined
v-model="agent.client"
:options="Object.keys(tree)"
@@ -38,13 +39,21 @@
<q-card-section class="row">
<div class="col-2">Site:</div>
<div class="col-2"></div>
<q-select class="col-8" dense outlined v-model="agent.site" :options="sites" />
<q-select
class="col-8"
dense
options-dense
outlined
v-model="agent.site"
:options="sites"
/>
</q-card-section>
<q-card-section class="row">
<div class="col-2">Type:</div>
<div class="col-2"></div>
<q-select
dense
options-dense
outlined
v-model="agent.monitoring_type"
:options="monTypes"
@@ -68,6 +77,7 @@
<q-select
outlined
dense
options-dense
v-model="timezone"
:options="allTimezones"
class="col-8"
@@ -125,6 +135,7 @@
<div class="col-4"></div>
<q-select
dense
options-dense
class="col-5"
outlined
v-model="agent.winupdatepolicy[0].critical"
@@ -138,6 +149,7 @@
<div class="col-4"></div>
<q-select
dense
options-dense
class="col-5"
outlined
v-model="agent.winupdatepolicy[0].important"
@@ -151,6 +163,7 @@
<div class="col-4"></div>
<q-select
dense
options-dense
class="col-5"
outlined
v-model="agent.winupdatepolicy[0].moderate"
@@ -164,6 +177,7 @@
<div class="col-4"></div>
<q-select
dense
options-dense
class="col-5"
outlined
v-model="agent.winupdatepolicy[0].low"
@@ -177,6 +191,7 @@
<div class="col-4"></div>
<q-select
dense
options-dense
class="col-5"
outlined
v-model="agent.winupdatepolicy[0].other"
@@ -193,6 +208,7 @@
<div class="col-4"></div>
<q-select
dense
options-dense
class="col-5"
outlined
v-model="agent.winupdatepolicy[0].run_time_hour"
@@ -326,7 +342,7 @@ export default {
severityOptions: [
{ label: "Manual", value: "manual" },
{ label: "Approve", value: "approve" },
{ label: "Ignore", value: "ignore" }
{ label: "Ignore", value: "ignore" },
],
timeOptions: scheduledTimes,
thumbStyle: {
@@ -334,8 +350,8 @@ export default {
borderRadius: "5px",
backgroundColor: "#027be3",
width: "5px",
opacity: 0.75
}
opacity: 0.75,
},
};
},
methods: {
@@ -388,7 +404,7 @@ export default {
this.notifySuccess("Agent was edited!");
})
.catch(() => this.notifyError("Something went wrong"));
}
},
},
computed: {
...mapGetters(["selectedAgentPk"]),
@@ -396,11 +412,11 @@ export default {
if (this.agentLoaded && this.clientsLoaded) {
return this.tree[this.agent.client];
}
}
},
},
created() {
this.getAgentInfo();
this.getClientsSites();
}
},
};
</script>

View File

@@ -15,6 +15,7 @@
<q-select
outlined
dense
options-dense
label="Client"
v-model="client"
:options="Object.keys(tree)"
@@ -22,7 +23,7 @@
/>
</q-card-section>
<q-card-section class="q-gutter-sm">
<q-select dense outlined label="Site" v-model="site" :options="sites" />
<q-select dense options-dense outlined label="Site" v-model="site" :options="sites" />
</q-card-section>
<q-card-section>
<div class="q-gutter-sm">
@@ -57,7 +58,13 @@
</q-card-section>
<q-card-section>
Select Version
<q-select dense outlined v-model="version" :options="Object.values(versions)" />
<q-select
dense
options-dense
outlined
v-model="version"
:options="Object.values(versions)"
/>
</q-card-section>
<q-card-section>
Installation Method

View File

@@ -10,7 +10,14 @@
<q-separator />
<q-card-section>
Select Version
<q-select square outlined v-model="version" :options="Object.values(versions)" />
<q-select
square
dense
options-dense
outlined
v-model="version"
:options="Object.values(versions)"
/>
</q-card-section>
<q-card-section v-show="version !== null">
Select Agent
@@ -38,7 +45,7 @@ export default {
version: null,
agents: [],
group: [],
selectAll: false
selectAll: false,
};
},
methods: {
@@ -68,7 +75,7 @@ export default {
this.notifySuccess("Agents will now be updated");
})
.catch(() => this.notifyError("Something went wrong"));
}
},
},
computed: {
agentPKs() {
@@ -83,10 +90,10 @@ export default {
options.push(opt);
}
return options;
}
},
},
created() {
this.getVersions();
}
},
};
</script>

View File

@@ -24,6 +24,7 @@
<q-select
outlined
dense
options-dense
v-model="cpuloadcheck.fails_b4_alert"
:options="failOptions"
label="Number of consecutive failures before alert"
@@ -47,7 +48,7 @@ export default {
agentpk: Number,
policypk: Number,
mode: String,
checkpk: Number
checkpk: Number,
},
mixins: [mixins],
data() {
@@ -55,9 +56,9 @@ export default {
cpuloadcheck: {
check_type: "cpuload",
threshold: 85,
fails_b4_alert: 1
fails_b4_alert: 1,
},
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
};
},
methods: {
@@ -68,7 +69,7 @@ export default {
const pk = this.policypk ? { policy: this.policypk } : { pk: this.agentpk };
const data = {
...pk,
check: this.cpuloadcheck
check: this.cpuloadcheck,
};
axios
.post("/checks/checks/", data)
@@ -95,12 +96,12 @@ export default {
} else {
this.$store.dispatch("loadChecks", this.agentpk);
}
}
},
},
created() {
if (this.mode === "edit") {
this.getCheck();
}
}
},
};
</script>

View File

@@ -33,6 +33,7 @@
<q-select
outlined
dense
options-dense
v-model="diskcheck.fails_b4_alert"
:options="failOptions"
label="Number of consecutive failures before alert"
@@ -57,7 +58,7 @@ export default {
agentpk: Number,
policypk: Number,
mode: String,
checkpk: Number
checkpk: Number,
},
mixins: [mixins],
data() {
@@ -66,10 +67,10 @@ export default {
disk: null,
check_type: "diskspace",
threshold: 25,
fails_b4_alert: 1
fails_b4_alert: 1,
},
diskOptions: [],
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
};
},
methods: {
@@ -91,7 +92,7 @@ export default {
const pk = this.policypk ? { policy: this.policypk } : { pk: this.agentpk };
const data = {
...pk,
check: this.diskcheck
check: this.diskcheck,
};
axios
.post("/checks/checks/", data)
@@ -118,10 +119,10 @@ export default {
} else {
this.$store.dispatch("loadChecks", this.agentpk);
}
}
},
},
computed: {
...mapGetters(["agentDisks"])
...mapGetters(["agentDisks"]),
},
created() {
if (this.mode === "add") {
@@ -129,6 +130,6 @@ export default {
} else if (this.mode === "edit") {
this.getCheck();
}
}
},
};
</script>

View File

@@ -20,6 +20,7 @@
<q-card-section>
<q-select
dense
options-dense
outlined
v-model="eventlogcheck.log_name"
:options="logNameOptions"
@@ -29,6 +30,7 @@
<q-card-section>
<q-select
dense
options-dense
outlined
v-model="eventlogcheck.fail_when"
:options="failWhenOptions"
@@ -83,6 +85,7 @@
<q-select
outlined
dense
options-dense
v-model="eventlogcheck.fails_b4_alert"
:options="failOptions"
label="Number of consecutive failures before alert"

View File

@@ -24,6 +24,7 @@
<q-select
outlined
dense
options-dense
v-model="memcheck.fails_b4_alert"
:options="failOptions"
label="Number of consecutive failures before alert"
@@ -47,7 +48,7 @@ export default {
agentpk: Number,
policypk: Number,
mode: String,
checkpk: Number
checkpk: Number,
},
mixins: [mixins],
data() {
@@ -55,9 +56,9 @@ export default {
memcheck: {
check_type: "memory",
threshold: 85,
fails_b4_alert: 1
fails_b4_alert: 1,
},
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
};
},
methods: {
@@ -68,7 +69,7 @@ export default {
const pk = this.policypk ? { policy: this.policypk } : { pk: this.agentpk };
const data = {
...pk,
check: this.memcheck
check: this.memcheck,
};
axios
.post("/checks/checks/", data)
@@ -95,12 +96,12 @@ export default {
} else {
this.$store.dispatch("loadChecks", this.agentpk);
}
}
},
},
created() {
if (this.mode === "edit") {
this.getCheck();
}
}
},
};
</script>

View File

@@ -28,6 +28,7 @@
<q-select
outlined
dense
options-dense
v-model="pingcheck.fails_b4_alert"
:options="failOptions"
label="Number of consecutive failures before alert"
@@ -51,7 +52,7 @@ export default {
agentpk: Number,
policypk: Number,
mode: String,
checkpk: Number
checkpk: Number,
},
mixins: [mixins],
data() {
@@ -60,9 +61,9 @@ export default {
check_type: "ping",
name: null,
ip: null,
fails_b4_alert: 1
fails_b4_alert: 1,
},
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
};
},
methods: {
@@ -73,7 +74,7 @@ export default {
const pk = this.policypk ? { policy: this.policypk } : { pk: this.agentpk };
const data = {
...pk,
check: this.pingcheck
check: this.pingcheck,
};
axios
.post("/checks/checks/", data)
@@ -100,12 +101,12 @@ export default {
} else {
this.$store.dispatch("loadChecks", this.agentpk);
}
}
},
},
created() {
if (this.mode === "edit") {
this.getCheck();
}
}
},
};
</script>

View File

@@ -23,6 +23,7 @@
<q-select
:rules="[val => !!val || '*Required']"
dense
options-dense
outlined
v-model="scriptcheck.script"
:options="scriptOptions"
@@ -49,6 +50,7 @@
<q-select
outlined
dense
options-dense
v-model="scriptcheck.fails_b4_alert"
:options="failOptions"
label="Number of consecutive failures before alert"
@@ -73,7 +75,7 @@ export default {
agentpk: Number,
policypk: Number,
mode: String,
checkpk: Number
checkpk: Number,
},
mixins: [mixins],
data() {
@@ -82,9 +84,9 @@ export default {
check_type: "script",
script: null,
timeout: 120,
fails_b4_alert: 1
fails_b4_alert: 1,
},
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
};
},
computed: {
@@ -95,7 +97,7 @@ export default {
ret.push({ label: i.name, value: i.id });
});
return ret;
}
},
},
methods: {
getCheck() {
@@ -108,7 +110,7 @@ export default {
const pk = this.policypk ? { policy: this.policypk } : { pk: this.agentpk };
const data = {
...pk,
check: this.scriptcheck
check: this.scriptcheck,
};
axios
.post("/checks/checks/", data)
@@ -135,12 +137,12 @@ export default {
} else {
this.$store.dispatch("loadChecks", this.agentpk);
}
}
},
},
created() {
if (this.mode === "edit") {
this.getCheck();
}
}
},
};
</script>

View File

@@ -28,6 +28,7 @@
v-if="policypk && winsvccheck.svc_policy_mode === 'default' && this.mode !== 'edit'"
:rules="[val => !!val || '*Required']"
dense
options-dense
outlined
v-model="winsvccheck.svc_name"
:options="serviceOptions"
@@ -41,6 +42,7 @@
v-if="policypk && winsvccheck.svc_policy_mode === 'default' && this.mode === 'edit'"
disable
dense
options-dense
outlined
v-model="winsvccheck.svc_name"
:options="serviceOptions"
@@ -70,6 +72,7 @@
v-if="agentpk"
:rules="[val => !!val || '*Required']"
dense
options-dense
outlined
v-model="winsvccheck.svc_name"
:options="serviceOptions"
@@ -95,6 +98,7 @@
<q-select
outlined
dense
options-dense
v-model="winsvccheck.fails_b4_alert"
:options="failOptions"
label="Number of consecutive failures before alert"
@@ -119,7 +123,7 @@ export default {
agentpk: Number,
policypk: Number,
mode: String,
checkpk: Number
checkpk: Number,
},
mixins: [mixins],
data() {
@@ -131,10 +135,10 @@ export default {
svc_policy_mode: null,
pass_if_start_pending: false,
restart_if_stopped: false,
fails_b4_alert: 1
fails_b4_alert: 1,
},
svcData: [],
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
failOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
};
},
computed: {
@@ -147,7 +151,7 @@ export default {
});
// sort alphabetically by display name
return ret.sort((a, b) => (a.label > b.label ? 1 : -1));
}
},
},
methods: {
clearServiceOptions() {
@@ -174,7 +178,7 @@ export default {
const pk = this.policypk ? { policy: this.policypk } : { pk: this.agentpk };
const data = {
...pk,
check: this.winsvccheck
check: this.winsvccheck,
};
axios
.post("/checks/checks/", data)
@@ -201,7 +205,7 @@ export default {
} else {
this.$store.dispatch("loadChecks", this.agentpk);
}
}
},
},
created() {
this.setServices();
@@ -210,6 +214,6 @@ export default {
if (this.mode === "edit") {
this.getCheck();
}
}
},
};
</script>

View File

@@ -12,7 +12,7 @@
<q-card-section>
<q-form @submit.prevent="addSite">
<q-card-section>
<q-select outlined v-model="clientName" :options="Object.keys(clients)" />
<q-select options-dense outlined v-model="clientName" :options="Object.keys(clients)" />
</q-card-section>
<q-card-section>
<q-input
@@ -41,7 +41,7 @@ export default {
data() {
return {
clientName: "",
siteName: ""
siteName: "",
};
},
methods: {
@@ -54,7 +54,7 @@ export default {
axios
.post("/clients/addsite/", {
client: this.clientName,
site: this.siteName
site: this.siteName,
})
.then(() => {
this.$emit("close");
@@ -62,10 +62,10 @@ export default {
this.notifySuccess(`Site ${this.siteName} was added!`);
})
.catch(err => this.notifyError(err.response.data.error));
}
},
},
created() {
this.loadFirstClient();
}
},
};
</script>

View File

@@ -15,6 +15,7 @@
<q-select
:rules="[val => !!val || '*Required']"
outlined
options-dense
label="Select client"
v-model="client.id"
:options="clients"
@@ -50,8 +51,8 @@ export default {
clients: [],
client: {
client: null,
id: null
}
id: null,
},
};
},
computed: {
@@ -60,7 +61,7 @@ export default {
const origName = this.clients.find(i => i.value === this.client.id).label;
return this.client.client === origName ? false : true;
}
}
},
},
methods: {
getClients() {
@@ -88,10 +89,10 @@ export default {
this.notifyError(e.response.data.non_field_errors);
}
});
}
},
},
created() {
this.getClients();
}
},
};
</script>

View File

@@ -15,6 +15,7 @@
<q-select
:rules="[val => !!val || '*Required']"
outlined
options-dense
label="Select client"
v-model="client"
:options="Object.keys(tree)"
@@ -25,6 +26,7 @@
<q-select
:rules="[val => !!val || '*Required']"
outlined
options-dense
label="Select site"
v-model="site"
:options="sites"
@@ -58,7 +60,7 @@ export default {
tree: null,
client: null,
site: null,
newName: null
newName: null,
};
},
computed: {
@@ -73,7 +75,7 @@ export default {
if (this.site !== null) {
return this.newName === this.site ? false : true;
}
}
},
},
methods: {
getTree() {
@@ -86,7 +88,7 @@ export default {
const data = {
client: this.client,
site: this.site,
name: this.newName
name: this.newName,
};
axios
.patch("/clients/editsite/", data)
@@ -96,10 +98,10 @@ export default {
this.notifySuccess("Site was edited");
})
.catch(e => this.notifyError(e.response.data));
}
},
},
created() {
this.getTree();
}
},
};
</script>

View File

@@ -32,6 +32,7 @@
<q-select
outlined
dense
options-dense
v-model="settings.default_time_zone"
:options="allTimezones"
class="col-6"

View File

@@ -23,6 +23,7 @@
<q-select
dark
dense
options-dense
outlined
v-model="agent"
:options="agents"
@@ -34,6 +35,7 @@
<q-select
dark
dense
options-dense
outlined
v-model="order"
:options="orders"
@@ -88,7 +90,7 @@ export default {
agent: "all",
agents: [],
order: "latest",
orders: ["latest", "oldest"]
orders: ["latest", "oldest"],
};
},
methods: {
@@ -113,12 +115,12 @@ export default {
},
hideLogModal() {
this.$store.commit("logs/TOGGLE_LOG_MODAL", false);
}
},
},
computed: {
...mapState({
toggleLogModal: state => state.logs.toggleLogModal
})
}
toggleLogModal: state => state.logs.toggleLogModal,
}),
},
};
</script>

View File

@@ -70,6 +70,7 @@
<q-select
:disable="isBuiltInScript"
dense
options-dense
class="col-10"
outlined
v-model="script.shell"

View File

@@ -22,6 +22,7 @@
<q-select
:rules="[val => !!val || '*Required']"
dense
options-dense
outlined
v-model="autotask.script"
:options="scriptOptions"
@@ -82,6 +83,7 @@
<q-select
:rules="[val => !!val || '*Required']"
dense
options-dense
outlined
v-model="autotask.assigned_check"
:options="checksOptions"
@@ -124,7 +126,7 @@ import mixins from "@/mixins/mixins";
export default {
name: "AddAutomatedTask",
props: {
policypk: Number
policypk: Number,
},
mixins: [mixins],
data() {
@@ -137,7 +139,7 @@ export default {
run_time_days: [],
run_time_minute: null,
task_type: "scheduled",
timeout: 120
timeout: 120,
},
dayOptions: [
{ label: "Monday", value: 0 },
@@ -146,8 +148,8 @@ export default {
{ label: "Thursday", value: 3 },
{ label: "Friday", value: 4 },
{ label: "Saturday", value: 5 },
{ label: "Sunday", value: 6 }
]
{ label: "Sunday", value: 6 },
],
};
},
methods: {
@@ -164,7 +166,7 @@ export default {
const data = {
...pk,
autotask: this.autotask
autotask: this.autotask,
};
axios
@@ -186,7 +188,7 @@ export default {
},
getScripts() {
this.$store.dispatch("getScripts");
}
},
},
computed: {
...mapGetters(["selectedAgentPk", "scripts"]),
@@ -224,10 +226,10 @@ export default {
} else {
return false;
}
}
},
},
created() {
this.getScripts();
}
},
};
</script>

View File

@@ -36,7 +36,7 @@
</q-card-section>
<q-card-section>
<div>Default timezone for agents:</div>
<q-select dense outlined v-model="timezone" :options="allTimezones" />
<q-select dense options-dense outlined v-model="timezone" :options="allTimezones" />
</q-card-section>
<q-card-section>
<div class="row">
@@ -77,11 +77,11 @@ export default {
return {
client: {
client: null,
site: null
site: null,
},
meshagent: null,
allTimezones: [],
timezone: null
timezone: null,
};
},
methods: {
@@ -90,7 +90,7 @@ export default {
const data = {
client: this.client,
timezone: this.timezone,
initialsetup: true
initialsetup: true,
};
axios
.post("/clients/clients/", data)
@@ -122,10 +122,10 @@ export default {
this.allTimezones = Object.freeze(r.data.all_timezones);
this.timezone = r.data.default_time_zone;
});
}
},
},
created() {
this.getSettings();
}
},
};
</script>