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.

43 lines
1.8 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. </select>
  11. <label>Timezone</label>
  12. <select key="timezone" class="big" placeholder="Kind" on-change("change", "timezone") value=state.values.timezone>
  13. <option for(tz in state.timezones) value=tz selected=(state.values.timezone === tz)>${tz}</option>
  14. </select>
  15. <label>Channel</label>
  16. <input key="channelName" placeholder="(Required)" class="big" on-change("change", "channelName") value=state.values.channelName />
  17. <if(state.values.importer === "MircLike")>
  18. <label>Date</label>
  19. <input key="date" class="big" placeholder="(Required)" on-change("change", "date") value=state.values.date />
  20. </if>
  21. <label>Content</label>
  22. <textarea key="data" placeholder="(Required)" class="tall" on-change("change", "data") value=state.values.data />
  23. <button disabled=state.loading on-click("save")>Import</button>
  24. </if>
  25. <else>
  26. <h1>Import Successful</h1>
  27. <p>The following logs were imported.</p>
  28. <ol class="imported-log-list">
  29. <for (log in state.imported)>
  30. <li><a class="color-primary" href=("/logs/" + log.id)>${log.id} (${moment(log.date).format("MMMM D, YYYY")})</a></li>
  31. </for>
  32. </ol>
  33. </else>
  34. </modal>