mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Add focus to server URL requirement. Closes https://github.com/owncast/owncast/issues/1673
This commit is contained in:
parent
6c14e9431b
commit
5a4553367d
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable react/no-unescaped-entities */
|
/* eslint-disable react/no-unescaped-entities */
|
||||||
import { Typography, Modal, Button, Row, Col } from 'antd';
|
import { Typography, Modal, Button, Row, Col, Alert } from 'antd';
|
||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {
|
import {
|
||||||
@ -226,7 +226,26 @@ export default function ConfigFederation() {
|
|||||||
|
|
||||||
const hasInstanceUrl = instanceUrl !== '';
|
const hasInstanceUrl = instanceUrl !== '';
|
||||||
const isInstanceUrlSecure = instanceUrl.startsWith('https://');
|
const isInstanceUrlSecure = instanceUrl.startsWith('https://');
|
||||||
|
const configurationWarning = !isInstanceUrlSecure && (
|
||||||
|
<>
|
||||||
|
<Alert
|
||||||
|
message="You must set your server URL before you can enable this feature."
|
||||||
|
type="warning"
|
||||||
|
showIcon
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<TextFieldWithSubmit
|
||||||
|
fieldName="instanceUrl"
|
||||||
|
{...TEXTFIELD_PROPS_FEDERATION_INSTANCE_URL}
|
||||||
|
value={formDataValues.instanceUrl}
|
||||||
|
initialValue={yp.instanceUrl}
|
||||||
|
type={TEXTFIELD_TYPE_URL}
|
||||||
|
onChange={handleFieldChange}
|
||||||
|
onSubmit={handleSubmitInstanceUrl}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Title>Configure Social Features</Title>
|
<Title>Configure Social Features</Title>
|
||||||
@ -245,6 +264,7 @@ export default function ConfigFederation() {
|
|||||||
</p>
|
</p>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={15} className="form-module" style={{ marginRight: '15px' }}>
|
<Col span={15} className="form-module" style={{ marginRight: '15px' }}>
|
||||||
|
{configurationWarning}
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
fieldName="enabled"
|
fieldName="enabled"
|
||||||
onChange={handleEnabledSwitchChange}
|
onChange={handleEnabledSwitchChange}
|
||||||
@ -252,15 +272,6 @@ export default function ConfigFederation() {
|
|||||||
checked={formDataValues.enabled}
|
checked={formDataValues.enabled}
|
||||||
disabled={!hasInstanceUrl || !isInstanceUrlSecure}
|
disabled={!hasInstanceUrl || !isInstanceUrlSecure}
|
||||||
/>
|
/>
|
||||||
<TextFieldWithSubmit
|
|
||||||
fieldName="instanceUrl"
|
|
||||||
{...TEXTFIELD_PROPS_FEDERATION_INSTANCE_URL}
|
|
||||||
value={formDataValues.instanceUrl}
|
|
||||||
initialValue={yp.instanceUrl}
|
|
||||||
type={TEXTFIELD_TYPE_URL}
|
|
||||||
onChange={handleFieldChange}
|
|
||||||
onSubmit={handleSubmitInstanceUrl}
|
|
||||||
/>
|
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
fieldName="isPrivate"
|
fieldName="isPrivate"
|
||||||
{...FIELD_PROPS_FEDERATION_IS_PRIVATE}
|
{...FIELD_PROPS_FEDERATION_IS_PRIVATE}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user