mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-30 12:13:52 +08:00 
			
		
		
		
	cleaned up unused backend log widget
This commit is contained in:
		
							parent
							
								
									7d0117bd28
								
							
						
					
					
						commit
						97cadc3acf
					
				| @ -48,7 +48,6 @@ import BulkActionsDialog from "../widgets/dialogs/bulk_actions.js"; | |||||||
| import AboutDialog from "../widgets/dialogs/about.js"; | import AboutDialog from "../widgets/dialogs/about.js"; | ||||||
| import HelpDialog from "../widgets/dialogs/help.js"; | import HelpDialog from "../widgets/dialogs/help.js"; | ||||||
| import RecentChangesDialog from "../widgets/dialogs/recent_changes.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 BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js"; | ||||||
| import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js"; | import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js"; | ||||||
| import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js"; | import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js"; | ||||||
| @ -187,7 +186,6 @@ export default class DesktopLayout { | |||||||
|             .child(new AboutDialog()) |             .child(new AboutDialog()) | ||||||
|             .child(new HelpDialog()) |             .child(new HelpDialog()) | ||||||
|             .child(new RecentChangesDialog()) |             .child(new RecentChangesDialog()) | ||||||
|             .child(new BackendLogDialog()) |  | ||||||
|             .child(new BranchPrefixDialog()) |             .child(new BranchPrefixDialog()) | ||||||
|             .child(new SortChildNotesDialog()) |             .child(new SortChildNotesDialog()) | ||||||
|             .child(new PasswordNoteSetDialog()) |             .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(); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam