feat: Download canary releases feature

This commit is contained in:
Kenny 2022-06-22 16:24:55 -04:00
parent 9eb2f0c437
commit 85a2c82027
3 changed files with 81 additions and 5 deletions

View File

@ -0,0 +1,77 @@
<template>
<div>
<center>
<h2 style="margin: 2em;">{{ lang.packageinstaller }}</h2>
</center>
<v-list-item-group>
<v-list-item v-for="(item, i) in assets" :key="i" @click="dl(item)">
<v-list-item-icon>
<v-icon v-text="item.icon" />
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="item.name" />
</v-list-item-content>
</v-list-item>
</v-list-item-group>
</div>
</template>
<script>
export default {
layout: "empty",
data() {
return {
lang: {},
releases: {},
assets: [],
icons: {
apk: "android",
ipa: "apple",
zip: "folder-zip"
}
};
},
async mounted() {
const allReleases = await this.$vuetube.releases;
this.releases = allReleases[this.$route.query.v].assets;
this.lang = this.$lang("events");
for (const i in this.releases) {
const asset = this.releases[i];
let icon = new String();
//--- Get Icon Type ---//
const fileExt = asset.name.split(".")
for (const i in this.icons) {
if (fileExt.includes(i)) {
icon = this.icons[i];
}
}
//--- Build Asset For Listing ---//
this.assets.push({
name: asset.name,
icon: "mdi-"+icon,
download_url: asset.browser_download_url
})
}
},
methods: {
dl(item) {
console.log(item.download_url)
window.open(item.download_url, '_blank');
}
}
};
</script>

View File

@ -39,7 +39,7 @@
<v-btn @click="openExternal(item)" class="background">
<v-icon class="btn-icon">mdi-github</v-icon>{{ lang.view }}
</v-btn>
<v-btn disabled @click="install(item)">
<v-btn @click="install(item, index)">
<v-icon class="btn-icon">mdi-download</v-icon>{{ lang.install }}
</v-btn>
</v-card-actions>
@ -101,10 +101,8 @@ export default {
});
},
install(item) {
this.$vuetube.getRuns(item, (data) => {
console.log(data);
});
install(item, index) {
this.$router.push(`/activities/packageInstaller?v=${index}`)
},
},
};

View File

@ -88,5 +88,6 @@ module.exports = {
enablespb: "Enable SponsorBlock",
thanks: "Thanks for Using VueTube",
enjoy: "We hope you have an amazing experience",
packageinstaller: "Select a Package to Download"
},
};