aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/components/PullRequestsSelector.vue
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-03-21 18:28:18 +0100
committerGitHub <noreply@github.com>2023-03-21 17:28:18 +0000
commita22486193ef49113851fab6f277d50f796ecc636 (patch)
treeae527a566c5a0e99032e16195a40b550fdeb328f /src-vue/src/components/PullRequestsSelector.vue
parent36fdc302bef162d213d6a026c99614673b24a069 (diff)
downloadFlightCore-a22486193ef49113851fab6f277d50f796ecc636.tar.gz
FlightCore-a22486193ef49113851fab6f277d50f796ecc636.zip
Add buttons to download PRs (#203)
* feat: Add button to download Mods PR Simply opens the browser on the repo download link * feat: Add button to download Launcher PR Uses existing function to fetch nightly.link link and opens it in browser * refactor: Open Mods PR download link via TS as opposed to having a link directly This way it acts the same way as the Launcher PR download button. Reason behind this change being consistent UI style. * chore: Revert introduced formatting changes Those were added by accident, whoops * fix: Remove introduced unused dependency * fix: Remove unused dependencies
Diffstat (limited to 'src-vue/src/components/PullRequestsSelector.vue')
-rw-r--r--src-vue/src/components/PullRequestsSelector.vue10
1 files changed, 8 insertions, 2 deletions
diff --git a/src-vue/src/components/PullRequestsSelector.vue b/src-vue/src/components/PullRequestsSelector.vue
index 58a355f4..9ddefc7e 100644
--- a/src-vue/src/components/PullRequestsSelector.vue
+++ b/src-vue/src/components/PullRequestsSelector.vue
@@ -15,6 +15,7 @@
<el-card v-else shadow="hover" v-for="pull_request in pull_requests_launcher"
v-bind:key="pull_request.url">
<el-button type="primary" @click="installLauncherPR(pull_request)">Install</el-button>
+ <el-button type="primary" @click="downloadLauncherPR(pull_request)">Download</el-button>
<a target="_blank" :href="pull_request.html_url">
{{ pull_request.number }}: {{ pull_request.title }}
</a>
@@ -41,6 +42,7 @@
</p>
<el-card v-else shadow="hover" v-for="pull_request in pull_requests_mods" v-bind:key="pull_request.url">
<el-button type="primary" @click="installModsPR(pull_request)">Install</el-button>
+ <el-button type="primary" @click="downloadModsPR(pull_request)">Download</el-button>
<a target="_blank" :href="pull_request.html_url">
{{ pull_request.number }}: {{ pull_request.title }}
</a>
@@ -54,8 +56,6 @@
import { defineComponent } from 'vue'
import { PullRequestType } from '../../../src-tauri/bindings/PullRequestType';
import { PullsApiResponseElement } from '../../../src-tauri/bindings/PullsApiResponseElement';
-import { invoke } from "@tauri-apps/api";
-import { ElNotification } from "element-plus";
export default defineComponent({
name: 'PullRequestsSelector',
@@ -80,6 +80,12 @@ export default defineComponent({
async getPullRequests(pull_request_type: PullRequestType) {
this.$store.commit('getPullRequests', pull_request_type);
},
+ async downloadLauncherPR(pull_request: PullsApiResponseElement) {
+ this.$store.commit('downloadLauncherPR', pull_request);
+ },
+ async downloadModsPR(pull_request: PullsApiResponseElement) {
+ this.$store.commit('downloadModsPR', pull_request);
+ },
async installLauncherPR(pull_request: PullsApiResponseElement) {
this.$store.commit('installLauncherPR', pull_request);
},