wikijs-fork/client/components/admin/admin-extensions.vue

120 lines
3.8 KiB
Vue
Raw Permalink Normal View History

2020-05-13 03:39:29 +00:00
<template lang='pug'>
v-container(fluid, grid-list-lg)
v-layout(row wrap)
v-flex(xs12)
.admin-header
img.animated.fadeInUp(src='/_assets/svg/icon-installing-updates.svg', alt='Extensions', style='width: 80px;')
2020-05-13 03:39:29 +00:00
.admin-header-title
.headline.primary--text.animated.fadeInLeft {{ $t('admin:extensions.title') }}
.subtitle-1.grey--text.animated.fadeInLeft {{ $t('admin:extensions.subtitle') }}
v-form.pt-3
v-layout(row wrap)
v-flex(xl6 lg8 xs12)
v-alert.mb-4(outlined, color='error', icon='mdi-alert')
span New extensions cannot be installed at the moment. This feature is coming in a future release.
v-expansion-panels.admin-extensions-exp(hover, popout)
2020-05-17 22:24:48 +00:00
v-expansion-panel(v-for='ext of extensions', :key='`ext-` + ext.key')
2020-05-13 03:39:29 +00:00
v-expansion-panel-header(disable-icon-rotate)
span {{ext.title}}
template(v-slot:actions)
2020-05-18 04:45:51 +00:00
v-chip(label, color='success', small, v-if='ext.isInstalled') Installed
2020-05-13 03:39:29 +00:00
v-chip(label, color='warning', small, v-else) Not Installed
v-expansion-panel-content.pa-0
2020-05-17 02:46:05 +00:00
v-card(flat, :class='$vuetify.theme.dark ? `grey darken-3` : `grey lighten-5`', tile)
2020-05-13 03:39:29 +00:00
v-card-text
.body-2 {{ext.description}}
v-divider.my-4
.body-2
strong.mr-2 This extension is
2020-05-18 04:45:51 +00:00
v-chip.mr-2(v-if='ext.isCompatible', label, outlined, small, color='success') compatible
v-chip.mr-2(v-else, label, small, color='error') not compatible
strong with your host.
2020-05-13 03:39:29 +00:00
v-card-chin
v-spacer
v-btn(disabled)
v-icon(left) mdi-plus
span Install
</template>
<script>
import _ from 'lodash'
import gql from 'graphql-tag'
export default {
data() {
return {
2020-05-18 04:45:51 +00:00
extensions: []
2020-05-13 03:39:29 +00:00
}
},
methods: {
async save () {
2020-05-18 04:45:51 +00:00
// try {
// await this.$apollo.mutate({
// mutation: gql`
// mutation (
// $host: String!
// ) {
// site {
// updateConfig(
// host: $host
// ) {
// responseResult {
// succeeded
// errorCode
// slug
// message
// }
// }
// }
// }
// `,
// variables: {
// host: _.get(this.config, 'host', '')
// },
// watchLoading (isLoading) {
// this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-extensions-update')
// }
// })
// this.$store.commit('showNotification', {
// style: 'success',
// message: 'Configuration saved successfully.',
// icon: 'check'
// })
// } catch (err) {
// this.$store.commit('pushGraphError', err)
// }
}
},
apollo: {
extensions: {
query: gql`
{
system {
extensions {
key
title
description
isInstalled
isCompatible
2020-05-13 03:39:29 +00:00
}
}
2020-05-18 04:45:51 +00:00
}
`,
fetchPolicy: 'network-only',
update: (data) => _.cloneDeep(data.system.extensions),
watchLoading (isLoading) {
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-extensions-refresh')
2020-05-13 03:39:29 +00:00
}
}
}
}
</script>
<style lang='scss'>
.admin-extensions-exp {
.v-expansion-panel-content__wrap {
padding: 0;
}
}
</style>