Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: option to hide banner "This website runs on Solara" #836

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions solara/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ThemeVariant(str, Enum):
class ThemeSettings(BaseSettings):
variant: ThemeVariant = ThemeVariant.light
loader: str = "solara"
show_banner: bool = True

class Config:
env_prefix = "solara_theme_"
Expand Down
2 changes: 1 addition & 1 deletion solara/server/templates/loader-solara.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1>{{ loading_text }}</h1>
<jupyter-widget-mount-point mount-id="solara-main">
A widget with mount-id="solara-main" should go here
</jupyter-widget-mount-point>
<div style="position: absolute; right: 0px; bottom: 0px; padding: 10px;">
<div v-if="showBanner" style="position: absolute; right: 0px; bottom: 0px; padding: 10px;">
<b>This website runs on <a href="https://solara.dev">Solara</a></b>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions solara/server/templates/solara.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@
this.forceUpdateTrigger += 1;
original_$forceUpdate();
});
// in case we are showing a popop (e.g. using ipypopout), hide the banner
if(searchParams.has('modelid')) {
this.showBanner = false;
}
},
mounted() {
document.querySelector('#app').removeAttribute("style");
Expand Down Expand Up @@ -413,6 +417,7 @@
loadingPage: false,
_lastBusyTimer: null,
kernelBusyLong: false,
showBanner: theme.show_banner,
// outputMessages: [{ name: 'stderr', text: 'lala' }],
}
}
Expand Down
Loading