mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	cleaned up unused backend log widget
This commit is contained in:
		| @@ -48,7 +48,6 @@ import BulkActionsDialog from "../widgets/dialogs/bulk_actions.js"; | ||||
| import AboutDialog from "../widgets/dialogs/about.js"; | ||||
| import HelpDialog from "../widgets/dialogs/help.js"; | ||||
| import RecentChangesDialog from "../widgets/dialogs/recent_changes.js"; | ||||
| import BackendLogDialog from "../widgets/dialogs/backend_log.js"; | ||||
| import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js"; | ||||
| import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js"; | ||||
| import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js"; | ||||
| @@ -187,7 +186,6 @@ export default class DesktopLayout { | ||||
|             .child(new AboutDialog()) | ||||
|             .child(new HelpDialog()) | ||||
|             .child(new RecentChangesDialog()) | ||||
|             .child(new BackendLogDialog()) | ||||
|             .child(new BranchPrefixDialog()) | ||||
|             .child(new SortChildNotesDialog()) | ||||
|             .child(new PasswordNoteSetDialog()) | ||||
|   | ||||
| @@ -1,46 +0,0 @@ | ||||
| import server from "../../services/server.js"; | ||||
| import BasicWidget from "../basic_widget.js"; | ||||
|  | ||||
| const TPL = ` | ||||
| <div class="backend-log-dialog modal fade mx-auto" tabindex="-1" role="dialog"> | ||||
|     <div class="modal-dialog modal-xl" role="document"> | ||||
|         <div class="modal-content"> | ||||
|             <div class="modal-header"> | ||||
|                 <h5 class="modal-title">Backend log</h5> | ||||
|                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||
|                     <span aria-hidden="true">×</span> | ||||
|                 </button> | ||||
|             </div> | ||||
|             e<div class="modal-body"> | ||||
|                 <textarea class="backend-log-textarea" readonly="readonly" style="min-height: 600px; width: 100%;"></textarea> | ||||
|             </div> | ||||
|             <div class="modal-footer"> | ||||
|                 <button class="refresh-backend-log-button btn btn-primary">Refresh</button> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| </div>`; | ||||
|  | ||||
| export default class BackendLogDialog extends BasicWidget { | ||||
|     doRender() { | ||||
|         this.$widget = $(TPL); | ||||
|         this.$backendLogTextArea = this.$widget.find(".backend-log-textarea"); | ||||
|         this.$refreshBackendLog = this.$widget.find(".refresh-backend-log-button"); | ||||
|  | ||||
|         this.$refreshBackendLog.on('click', () => this.load()); | ||||
|  | ||||
|         this.$widget.on('shown.bs.modal', () => this.scrollToBottom()); | ||||
|     } | ||||
|  | ||||
|     scrollToBottom() { | ||||
|         this.$backendLogTextArea.scrollTop(this.$backendLogTextArea[0].scrollHeight); | ||||
|     } | ||||
|  | ||||
|     async load() { | ||||
|         const backendLog = await server.get('backend-log'); | ||||
|  | ||||
|         this.$backendLogTextArea.text(backendLog); | ||||
|  | ||||
|         this.scrollToBottom(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user