mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
119 lines
6.0 KiB
Plaintext
119 lines
6.0 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang={Plug.Conn.get_session(@conn, :locale)}>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
<%= live_title_tag assigns[:page_title] || "Home", suffix: " · TeslaMate" %>
|
|
<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/assets/app.css")}/>
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=5AB53N3ALo">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png?v=5AB53N3ALo">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=5AB53N3ALo">
|
|
<link rel="manifest" href="/site.webmanifest?v=5AB53N3ALo" crossorigin="use-credentials">
|
|
<link rel="mask-icon" href="/safari-pinned-tab.svg?v=5AB53N3ALo" color="#363636">
|
|
<link rel="shortcut icon" href="/favicon.ico?v=5AB53N3ALo">
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="msapplication-TileColor" content="#ffffff">
|
|
<meta name="theme-color" content="#ffffff">
|
|
<%= csrf_meta_tag() %>
|
|
<script defer phx-track-static type="text/javascript" src={Routes.static_path(@conn, "/assets/app.js")}></script>
|
|
</head>
|
|
<body tabIndex="0">
|
|
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
|
|
<div class="container">
|
|
<div class="navbar-brand">
|
|
<a class="navbar-item" href="/">
|
|
<%= img_tag Routes.static_path(@conn, "/images/logo.svg"), alt: "TeslaMate", width: "90px" %>
|
|
</a>
|
|
|
|
<a
|
|
role="button"
|
|
class="navbar-burger burger"
|
|
aria-label="menu"
|
|
aria-expanded="false"
|
|
data-target="navbar"
|
|
>
|
|
<span aria-hidden="true"></span>
|
|
<span aria-hidden="true"></span>
|
|
<span aria-hidden="true"></span>
|
|
</a>
|
|
</div>
|
|
|
|
<div id="navbar" class="navbar-menu">
|
|
<div class="navbar-end">
|
|
<%= if grafana_url = @conn.assigns.settings.grafana_url do %>
|
|
<div class="navbar-item has-dropdown is-hoverable">
|
|
<a class="navbar-link is-arrowless">
|
|
<span class="icon"><i class="mdi mdi-view-dashboard"></i></span> <span><%= gettext "Dashboards" %></span>
|
|
</a>
|
|
<div class="navbar-dropdown">
|
|
<%= for %{"title" => title, "uid" => uid} <- list_dashboards() do %>
|
|
<%= link title, to: "#{grafana_url}/d/#{uid}", class: "navbar-item", data_uid: uid, target: "_blank" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<%= live_redirect [to: Routes.live_path(@conn, TeslaMateWeb.GeoFenceLive.Index), class: "navbar-item mr-5"] do %>
|
|
<span class="icon"><i class="mdi mdi-map-marker-radius"></i></span> <span><%= gettext("Geo-Fences") %></span>
|
|
<% end %>
|
|
<%= live_redirect [to: Routes.live_path(@conn, TeslaMateWeb.SettingsLive.Index), class: "navbar-item mr-5"] do %>
|
|
<span class="icon"><i class="mdi mdi-cog"></i></span> <span><%= gettext("Settings") %></span>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<% show_doante_button = @conn.cookies["donate"] in Enum.map(0..1, &to_string/1) %>
|
|
<% update = TeslaMate.Updater.get_update() %>
|
|
|
|
|
|
<main role="main" style="overflow: hidden;" class={["section", (if show_doante_button or update, do: " full-height")]}>
|
|
<div class="container">
|
|
<%= if not TeslaMate.Vault.encryption_key_provided?() or
|
|
(not TeslaMate.Api.signed_in?() and not TeslaMate.Auth.can_decrypt_tokens?()) do %>
|
|
<% docs_link = link "docs.teslamate.org", to: "https://docs.teslamate.org",
|
|
target: "_blank",
|
|
rel: "noopener noreferrer" %>
|
|
|
|
<div class="notification is-warning">
|
|
<p class="title is-5 is-spaced">
|
|
<span class="icon"><i class="mdi mdi-shield-alert"></i></span> <%= gettext "No encryption key provided" %>
|
|
</p>
|
|
<p class="subtitle is-6"><%= raw(gettext "To ensure that your <strong>Tesla API tokens are stored securely</strong>, an encryption key must be provided to TeslaMate via the <code>ENCRYPTION_KEY</code> environment variable. Otherwise, a <strong>login will be required after every restart</strong>.") %></p>
|
|
<p class="subtitle is-6"><%= raw(gettext "The automatically generated encryption key used for the current session can be found <strong>in the application logs</strong>.") %></p>
|
|
<p class="subtitle is-6"><%= raw(gettext "For more information, see the updated installation guides on %{link}", link: safe_to_string(docs_link)) %></p>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= Enum.map(get_flash(@conn), fn {flash_key, flash_message} -> %>
|
|
<p class={"notification is-#{flash_key}"}><%= flash_message %></p>
|
|
<% end) %>
|
|
|
|
<%= @inner_content %>
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="footer">
|
|
<div class="content has-text-centered">
|
|
<%= if @conn.cookies["donate"] in Enum.map(0..1, &to_string/1) do %>
|
|
<%= link to: Routes.donate_path(@conn, :index),
|
|
class: "button is-rounded is-text is-small has-text-grey", type: "button",
|
|
target: "_blank", rel: "noopener noreferrer" do %>
|
|
<span class="icon"><i class="mdi mdi-heart"></i> </span>
|
|
<strong><%= gettext "Donate" %></strong>
|
|
<% end %>
|
|
<% end %>
|
|
<%= if update do %>
|
|
<%= link to: "https://github.com/adriankumpf/teslamate/releases",
|
|
class: "button is-rounded is-text is-small has-text-grey", type: "button",
|
|
target: "_blank", rel: "noopener noreferrer" do %>
|
|
<span class="icon"><i class="mdi mdi-gift"></i> </span>
|
|
<strong><%= [gettext("Update available"), ": ", update] %></strong>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|