Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
implement query backend version
Browse files Browse the repository at this point in the history
Signed-off-by: cbh778899 <[email protected]>
  • Loading branch information
cbh778899 committed Jun 29, 2024
1 parent 7bee55d commit ad76d4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pages/ui-components/Information.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import getVersions from '~/tools/getVersions';
const backendVersion = ref('Loading');
getVersions('frontend').then(version=>frontendVersion.value = version);
getVersions('backend').then(version=>backendVersion.value = version);
</script>
<template>
<div class="p-10 pb-5">
Expand Down
5 changes: 3 additions & 2 deletions tools/getVersions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { FRONTEND_APP_VERSION } from "~/types/version";
import request from "./request";

async function getVersions(ofEnd:'frontend'|'backend') {
if(ofEnd === 'frontend') {
return FRONTEND_APP_VERSION;
} else {
// TODO: call backend api to get version
} else if(ofEnd === 'backend') {
return (await request('/version')).version
}
}

Expand Down

0 comments on commit ad76d4a

Please sign in to comment.