aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views/RepairView.vue
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-03-12 15:55:36 +0100
committerGitHub <noreply@github.com>2023-03-12 14:55:36 +0000
commit82739f56b198054acbde53527e9eb39fa14f2602 (patch)
tree8a1601eada3846ae554ec56fb6feede2be792338 /src-vue/src/views/RepairView.vue
parentac8c02a3860c2b079dc3f3806c3638563ac16d10 (diff)
downloadFlightCore-82739f56b198054acbde53527e9eb39fa14f2602.tar.gz
FlightCore-82739f56b198054acbde53527e9eb39fa14f2602.zip
feat: Allow opening a window with various repair features (#129)
* feat: Initial code for spawning repair window * refactor: Move disable all but core mods button to repair window * refactor: Rename function * refactor: Move button location Still in DeveloperView for now, will be moved to settings page later * feat: Add info banner * feat: Set repair window title * fix: Stop thread crash on duplicate window open Instead of calling an unwrap, handle failure to create window which is usually caused by spawning a second repair window although one already exists. * fix: Re-add accidentally removed lines from merge * fix: Set top padding to zero px As there's no menu bar in this view * feat: Close all windows when close bttn is clicked
Diffstat (limited to 'src-vue/src/views/RepairView.vue')
-rw-r--r--src-vue/src/views/RepairView.vue60
1 files changed, 60 insertions, 0 deletions
diff --git a/src-vue/src/views/RepairView.vue b/src-vue/src/views/RepairView.vue
new file mode 100644
index 00000000..cf19e3e6
--- /dev/null
+++ b/src-vue/src/views/RepairView.vue
@@ -0,0 +1,60 @@
+<template>
+ <div class="fc-container">
+ <el-scrollbar>
+ <el-alert title="Info" type="info" :closable="false" show-icon>
+ This window contains various functionality to repair common issues with Northstar and FlightCore.
+ </el-alert>
+
+ <h1>Repair</h1>
+
+ <h2>Northstar</h2>
+
+ <el-button type="primary" @click="disableAllModsButCore">
+ Disable all but core mods
+ </el-button>
+
+ </el-scrollbar>
+ </div>
+</template>
+
+<script lang="ts">
+import { defineComponent } from "vue";
+import { ElNotification } from "element-plus";
+import { GameInstall } from "../utils/GameInstall";
+import { invoke } from "@tauri-apps/api";
+
+export default defineComponent({
+ name: "RepairView",
+ methods: {
+ async disableAllModsButCore() {
+ let game_install = {
+ game_path: this.$store.state.game_path,
+ install_type: this.$store.state.install_type
+ } as GameInstall;
+ await invoke("disable_all_but_core", { gameInstall: game_install })
+ .then((message) => {
+ ElNotification({
+ title: 'Success',
+ message: "Disabled all mods but core",
+ type: 'success',
+ position: 'bottom-right'
+ });
+ })
+ .catch((error) => {
+ ElNotification({
+ title: 'Error',
+ message: error,
+ type: 'error',
+ position: 'bottom-right'
+ });
+ });
+ },
+ }
+});
+</script>
+
+<style scoped>
+.fc-container {
+ padding-top: 0px;
+}
+</style>