0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-25 12:45:17 +00:00
VueTube/NUXT/pages/mods/updates.vue

106 lines
2.5 KiB
Vue
Raw Normal View History

2022-03-07 14:36:23 +00:00
<template>
2022-05-14 00:25:48 +00:00
<div>
2022-06-22 16:19:51 +00:00
<v-list-item v-for="(item, index) in releases" :key="index" class="my-1">
2022-03-31 22:25:31 +00:00
<v-card
flat
class="card my-2 background"
:class="$vuetify.theme.dark ? 'lighten-1' : 'darken-1'"
:style="{ borderRadius: `${roundTweak / 2}rem` }"
2022-03-31 22:25:31 +00:00
>
2022-03-21 23:47:11 +00:00
<v-card-title style="padding: 0 0.25em 0 0.75em">
2022-06-22 16:19:51 +00:00
{{ item.tag_name }}
2022-03-31 22:25:31 +00:00
<span
class="subtitle background--text"
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
2022-06-22 16:19:51 +00:00
v-text="`• ${ new Date(item.published_at).toLocaleString() }`"
2022-03-31 22:25:31 +00:00
/>
2022-03-07 14:36:23 +00:00
</v-card-title>
<div style="margin-left: 1em; white-space: pre-line; margin-top: -1.5em;">
{{ item.body.trim() }}
2022-03-07 19:07:24 +00:00
</div>
2022-03-07 14:36:23 +00:00
<v-card-actions>
<v-chip
v-if="index == 0"
class="tags"
color="orange"
style="border-radius: 0.5rem; border: 2px var(--v-orange-base)"
>{{ lang.latest }}</v-chip
>
<v-chip
v-if="item.tag_name == installedVersion"
class="tags"
color="green"
style="border-radius: 0.5rem; border: 2px var(--v-green-base)"
>{{ lang.installed }}</v-chip
>
2022-03-07 14:36:23 +00:00
<v-spacer />
2022-03-31 22:25:31 +00:00
<v-btn @click="openExternal(item)" class="background">
<v-icon class="btn-icon">mdi-github</v-icon>{{ lang.view }}
2022-03-31 22:25:31 +00:00
</v-btn>
<v-btn @click="install(item, index)">
<v-icon class="btn-icon">mdi-download</v-icon>{{ lang.install }}
2022-03-31 22:25:31 +00:00
</v-btn>
2022-03-07 14:36:23 +00:00
</v-card-actions>
</v-card>
</v-list-item>
</div>
</template>
<style scoped>
.card {
width: 100%;
}
2022-03-07 14:36:23 +00:00
.subtitle {
margin: 0.4em;
font-size: 0.75em;
transform: translateY(5%);
}
.date {
transform: translateY(-40%);
}
2022-03-10 17:39:29 +00:00
.btn-icon {
margin-right: 0.25em;
}
2022-03-11 13:31:01 +00:00
.tags {
2022-03-13 19:16:22 +00:00
margin-left: 0.5em;
2022-03-11 13:31:01 +00:00
}
2022-03-07 14:36:23 +00:00
</style>
<script>
export default {
computed: {
roundTweak() {
return this.$store.state.tweaks.roundTweak;
2022-03-11 16:39:52 +00:00
},
},
2022-03-07 14:36:23 +00:00
data() {
return {
2022-06-22 16:19:51 +00:00
releases: new Array(),
2022-03-21 23:47:11 +00:00
installedVersion: process.env.appVersion,
lang: {},
2022-03-21 23:47:11 +00:00
};
2022-03-07 14:36:23 +00:00
},
async mounted() {
2022-06-22 16:19:51 +00:00
this.releases = await this.$vuetube.releases;
this.lang = this.$lang("mods").updates;
},
methods: {
openExternal(item) {
this.$vuetube.openExternal(item.html_url,);
},
2022-03-11 16:39:52 +00:00
install(item, index) {
this.$router.push(`/activities/packageInstaller?v=${index}`);
},
2022-03-21 23:47:11 +00:00
},
};
2022-03-07 14:36:23 +00:00
</script>