settings.eta 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <% layout("/sk/layout") %>
  2. <%~ include("/sk/partials/topbar") %>
  3. <% const ipIcon = `
  4. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  5. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  6. <rect width="6" height="6" x="16" y="16" rx="1" />
  7. <rect width="6" height="6" x="2" y="16" rx="1" />
  8. <rect width="6" height="6" x="9" y="2" rx="1" />
  9. <path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3m-7-4V8" />
  10. </g>
  11. </svg>
  12. ` %>
  13. <h2>nastavenia</h2>
  14. <% const errorValue = it.error?.split('.').reduce((a, b) => a[b], it.lang.settings?.errors)?.(it?.errorDetails) %>
  15. <% if (typeof errorValue === "string") { %>
  16. <div class="message error">
  17. <p><%= errorValue %></p>
  18. </div>
  19. <% } %>
  20. <p><%~ ipIcon %> <%= it.wifiIPv4 %></p>
  21. <form action="/settings" method="post">
  22. <div>
  23. <label for="postDataEnabled">odosielať dáta</label>
  24. <input type="checkbox" id="postDataEnabled" name="postDataEnabled" <%= it.postDataEnabled !== "false" ? `checked` : `` %> value="true">
  25. </div>
  26. <div>
  27. <label for="cloudURL">cloud url</label>
  28. <input type="text" id="cloudURL" name="cloudURL" placeholder="wss://meteostanica.com" value="<%= it.cloudURL ?? `wss://meteostanica.com` %>">
  29. </div>
  30. <button type="submit">uložiť</button>
  31. </form>