Seamless host switching

This commit is contained in:
2022-09-27 19:22:57 -04:00
parent 8b76181b4d
commit 9785af43a0
2 changed files with 45 additions and 39 deletions

View File

@@ -3,7 +3,7 @@
<Navbar v-model:server="server" :user="user" />
<div class="container">
<Login :secret="secret" v-model:client="client" v-model:server="server" v-model:user="user" />
<router-view v-if="user"></router-view>
<router-view v-if="user" :client="client"></router-view>
</div>
</div>
</template>
@@ -38,10 +38,10 @@
if(this.heartbeat) window.clearInterval(this.heartbeat);
else {
[
{ path: '/', component: RouteSchedule, props: { client: this.client } },
{ path: '/patient', component: RoutePatientLookup, props: { client: this.client } },
{ path: '/patient/:id', component: RoutePatientDetail, props: { client: this.client } },
{ path: '/recall', component: RouteRecall, props: { client: this.client } },
{ path: '/', component: RouteSchedule },
{ path: '/patient', component: RoutePatientLookup },
{ path: '/patient/:id', component: RoutePatientDetail },
{ path: '/recall', component: RouteRecall },
].forEach(route => this.$root.$router.addRoute(route));
await this.$root.$router.replace(this.$route);
}