2022-03-07 14:36:23 +00:00
|
|
|
<template>
|
2022-03-17 23:39:36 +00:00
|
|
|
<div class="py-2">
|
|
|
|
<v-list-item v-for="(item, index) in commits" :key="index" class="my-1">
|
|
|
|
<v-card class="card my-2">
|
2022-03-21 23:47:11 +00:00
|
|
|
<v-card-title style="padding: 0 0.25em 0 0.75em">
|
2022-03-15 20:18:27 +00:00
|
|
|
{{ item.author ? item.author.login : item.commit.author.name }}
|
2022-03-21 23:47:11 +00:00
|
|
|
<span class="subtitle" v-text="`• ${item.sha.substring(0, 7)}`" />
|
2022-03-11 13:31:01 +00:00
|
|
|
<v-spacer />
|
2022-03-21 23:47:11 +00:00
|
|
|
<v-chip v-if="index == 0" outlined class="tags" color="orange"
|
|
|
|
>Latest</v-chip
|
|
|
|
>
|
|
|
|
<v-chip
|
|
|
|
v-if="item.sha == installedVersion"
|
|
|
|
outlined
|
|
|
|
class="tags"
|
|
|
|
color="green"
|
|
|
|
>Installed</v-chip
|
|
|
|
>
|
2022-03-07 14:36:23 +00:00
|
|
|
</v-card-title>
|
|
|
|
|
2022-03-21 23:47:11 +00:00
|
|
|
<div style="margin-left: 1em">
|
|
|
|
<div
|
|
|
|
class="date"
|
|
|
|
v-text="new Date(item.commit.committer.date).toLocaleString()"
|
|
|
|
/>
|
2022-03-07 19:09:58 +00:00
|
|
|
{{ item.commit.message }}
|
2022-03-07 19:07:24 +00:00
|
|
|
</div>
|
2022-03-07 14:36:23 +00:00
|
|
|
|
|
|
|
<v-card-actions>
|
|
|
|
<v-spacer />
|
2022-03-21 23:47:11 +00:00
|
|
|
<v-btn @click="openExternal(item)"
|
|
|
|
><v-icon class="btn-icon">mdi-github</v-icon>View</v-btn
|
|
|
|
>
|
|
|
|
<v-btn disabled @click="install(item)"
|
|
|
|
><v-icon class="btn-icon">mdi-download</v-icon>Install</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%;
|
|
|
|
}
|
|
|
|
.subtitle {
|
|
|
|
margin: 0.4em;
|
|
|
|
font-size: 0.75em;
|
|
|
|
transform: translateY(5%);
|
|
|
|
color: #999;
|
|
|
|
}
|
2022-03-08 17:35:07 +00:00
|
|
|
.date {
|
|
|
|
color: #999;
|
|
|
|
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>
|
2022-03-21 23:47:11 +00:00
|
|
|
import { Browser } from "@capacitor/browser";
|
2022-03-07 14:36:23 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2022-03-11 13:31:01 +00:00
|
|
|
commits: new Array(),
|
2022-03-21 23:47:11 +00:00
|
|
|
installedVersion: process.env.appVersion,
|
|
|
|
};
|
2022-03-07 14:36:23 +00:00
|
|
|
},
|
2022-03-10 14:59:50 +00:00
|
|
|
async mounted() {
|
|
|
|
const commits = await this.$vuetube.commits;
|
2022-03-21 23:47:11 +00:00
|
|
|
if (commits[0].sha) {
|
|
|
|
//If Commit Valid
|
2022-03-10 14:59:50 +00:00
|
|
|
this.commits = commits;
|
|
|
|
} else {
|
2022-03-21 23:47:11 +00:00
|
|
|
console.log(commits);
|
2022-03-10 14:59:50 +00:00
|
|
|
}
|
2022-03-07 14:36:23 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2022-03-08 17:40:46 +00:00
|
|
|
async openExternal(item) {
|
|
|
|
await Browser.open({ url: item.html_url });
|
2022-03-11 16:39:52 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
install(item) {
|
|
|
|
this.$vuetube.getRuns(item, (data) => {
|
2022-03-21 23:47:11 +00:00
|
|
|
console.log(data);
|
2022-03-11 16:39:52 +00:00
|
|
|
});
|
2022-03-21 23:47:11 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-03-07 14:36:23 +00:00
|
|
|
</script>
|