@@ -45,7 +42,7 @@
v-for="person in filtered"
as="template"
:key="person.id"
- :value="person"
+ :value="person.id"
v-slot="{ selected, active }"
>
af.id == this.selected);
+ },
filtered() {
return this.query == ""
? this.availableForces
diff --git a/src/stores/admin/operation/missionDetail.ts b/src/stores/admin/operation/missionDetail.ts
index 39f6186..a9b3ed5 100644
--- a/src/stores/admin/operation/missionDetail.ts
+++ b/src/stores/admin/operation/missionDetail.ts
@@ -56,9 +56,7 @@ export const useMissionDetailStore = defineStore("missionDetail", {
});
connectionStore.connection?.on("package-sync-awareness", (data) => {
- // if (this.awareness != undefined) {
- // AwarenessProtocol.applyAwarenessUpdate(this.awareness, new Uint8Array(data.update), this);
- // }
+ // TODO self implement where users edit what and cursors
});
this.joinDocument();
@@ -69,7 +67,7 @@ export const useMissionDetailStore = defineStore("missionDetail", {
const connectionStore = useConnectionStore();
if (connectionStore.connected) {
connectionStore.connection?.emit("mission:sync-client-updates", {
- update: Array.from(update),
+ update: Uint8Array.from(update),
timestamp: Date.now(),
});
}
@@ -88,7 +86,7 @@ export const useMissionDetailStore = defineStore("missionDetail", {
const connectionStore = useConnectionStore();
connectionStore.connection?.emit(
"mission:sync-client-awareness",
- Array.from(AwarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))
+ Uint8Array.from(AwarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))
);
}
});
diff --git a/src/views/admin/operation/mission/MissionDetail.vue b/src/views/admin/operation/mission/MissionDetail.vue
index 950d8c8..bf97238 100644
--- a/src/views/admin/operation/mission/MissionDetail.vue
+++ b/src/views/admin/operation/mission/MissionDetail.vue
@@ -5,47 +5,47 @@
-
-
+
+
-
+
-
+
-
-
+
+
@@ -111,12 +111,98 @@ export default defineComponent({
...mapState(useForceStore, ["availableForces"]),
title: {
get() {
- return this.document.getMap("form").get("title");
+ return this.document.getMap("form").get("title") as string;
},
set(val: string) {
this.document.getMap("form").set("title", val);
},
},
+ command: {
+ get() {
+ return this.document.getMap("form").get("command") as string;
+ },
+ set(val: string) {
+ this.document.getMap("form").set("command", val);
+ },
+ },
+ secretary: {
+ get() {
+ return this.document.getMap("form").get("secretary") as string;
+ },
+ set(val: string) {
+ this.document.getMap("form").set("secretary", val);
+ },
+ },
+ start: {
+ get() {
+ return (
+ (this.document.getMap("form").get("start") as string) ||
+ new Date(new Date().setHours(new Date().getHours() + 1)).toISOString().slice(0, -8)
+ );
+ },
+ set(val: string) {
+ this.document.getMap("form").set("start", val);
+ },
+ },
+ end: {
+ get() {
+ return this.document.getMap("form").get("end") as string;
+ },
+ set(val: string) {
+ this.document.getMap("form").set("end", val);
+ },
+ },
+ duration() {
+ const diffInMs = new Date(this.end).getTime() - new Date(this.start).getTime();
+
+ const durationDate = new Date(diffInMs || 0);
+
+ return {
+ days: (durationDate.getUTCDate() - 1).toString().padStart(2, "0"),
+ hours: durationDate.getUTCHours().toString().padStart(2, "0"),
+ minutes: durationDate.getUTCMinutes().toString().padStart(2, "0"),
+ };
+ },
+ mission_short: {
+ get() {
+ return this.document.getMap("form").get("mission_short");
+ },
+ set(val: string) {
+ this.document.getMap("form").set("mission_short", val);
+ },
+ },
+ location: {
+ get() {
+ return this.document.getMap("form").get("location");
+ },
+ set(val: string) {
+ this.document.getMap("form").set("location", val);
+ },
+ },
+ others: {
+ get() {
+ return this.document.getMap("form").get("others");
+ },
+ set(val: string) {
+ this.document.getMap("form").set("others", val);
+ },
+ },
+ rescued: {
+ get() {
+ return this.document.getMap("form").get("rescued") || 0;
+ },
+ set(val: number) {
+ this.document.getMap("form").set("rescued", val);
+ },
+ },
+ recovered: {
+ get() {
+ return this.document.getMap("form").get("recovered") || 0;
+ },
+ set(val: number) {
+ this.document.getMap("form").set("recovered", val);
+ },
+ },
editor() {
return this.document.getText("editor");
},
@@ -130,7 +216,7 @@ export default defineComponent({
methods: {
initEditor(quill: Quill) {
quill.history.clear();
- this.binding = new QuillBinding(this.editor, quill, this.awareness);
+ this.binding = new QuillBinding(this.document.getText("editor"), quill); //this.awareness
this.cursors = quill.getModule("cursors") as QuillCursors;
},
},
diff --git a/src/views/admin/operation/mission/MissionOverview.vue b/src/views/admin/operation/mission/MissionOverview.vue
index 035c7b1..72cfc47 100644
--- a/src/views/admin/operation/mission/MissionOverview.vue
+++ b/src/views/admin/operation/mission/MissionOverview.vue
@@ -28,7 +28,7 @@
-
+