()
| 721 | }); |
| 722 | }, |
| 723 | async clearLogs() { |
| 724 | let ok = await this.confirmDialog({ |
| 725 | type: 'warning', |
| 726 | title: '清空所有运行日志?', |
| 727 | message: '将清空最近 300 条日志记录。', |
| 728 | confirmText: '清空', cancelText: '取消' |
| 729 | }); |
| 730 | if (!ok) return; |
| 731 | let d = {}; d[PAGE_MONKEY_LOG_KEY] = '[]'; |
| 732 | chrome.storage.local.set(d, () => { this.logs = []; this.errorBadge = 0; }); |
| 733 | }, |
| 734 | formatTime(t) { |
| 735 | if (!t) return ''; |
| 736 | let d = new Date(t); |