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.

32 lines
602 B

  1. const {logsApi} = require("../../../../../rpdata/api/Log")
  2. module.exports = class {
  3. onCreate(input) {
  4. this.state = {
  5. error: null,
  6. loading: false,
  7. }
  8. }
  9. open() {
  10. }
  11. close() {
  12. this.emit("close")
  13. }
  14. doIt() {
  15. this.state.loading = true
  16. logsApi.remove({id: this.input.logId}).then(() => {
  17. this.emit("removed")
  18. this.emit("close")
  19. }).catch(errs => {
  20. console.warn("Failed to remove:", errs)
  21. this.state.error = "Failed to remove: " + errs.message || errs[0].message
  22. }).then(() => {
  23. this.state.loading = false
  24. })
  25. }
  26. }