settings.eta 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <% layout("/sk/layout", { title: `nastavenia` }) %>
  2. <%~ include("/sk/partials/topbar") %>
  3. <% const settingsIcon = `
  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. <path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0a2.34 2.34 0 0 0 3.319 1.915a2.34 2.34 0 0 1 2.33 4.033a2.34 2.34 0 0 0 0 3.831a2.34 2.34 0 0 1-2.33 4.033a2.34 2.34 0 0 0-3.319 1.915a2.34 2.34 0 0 1-4.659 0a2.34 2.34 0 0 0-3.32-1.915a2.34 2.34 0 0 1-2.33-4.033a2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />
  7. <circle cx="12" cy="12" r="3" />
  8. </g>
  9. </svg>
  10. ` %>
  11. <% const ipIcon = `
  12. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  13. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  14. <rect width="6" height="6" x="16" y="16" rx="1" />
  15. <rect width="6" height="6" x="2" y="16" rx="1" />
  16. <rect width="6" height="6" x="9" y="2" rx="1" />
  17. <path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3m-7-4V8" />
  18. </g>
  19. </svg>
  20. ` %>
  21. <h2><%~ settingsIcon %> nastavenia</h2>
  22. <% const errorValue = it.error?.split('.').reduce((a, b) => a[b], it.lang.settings?.errors)?.(it?.errorDetails) %>
  23. <% if (typeof errorValue === "string") { %>
  24. <div class="message error">
  25. <p><%= errorValue %></p>
  26. </div>
  27. <% } %>
  28. <p><%~ ipIcon %> <%= it.wifiIPv4 %></p>
  29. <form action="/settings" method="post">
  30. <div class="container-row">
  31. <label for="postDataEnabled">odosielať dáta</label>
  32. <input type="checkbox" id="postDataEnabled" name="postDataEnabled" <%= it.postDataEnabled !== "false" ? `checked` : `` %> value="true">
  33. </div>
  34. <div>
  35. <label for="cloudURL">cloud url</label>
  36. <input type="text" id="cloudURL" name="cloudURL" placeholder="wss://meteostanica.com" value="<%= it.cloudURL ?? `wss://meteostanica.com` %>">
  37. </div>
  38. <button type="submit">uložiť</button>
  39. </form>