* Display app version.

* Fix: FPrint enroll start/stop toggle.
This commit is contained in:
2022-01-26 11:14:22 +01:00
parent f9ef35103c
commit 8bbfb59c6b
3 changed files with 56 additions and 29 deletions
+12 -11
View File
@@ -6,9 +6,11 @@ var app = new Vue({
phone: '',
domain: { code: 'uc', name: 'UNICAL' },
errorMessage: '',
version: '',
otp: '',
busy: {
login: false
login: false,
capture: false,
},
user: {
phone: '',
@@ -37,12 +39,13 @@ var app = new Vue({
this.socket.on("config", (data) => {
this.domain = data.domain;
this.version = data.version;
});
this.socket.on("fprint-enroll-error", (data) => {
console.log({ event: 'enroll-error', data });
swal("Oops!", `Operation failed. ${data}.`, "error");
this.busy.login = false;
this.busy.capture = false;
});
this.socket.on("fprint-enroll-done", (data) => {
@@ -52,8 +55,8 @@ var app = new Vue({
this.step = 1.2;
this.fingerDetails[finger] = { id, fingerprint, finger }
}
this.busy.login = false;
})
this.busy.capture = false;
});
this.socket.on("fprint-verify-done", (data) => {
console.log({ event: 'verify-done', data});
@@ -100,16 +103,13 @@ var app = new Vue({
}
},
captureFingerPrint: async function (finger) {
this.busy.login = true;
this.busy.capture = true;
this.step = 1.1;
// var { data: { success, message: { id, data, fingerprint } } } = await axios.post("http://localhost:9000/api/user", {
// name: this.staff.reference
// });
// this.fingerDetails = { id, fingerprint };
// var { data } = await axios.delete(`http://localhost:9000/api/user/${id}`);
// console.log(`${id} purged.`);
this.socket.emit("fprint-enroll", { finger });
},
cancelCapture: async function () {
this.socket.emit("fprint-enroll-stop", { });
},
saveFingerPrint: async function () {
this.busy.login = true;
try {
@@ -143,6 +143,7 @@ var app = new Vue({
newEnrolment: function () {
this.step = 1.0;
this.busy.login = false;
this.busy.capture = false;
this.staff.reference = "";
this.fingerDetails = {
'right-thumb': { },