Files
AstralRinth/theseus_gui/src/components/ui/InstallConfirmModal.vue
Adrian O.V bb126c0545 Project wireup (#80)
* Remove unneeded style

* Base modpack wire up

* Run lint

* Thats not supposed to be there

* Remove errant class

* Fix safety

* Username => ID

* fix id missing

* Fix bug with clicking

* remove unnecessary

* Update Versions.vue

* Addressed changes

* Lintttt
2023-04-12 22:29:40 -04:00

55 lines
1.2 KiB
Vue

<script setup>
import { Button, Modal, XIcon, DownloadIcon } from 'omorphia'
import { useRouter } from 'vue-router'
import { install as pack_install } from '@/helpers/pack'
import { ref } from 'vue'
const router = useRouter()
const version = ref('')
const confirmModal = ref(null)
defineExpose({
show: (id) => {
version.value = id
confirmModal.value.show()
},
})
async function install() {
let id = await pack_install(version.value)
await router.push({ path: `/instance/${encodeURIComponent(id)}` })
confirmModal.value.hide()
}
</script>
<template>
<Modal ref="confirmModal" header="Are you sure?">
<div class="modal-body">
<p>
This project is already installed on your system. Are you sure you want to install it again?
</p>
<div class="button-group">
<Button @click="() => $refs.confirmModal.hide()"><XIcon />Cancel</Button>
<Button color="primary" @click="install()"><DownloadIcon /> Install</Button>
</div>
</div>
</Modal>
</template>
<style lang="scss" scoped>
.modal-body {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1rem;
}
.button-group {
display: flex;
flex-direction: row;
gap: 0.5rem;
justify-content: flex-end;
}
</style>