61 lines
1.8 KiB
Python
61 lines
1.8 KiB
Python
from PyQt6.QtWidgets import (
|
|
QApplication, QWidget, QVBoxLayout, QLabel, QGridLayout, QProgressBar
|
|
)
|
|
from PyQt6.QtCore import Qt, QTimer
|
|
import sys
|
|
|
|
class LoadingScreen(QWidget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setFixedSize(960, 640)
|
|
self.setWindowTitle("서버 모니터링 - 로딩 중")
|
|
layout = QVBoxLayout()
|
|
layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
|
|
self.label = QLabel("서버 상태를 불러오는 중...")
|
|
self.label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
self.spinner = QProgressBar()
|
|
self.spinner.setRange(0, 0) # 무한 로딩 표시
|
|
|
|
layout.addWidget(self.label)
|
|
layout.addWidget(self.spinner)
|
|
self.setLayout(layout)
|
|
|
|
class MonitoringGrid(QWidget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setFixedSize(960, 640)
|
|
self.setWindowTitle("서버 모니터링")
|
|
|
|
grid = QGridLayout()
|
|
grid.setSpacing(10)
|
|
|
|
for row in range(3):
|
|
for col in range(4):
|
|
label = QLabel(f"서버 {row * 3 + col + 1}")
|
|
label.setStyleSheet("background-color: #e0e0e0; padding: 20px; border: 1px solid #aaa;")
|
|
label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
grid.addWidget(label, row, col)
|
|
|
|
self.setLayout(grid)
|
|
|
|
class MainApp:
|
|
def __init__(self):
|
|
self.app = QApplication(sys.argv)
|
|
self.loading = LoadingScreen()
|
|
self.grid = MonitoringGrid()
|
|
|
|
def run(self):
|
|
self.loading.show()
|
|
|
|
# 3초 후 로딩 화면 종료하고 그리드 표시
|
|
QTimer.singleShot(3000, self.show_grid)
|
|
sys.exit(self.app.exec())
|
|
|
|
def show_grid(self):
|
|
self.loading.close()
|
|
self.grid.show()
|
|
|
|
if __name__ == "__main__":
|
|
MainApp().run()
|