mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-03 07:01:35 -06:00
add recreate to GUI.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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: {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user