Skip to content

Commit

Permalink
feat(ui): add version info
Browse files Browse the repository at this point in the history
Signed-off-by: Martichou <m@rtin.fyi>
  • Loading branch information
Martichou committed Mar 2, 2024
1 parent 2990fba commit db14a39
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions frontend/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
Rtin
</h2>
</div>
<div>
<div class="flex justify-center items-center gap-4">
<p class="text-sm">
v{{ version }}
</p>
<div class="hover:bg-gray-200 cursor-pointer p-2 rounded-lg active:scale-105 transition duration-150 ease-in-out">
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
<!-- eslint-disable-next-line -->
Expand Down Expand Up @@ -253,6 +256,7 @@ import { ref, nextTick } from 'vue'
import { UnlistenFn, listen } from '@tauri-apps/api/event'
import { invoke } from "@tauri-apps/api/core"
import { getCurrent } from '@tauri-apps/api/webview';
import { getVersion } from '@tauri-apps/api/app';
import { enable, isEnabled } from "@tauri-apps/plugin-autostart";
import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';
Expand Down Expand Up @@ -289,7 +293,7 @@ export default {
name: "HomePage",
setup() {
return {stateToDisplay, invoke};
return {stateToDisplay, invoke, getVersion};
},
data() {
Expand All @@ -304,12 +308,16 @@ export default {
outboundPayload: ref<OutboundPayload | undefined>(),
cleanupInterval: opt<NodeJS.Timeout>(),
unlisten: Array<UnlistenFn>()
unlisten: Array<UnlistenFn>(),
version: opt<string>()
};
},
mounted: function () {
nextTick(async () => {
this.version = await getVersion();
// Check start at boot
await enable();
console.log(`Is auto start: ${await isEnabled()}`);
Expand Down

0 comments on commit db14a39

Please # to comment.