-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#137] Add light-weight protocol filter
- Loading branch information
Showing
4 changed files
with
36 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
<script setup lang="ts"> | ||
import ProtocolList from "@/components/protocol/ProtocolList.vue"; | ||
import {useProtocolStore} from "@/store/protocolState"; | ||
import {computed, ref} from "vue"; | ||
import {changeDetails, type ChangeDetails} from "@/helpers/ChangeDetails"; | ||
const protocolStore = useProtocolStore() | ||
const command = ref(true) | ||
const gameEvent = ref(true) | ||
const other = ref(true) | ||
const showChange = (change: ChangeDetails) => { | ||
if (change.typeName === 'Command') { | ||
return command.value | ||
} | ||
if (change.typeName === 'Game Event') { | ||
return gameEvent.value | ||
} | ||
return other.value | ||
} | ||
const protocolEntries = computed(() => { | ||
return protocolStore.protocolEntries.filter(entry => showChange(changeDetails(entry.change!))) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<ProtocolList/> | ||
<div class="q-ma-sm"> | ||
<q-checkbox v-model="command" label="Command"/> | ||
<q-checkbox v-model="gameEvent" label="Game Event"/> | ||
<q-checkbox v-model="other" label="Other"/> | ||
</div> | ||
<ProtocolList :protocol-entries="protocolEntries"/> | ||
</template> |