some quasar cleanup

This commit is contained in:
wh1te909
2020-04-19 09:41:45 +00:00
parent 4fa35e616c
commit e0281f6a52
9 changed files with 840 additions and 556 deletions

View File

@@ -1,2 +0,0 @@
> 1%
last 2 versions

View File

@@ -1,3 +1,16 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
};
"presets": [
"@vue/cli-plugin-babel/preset"
],
"plugins": [
[
"transform-imports",
{
"quasar": {
"transform": "quasar/dist/babel-transforms/imports.js",
"preventFullImport": true
}
}
]
]
}

1230
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -16,12 +16,19 @@
"vuex": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.2.3",
"@vue/cli-service": "^4.2.3",
"babel-plugin-transform-imports": "2.0.0",
"@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-router": "~4.3.0",
"@vue/cli-plugin-vuex": "~4.3.0",
"@vue/cli-service": "~4.3.0",
"babel-plugin-transform-imports": "1.5.0",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"vue-cli-plugin-quasar": "^2.0.0",
"vue-cli-plugin-quasar": "~2.0.0",
"vue-template-compiler": "^2.6.11"
}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

View File

@@ -1,5 +0,0 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}

View File

@@ -3,8 +3,14 @@ import Vue from "vue";
import "./styles/quasar.styl";
import "@quasar/extras/material-icons/material-icons.css";
import "@quasar/extras/fontawesome-v5/fontawesome-v5.css";
import "@quasar/extras/mdi-v3/mdi-v3.css";
import Quasar from "quasar";
import {
Quasar,
Dialog,
Loading,
LoadingBar,
Meta,
Notify
} from 'quasar';
Vue.use(Quasar, {
config: {
@@ -18,5 +24,13 @@ Vue.use(Quasar, {
textColor: "white",
actions: [{ icon: "close", color: "white" }]
}
},
plugins: {
Dialog,
Loading,
LoadingBar,
Meta,
Notify
}
});

View File

@@ -1,16 +1,16 @@
import Vue from "vue";
import Router from "vue-router";
import VueRouter from "vue-router";
Vue.use(Router);
Vue.use(VueRouter);
export default new Router({
const router = new VueRouter({
mode: "history",
base: process.env.BASE_URL,
routes: [
{
path: "/",
name: "Dashboard",
component: () => import ("@/views/Dashboard"),
component: () => import("@/views/Dashboard"),
meta: {
requireAuth: true
}
@@ -18,7 +18,7 @@ export default new Router({
{
path: "/setup",
name: "InitialSetup",
component: () => import ("@/views/InitialSetup"),
component: () => import("@/views/InitialSetup"),
meta: {
requireAuth: true
}
@@ -26,7 +26,7 @@ export default new Router({
{
path: "/takecontrol/:pk",
name: "TakeControl",
component: () => import ("@/views/TakeControl"),
component: () => import("@/views/TakeControl"),
meta: {
requireAuth: true
}
@@ -34,7 +34,7 @@ export default new Router({
{
path: "/remotebackground/:pk",
name: "RemoteBackground",
component: () => import ("@/views/RemoteBackground"),
component: () => import("@/views/RemoteBackground"),
meta: {
requireAuth: true
}
@@ -42,7 +42,7 @@ export default new Router({
{
path: "/login",
name: "Login",
component: () => import ("@/views/Login"),
component: () => import("@/views/Login"),
meta: {
requiresVisitor: true
}
@@ -50,16 +50,18 @@ export default new Router({
{
path: "/logout",
name: "Logout",
component: () => import ("@/views/Logout")
component: () => import("@/views/Logout")
},
{
path: "/expired",
name: "SessionExpired",
component: () => import ("@/views/SessionExpired"),
component: () => import("@/views/SessionExpired"),
meta: {
requireAuth: true
}
},
{ path: "*", component: () => import ("@/views/NotFound") }
{ path: "*", component: () => import("@/views/NotFound") }
]
});
export default router;

View File

@@ -33,16 +33,16 @@ export const store = new Vuex.Store({
toggleAutomationManager: false
},
getters: {
loggedIn(state) {
loggedIn (state) {
return state.token !== null;
},
selectedAgentPk(state) {
selectedAgentPk (state) {
return state.agentSummary.id;
},
managedByWsus(state) {
managedByWsus (state) {
return state.agentSummary.managed_by_wsus;
},
sortedUpdates(state) {
sortedUpdates (state) {
// sort patches by latest then not installed
if (!state.winUpdates.winupdates) {
return [];
@@ -55,115 +55,115 @@ export const store = new Vuex.Store({
);
return sortedByInstall;
},
agentHostname(state) {
agentHostname (state) {
return state.agentSummary.hostname;
},
scripts(state) {
scripts (state) {
return state.scripts;
},
policies(state) {
policies (state) {
return state.policies;
}
},
mutations: {
TOGGLE_AUTOMATION_MANAGER(state, action) {
TOGGLE_AUTOMATION_MANAGER (state, action) {
state.toggleAutomationManager = action;
},
TOGGLE_SCRIPT_MANAGER(state, action) {
TOGGLE_SCRIPT_MANAGER (state, action) {
state.toggleScriptManager = action;
},
AGENT_TABLE_LOADING(state, visible) {
AGENT_TABLE_LOADING (state, visible) {
state.agentTableLoading = visible;
},
setActiveRow(state, pk) {
setActiveRow (state, pk) {
state.selectedRow = pk;
},
retrieveToken(state, { token, username }) {
retrieveToken (state, { token, username }) {
state.token = token;
state.username = username;
},
destroyCommit(state) {
destroyCommit (state) {
state.token = null;
state.username = null;
},
getUpdatedSites(state, clients) {
getUpdatedSites (state, clients) {
state.clients = clients;
},
loadTree(state, treebar) {
loadTree (state, treebar) {
state.tree = treebar;
state.treeReady = true;
},
setSummary(state, summary) {
setSummary (state, summary) {
state.agentSummary = summary;
},
SET_WIN_UPDATE(state, updates) {
SET_WIN_UPDATE (state, updates) {
state.winUpdates = updates;
},
SET_INSTALLED_SOFTWARE(state, software) {
SET_INSTALLED_SOFTWARE (state, software) {
state.installedSoftware = software;
},
setChecks(state, checks) {
setChecks (state, checks) {
state.agentChecks = checks;
},
SET_AUTOMATED_TASKS(state, tasks) {
SET_AUTOMATED_TASKS (state, tasks) {
state.automatedTasks = tasks;
},
destroySubTable(state) {
destroySubTable (state) {
(state.agentSummary = {}),
(state.agentChecks = {}),
(state.winUpdates = {});
(state.installedSoftware = []);
(state.installedSoftware = []);
state.selectedRow = "";
},
SET_SCRIPTS(state, scripts) {
SET_SCRIPTS (state, scripts) {
state.scripts = scripts;
},
SET_POLICIES(state, policies) {
SET_POLICIES (state, policies) {
state.policies = policies;
}
},
actions: {
getPolicies(context) {
getPolicies (context) {
axios.get("/automation/policies/").then(r => {
context.commit("SET_POLICIES", r.data);
})
},
loadAutomatedTasks(context, pk) {
loadAutomatedTasks (context, pk) {
axios.get(`/automation/${pk}/automatedtasks/`).then(r => {
context.commit("SET_AUTOMATED_TASKS", r.data);
})
},
getScripts(context) {
getScripts (context) {
axios.get("/checks/getscripts/").then(r => {
context.commit("SET_SCRIPTS", r.data);
})
},
loadInstalledSoftware(context, pk) {
loadInstalledSoftware (context, pk) {
axios.get(`/software/installed/${pk}`).then(r => {
context.commit("SET_INSTALLED_SOFTWARE", r.data.software);
});
},
loadWinUpdates(context, pk) {
loadWinUpdates (context, pk) {
axios.get(`/winupdate/${pk}/getwinupdates/`).then(r => {
context.commit("SET_WIN_UPDATE", r.data);
});
},
loadSummary(context, pk) {
loadSummary (context, pk) {
axios.get(`/agents/${pk}/agentdetail/`).then(r => {
context.commit("setSummary", r.data);
});
},
loadChecks(context, pk) {
loadChecks (context, pk) {
axios.get(`/checks/${pk}/loadchecks/`).then(r => {
context.commit("setChecks", r.data);
});
},
getUpdatedSites(context) {
getUpdatedSites (context) {
axios.get("/clients/loadclients/").then(r => {
context.commit("getUpdatedSites", r.data);
});
},
loadTree({ commit }) {
loadTree ({ commit }) {
axios.get("/clients/loadtree/").then(r => {
const input = r.data;
if (
@@ -206,7 +206,7 @@ export const store = new Vuex.Store({
//commit("destroySubTable");
});
},
retrieveToken(context, credentials) {
retrieveToken (context, credentials) {
return new Promise((resolve, reject) => {
axios
.post("/login/", credentials)
@@ -228,7 +228,7 @@ export const store = new Vuex.Store({
});
});
},
destroyToken(context) {
destroyToken (context) {
if (context.getters.loggedIn) {
return new Promise((resolve, reject) => {
axios

View File

@@ -3,7 +3,12 @@ module.exports = {
host: "192.168.99.150"
},
pluginOptions: {
quasar: {}
quasar: {
importStrategy: 'kebab',
rtlSupport: false
}
},
transpileDependencies: [/[\\\/]node_modules[\\\/]quasar[\\\/]/]
};
transpileDependencies: [
'quasar'
]
}