1+ <template >
2+ <v-data-table
3+ :headers =" headers"
4+ :items =" pluginList"
5+ >
6+ <template v-slot :item =" {item } " >
7+ <tr >
8+ <td ><a :href =" item.source" target =" _blank" >{{ item.name }}</a ></td >
9+ <td >{{ item.version }}</td >
10+ <td >{{ item.desc }}</td >
11+ <td >
12+ <v-icon small color =" green" v-if =" item.synced" >mdi-check-circle</v-icon >
13+ <v-icon small color =" red" v-else >mdi-close-circle-outline</v-icon >
14+ </td >
15+ <td >{{ item.syncTime }}</td >
16+ </tr >
17+ </template >
18+ </v-data-table >
19+ </template >
20+
21+ <script >
22+ import actions from " @/store/actions" ;
23+ import {mapState } from " vuex" ;
24+ import { PluginWrapper } from ' @/util/plugins'
25+
26+ export default {
27+ name: " PluginSettingsHome" ,
28+
29+ mounted () {
30+ this .$emit (' onConfigNav' , {
31+ navs: [{text: this .$t (' settings.li.plugin' )}],
32+ showAddBtn: false
33+ })
34+
35+ this .$store .dispatch (actions .plugins .list ).then (() => {
36+ })
37+ },
38+
39+ data () {
40+ return {
41+ loading: false ,
42+ pluginList: [],
43+ headers: [
44+ {text: ' Name' , sortable: true , value: ' name' },
45+ {text: ' Version' , value: ' version' },
46+ {text: ' Description' , value: ' description' },
47+ {text: ' Synced' , value: ' synced' },
48+ {text: ' Last sync time' , value: ' synced' },
49+ ]
50+ }
51+ },
52+
53+ computed: {
54+ ... mapState ({
55+ plugins : state => state .plugins .items ,
56+ })
57+ },
58+
59+ watch: {
60+ plugins (val ) {
61+ this .pluginList = []
62+ for (let p of val) {
63+ this .pluginList .push (new PluginWrapper (p))
64+ }
65+ },
66+ }
67+
68+ }
69+ </script >
70+
71+ <style scoped>
72+
73+ </style >
0 commit comments