mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-08 14:04:31 +08:00
Show read-only mode warning on all admin pages
This commit is contained in:
parent
f4d96043b5
commit
9180e493a7
2 changed files with 27 additions and 0 deletions
|
@ -23,6 +23,10 @@ defmodule LivebookWeb.LayoutComponents do
|
|||
<.sidebar current_page={@current_page} current_user={@current_user} saved_hubs={@saved_hubs} />
|
||||
</div>
|
||||
<div class="grow overflow-y-auto">
|
||||
<.topbar :if={Livebook.Config.teams_auth?()} variant="warning">
|
||||
This Livebook instance has been configured for notebook deployment and is in read-only mode.
|
||||
</.topbar>
|
||||
|
||||
<div class="md:hidden sticky flex items-center justify-between h-14 px-4 top-0 left-0 z-[500] bg-white border-b border-gray-200">
|
||||
<div class="pt-1 text-xl text-gray-400 hover:text-gray-600 focus:text-gray-600">
|
||||
<button
|
||||
|
|
23
test/livebook_teams/web/admin_live_test.exs
Normal file
23
test/livebook_teams/web/admin_live_test.exs
Normal file
|
@ -0,0 +1,23 @@
|
|||
defmodule LivebookWeb.Integration.AdminLiveTest do
|
||||
# Not async, because we alter global config (app server instance)
|
||||
use Livebook.TeamsIntegrationCase, async: false
|
||||
|
||||
import Phoenix.LiveViewTest
|
||||
|
||||
setup do
|
||||
Application.put_env(:livebook, :teams_auth?, true)
|
||||
on_exit(fn -> Application.put_env(:livebook, :teams_auth?, false) end)
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
for page <- ["/", "/settings", "/learn", "/hub", "/apps-dashboard"] do
|
||||
@tag page: page
|
||||
test "GET #{page} shows the app server topbar warning", %{conn: conn, page: page} do
|
||||
{:ok, view, _} = live(conn, page)
|
||||
|
||||
assert render(view) =~
|
||||
"This Livebook instance has been configured for notebook deployment and is in read-only mode."
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue