You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.8 KiB

  1. <template lang='pug'>
  2. v-container(fluid, grid-list-lg)
  3. v-layout(row wrap)
  4. v-flex(xs12)
  5. .admin-header
  6. img.animated.fadeInUp(src='/_assets/svg/icon-installing-updates.svg', alt='Extensions', style='width: 80px;')
  7. .admin-header-title
  8. .headline.primary--text.animated.fadeInLeft {{ $t('admin:extensions.title') }}
  9. .subtitle-1.grey--text.animated.fadeInLeft {{ $t('admin:extensions.subtitle') }}
  10. v-form.pt-3
  11. v-layout(row wrap)
  12. v-flex(xl6 lg8 xs12)
  13. v-alert.mb-4(outlined, color='error', icon='mdi-alert')
  14. span New extensions cannot be installed at the moment. This feature is coming in a future release.
  15. v-expansion-panels.admin-extensions-exp(hover, popout)
  16. v-expansion-panel(v-for='ext of extensions', :key='`ext-` + ext.key')
  17. v-expansion-panel-header(disable-icon-rotate)
  18. span {{ext.title}}
  19. template(v-slot:actions)
  20. v-chip(label, color='success', small, v-if='ext.isInstalled') Installed
  21. v-chip(label, color='warning', small, v-else) Not Installed
  22. v-expansion-panel-content.pa-0
  23. v-card(flat, :class='$vuetify.theme.dark ? `grey darken-3` : `grey lighten-5`', tile)
  24. v-card-text
  25. .body-2 {{ext.description}}
  26. v-divider.my-4
  27. .body-2
  28. strong.mr-2 This extension is
  29. v-chip.mr-2(v-if='ext.isCompatible', label, outlined, small, color='success') compatible
  30. v-chip.mr-2(v-else, label, small, color='error') not compatible
  31. strong with your host.
  32. v-card-chin
  33. v-spacer
  34. v-btn(disabled)
  35. v-icon(left) mdi-plus
  36. span Install
  37. </template>
  38. <script>
  39. import _ from 'lodash'
  40. import gql from 'graphql-tag'
  41. export default {
  42. data() {
  43. return {
  44. extensions: []
  45. }
  46. },
  47. methods: {
  48. async save () {
  49. // try {
  50. // await this.$apollo.mutate({
  51. // mutation: gql`
  52. // mutation (
  53. // $host: String!
  54. // ) {
  55. // site {
  56. // updateConfig(
  57. // host: $host
  58. // ) {
  59. // responseResult {
  60. // succeeded
  61. // errorCode
  62. // slug
  63. // message
  64. // }
  65. // }
  66. // }
  67. // }
  68. // `,
  69. // variables: {
  70. // host: _.get(this.config, 'host', '')
  71. // },
  72. // watchLoading (isLoading) {
  73. // this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-extensions-update')
  74. // }
  75. // })
  76. // this.$store.commit('showNotification', {
  77. // style: 'success',
  78. // message: 'Configuration saved successfully.',
  79. // icon: 'check'
  80. // })
  81. // } catch (err) {
  82. // this.$store.commit('pushGraphError', err)
  83. // }
  84. }
  85. },
  86. apollo: {
  87. extensions: {
  88. query: gql`
  89. {
  90. system {
  91. extensions {
  92. key
  93. title
  94. description
  95. isInstalled
  96. isCompatible
  97. }
  98. }
  99. }
  100. `,
  101. fetchPolicy: 'network-only',
  102. update: (data) => _.cloneDeep(data.system.extensions),
  103. watchLoading (isLoading) {
  104. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-extensions-refresh')
  105. }
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang='scss'>
  111. .admin-extensions-exp {
  112. .v-expansion-panel-content__wrap {
  113. padding: 0;
  114. }
  115. }
  116. </style>