The frontend/UI server, written in JS using the MarkoJS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.1 KiB

  1. import moment from "moment"
  2. <modal class="modal color-text nolabel" key="modal" enabled=(input.enabled) closable on-close("close") on-open("open") >
  3. <if(state.imported == null)>
  4. <h1>Import Log</h1>
  5. <p key="error" class="color-error">${state.error}</p>
  6. <label>Type</label>
  7. <select key="importer" autofocus class="big" placeholder="Kind" on-change("change", "importer") value=state.values.importer>
  8. <option value="MircLike" selected=(state.values.importer === "MircLike")>mIRC-Like log</option>
  9. <option value="ForumLog" selected=(state.values.importer === "ForumLog")>Forum Log</option>
  10. <option value="IrcCloud" selected=(state.values.importer === "IrcCloud")>IRCCloud log export</option>
  11. </select>
  12. <label>Timezone</label>
  13. <select key="timezone" class="big" placeholder="Kind" on-change("change", "timezone") value=state.values.timezone>
  14. <option for(tz in state.timezones) value=tz selected=(state.values.timezone === tz)>${tz}</option>
  15. </select>
  16. <label>Channel</label>
  17. <input key="channelName" placeholder="(Required)" class="big" on-change("change", "channelName") value=state.values.channelName />
  18. <if(state.values.importer === "MircLike")>
  19. <label>Date</label>
  20. <input key="date" class="big" placeholder="(Required)" on-change("change", "date") value=state.values.date />
  21. </if>
  22. <if(state.values.importer === "IrcCloud")>
  23. <label>Session Change Threshold (Hours)</label>
  24. <input key="sessionThreshold" class="big" placeholder="(Required)" on-change("change", "sessionThresholdHours") value=state.values.sessionThresholdHours />
  25. </if>
  26. <label>Content</label>
  27. <textarea key="data" placeholder="(Required)" class="tall" on-change("change", "data") value=state.values.data />
  28. <button disabled=state.loading on-click("save")>Import</button>
  29. </if>
  30. <else>
  31. <h1>Import Successful</h1>
  32. <p>The following logs were imported.</p>
  33. <ol class="imported-log-list">
  34. <for (log in state.imported)>
  35. <li><a class="color-primary" href=("/logs/" + log.id)>${log.id} (${moment(log.date).format("MMMM D, YYYY")})</a></li>
  36. </for>
  37. </ol>
  38. </else>
  39. </modal>