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.4 KiB

  1. <template lang='pug'>
  2. v-card
  3. v-toolbar(flat, color='primary', dark, dense)
  4. .subtitle-1 {{ $t('admin:utilities.telemetryTitle') }}
  5. v-form
  6. v-card-text
  7. .subtitle-2 What is telemetry?
  8. .body-2.mt-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-2.mt-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-4
  11. .subtitle-2 What is collected?
  12. .body-2.mt-3 When telemetry is enabled, only the following data is transmitted:
  13. v-list
  14. v-list-item
  15. v-list-item-avatar: v-icon mdi-information-outline
  16. v-list-item-content
  17. v-list-item-title.body-2 Version of Wiki.js installed
  18. v-list-item-subtitle.caption: em e.g. v2.0.123
  19. v-list-item
  20. v-list-item-avatar: v-icon mdi-information-outline
  21. v-list-item-content
  22. v-list-item-title.body-2 Basic OS information
  23. v-list-item-subtitle.caption: em Platform (Linux, macOS or Windows), Total CPU cores and DB type (PostgreSQL, MySQL, MariaDB, SQLite or SQL Server)
  24. v-list-item
  25. v-list-item-avatar: v-icon mdi-information-outline
  26. v-list-item-content
  27. v-list-item-title.body-2 Crash debug data
  28. v-list-item-subtitle.caption: em Stack trace of the error
  29. v-list-item
  30. v-list-item-avatar: v-icon mdi-information-outline
  31. v-list-item-content
  32. v-list-item-title.body-2 Setup analytics
  33. v-list-item-subtitle.caption: em Installation checkpoint reached
  34. .body-2 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-4
  36. .subtitle-2 What is it used for?
  37. .body-2.mt-3 Telemetry is used by developers to improve Wiki.js, mostly for the following reasons:
  38. v-list(dense)
  39. v-list-item
  40. v-list-item-avatar: v-icon mdi-chevron-right
  41. v-list-item-content: v-list-item-title: .body-2 Identify critical bugs more easily and fix them in a timely manner.
  42. v-list-item
  43. v-list-item-avatar: v-icon mdi-chevron-right
  44. v-list-item-content: v-list-item-title: .body-2 Understand the upgrade rate of current installations.
  45. v-list-item
  46. v-list-item-avatar: v-icon mdi-chevron-right
  47. v-list-item-content: v-list-item-title: .body-2 Optimize performance and testing scenarios based on most popular environments.
  48. .body-2 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-4
  50. .subtitle-2 Settings
  51. .mt-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. v-divider.my-4
  60. .subtitle-2.mt-3.grey--text.text--darken-1 Client ID
  61. .body-2.mt-2 {{clientId}}
  62. v-card-chin
  63. v-btn.px-3(depressed, color='success', @click='updateTelemetry')
  64. v-icon(left) mdi-chevron-right
  65. | Save Changes
  66. v-spacer
  67. v-btn.px-3(outlined, color='grey', @click='resetClientId')
  68. v-icon(left) mdi-autorenew
  69. span Reset Client ID
  70. </template>
  71. <script>
  72. import _ from 'lodash'
  73. import utilityTelemetryResetIdMutation from 'gql/admin/utilities/utilities-mutation-telemetry-resetid.gql'
  74. import utilityTelemetrySetMutation from 'gql/admin/utilities/utilities-mutation-telemetry-set.gql'
  75. import utilityTelemetryQuery from 'gql/admin/utilities/utilities-query-telemetry.gql'
  76. export default {
  77. data() {
  78. return {
  79. telemetry: false,
  80. clientId: 'N/A'
  81. }
  82. },
  83. methods: {
  84. async updateTelemetry() {
  85. this.loading = true
  86. this.$store.commit(`loadingStart`, 'admin-utilities-telemetry-set')
  87. try {
  88. const respRaw = await this.$apollo.mutate({
  89. mutation: utilityTelemetrySetMutation,
  90. variables: {
  91. enabled: this.telemetry
  92. }
  93. })
  94. const resp = _.get(respRaw, 'data.system.setTelemetry.responseResult', {})
  95. if (resp.succeeded) {
  96. this.$store.commit('showNotification', {
  97. message: 'Telemetry updated successfully.',
  98. style: 'success',
  99. icon: 'check'
  100. })
  101. } else {
  102. throw new Error(resp.message)
  103. }
  104. } catch (err) {
  105. this.$store.commit('pushGraphError', err)
  106. }
  107. this.$store.commit(`loadingStop`, 'admin-utilities-telemetry-set')
  108. this.loading = false
  109. },
  110. async resetClientId() {
  111. this.loading = true
  112. this.$store.commit(`loadingStart`, 'admin-utilities-telemetry-resetid')
  113. try {
  114. const respRaw = await this.$apollo.mutate({
  115. mutation: utilityTelemetryResetIdMutation
  116. })
  117. const resp = _.get(respRaw, 'data.system.resetTelemetryClientId.responseResult', {})
  118. if (resp.succeeded) {
  119. this.$apollo.queries.telemetry.refetch()
  120. this.$store.commit('showNotification', {
  121. message: 'Telemetry Client ID reset successfully.',
  122. style: 'success',
  123. icon: 'check'
  124. })
  125. } else {
  126. throw new Error(resp.message)
  127. }
  128. } catch (err) {
  129. this.$store.commit('pushGraphError', err)
  130. }
  131. this.$store.commit(`loadingStop`, 'admin-utilities-telemetry-resetid')
  132. this.loading = false
  133. }
  134. },
  135. apollo: {
  136. telemetry: {
  137. query: utilityTelemetryQuery,
  138. fetchPolicy: 'network-only',
  139. manual: true,
  140. result ({ data }) {
  141. this.telemetry = _.get(data, 'system.info.telemetry', false)
  142. this.clientId = _.get(data, 'system.info.telemetryClientId', 'N/A')
  143. },
  144. watchLoading (isLoading) {
  145. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-utilities-telemetry-refresh')
  146. }
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang='scss'>
  152. </style>