2
0

admin-utilities-telemetry.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template lang='pug'>
  2. v-card
  3. v-toolbar(flat, color='primary', dark, dense)
  4. .subheading {{ $t('admin:utilities.telemetryTitle') }}
  5. v-form
  6. v-card-text
  7. v-subheader What is telemetry?
  8. .body-1.pl-3 Telemetry allows the developers of Wiki.js to improve the software by collecting basic anonymized data about its usage and the host info. #[br] This is entirely optional and #[strong absolutely no] private data (such as content or personal data) is collected.
  9. .body-1.pt-3.pl-3 For maximum privacy, a random client ID is generated during setup. This ID is used to group requests together while keeping complete anonymity. You can reset and generate a new one below at any time.
  10. v-divider.my-3
  11. v-subheader What is collected?
  12. .body-1.pl-3 When telemetry is enabled, only the following data is transmitted:
  13. v-list
  14. v-list-tile
  15. v-list-tile-avatar: v-icon info_outline
  16. v-list-tile-content
  17. v-list-tile-title.body-1 Version of Wiki.js installed
  18. v-list-tile-sub-title.caption: em e.g. v2.0.123
  19. v-list-tile
  20. v-list-tile-avatar: v-icon info_outline
  21. v-list-tile-content
  22. v-list-tile-title.body-1 Basic OS information
  23. v-list-tile-sub-title.caption: em Platform (Linux, macOS or Windows), Total CPU cores and DB type (PostgreSQL, MySQL, MariaDB, SQLite or SQL Server)
  24. v-list-tile
  25. v-list-tile-avatar: v-icon info_outline
  26. v-list-tile-content
  27. v-list-tile-title.body-1 Crash debug data
  28. v-list-tile-sub-title.caption: em Stack trace of the error
  29. v-list-tile
  30. v-list-tile-avatar: v-icon info_outline
  31. v-list-tile-content
  32. v-list-tile-title.body-1 Setup analytics
  33. v-list-tile-sub-title.caption: em Installation checkpoint reached
  34. .body-1.pl-3 Note that crash debug data is stored for a maximum of 30 days while analytics are stored for a maximum of 16 months, after which it is permanently deleted.
  35. v-divider.my-3
  36. v-subheader What is it used for?
  37. .body-1.pl-3 Telemetry is used by developers to improve Wiki.js, mostly for the following reasons:
  38. v-list(dense)
  39. v-list-tile
  40. v-list-tile-avatar: v-icon chevron_right
  41. v-list-tile-content: v-list-tile-title.body-1 Identify critical bugs more easily and fix them in a timely manner.
  42. v-list-tile
  43. v-list-tile-avatar: v-icon chevron_right
  44. v-list-tile-content: v-list-tile-title.body-1 Understand the upgrade rate of current installations.
  45. v-list-tile
  46. v-list-tile-avatar: v-icon chevron_right
  47. v-list-tile-content: v-list-tile-title.body-1 Optimize performance and testing scenarios based on most popular environments.
  48. .body-1.pl-3 Only authorized developers have access to the data. It is not shared to any 3rd party nor is it used for any other application than improving Wiki.js.
  49. v-divider.my-3
  50. v-subheader Settings
  51. .pl-3
  52. v-switch.mt-0(
  53. v-model='telemetry',
  54. label='Enable Telemetry',
  55. color='primary',
  56. hint='Allow Wiki.js to transmit telemetry data.',
  57. persistent-hint
  58. )
  59. .subheading.mt-3.grey--text.text--darken-1 Client ID
  60. .body-1 {{clientId}}
  61. v-card-chin
  62. v-btn(depressed, color='success', @click='updateTelemetry')
  63. v-icon(left) chevron_right
  64. | Save Changes
  65. v-spacer
  66. v-btn(outline, color='grey', @click='resetClientId')
  67. v-icon(left) autorenew
  68. span Reset Client ID
  69. </template>
  70. <script>
  71. import _ from 'lodash'
  72. import utilityTelemetryResetIdMutation from 'gql/admin/utilities/utilities-mutation-telemetry-resetid.gql'
  73. import utilityTelemetrySetMutation from 'gql/admin/utilities/utilities-mutation-telemetry-set.gql'
  74. import utilityTelemetryQuery from 'gql/admin/utilities/utilities-query-telemetry.gql'
  75. export default {
  76. data() {
  77. return {
  78. telemetry: false,
  79. clientId: 'N/A'
  80. }
  81. },
  82. methods: {
  83. async updateTelemetry() {
  84. this.loading = true
  85. this.$store.commit(`loadingStart`, 'admin-utilities-telemetry-set')
  86. try {
  87. const respRaw = await this.$apollo.mutate({
  88. mutation: utilityTelemetrySetMutation,
  89. variables: {
  90. enabled: this.telemetry
  91. }
  92. })
  93. const resp = _.get(respRaw, 'data.system.setTelemetry.responseResult', {})
  94. if (resp.succeeded) {
  95. this.$store.commit('showNotification', {
  96. message: 'Telemetry updated successfully.',
  97. style: 'success',
  98. icon: 'check'
  99. })
  100. } else {
  101. throw new Error(resp.message)
  102. }
  103. } catch (err) {
  104. this.$store.commit('pushGraphError', err)
  105. }
  106. this.$store.commit(`loadingStop`, 'admin-utilities-telemetry-set')
  107. this.loading = false
  108. },
  109. async resetClientId() {
  110. this.loading = true
  111. this.$store.commit(`loadingStart`, 'admin-utilities-telemetry-resetid')
  112. try {
  113. const respRaw = await this.$apollo.mutate({
  114. mutation: utilityTelemetryResetIdMutation
  115. })
  116. const resp = _.get(respRaw, 'data.system.resetTelemetryClientId.responseResult', {})
  117. if (resp.succeeded) {
  118. this.$apollo.queries.telemetry.refetch()
  119. this.$store.commit('showNotification', {
  120. message: 'Telemetry Client ID reset successfully.',
  121. style: 'success',
  122. icon: 'check'
  123. })
  124. } else {
  125. throw new Error(resp.message)
  126. }
  127. } catch (err) {
  128. this.$store.commit('pushGraphError', err)
  129. }
  130. this.$store.commit(`loadingStop`, 'admin-utilities-telemetry-resetid')
  131. this.loading = false
  132. }
  133. },
  134. apollo: {
  135. telemetry: {
  136. query: utilityTelemetryQuery,
  137. fetchPolicy: 'network-only',
  138. manual: true,
  139. result ({ data }) {
  140. this.telemetry = _.get(data, 'system.info.telemetry', false)
  141. this.clientId = _.get(data, 'system.info.telemetryClientId', 'N/A')
  142. },
  143. watchLoading (isLoading) {
  144. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-utilities-telemetry-refresh')
  145. }
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang='scss'>
  151. </style>