Compare commits
No commits in common. "3900052adbfb98c33b44690f2a3b2a720dddf75c" and "66715d05a5d035aee1e2ec788cdd32e9bbe4a1ee" have entirely different histories.
3900052adb
...
66715d05a5
|
@ -70,25 +70,25 @@ Available to download for free from [here](https://github.com/tiny-craft/tiny-rd
|
||||||
* Node.js >= 16
|
* Node.js >= 16
|
||||||
* NPM >= 9
|
* NPM >= 9
|
||||||
|
|
||||||
### Install Wails
|
### Install wails
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
### Pull the Code
|
### Clone the code
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/tiny-craft/tiny-rdm --depth=1
|
git clone https://github.com/tiny-craft/tiny-rdm --depth=1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Build Frontend
|
### Build frontend
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install --prefix ./frontend
|
npm install --prefix ./frontend
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compile and Run
|
### Compile and run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails dev
|
wails dev
|
||||||
|
|
|
@ -14,7 +14,7 @@ import useConnectionStore from './stores/connections.js'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { darkTheme, NButton, NSpace } from 'naive-ui'
|
import { darkTheme, NButton, NSpace } from 'naive-ui'
|
||||||
import KeyFilterDialog from './components/dialogs/KeyFilterDialog.vue'
|
import KeyFilterDialog from './components/dialogs/KeyFilterDialog.vue'
|
||||||
import { Environment, WindowSetDarkTheme, WindowSetLightTheme } from 'wailsjs/runtime/runtime.js'
|
import { WindowSetDarkTheme, WindowSetLightTheme } from 'wailsjs/runtime/runtime.js'
|
||||||
import { darkThemeOverrides, themeOverrides } from '@/utils/theme.js'
|
import { darkThemeOverrides, themeOverrides } from '@/utils/theme.js'
|
||||||
import AboutDialog from '@/components/dialogs/AboutDialog.vue'
|
import AboutDialog from '@/components/dialogs/AboutDialog.vue'
|
||||||
import FlushDbDialog from '@/components/dialogs/FlushDbDialog.vue'
|
import FlushDbDialog from '@/components/dialogs/FlushDbDialog.vue'
|
||||||
|
@ -22,7 +22,8 @@ import ExportKeyDialog from '@/components/dialogs/ExportKeyDialog.vue'
|
||||||
import ImportKeyDialog from '@/components/dialogs/ImportKeyDialog.vue'
|
import ImportKeyDialog from '@/components/dialogs/ImportKeyDialog.vue'
|
||||||
import { Info } from 'wailsjs/go/services/systemService.js'
|
import { Info } from 'wailsjs/go/services/systemService.js'
|
||||||
import DecoderDialog from '@/components/dialogs/DecoderDialog.vue'
|
import DecoderDialog from '@/components/dialogs/DecoderDialog.vue'
|
||||||
import { loadModule, trackEvent } from '@/utils/analytics.js'
|
import { enableTrack, loadModule, trackEvent } from '@/utils/analytics.js'
|
||||||
|
import { endsWith } from 'lodash'
|
||||||
|
|
||||||
const prefStore = usePreferencesStore()
|
const prefStore = usePreferencesStore()
|
||||||
const connectionStore = useConnectionStore()
|
const connectionStore = useConnectionStore()
|
||||||
|
@ -37,10 +38,13 @@ onMounted(async () => {
|
||||||
if (prefStore.autoCheckUpdate) {
|
if (prefStore.autoCheckUpdate) {
|
||||||
prefStore.checkForUpdate()
|
prefStore.checkForUpdate()
|
||||||
}
|
}
|
||||||
const env = await Environment()
|
loadModule(prefStore.general.allowTrack !== false).then(() => {
|
||||||
loadModule(env.buildType !== 'dev' && prefStore.general.allowTrack !== false).then(() => {
|
|
||||||
Info().then(({ data }) => {
|
Info().then(({ data }) => {
|
||||||
|
if (endsWith(data.version, 'dev')) {
|
||||||
|
enableTrack(false)
|
||||||
|
} else {
|
||||||
trackEvent('startup', data, true)
|
trackEvent('startup', data, true)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -427,7 +427,6 @@ const networkRate = shallowRef({
|
||||||
|
|
||||||
const chartOption = computed(() => {
|
const chartOption = computed(() => {
|
||||||
return {
|
return {
|
||||||
animation: false,
|
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
events: [],
|
events: [],
|
||||||
|
@ -465,7 +464,6 @@ const chartOption = computed(() => {
|
||||||
|
|
||||||
const byteChartOption = computed(() => {
|
const byteChartOption = computed(() => {
|
||||||
return {
|
return {
|
||||||
animation: false,
|
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
events: [],
|
events: [],
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
let inited = false
|
let inited = false
|
||||||
|
let allow = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* load umami analytics module
|
* load umami analytics module
|
||||||
|
@ -6,6 +7,7 @@ let inited = false
|
||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
*/
|
*/
|
||||||
export const loadModule = async (allowTrack = true) => {
|
export const loadModule = async (allowTrack = true) => {
|
||||||
|
allow = allowTrack !== false
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const script = document.createElement('script')
|
const script = document.createElement('script')
|
||||||
script.setAttribute('src', 'https://analytics.tinycraft.cc/script.js')
|
script.setAttribute('src', 'https://analytics.tinycraft.cc/script.js')
|
||||||
|
@ -25,7 +27,11 @@ export const loadModule = async (allowTrack = true) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const enable = () => {
|
const enable = () => {
|
||||||
return inited && umami
|
return inited && allow && umami
|
||||||
|
}
|
||||||
|
|
||||||
|
export const enableTrack = (enable) => {
|
||||||
|
allow = enable
|
||||||
}
|
}
|
||||||
|
|
||||||
export const trackEvent = async (event, data) => {
|
export const trackEvent = async (event, data) => {
|
||||||
|
|
Loading…
Reference in New Issue