You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defmoduleProxyLiveView.LayoutdousePhoenix.Componentdefrender("root.html",assigns)do~H"""<!DOCTYPE html><htmllang="en"class="h-full"><head><metacharset="utf-8"/><metaname="viewport"content="width=device-width, initial-scale=1"/><.live_title><%=assigns[:page_title]||"Phoenix Playground" %></.live_title><linkrel="icon"href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgAB/ajN8ioAAAAASUVORK5CYII="></head><body><scriptsrc={ProxyEndpoint.static_path("/assets/phoenix/phoenix.js")}></script><scriptsrc={ProxyEndpoint.static_path("/assets/phoenix_live_view/phoenix_live_view.js")}></script><scriptsrc="https://cdn.tailwindcss.com"></script><script> // Set global hooks and uploaders objects to be used by the LiveSocket, // so they can be overwritten in user provided templates. window.hooks = {} window.uploaders = {} let liveSocket = new window.LiveView.LiveSocket( "<%=ProxyEndpoint.static_path("/proxylive") %>", window.Phoenix.Socket,{hooks, uploaders,transport: window.Phoenix.LongPoll} ) liveSocket.connect()</script><divclass="container mx-auto"><%=@inner_content %></div></body></html>"""endenddefmoduleProxyEndpoint.ErrorViewdodefrender(template,_),do: Phoenix.Controller.status_message_from_template(template)enddefmoduleProxyLiveView.RootLivedousePhoenix.LiveViewdefmount(_params,_session,socket)do{:ok,socket|>assign(value: true)}enddefrender(assigns)do~H"""{@value}<buttonclass="border rounded bg-teal-100 p-2"phx-click="toggle">toggle</button>"""enddefhandle_event("toggle",_,socket)do{:noreply,socket|>assign(value: !socket.assigns.value)}endenddefmoduleProxyRouterdousePhoenix.RouterimportPhoenix.LiveView.Routerpipeline:browserdoplug(:put_root_layout,html: {ProxyLiveView.Layout,:root})endscope"/",ProxyLiveViewdopipe_through(:browser)live("/",RootLive)endenddefmoduleProxyEndpointdousePhoenix.Endpoint,otp_app: :proxy_live_viewplug(Plug.Logger,log: :debug)socket("/proxylive",Phoenix.LiveView.Socket,longpoll: true,websocket: false,pubsub_server: ProxyLiveView.PubSub)plug(Plug.Static,from: {:phoenix,"priv/static"},at: "/assets/phoenix")plug(Plug.Static,from: {:phoenix_live_view,"priv/static"},at: "/assets/phoenix_live_view")plug(ProxyRouter)endProxyLiveView.Iframe.start(endpoint: ProxyEndpoint)