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.

157 lines
5.6 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(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. </template>
  89. <script>
  90. import _ from 'lodash'
  91. import IconDatabase from 'mdi/Database'
  92. import IconNodeJs from 'mdi/Nodejs'
  93. import systemInfoQuery from 'gql/admin/system/system-query-info.gql'
  94. export default {
  95. components: {
  96. IconDatabase,
  97. IconNodeJs
  98. },
  99. data() {
  100. return {
  101. info: {}
  102. }
  103. },
  104. computed: {
  105. dbVersion() {
  106. return _.get(this.info, 'dbVersion', '').replace(/(?:\r\n|\r|\n)/g, '<br />')
  107. },
  108. platformLogo() {
  109. switch (this.info.platform) {
  110. case 'docker':
  111. return 'docker'
  112. case 'darwin':
  113. return 'apple'
  114. case 'linux':
  115. return 'linux'
  116. case 'win32':
  117. return 'windows'
  118. default:
  119. return ''
  120. }
  121. }
  122. },
  123. methods: {
  124. async refresh() {
  125. await this.$apollo.queries.info.refetch()
  126. this.$store.commit('showNotification', {
  127. message: 'System Info has been refreshed.',
  128. style: 'success',
  129. icon: 'cached'
  130. })
  131. }
  132. },
  133. apollo: {
  134. info: {
  135. query: systemInfoQuery,
  136. fetchPolicy: 'network-only',
  137. update: (data) => data.system.info,
  138. watchLoading (isLoading) {
  139. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-system-refresh')
  140. }
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang='scss'>
  146. </style>