2022-03-07 14:36:23 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<v-list-item v-for="(item, index) in commits" :key="index">
|
|
|
|
<v-card class="card">
|
|
|
|
<v-card-title style="padding-bottom: 0;">
|
|
|
|
{{ item.author.login }}
|
2022-03-08 17:35:07 +00:00
|
|
|
<span v-text="`• ${item.sha.substring(0, 7)}`" class="subtitle" />
|
2022-03-07 14:36:23 +00:00
|
|
|
</v-card-title>
|
|
|
|
|
2022-03-07 19:07:24 +00:00
|
|
|
<div style="margin-left: 1em;">
|
2022-03-08 17:35:07 +00:00
|
|
|
<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 />
|
|
|
|
<v-btn @click="openExternal(item)"><v-icon>mdi-open-in-new</v-icon>Open</v-btn>
|
|
|
|
<v-btn disabled><v-icon>mdi-download</v-icon>Download</v-btn>
|
|
|
|
</v-card-actions>
|
|
|
|
|
|
|
|
</v-card>
|
|
|
|
</v-list-item>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.card {
|
|
|
|
width: 100%;
|
|
|
|
margin: 1em 0 1em 0;
|
|
|
|
}
|
|
|
|
.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-07 14:36:23 +00:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { Browser } from '@capacitor/browser';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
commits: new Array()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.$vuetube.commits((commits) => {
|
2022-03-07 18:38:54 +00:00
|
|
|
if (commits[0].sha) { //If Commit Valid
|
|
|
|
this.commits = commits;
|
|
|
|
} else {
|
|
|
|
console.log(commits)
|
|
|
|
}
|
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-07 14:36:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|