mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
New UI Redesign in pyqt6 (#56)
* Initial commit for new UI * Initial commit for new UI * WIP * Status bar updates and has an icon for online / offline * Add log_viewer.py * Use JSON for delete_engine_download API * Fix class issue with Downloaders * Move Config class to new ui * Add engine_browser.py * Add a close event handler to the main window * Fix issue with engine manager not deleting engines properly * Rearrange all the files * Add icons and resources * Cache system info in RenderServerProxy * Toolbar polish * Fix resource path in status bar * Add config_dir to misc_helper.py * Add try block to zeroconf setup * Add add_job.py * Add raw args to add_job.py
This commit is contained in:
30
src/ui/log_viewer.py
Normal file
30
src/ui/log_viewer.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import requests
|
||||
from PyQt6.QtGui import QFont
|
||||
from PyQt6.QtWidgets import QMainWindow, QVBoxLayout, QWidget, QPlainTextEdit
|
||||
|
||||
|
||||
class LogViewer(QMainWindow):
|
||||
def __init__(self, log_path):
|
||||
super().__init__()
|
||||
|
||||
self.log_path = log_path
|
||||
self.setGeometry(100, 100, 600, 800)
|
||||
self.setWindowTitle("Log Output")
|
||||
|
||||
self.text_edit = QPlainTextEdit(self)
|
||||
self.text_edit.setReadOnly(True)
|
||||
self.text_edit.setFont(QFont("Courier", 10))
|
||||
|
||||
layout = QVBoxLayout()
|
||||
layout.addWidget(self.text_edit)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
central_widget = QWidget()
|
||||
central_widget.setLayout(layout)
|
||||
self.setCentralWidget(central_widget)
|
||||
|
||||
self.fetch_logs()
|
||||
|
||||
def fetch_logs(self):
|
||||
result = requests.get(self.log_path)
|
||||
self.text_edit.setPlainText(result.text)
|
||||
Reference in New Issue
Block a user