Experiment with colapsing details

This commit is contained in:
Gabe Kangas
2021-04-08 20:57:50 -07:00
parent 6e5e750c57
commit 6ebe52c5f4

View File

@@ -1,12 +1,11 @@
import Link from 'next/link'; import Link from 'next/link';
import { Result, Card, Row, Col, Input, Form, Typography } from 'antd'; import { Result, Card, Row, Col, Input, Collapse, Typography } from 'antd';
import { import {
MessageTwoTone, MessageTwoTone,
QuestionCircleTwoTone, QuestionCircleTwoTone,
BookTwoTone, BookTwoTone,
PlaySquareTwoTone, PlaySquareTwoTone,
ProfileTwoTone, ProfileTwoTone,
CopyOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import OwncastLogo from '../components/logo'; import OwncastLogo from '../components/logo';
import LogTable from '../components/log-table'; import LogTable from '../components/log-table';
@@ -17,6 +16,7 @@ const { Paragraph, Text } = Typography;
const { Title } = Typography; const { Title } = Typography;
const { Meta } = Card; const { Meta } = Card;
const { Panel } = Collapse;
function generateStreamURL(serverURL) { function generateStreamURL(serverURL) {
return `rtmp://${serverURL.replace(/(^\w+:|^)\/\//, '')}/live/`; return `rtmp://${serverURL.replace(/(^\w+:|^)\/\//, '')}/live/`;
@@ -26,8 +26,8 @@ export default function Offline({ logs = [], config }) {
const serverStatusData = useContext(ServerStatusContext); const serverStatusData = useContext(ServerStatusContext);
const { serverConfig } = serverStatusData || {}; const { serverConfig } = serverStatusData || {};
const { streamKey, yp } = serverConfig; const { streamKey } = serverConfig;
let { instanceUrl } = yp; const instanceUrl = global.window?.location.hostname || '';
const data = [ const data = [
{ {
@@ -35,9 +35,19 @@ export default function Offline({ logs = [], config }) {
title: 'Use your broadcasting software', title: 'Use your broadcasting software',
content: ( content: (
<div> <div>
<a
href="https://owncast.online/docs/broadcasting/?source=admin"
target="_blank"
rel="noopener noreferrer"
>
Learn how to point your existing software to your new server and start streaming your
content.
</a>
<Collapse>
<Panel header="Your connection details" key="1">
<Row align="middle"> <Row align="middle">
<Col flex="none"> <Col flex="none">
<Text strong>Stream-URL:</Text> <Text strong>Streaming URL:</Text>
</Col> </Col>
<Col flex="auto"> <Col flex="auto">
<Paragraph className="stream-info-box" copyable> <Paragraph className="stream-info-box" copyable>
@@ -48,7 +58,7 @@ export default function Offline({ logs = [], config }) {
<Row align="middle"> <Row align="middle">
<Col flex="none"> <Col flex="none">
<Text strong>Stream-Key:</Text> <Text strong>Stream Key:</Text>
</Col> </Col>
<Col flex="auto"> <Col flex="auto">
<Paragraph className="stream-info-box" copyable={{ text: streamKey }}> <Paragraph className="stream-info-box" copyable={{ text: streamKey }}>
@@ -56,14 +66,8 @@ export default function Offline({ logs = [], config }) {
</Paragraph> </Paragraph>
</Col> </Col>
</Row> </Row>
<a </Panel>
href="https://owncast.online/docs/broadcasting/?source=admin" </Collapse>
target="_blank"
rel="noopener noreferrer"
>
Learn how to point your existing software to your new server and start streaming your
content.
</a>
</div> </div>
), ),
}, },