* 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': { },
+12 -10
View File
@@ -18,7 +18,7 @@
</div>
<h1>
{{domain.name}} Biometrics Enrolment Wizard
{{domain.name}} Biometrics Enrolment Wizard <span style="color: gainsboro">#{{version}}</span>
</h1>
<hr />
<div v-if="step > 0" style="text-align: right">
@@ -114,16 +114,17 @@
<label>Enrolment ID</label>
<input type="text" readonly v-model="fingerDetails['right-thumb'].id" class="form-control" />
</div>
<div class="btn btn-success" style="display: inline" v-if="!fingerDetails['right-thumb'].id" v-bind:class="{ disabledbutton: busy.login }"
<div class="btn btn-success" style="display: inline" v-if="!fingerDetails['right-thumb'].id" v-bind:class="{ disabledbutton: busy.capture }"
v-on:click="() => { captureFingerPrint('right-thumb') }">
<span v-if="!busy.login">Capture Fingerprint</span>
<span v-if="!busy.capture">Capture Fingerprint</span>
<span v-else>Please wait...</span>
</div>
<div class="btn btn-warning" style="display: inline" v-if="fingerDetails['right-thumb'].id" v-bind:class="{ disabledbutton: busy.login }"
<div class="btn btn-warning" style="display: inline" v-if="fingerDetails['right-thumb'].id" v-bind:class="{ disabledbutton: busy.capture }"
v-on:click="() => { captureFingerPrint('right-thumb') }">
<span v-if="!busy.login">Recapture Fingerprint</span>
<span v-if="!busy.capture">Recapture Fingerprint</span>
<span v-else>Please wait...</span>
</div>
<span style="cursor:pointer;" @click="cancelCapture" v-if="busy.capture">&nbsp;&nbsp;Cancel</span>
</div>
<div class="col-md-6">
<div class="form-group">
@@ -134,16 +135,17 @@
<label>Enrolment ID</label>
<input type="text" readonly v-model="fingerDetails['right-index-finger'].id" class="form-control" />
</div>
<div class="btn btn-success" style="display: inline" v-if="!fingerDetails['right-index-finger'].id" v-bind:class="{ disabledbutton: busy.login }"
<div class="btn btn-success" style="display: inline" v-if="!fingerDetails['right-index-finger'].id" v-bind:class="{ disabledbutton: busy.capture }"
v-on:click="() => { captureFingerPrint('right-index-finger') }">
<span v-if="!busy.login">Capture Fingerprint</span>
<span v-if="!busy.capture">Capture Fingerprint</span>
<span v-else>Please wait...</span>
</div>
<div class="btn btn-warning" style="display: inline" v-if="fingerDetails['right-index-finger'].id" v-bind:class="{ disabledbutton: busy.login }"
<div class="btn btn-warning" style="display: inline" v-if="fingerDetails['right-index-finger'].id" v-bind:class="{ disabledbutton: busy.capture }"
v-on:click="() => { captureFingerPrint('right-index-finger') }">
<span v-if="!busy.login">Recapture Fingerprint</span>
<span v-if="!busy.capture">Recapture Fingerprint</span>
<span v-else>Please wait...</span>
</div>
</div>
<span style="cursor:pointer;" @click="cancelCapture" v-if="busy.capture">&nbsp;&nbsp;Cancel</span>
</div>
</div>
<!-- &nbsp;&nbsp;Your profile has <span style="color: red; font-weight: bold;" v-if="!staff.verified">NOT </span>been verified. -->