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.

172 lines
6.1 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(src='/svg/icon-tune.svg', alt='System Info', style='width: 80px;')
  7. .admin-header-title
  8. .headline.primary--text {{ $t('admin:system.title') }}
  9. .subheading.grey--text {{ $t('admin:system.subtitle') }}
  10. v-layout.mt-3(row wrap)
  11. v-flex(lg6 xs12)
  12. v-card
  13. v-btn(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
  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 Redis
  81. v-list-tile(avatar)
  82. v-list-tile-avatar
  83. v-avatar.red(size='40')
  84. icon-cube(fillColor='#FFFFFF')
  85. v-list-tile-content
  86. v-list-tile-title {{ info.redisVersion }}
  87. v-list-tile-sub-title {{ info.redisHost }}
  88. v-list-tile-action
  89. v-list-tile-action-text {{ $t('admin:system.ramUsage', { used: info.redisUsedRAM, total: info.redisTotalRAM }) }}
  90. v-divider.mt-3
  91. v-subheader {{ info.dbType }}
  92. v-list-tile(avatar)
  93. v-list-tile-avatar
  94. v-avatar.indigo.darken-1(size='40')
  95. icon-database(fillColor='#FFFFFF')
  96. v-list-tile-content
  97. v-list-tile-title(v-html='dbVersion')
  98. v-list-tile-sub-title {{ info.dbHost }}
  99. </template>
  100. <script>
  101. import _ from 'lodash'
  102. import IconCube from 'mdi/Cube'
  103. import IconDatabase from 'mdi/Database'
  104. import IconNodeJs from 'mdi/Nodejs'
  105. import systemInfoQuery from 'gql/admin/system/system-query-info.gql'
  106. export default {
  107. components: {
  108. IconCube,
  109. IconDatabase,
  110. IconNodeJs
  111. },
  112. data() {
  113. return {
  114. info: {}
  115. }
  116. },
  117. computed: {
  118. dbVersion() {
  119. return _.get(this.info, 'dbVersion', '').replace(/(?:\r\n|\r|\n)/g, '<br />')
  120. },
  121. platformLogo() {
  122. switch (this.info.platform) {
  123. case 'docker':
  124. return 'docker'
  125. case 'darwin':
  126. return 'apple'
  127. case 'linux':
  128. return 'linux'
  129. case 'win32':
  130. return 'windows'
  131. default:
  132. return ''
  133. }
  134. }
  135. },
  136. methods: {
  137. async refresh() {
  138. await this.$apollo.queries.info.refetch()
  139. this.$store.commit('showNotification', {
  140. message: 'System Info has been refreshed.',
  141. style: 'success',
  142. icon: 'cached'
  143. })
  144. }
  145. },
  146. apollo: {
  147. info: {
  148. query: systemInfoQuery,
  149. fetchPolicy: 'network-only',
  150. update: (data) => data.system.info,
  151. watchLoading (isLoading) {
  152. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-system-refresh')
  153. }
  154. }
  155. }
  156. }
  157. </script>
  158. <style lang='scss'>
  159. </style>