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.

162 lines
6.0 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='/svg/icon-tune.svg', alt='System Info', style='width: 80px;')
  7. .admin-header-title
  8. .headline.primary--text.animated.fadeInLeft {{ $t('admin:system.title') }}
  9. .subheading.grey--text.animated.fadeInLeft.wait-p2s {{ $t('admin:system.subtitle') }}
  10. v-layout.mt-3(row wrap)
  11. v-flex(lg6 xs12)
  12. v-card.animated.fadeInUp
  13. v-btn.animated.fadeInLeft.wait-p2s.btn-animate-rotate(fab, absolute, right, top, small, light, @click='refresh'): v-icon refresh
  14. v-list(two-line, dense)
  15. v-subheader Wiki.js
  16. v-list-tile(avatar)
  17. v-list-tile-avatar
  18. v-icon.blue.white--text system_update_alt
  19. v-list-tile-content
  20. v-list-tile-title {{ $t('admin:system.currentVersion') }}
  21. v-list-tile-sub-title {{ info.currentVersion }}
  22. v-list-tile(avatar)
  23. v-list-tile-avatar
  24. v-icon.blue.white--text open_in_browser
  25. v-list-tile-content
  26. v-list-tile-title {{ $t('admin:system.latestVersion') }}
  27. v-list-tile-sub-title {{ info.latestVersion }}
  28. v-list-tile-action
  29. v-list-tile-action-text {{ $t('admin:system.published') }} {{ info.latestVersionReleaseDate | moment('from') }}
  30. v-divider.mt-3
  31. v-subheader {{ $t('admin:system.hostInfo') }}
  32. v-list-tile(avatar)
  33. v-list-tile-avatar
  34. v-avatar.blue-grey(size='40')
  35. img(:src='`/svg/icon-` + platformLogo + `-logo.svg`', alt='Platform', style='width: 24px;')
  36. v-list-tile-content
  37. v-list-tile-title {{ $t('admin:system.os') }}
  38. v-list-tile-sub-title {{ (info.platform === 'docker') ? 'Docker Container (Linux)' : info.operatingSystem }}
  39. v-list-tile(avatar)
  40. v-list-tile-avatar
  41. v-icon.blue-grey.white--text computer
  42. v-list-tile-content
  43. v-list-tile-title {{ $t('admin:system.hostname') }}
  44. v-list-tile-sub-title {{ info.hostname }}
  45. v-list-tile(avatar)
  46. v-list-tile-avatar
  47. v-icon.blue-grey.white--text nfc
  48. v-list-tile-content
  49. v-list-tile-title {{ $t('admin:system.cpuCores') }}
  50. v-list-tile-sub-title {{ info.cpuCores }}
  51. v-list-tile(avatar)
  52. v-list-tile-avatar
  53. v-icon.blue-grey.white--text memory
  54. v-list-tile-content
  55. v-list-tile-title {{ $t('admin:system.totalRAM') }}
  56. v-list-tile-sub-title {{ info.ramTotal }}
  57. v-list-tile(avatar)
  58. v-list-tile-avatar
  59. v-icon.blue-grey.white--text last_page
  60. v-list-tile-content
  61. v-list-tile-title {{ $t('admin:system.workingDirectory') }}
  62. v-list-tile-sub-title {{ info.workingDirectory }}
  63. v-list-tile(avatar)
  64. v-list-tile-avatar
  65. v-icon.blue-grey.white--text settings
  66. v-list-tile-content
  67. v-list-tile-title {{ $t('admin:system.configFile') }}
  68. v-list-tile-sub-title {{ info.configFile }}
  69. v-flex(lg6 xs12)
  70. v-card.pb-3.animated.fadeInUp.wait-p4s
  71. v-list(dense)
  72. v-subheader Node.js
  73. v-list-tile(avatar)
  74. v-list-tile-avatar
  75. v-avatar.light-green(size='40')
  76. icon-node-js(fillColor='#FFFFFF')
  77. v-list-tile-content
  78. v-list-tile-title {{ info.nodeVersion }}
  79. v-divider.mt-3
  80. v-subheader {{ info.dbType }}
  81. v-list-tile(avatar)
  82. v-list-tile-avatar
  83. v-avatar.indigo.darken-1(size='40')
  84. icon-database(fillColor='#FFFFFF')
  85. v-list-tile-content
  86. v-list-tile-title(v-html='dbVersion')
  87. v-list-tile-sub-title {{ info.dbHost }}
  88. v-alert.mt-3(:value='isDbLimited', color='deep-orange', icon='warning') Your database version is not fully supported. Some functionality may be limited or not work as expected.
  89. </template>
  90. <script>
  91. import _ from 'lodash'
  92. import IconDatabase from 'mdi/Database'
  93. import IconNodeJs from 'mdi/Nodejs'
  94. import systemInfoQuery from 'gql/admin/system/system-query-info.gql'
  95. export default {
  96. components: {
  97. IconDatabase,
  98. IconNodeJs
  99. },
  100. data() {
  101. return {
  102. info: {}
  103. }
  104. },
  105. computed: {
  106. dbVersion() {
  107. return _.get(this.info, 'dbVersion', '').replace(/(?:\r\n|\r|\n)/g, '<br />')
  108. },
  109. platformLogo() {
  110. switch (this.info.platform) {
  111. case 'docker':
  112. return 'docker'
  113. case 'darwin':
  114. return 'apple'
  115. case 'linux':
  116. return 'linux'
  117. case 'win32':
  118. return 'windows'
  119. default:
  120. return ''
  121. }
  122. },
  123. isDbLimited() {
  124. return this.info.dbType === 'MySQL' && this.dbVersion.indexOf('5.') === 0
  125. }
  126. },
  127. methods: {
  128. async refresh() {
  129. await this.$apollo.queries.info.refetch()
  130. this.$store.commit('showNotification', {
  131. message: 'System Info has been refreshed.',
  132. style: 'success',
  133. icon: 'cached'
  134. })
  135. }
  136. },
  137. apollo: {
  138. info: {
  139. query: systemInfoQuery,
  140. fetchPolicy: 'network-only',
  141. update: (data) => data.system.info,
  142. watchLoading (isLoading) {
  143. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-system-refresh')
  144. }
  145. }
  146. }
  147. }
  148. </script>
  149. <style lang='scss'>
  150. </style>