add recreate to GUI.

This commit is contained in:
Miroslav Šedivý
2021-05-31 22:18:01 +02:00
parent 9a3e78fa8c
commit 4baacdd704
3 changed files with 29 additions and 0 deletions
+19
View File
@@ -45,6 +45,14 @@ export default class RoomActionBtn extends Vue {
color: 'blue',
icon: 'mdi-refresh',
}
case 'recreate':
return {
dispatch: 'ROOMS_RECREATE',
msg: 'Room recreated!',
tooltip: 'Recreate',
color: 'blue',
icon: 'mdi-cloud-refresh',
}
case 'remove':
return {
dispatch: 'ROOMS_REMOVE',
@@ -71,6 +79,17 @@ export default class RoomActionBtn extends Vue {
cancelButtonText: "No",
})
if (!value) return
} else if (this.action === 'recreate') {
const { value } = await this.$swal({
title: "Recreate room",
text: "Do you really want to recreate this room? It will detele all your non-persistent data.",
icon: 'warning',
showCancelButton: true,
confirmButtonText: "Yes",
cancelButtonText: "No",
})
if (!value) return
}
+4
View File
@@ -22,6 +22,10 @@
<span>Link to deployment</span>
</v-tooltip>
</template>
<template v-slot:[`item.neko_image`]="{ item }">
<RoomActionBtn action="recreate" :roomId="item.id" />
<span class="ml-3">{{ item.neko_image }}</span>
</template>
<template v-slot:[`item.max_connections`]="{ item }">
<span v-if="item.max_connections">{{ item.max_connections }}</span>
<i v-else>--not-specified--</i>
+6
View File
@@ -106,6 +106,12 @@ export default new Vuex.Store({
async ROOMS_RESTART(_: ActionContext<State, State>, roomId: string) {
await roomsApi.roomRestart(roomId)
},
async ROOMS_RECREATE({ commit }: ActionContext<State, State>, roomId: string) {
const res = await roomsApi.roomRecreate(roomId)
commit('ROOMS_DEL', roomId)
commit('ROOMS_PUT', res.data)
return res.data
},
},
modules: {
}