Update documentation.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""APIClient - Agent — Response Panel."""
|
||||
"""APIClient - Agent - Response Panel."""
|
||||
import json
|
||||
|
||||
from PyQt6.QtWidgets import (
|
||||
@@ -25,13 +25,13 @@ def _fmt_size(n: int) -> str:
|
||||
|
||||
class StatusBadge(QLabel):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__("—", parent)
|
||||
super().__init__("-", parent)
|
||||
self.setFixedHeight(26)
|
||||
self._apply_style(Colors.TEXT_MUTED)
|
||||
self.setFont(QFont("Segoe UI", 11, QFont.Weight.Bold))
|
||||
|
||||
def _apply_style(self, color: str):
|
||||
# Inline style intentional — badge color is dynamic per status code
|
||||
# Inline style intentional - badge color is dynamic per status code
|
||||
self.setStyleSheet(f"""
|
||||
QLabel {{
|
||||
color: {color};
|
||||
@@ -53,7 +53,7 @@ class StatusBadge(QLabel):
|
||||
self._apply_style(Colors.ERROR)
|
||||
|
||||
def clear(self):
|
||||
self.setText("—")
|
||||
self.setText("-")
|
||||
self._apply_style(Colors.TEXT_MUTED)
|
||||
|
||||
|
||||
@@ -174,8 +174,8 @@ class ResponsePanel(QWidget):
|
||||
self._loading_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
ll.addWidget(self._loading_label)
|
||||
|
||||
self._stack.addWidget(self.tabs) # index 0 — normal view
|
||||
self._stack.addWidget(loading_widget) # index 1 — loading
|
||||
self._stack.addWidget(self.tabs) # index 0 - normal view
|
||||
self._stack.addWidget(loading_widget) # index 1 - loading
|
||||
|
||||
layout.addWidget(self._stack, 1)
|
||||
|
||||
@@ -203,7 +203,7 @@ class ResponsePanel(QWidget):
|
||||
size = resp.size_bytes or len(resp.body.encode())
|
||||
self.size_label.setText(_fmt_size(size))
|
||||
|
||||
# Body — pretty-print JSON if possible
|
||||
# Body - pretty-print JSON if possible
|
||||
try:
|
||||
parsed = json.loads(resp.body)
|
||||
self.body_view.setPlainText(json.dumps(parsed, indent=2, ensure_ascii=False))
|
||||
|
||||
Reference in New Issue
Block a user