-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from skychatorg/dev/7ph
Various improvements
- Loading branch information
Showing
32 changed files
with
622 additions
and
75 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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup> | ||
import { computed, watch, onMounted, ref } from 'vue'; | ||
import { useClientStore } from '@/stores/client'; | ||
import ModalTemplate from '@/components/modal/ModalTemplate.vue'; | ||
import SingleRoom from '@/components/room/SingleRoom.vue'; | ||
import draggable from 'vuedraggable'; | ||
const client = useClientStore(); | ||
const publicRooms = computed(() => { | ||
return client.state.rooms.filter((room) => !room.isPrivate); | ||
}); | ||
let sortedRooms = ref(publicRooms.value); | ||
onMounted(() => { | ||
sortedRooms.value = publicRooms.value; | ||
}); | ||
watch(publicRooms, () => { | ||
sortedRooms.value = publicRooms.value; | ||
}); | ||
function onMoved() { | ||
const sortedRoomIds = sortedRooms.value.map((room) => room.id); | ||
client.sendMessage('/roomorder ' + sortedRoomIds.join(',')); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ModalTemplate id="manageRooms" title="Manage rooms"> | ||
Manage rooms | ||
|
||
<draggable v-model="sortedRooms" group="rooms" item-key="id" @end="onMoved"> | ||
<template #item="{ element }"> | ||
<SingleRoom :room="element">{{ element.name }}</SingleRoom> | ||
</template> | ||
</draggable> | ||
</ModalTemplate> | ||
</template> |
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
Oops, something went wrong.