remodel scan process and visualize external
This commit is contained in:
parent
9ef76a7c26
commit
ed947e5777
23 changed files with 338 additions and 29 deletions
28
src/stores/admin/scanner.ts
Normal file
28
src/stores/admin/scanner.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
export const useScannerStore = defineStore("scanner", {
|
||||
state: () => {
|
||||
return {
|
||||
inUse: false as boolean,
|
||||
roomId: undefined as undefined | string,
|
||||
results: [] as Array<string>,
|
||||
connectedDevices: 0 as number,
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
startSession() {
|
||||
if (this.inUse) return;
|
||||
this.roomId = uuid();
|
||||
this.inUse = true;
|
||||
},
|
||||
endSession() {
|
||||
this.inUse = false;
|
||||
this.roomId = undefined;
|
||||
this.results = [];
|
||||
},
|
||||
removeElementFromResults(el: string) {
|
||||
this.results = this.results.filter((result) => result !== el);
|
||||
},
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue