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