Skip to content

Commit

Permalink
build: add Tianji telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
gander committed Mar 20, 2024
1 parent bf02c44 commit 4d34e16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ const calcExpeditions = (expeditions: number): number => {
return result;
};
const telemetryImg = import.meta.env.VITE_TELEMETRY_IMG;
watch([traitsInput, statsInput, expeditions], () => {
stats.value = extractTraits(statsInput.value).reduce((sum, cur) => cur + sum, 0);
bonuses.value = extractTraits(traitsInput.value).reduce((sum, cur) => cur + sum, 0);
Expand Down Expand Up @@ -152,6 +154,11 @@ watch(validStat, (value) => {

</div>
</div>
<div class="row" v-if="telemetryImg">
<div class="telemetry">
<img :src="telemetryImg" alt="">
</div>
</div>
<div class="row">
<div class="col mt-3 d-flex flex-column align-items-center">
<div class="lead">Formula sources</div>
Expand All @@ -177,4 +184,7 @@ watch(validStat, (value) => {
justify-content: center;
cursor: help;
}
.telemetry {
text-align: center;
}
</style>
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface ImportMetaEnv {
readonly VITE_TIANJI_ID: string
readonly VITE_TIANJI_SRC: string
readonly VITE_SENTRY_DSN: string;
readonly VITE_TELEMETRY_IMG: string;
}

interface ImportMeta {
Expand Down

0 comments on commit 4d34e16

Please sign in to comment.