Skip to content

Commit

Permalink
feat: use solara instead of voila for rendering the popout widget
Browse files Browse the repository at this point in the history
Should be used in combination with:
 widgetti/solara#805
  • Loading branch information
maartenbreddels committed Oct 2, 2024
1 parent 05ba109 commit c50e2be
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions ipypopout/popout_button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,22 @@
</template>
<script>
module.exports = {
data() {
return {solaraFound: false}
},
created() {
if (!this.getBaseUrl()) {
const baseUrl = this.getBaseUrl();
if (!baseUrl) {
console.info('BaseUrl not found, hiding popout button.');
} else {
const solaraReadyZUrl = `${baseUrl}solara/readyz`;
fetch(solaraReadyZUrl)
.then(response => {
if (response.ok) {
console.error('Solara found, using Solara popout page.');
this.solaraFound = true;
}
})
}
},
mounted() {
Expand Down Expand Up @@ -68,7 +81,7 @@ module.exports = {
if (window.solara && (solara.rootPath !== undefined)) {
return solara.rootPath;
}
return 'voila/templates/ipypopout/static/popout.html'
return this.solaraFound ? 'solara' : 'voila/templates/ipypopout/static/popout.html'
}
}
}
Expand Down

0 comments on commit c50e2be

Please sign in to comment.