diff --git a/web/pages/components/config/form-textfield.tsx b/web/pages/components/config/form-textfield.tsx index 7219cf16d..8db66d1ae 100644 --- a/web/pages/components/config/form-textfield.tsx +++ b/web/pages/components/config/form-textfield.tsx @@ -33,6 +33,7 @@ export default function TextField(props: TextFieldProps) { fieldName, handleResetValue = () => {}, initialValues = {}, + placeholder, onSubmit, onBlur, onChange, @@ -48,7 +49,6 @@ export default function TextField(props: TextFieldProps) { const { apiPath = '', maxLength = TEXT_MAXLENGTH, - placeholder = '', label = '', tip = '', required = false, diff --git a/web/pages/index.tsx b/web/pages/index.tsx index 2c2d116a3..0dbec49d2 100644 --- a/web/pages/index.tsx +++ b/web/pages/index.tsx @@ -8,13 +8,15 @@ TODO: Link each overview value to the sub-page that focuses on it. */ import React, { useState, useEffect, useContext } from "react"; -import { Skeleton, Card, Statistic } from "antd"; +import { Skeleton, Card, Statistic, Form } from "antd"; import { UserOutlined, ClockCircleOutlined } from "@ant-design/icons"; import { formatDistanceToNow, formatRelative } from "date-fns"; import { ServerStatusContext } from "../utils/server-status-context"; import StatisticItem from "./components/statistic" import LogTable from "./components/log-table"; import Offline from './offline-notice'; +import TextField, { TEXTFIELD_TYPE_TEXTAREA, TEXTFIELD_TYPE_URL } from './components/config/form-textfield'; +import { TEXTFIELD_DEFAULTS, postConfigUpdateToAPI } from './components/config/constants'; import { LOGS_WARN, @@ -77,19 +79,19 @@ export default function Home() { if (!broadcaster) { return ; } - + // map out settings const videoQualitySettings = serverStatusData?.currentBroadcast?.outputSettings?.map((setting, index) => { const { audioPassthrough, videoPassthrough, audioBitrate, videoBitrate, framerate } = setting; const audioSetting = audioPassthrough - ? `${streamDetails.audioCodec || 'Unknown'}, ${streamDetails.audioBitrate} kbps` - : `${audioBitrate || 'Unknown'} kbps`; + ? `${streamDetails.audioCodec || 'Unknown'}, ${streamDetails.audioBitrate} kbps` + : `${audioBitrate || 'Unknown'} kbps`; const videoSetting = videoPassthrough - ? `${streamDetails.videoBitrate || 'Unknown'} kbps, ${streamDetails.framerate} fps ${streamDetails.width} x ${streamDetails.height}` - : `${videoBitrate || 'Unknown'} kbps, ${framerate} fps`; - + ? `${streamDetails.videoBitrate || 'Unknown'} kbps, ${streamDetails.framerate} fps ${streamDetails.width} x ${streamDetails.height}` + : `${videoBitrate || 'Unknown'} kbps, ${framerate} fps`; + let settingTitle = 'Outbound Stream Details'; settingTitle = (videoQualitySettings?.length > 1) ? `${settingTitle} ${index + 1}` : settingTitle; @@ -117,7 +119,7 @@ export default function Home() { const broadcastDate = new Date(broadcaster.time); return ( -
+
@@ -140,7 +142,15 @@ export default function Home() { prefix={} /> -
+
+ +
+ +
+ + +
+
diff --git a/web/types/config-section.ts b/web/types/config-section.ts index d7144c78a..b4e1249b9 100644 --- a/web/types/config-section.ts +++ b/web/types/config-section.ts @@ -4,6 +4,7 @@ export interface TextFieldProps { handleResetValue?: (fieldName: string) => void; fieldName: string; initialValues?: any; + placeholder?: string; type?: string; configPath?: string; required?: boolean;