mirror of
https://github.com/netfun2000/hipudding-teslamate.git
synced 2026-02-27 09:44:28 +08:00
* feat: update to Phenix HTML 4.1 * fix: updating to the new Gettext.Backend approach * chore: update pot files ro locale version 45.0.0 * fix: downgrade cloack back to 1.1.2 * revert: merge of mix.lock * fix: new syntax for field name generation for phx-feedback-for * Revert "fix: new syntax for field name generation for phx-feedback-for" This reverts commit 4d95e4f1c9367d2d5c606ced2190ab23edcb971b. * fix: downgrade floki back to 0.35.2 * Revert "fix: downgrade floki back to 0.35.2" This reverts commit a4f0b6bf4b32099d89003c3d20f72333d510e109. * fix: ensure floki nil is handled * style: linter findings * Revert "fix: ensure floki nil is handled" * fix: new syntax for field name generation for phx-feedback-for * debug: floki paramter error * Revert "debug: floki paramter error" This reverts commit 61920267edf5186b593920bde7d87e8b30af55aa. * fix: Remove unnecessary code in settings_test.exs which breaks floki 0.36+
183 lines
6.5 KiB
Plaintext
183 lines
6.5 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 suffix=" · TeslaMate">
|
|
<%= assigns[:page_title] || "Home" %>
|
|
</.live_title>
|
|
<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/assets/app.css")} />
|
|
<link
|
|
rel="apple-touch-icon"
|
|
sizes="180x180"
|
|
href={Routes.static_path(@conn, "/apple-touch-icon.png?v=5AB53N3ALo")}
|
|
/>
|
|
<link
|
|
rel="icon"
|
|
type="image/png"
|
|
sizes="32x32"
|
|
href={Routes.static_path(@conn, "/favicon-32x32.png?v=5AB53N3ALo")}
|
|
/>
|
|
<link
|
|
rel="icon"
|
|
type="image/png"
|
|
sizes="16x16"
|
|
href={Routes.static_path(@conn, "/favicon-16x16.png?v=5AB53N3ALo")}
|
|
/>
|
|
<link
|
|
rel="manifest"
|
|
href={Routes.static_path(@conn, "/site.webmanifest?v=5AB53N3ALo")}
|
|
crossorigin="use-credentials"
|
|
/>
|
|
<link
|
|
rel="mask-icon"
|
|
href={Routes.static_path(@conn, "/safari-pinned-tab.svg?v=5AB53N3ALo")}
|
|
color="#363636"
|
|
/>
|
|
<link rel="shortcut icon" href={Routes.static_path(@conn, "/favicon.ico?v=5AB53N3ALo")} />
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="msapplication-TileColor" content="#ffffff" />
|
|
<meta name="theme-color" content="#363636" />
|
|
<%= csrf_meta_tag() %>
|
|
<script>
|
|
window.LIVE_PATH = "<%= Routes.static_path(@conn, "/live") %>";
|
|
</script>
|
|
<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={Routes.static_path(@conn, "/")}>
|
|
<%= 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 %>
|
|
<.link
|
|
navigate={Routes.live_path(@conn, TeslaMateWeb.GeoFenceLive.Index)}
|
|
class="navbar-item mr-5"
|
|
>
|
|
<span class="icon"><i class="mdi mdi-map-marker-radius"></i></span> <span><%= gettext("Geo-Fences") %></span>
|
|
</.link>
|
|
<.link
|
|
navigate={Routes.live_path(@conn, TeslaMateWeb.SettingsLive.Index)}
|
|
class="navbar-item mr-5"
|
|
>
|
|
<span class="icon"><i class="mdi mdi-cog"></i></span> <span><%= gettext("Settings") %></span>
|
|
</.link>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<% update = TeslaMate.Updater.get_update() %>
|
|
|
|
<main
|
|
role="main"
|
|
style="overflow: hidden;"
|
|
class={["section", if(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(@flash, 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 update do %>
|
|
<%= link to: "https://github.com/teslamate-org/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>
|