Take control over your live stream video by running it yourself. Streaming + chat out of the box.
HTML activitypubbroadcastingchatdecentralizedfederationfediversegolanghacktoberfesthlslivelivestreamowncastrtmpself-hostedstreaming-videovideo
update some home styles
gingervitis5a4f38000952
diff --git a/web/pages/components/chart.tsx b/web/pages/components/chart.tsxindex 977ebdbd41..b2bd34d7e1 100644--- a/web/pages/components/chart.tsx+++ b/web/pages/components/chart.tsx@@ -1,5 +1,5 @@import { LineChart } from 'react-chartkick'-import styles from '../../styles/styles.module.css';+import styles from '../../styles/styles.module.scss';import 'chart.js';const defaultProps = {diff --git a/web/pages/components/logo.tsx b/web/pages/components/logo.tsxindex a6a814185e..cb1a49732d 100644--- a/web/pages/components/logo.tsx+++ b/web/pages/components/logo.tsx@@ -1,5 +1,5 @@import React from 'react';-import adminStyles from '../../styles/styles.module.css';+import adminStyles from '../../styles/styles.module.scss';export default function Logo() {return (diff --git a/web/pages/components/main-layout.tsx b/web/pages/components/main-layout.tsxindex d8c7ff5fe1..6d2f9fcaff 100644--- a/web/pages/components/main-layout.tsx+++ b/web/pages/components/main-layout.tsx@@ -21,7 +21,7 @@ import { parseSecondsToDurationString } from '../../utils/format'import OwncastLogo from './logo';import { ServerStatusContext } from '../../utils/server-status-context';-import adminStyles from '../../styles/styles.module.css';+import adminStyles from '../../styles/styles.module.scss';let performedUpgradeCheck = false;diff --git a/web/pages/components/statistic.tsx b/web/pages/components/statistic.tsxindex ae5b5568bd..bf212b6809 100644--- a/web/pages/components/statistic.tsx+++ b/web/pages/components/statistic.tsx@@ -1,4 +1,4 @@-import { Typography, Statistic, Card, Col, Progress} from "antd";+import { Typography, Statistic, Card, Progress} from "antd";const { Text } = Typography;interface StatisticItemProps {@@ -8,6 +8,7 @@ interface StatisticItemProps {color?: string,progress?: boolean,centered?: boolean,+ formatter?: any,};const defaultProps = {title: '',@@ -16,6 +17,7 @@ const defaultProps = {color: '',progress: false,centered: false,+ formatter: null,};@@ -43,14 +45,15 @@ function ProgressView({ title, value, prefix, color }: StatisticItemProps) {}ProgressView.defaultProps = defaultProps;-function StatisticView({ title, value, prefix }: StatisticItemProps) {+function StatisticView({ title, value, prefix, formatter }: StatisticItemProps) {return (<Statistictitle={title}value={value}prefix={prefix}- />- )+ formatter={formatter}+ />+ );}StatisticView.defaultProps = defaultProps;diff --git a/web/pages/index.tsx b/web/pages/index.tsxindex d14d7f5cd2..ff4b41b6b5 100644--- a/web/pages/index.tsx+++ b/web/pages/index.tsx@@ -14,7 +14,7 @@ GW: to do:*/import React, { useState, useEffect, useContext } from "react";-import { Skeleton, Typography, Card, Statistic } from "antd";+import { Skeleton, Card, Statistic } from "antd";import { UserOutlined, ClockCircleOutlined } from "@ant-design/icons";import { formatDistanceToNow, formatRelative } from "date-fns";import { ServerStatusContext } from "../utils/server-status-context";@@ -29,6 +29,16 @@ import {} from "../utils/apis";import { formatIPAddress, isEmptyObject } from "../utils/format";+function streamDetailsFormatter(streamDetails) {+ return (+ <ul className="statistics-list">+ <li>{streamDetails.videoCodec} @ {streamDetails.videoBitrate} kbps</li>+ <li>{streamDetails.framerate} fps</li>+ <li>{streamDetails.width} x {streamDetails.height}</li>+ </ul>+ );+}+export default function Home() {const serverStatusData = useContext(ServerStatusContext);const { broadcaster, serverConfig: configData } = serverStatusData || {};@@ -45,7 +55,6 @@ export default function Home() {};const getMoreStats = () => {getLogs();- // getConfig();}useEffect(() => {let intervalId = null;@@ -74,12 +83,12 @@ export default function Home() {const { audioPassthrough, videoPassthrough, audioBitrate, videoBitrate, framerate } = setting;const audioSetting =audioPassthrough || audioBitrate === 0- ? `${streamDetails.audioCodec} ${streamDetails.audioBitrate} kpbs`+ ? `${streamDetails.audioCodec}, ${streamDetails.audioBitrate} kbps`: `${audioBitrate} kbps`;const videoSetting =videoPassthrough || videoBitrate === 0- ? `${streamDetails.videoBitrate} kbps ${streamDetails.framerate}fps ${streamDetails.width}x${streamDetails.height}`- : `${videoBitrate} kbps ${framerate}fps`;+ ? `${streamDetails.videoBitrate} kbps, ${streamDetails.framerate} fps ${streamDetails.width} x ${streamDetails.height}`+ : `${videoBitrate} kbps, ${framerate} fps`;let settingTitle = 'Outbound Stream Details';settingTitle = (videoQualitySettings?.length > 1) ?@@ -100,9 +109,11 @@ export default function Home() {);});++ // inboundconst { viewerCount, sessionMaxViewerCount } = serverStatusData;- const streamVideoDetailString = `${streamDetails.videoCodec} ${streamDetails.videoBitrate} kbps ${streamDetails.framerate}fps ${streamDetails.width}x${streamDetails.height}`;- const streamAudioDetailString = `${streamDetails.audioCodec} ${streamDetails.audioBitrate} kbps`;++ const streamAudioDetailString = `${streamDetails.audioCodec}, ${streamDetails.audioBitrate} kbps`;const broadcastDate = new Date(broadcaster.time);@@ -147,7 +158,8 @@ export default function Home() {/><StatisticItemtitle="Inbound Video Stream"- value={streamVideoDetailString}+ value={streamDetails}+ formatter={streamDetailsFormatter}prefix={null}/><StatisticItemdiff --git a/web/pages/logs.tsx b/web/pages/logs.tsxindex efd72412c7..94957d45a5 100644--- a/web/pages/logs.tsx+++ b/web/pages/logs.tsx@@ -1,5 +1,5 @@import React, { useState, useEffect } from "react";-import LogTable from "./components/log-table"+import LogTable from "./components/log-table";import {LOGS_ALL,diff --git a/web/pages/update-server-config.tsx b/web/pages/update-server-config.tsxindex b38c12c1a0..ff0aa6a5f2 100644--- a/web/pages/update-server-config.tsx+++ b/web/pages/update-server-config.tsx@@ -4,7 +4,7 @@ import { Table, Typography, Input } from 'antd';import { isEmptyObject } from '../utils/format';import KeyValueTable from "./components/key-value-table";import { ServerStatusContext } from '../utils/server-status-context';-import adminStyles from '../styles/styles.module.css';+import adminStyles from '../styles/styles.module.scss';const { Title } = Typography;const { TextArea } = Input;diff --git a/web/styles/home.scss b/web/styles/home.scssindex 770d90d077..68fd415595 100644--- a/web/styles/home.scss+++ b/web/styles/home.scss@@ -1,20 +1,33 @@.home-container {max-width: 1000px;+ .statistics-list {+ li {+ margin-left: -.5em;+ }+ }+.section {margin: 1rem 0;++ .ant-statistic-content {+ font-size: 1rem;+ }}.online-status-section {> .ant-card {- box-shadow: 0px 1px 1px 0px rgba(0, 22, 40, 0.1);+ box-shadow: 0px 1px 10px 2px rgba(0, 22, 40, 0.1);}.ant-card-head {- background-color: var(--owncast-purple);+ background-color: #40b246;border-color: #ccc;color:#fff;-+ @media (prefers-color-scheme: dark) {+ background-color: #2a762e;+ border-bottom-color: black;+ }}.ant-card-head-title {font-size: .88rem;@@ -32,7 +45,7 @@text-align: center;margin: 0 1rem;}- }+ }}@@ -52,6 +65,11 @@.ant-card-head {background-color: #ccd;color: black;+ @media (prefers-color-scheme: dark) {+ background-color: #000;+ color: #ccd;+ }+}}.server-detail {@@ -62,7 +80,7 @@align-items: flex-start;.ant-card {- width: 49%;+ width: 45%;text-align: center;}}diff --git a/web/styles/styles.module.css b/web/styles/styles.module.scsssimilarity index 99%rename from web/styles/styles.module.cssrename to web/styles/styles.module.scssindex 2e96ae7d65..9b2acec4b9 100644--- a/web/styles/styles.module.css+++ b/web/styles/styles.module.scss@@ -85,4 +85,4 @@.configSection {margin-bottom: 2em;-}\ No newline at end of file+}