0

assorted cleanup

This commit is contained in:
gingervitis 2020-11-13 03:57:57 -08:00
parent 2211572ba1
commit 72d9ff4edb
6 changed files with 19 additions and 26 deletions

View File

@ -1,9 +1,11 @@
import React from "react";
import { timeFormat } from "d3-time-format";
import { Table, Tag} from "antd";
import { Table, Tag, Typography } from "antd";
import Linkify from "react-linkify";
import { SortOrder } from "antd/lib/table/interface";
const { Title } = Typography;
function renderColumnLevel(text, entry) {
let color = 'black';
@ -28,6 +30,9 @@ interface Props {
}
export default function LogTable({ logs, pageSize }: Props) {
if (!logs.length) {
return null;
}
const columns = [
{
title: "Level",
@ -69,7 +74,8 @@ export default function LogTable({ logs, pageSize }: Props) {
];
return (
<div>
<div className="logs-section">
<Title level={2}>Logs</Title>
<Table
size="middle"
dataSource={logs}

View File

@ -9,7 +9,7 @@ TODO: Link each overview value to the sub-page that focuses on it.
*/
import React, { useState, useEffect, useContext } from "react";
import { Row, Col, Skeleton, Result, List, Typography, Card, Statistic } from "antd";
import { Skeleton, Typography, Card, Statistic } from "antd";
import { UserOutlined, ClockCircleOutlined } from "@ant-design/icons";
import { formatDistanceToNow, formatRelative } from "date-fns";
import { ServerStatusContext } from "../utils/server-status-context";
@ -94,7 +94,7 @@ export default function Home() {
settingTitle = (videoQualitySettings?.length > 1) ?
`${settingTitle} ${index + 1}` : settingTitle;
return (
<Card title={settingTitle} type="inner">
<Card title={settingTitle} type="inner" key={settingTitle}>
<StatisticItem
title="Outbound Video Stream"
value={`${videoBitrate} kbps, ${framerate} fps`}
@ -188,12 +188,7 @@ export default function Home() {
</div>
</div>
{logsData.length ? (
<>
<Title level={2}>Stream Logs</Title>
<LogTable logs={logsData} pageSize={5} />
</>
): null}
</div>
);
}

View File

@ -69,13 +69,7 @@ export default function Offline({ logs = [] }) {
}
</div>
{logs.length ? (
<>
<Title level={2}>Stream Logs</Title>
<LogTable logs={logs} pageSize={5} />
</>
): null}
</div>
);
}

View File

@ -82,15 +82,15 @@ function InstanceDetails({ config }) {
},
{
name: "Logo",
value: instanceDetails.logo.large,
value: instanceDetails.logo?.large,
},
{
name: "Tags",
value: instanceDetails.tags.join(", "),
value: instanceDetails.tags?.join(", "),
},
{
name: "NSFW",
value: instanceDetails.nsfw.toString(),
value: instanceDetails.nsfw?.toString(),
},
{
name: "Shows in Owncast directory",
@ -150,9 +150,9 @@ export default function ServerConfig() {
setConfig({ ...config, message: error.message });
}
};
useEffect(() => {
getInfo();
}, []);
return (
<div>

View File

@ -109,19 +109,16 @@ export default function ViewersOverTime() {
title="Current viewers"
value={viewerCount.toString()}
prefix={<UserOutlined />}
color="#334"
/>
<StatisticItem
title="Peak viewers this session"
value={sessionPeakViewerCount.toString()}
prefix={<UserOutlined />}
color="#334"
/>
<StatisticItem
title="Peak viewers overall"
value={overallPeakViewerCount.toString()}
prefix={<UserOutlined />}
color="#334"
/>
</Row>
<div className="chart-container">

View File

@ -63,6 +63,7 @@
.ant-card {
width: 49%;
text-align: center;
}
}
.ant-card-head {