Skip to content

Commit

Permalink
Remove record and vlive group. v5.9.25
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Sep 10, 2023
1 parent 631dde4 commit f0fd6aa
Showing 1 changed file with 2 additions and 60 deletions.
62 changes: 2 additions & 60 deletions ui/src/pages/Scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ function ScenarioImpl({defaultActiveTab}) {
{activeTab === 'forward' && <ScenarioForward/>}
</Tab>
<Tab eventKey="rgroup" title={t('scenario.rgroup')}>
{activeTab === 'rgroup' && <ScenarioRxGroup/>}
{activeTab === 'rgroup' && <ScenarioRecord/>}
</Tab>
<Tab eventKey="vgroup" title={t('scenario.vgroup')}>
{activeTab === 'vgroup' && <ScenarioVxGroup/>}
{activeTab === 'vgroup' && <ScenarioVLive/>}
</Tab>
<Tab eventKey="transcode" title={t('scenario.transcode')}>
{activeTab === 'transcode' && <ScenarioTranscode/>}
Expand All @@ -117,61 +117,3 @@ function ScenarioTranscode() {
);
}

function ScenarioRxGroup() {
const [searchParams, setSearchParams] = useSearchParams();
const [activeChildTab, setActiveChildTab] = React.useState();
const language = useSrsLanguage();
const {t} = useTranslation();

React.useEffect(() => {
const ctab = searchParams.get('ctab') || 'record';
console.log(`?ctab=record, current=${ctab}, Select the child tab to render`);
setActiveChildTab(ctab);
}, [searchParams, language, setActiveChildTab]);

const onSelectChildTab = React.useCallback((k) => {
setSearchParams({...searchParams, 'tab': 'rgroup', 'ctab': k});
setActiveChildTab(k);
}, [searchParams, setSearchParams, setActiveChildTab]);

return <>
{activeChildTab &&
<Tabs defaultActiveKey={activeChildTab} id="ctab0" className="mb-3"
onSelect={(k) => onSelectChildTab(k)}>
<Tab eventKey="record" title={t('scenario.record')}>
{activeChildTab === 'record' && <ScenarioRecord/>}
</Tab>
</Tabs>
}
</>;
}

function ScenarioVxGroup() {
const [searchParams, setSearchParams] = useSearchParams();
const [activeChildTab, setActiveChildTab] = React.useState();
const language = useSrsLanguage();
const {t} = useTranslation();

React.useEffect(() => {
const ctab = searchParams.get('ctab') || 'vfile';
console.log(`?ctab=vfile, current=${ctab}, Select the child tab to render`);
setActiveChildTab(ctab);
}, [searchParams, language, setActiveChildTab]);

const onSelectChildTab = React.useCallback((k) => {
setSearchParams({...searchParams, 'tab': 'vgroup', 'ctab': k});
setActiveChildTab(k);
}, [searchParams, setSearchParams, setActiveChildTab]);

return <>
{activeChildTab &&
<Tabs defaultActiveKey={activeChildTab} id="ctab1" className="mb-3"
onSelect={(k) => onSelectChildTab(k)}>
<Tab eventKey="vfile" title={t('scenario.vfile')}>
{activeChildTab === 'vfile' && <ScenarioVLive/>}
</Tab>
</Tabs>
}
</>;
}

0 comments on commit f0fd6aa

Please sign in to comment.