This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
|
||||
<script>
|
||||
import aboutInfo from "./utils/aboutinfo";
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
data() {
|
||||
@@ -55,6 +56,9 @@ export default {
|
||||
drawer: null
|
||||
};
|
||||
},
|
||||
// beforeCreate() {
|
||||
|
||||
// },
|
||||
mounted() {
|
||||
if (!this.$store.state.authenticated) {
|
||||
this.$router.replace({ name: "login" });
|
||||
|
||||
@@ -5,9 +5,13 @@ import App from "./App.vue";
|
||||
import router from "./router";
|
||||
import store from "./store";
|
||||
import "./registerServiceWorker";
|
||||
import errorHandler from "./utils/errorhandler";
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
Vue.config.errorHandler = errorHandler.handleVueError;
|
||||
window.onerror = errorHandler.handleGeneralError;
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Vue from "vue";
|
||||
import Vuex from "vuex";
|
||||
import createPersistedState from "vuex-persistedstate";
|
||||
import _ from "./utils/libs/core.min.js";
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
@@ -14,7 +15,7 @@ export default new Vuex.Store({
|
||||
roles: 0,
|
||||
localeText: {},
|
||||
navItems: [],
|
||||
logBuffer: []
|
||||
logArray: []
|
||||
},
|
||||
mutations: {
|
||||
login(state, data) {
|
||||
@@ -42,8 +43,12 @@ export default new Vuex.Store({
|
||||
setAPIURL(state, data) {
|
||||
state.apiUrl = data;
|
||||
},
|
||||
setLog(state, data) {
|
||||
state.logBuffer = data;
|
||||
logItem(state, msg) {
|
||||
msg = Date.now() + "|" + msg;
|
||||
state.logArray.push(msg);
|
||||
if (state.logArray.length > 100) {
|
||||
_.drop(state.logArray);
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {}
|
||||
|
||||
34
app/ayanova/src/utils/errorhandler.js
Normal file
34
app/ayanova/src/utils/errorhandler.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* xeslint-disable */
|
||||
//import store from "../store";
|
||||
|
||||
function dealWithError(msg) {
|
||||
alert(msg);
|
||||
}
|
||||
export default {
|
||||
handleGeneralError(message, source, lineno, colno, error) {
|
||||
var msg = "GeneralError: \n" + message;
|
||||
if (source) {
|
||||
msg += "\nsource: " + source;
|
||||
}
|
||||
if (lineno) {
|
||||
msg += "\nlineno: " + lineno;
|
||||
}
|
||||
if (colno) {
|
||||
msg += "\ncolno: " + colno;
|
||||
}
|
||||
if (error) {
|
||||
msg += "\nerror: " + error;
|
||||
}
|
||||
dealWithError(msg);
|
||||
},
|
||||
handleVueError(err, vm, info) {
|
||||
var msg = "VueError: \n" + err;
|
||||
if (vm) {
|
||||
msg += "\nvm present ";
|
||||
}
|
||||
if (info) {
|
||||
msg += "\ninfo: " + info;
|
||||
}
|
||||
dealWithError(msg);
|
||||
}
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable */
|
||||
/* xeslint-disable */
|
||||
//////////////////////////////////////////////////////
|
||||
//in-memory log, keeps up to 100 of the past log items
|
||||
//
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
buffer.push(msg);
|
||||
store.commit("setLog", buffer.toArray());
|
||||
},
|
||||
getLogText(){
|
||||
getLogText() {
|
||||
//TODO: iterate the array from store, convert timestamps to local date and time and arrange as a block of multiline text to display in the UI
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* xeslint-disable */
|
||||
import auth from "../api/auth";
|
||||
export default {
|
||||
name: "Login",
|
||||
@@ -52,9 +53,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
// xeslint-disable-next-line
|
||||
// debugger;
|
||||
//console.log("Login.vue::page url is:" + this.$route.query.page);
|
||||
if (this.input.username != "" && this.input.password != "") {
|
||||
auth
|
||||
.authenticate(this.input.username, this.input.password)
|
||||
|
||||
@@ -62,6 +62,8 @@ NEXT UP / CURRENTLY WORKING ON:
|
||||
- Widget: List, search, edit, localized WIDGET UI components
|
||||
- Post up another build with the entry form and re-round of testing
|
||||
|
||||
- Stage 2.5 TESTING
|
||||
- Enable some end to end testing and use it going forward all over.
|
||||
|
||||
- Stage 3:
|
||||
- At the end of this phase re-assess and see what needs to be the focus going forward and if anything is amiss
|
||||
|
||||
Reference in New Issue
Block a user