diff --git a/src/components/Rooms.vue b/src/components/Rooms.vue index 1d16b19..4c9d47c 100644 --- a/src/components/Rooms.vue +++ b/src/components/Rooms.vue @@ -15,6 +15,13 @@   Room list +
+ + {{$t('All rooms')}} + {{$t('Rooms with recorders')}} + {{$t('Rooms without recorders')}} + +

{{ $tc('rooms_defined', rooms.length, {num: rooms.length})}}:

- {{recorders}} + {{rooms}}
@@ -351,6 +358,8 @@ props: [], data() { return { + onlyShowRoomsWithRecorder: false, + onlyShowRoomsWithoutRecorder: false, tabIndex: 0, updateValues: {}, formEditField: {}, @@ -365,6 +374,18 @@ }; }, methods: { + showAllRooms(){ + this.onlyShowRoomsWithRecorder = false; + this.onlyShowRoomsWithoutRecorder = false; + }, + showRoomsWithRecorder(){ + this.onlyShowRoomsWithRecorder = true; + this.onlyShowRoomsWithoutRecorder = false; + }, + showRoomsWithoutRecorder(){ + this.onlyShowRoomsWithRecorder = false; + this.onlyShowRoomsWithoutRecorder = true; + }, saveRoom() { this.$parent.$data.isLoading = true; RoomRepository.createRoom(this.form) @@ -433,6 +454,16 @@ }; }, rooms() { + if(this.onlyShowRoomsWithRecorder){ + return this.$store.state.rooms.filter(item => { + return item.recorder + }); + } + else if(this.onlyShowRoomsWithoutRecorder){ + return this.$store.state.rooms.filter(item => { + return !item.recorder + }); + } return this.$store.state.rooms; }, recorders() {