Merge branch 'frontend' of gitea.d3m0k1d.ru:d3m0k1d/HellreigN into HEAD
ci-front / build (push) Successful in 1m59s

This commit is contained in:
nikita
2026-04-05 00:56:55 +03:00
5 changed files with 165 additions and 69 deletions
+34 -24
View File
@@ -15,35 +15,35 @@ import {
} from "react-icons/fi";
const logLevelIcons: Record<string, React.ReactNode> = {
INFO: <FiInfo size={14} />,
WARNING: <FiAlertTriangle size={14} />,
ERROR: <FiAlertCircle size={14} />,
FATAL: <FiXOctagon size={14} />,
info: <FiInfo size={14} />,
warning: <FiAlertTriangle size={14} />,
error: <FiAlertCircle size={14} />,
fatal: <FiXOctagon size={14} />,
};
const logLevelColors: Record<
string,
{ bg: string; text: string; border: string }
> = {
INFO: {
bg: "var(--info-bg)",
text: "var(--info-text)",
border: "var(--info-border)",
info: {
bg: "rgba(59, 130, 246, 0.1)",
text: "#3b82f6",
border: "rgba(59, 130, 246, 0.3)",
},
WARNING: {
bg: "var(--warning-bg)",
text: "var(--warning-text)",
border: "var(--warning-border)",
warning: {
bg: "rgba(245, 158, 11, 0.1)",
text: "#f59e0b",
border: "rgba(245, 158, 11, 0.3)",
},
ERROR: {
error: {
bg: "var(--error-bg)",
text: "var(--error-text)",
border: "var(--error-border)",
},
FATAL: {
bg: "var(--fatal-bg)",
text: "var(--fatal-text)",
border: "var(--fatal-border)",
fatal: {
bg: "rgba(168, 85, 247, 0.1)",
text: "#a855f7",
border: "rgba(168, 85, 247, 0.3)",
},
};
@@ -306,13 +306,13 @@ export const LogsPage: React.FC = () => {
</thead>
<tbody>
{logs.map((log, index) => {
const level = log.level || "INFO";
const level = log.Level?.toLowerCase() || "info";
const colors =
logLevelColors[level] || logLevelColors.INFO;
logLevelColors[level] || logLevelColors.info;
return (
<tr
key={index}
className="border-t"
className="border-t transition-colors"
style={{
borderColor: "var(--border)",
backgroundColor:
@@ -320,12 +320,22 @@ export const LogsPage: React.FC = () => {
? "var(--card-bg)"
: "var(--bg-secondary)",
}}
onMouseEnter={(e) => {
e.currentTarget.style.backgroundColor =
"var(--border)";
}}
onMouseLeave={(e) => {
e.currentTarget.style.backgroundColor =
index % 2 === 0
? "var(--card-bg)"
: "var(--bg-secondary)";
}}
>
<td
className="px-4 py-3 text-sm font-mono whitespace-nowrap"
style={{ color: "var(--text-secondary)" }}
>
{formatTimestamp(log.timestamp)}
{formatTimestamp(log.Timestamp)}
</td>
<td className="px-4 py-3">
<span
@@ -344,19 +354,19 @@ export const LogsPage: React.FC = () => {
className="px-4 py-3 text-sm"
style={{ color: "var(--text-primary)" }}
>
{log.service || "—"}
{log.Service || "—"}
</td>
<td
className="px-4 py-3 text-sm font-mono"
style={{ color: "var(--text-primary)" }}
>
{log.agent || "—"}
{log.Agent || "—"}
</td>
<td
className="px-4 py-3 text-sm"
style={{ color: "var(--text-primary)" }}
>
{log.message || "—"}
{log.Message || "—"}
</td>
</tr>
);