Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: small ui-fixes #99

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions src/api/manager/teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export async function teardown(
};
};

// PIPELINES
// STEP 1
// FETCH PIPELINES
// Pipelines
// Step 1
// Fetch pipelines
let pipelines: ResourcesCompactPipelineResponse[];

if (pipes) {
Expand All @@ -78,9 +78,9 @@ export async function teardown(
}
}

// STEP 2
// FETCH PIPELINE OUTPUTS
// DELETE PIPELINE OUTPUT STREAMS
// Step 2
// Fetch pipeline outputs
// Delete pipeline output streams
try {
for (const pipeline of pipelines) {
const outputs = await getPipelineOutputs(pipeline.uuid).catch(() => {
Expand All @@ -103,9 +103,9 @@ export async function teardown(
return generateResponse(false);
}

// STEP 3
// FETCH PIPELINE MULTIVIEWERS
// DELETE PIPELINE MULTIVIEWERS
// Step 3
// Fetch pipeline multiviewers
// Delete pipeline multiviewers
try {
for (const pipeline of pipelines) {
const multiviewers = await getMultiviewsForPipeline(pipeline.uuid).catch(
Expand All @@ -127,9 +127,9 @@ export async function teardown(
return generateResponse(false);
}

// STEP 4
// FETCH PIPELINE STREAMS
// DELETE PIPELINE STREAMS
// Step 4
// Fetch pipeline streams
// Delete pipeline streams
try {
for (const pipeline of pipelines) {
await removePipelineStreams(pipeline.uuid).catch(() => {
Expand All @@ -142,8 +142,8 @@ export async function teardown(
return generateResponse(false);
}

// STEP 5
// DELETE PIPELINE CONNECTIONS
// Step 5
// Delete pipeline connections
try {
const disconnectedReceiverIDs: string[] = [];
for (const pipeline of pipelines) {
Expand All @@ -170,9 +170,9 @@ export async function teardown(
return generateResponse(false);
}

// STEP 6
// RESET PIPELINES
// ONLY DO THIS STEP IF ENABLED IN OPTIONS
// Step 6
// Reset pipelines
// Only do this step if enabled in options
if (resetPipelines) {
try {
for (const pipeline of pipelines) {
Expand All @@ -187,12 +187,12 @@ export async function teardown(
}
}

// INGESTS
// DO NOT DO THESE STEPS IF PIPELINES WERE SPECIFIED IN THE OPTIONS
// Ingests
// Do not do these steps if pipelines were specified in the options
if (!pipes) {
let ingests: ResourcesCompactIngestResponse[];
// STEP 7
// FETCH INGESTS
// Step 7
// Fetch ingests
try {
ingests = await getIngests().catch((e) => {
throw 'Failed to fetch ingests';
Expand All @@ -202,8 +202,8 @@ export async function teardown(
return generateResponse(false);
}

// STEP 8
// DELETE INGEST STREAMS
// Step 8
// Delete ingest streams
try {
for (const ingest of ingests) {
for (const stream of ingest.streams) {
Expand All @@ -218,9 +218,9 @@ export async function teardown(
return generateResponse(false);
}

// STEP 9
// DELETE INGEST SRC SOURCES
// ONLY DO THIS STEP IF ENABLED IN OPTIONS
// Step 9
// Delete ingest SRT sources
// Only do this step if enabled in options
if (deleteIngestSRTSources) {
try {
for (const ingest of ingests) {
Expand All @@ -243,34 +243,34 @@ export async function teardown(
}
}

// STEP 10
// CHECK THAT EVERYTHING WAS REMOVED/DISCONNECTED/DELETED
// Step 10
// Check that everything was removed/disconnected/deleted
try {
const newPipelines = await getPipelines().catch((e) => {
throw 'Failed to fetch pipelines';
});

for (const pipeline of newPipelines) {
// CHECK IF ALL OUTPUT STREAMS HAVE BEEN STOPPED
// Check if all output streams have been stopped
const outputs = await getPipelineOutputs(pipeline.uuid).catch((e) => {
throw `Failed to fetch outputs for pipeline ${pipeline.name}`;
});
for (const output of outputs) {
if (output.active_streams && output.active_streams.length)
throw `Failed to stop all active streams for output ${output.name} in pipeline ${pipeline.name}`;
}
// CHECK IF ALL MULTIVIEWERS HAVE BEEN DELETED
// Check if all multiviewers have been deleted
const multiviewers = await getMultiviewsForPipeline(pipeline.uuid).catch(
() => {
throw `Failed to fetch multiviewers for pipeline ${pipeline.name}`;
}
);
if (multiviewers?.length)
throw `Failed to delete all multiviewers for pipeline ${pipeline.name}`;
// CHECK IF ALL PIPELINE STREAMS HAVE BEEN STOPPED
// Check if all pipeline streams have been stopped
if (pipeline.streams?.length)
throw `Failed to stop all streams for pipeline ${pipeline.name}`;
// CHECK IF ALL PIPELINE CONNECTIONS HAVE BEEN DISCONNECTED
// Check if all pipeline connections have been disconnected
if (pipeline.control_receiver?.incoming_connections?.length)
throw `Failed to disconnect all incoming connections to the control receiver of pipeline ${pipeline.name}`;
if (pipeline.control_receiver?.outgoing_connections?.length)
Expand All @@ -283,11 +283,11 @@ export async function teardown(
});

for (const ingest of ingests) {
// CHECK IF ALL INGEST STREAMS HAVE BEEN STOPPED
// Check if all ingest streams have been stopped
if (ingest.streams?.length)
throw `Failed to stop ingest streams for ingest ${ingest.name}`;
// CHECK IF ALL SRT SOURCES HAVE BEEN DELETED
// ONLY IF DELETE INGEST SRT SOURCES IS SET TO TRUE IN OPTIONS (DEFAULT)
// Check if all SRT sources have been deleted
// Only if delete ingest SRT sources is set to true in options (default)
if (deleteIngestSRTSources && ingest.sources?.length) {
const sources = await getIngestSources(ingest.uuid);
for (const source of sources) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/sourceCard/SourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function SourceCard({
ref={forwardedRef}
style={style}
className={`relative bg-zinc-700 aspect-video m-2 overflow-hidden ${
productionSetup?.isActive ? 'cursor-auto' : 'cursor-pointer'
productionSetup?.isActive || locked ? 'cursor-auto' : 'cursor-pointer'
}`}
>
<div className="relative">
Expand All @@ -120,7 +120,7 @@ export default function SourceCard({
{source && (
<ImageComponent
className={`${
productionSetup?.isActive
productionSetup?.isActive || locked
? 'pointer-events-none'
: 'pointer-events-auto'
}`}
Expand All @@ -130,7 +130,7 @@ export default function SourceCard({
{!source && sourceRef && (
<ImageComponent
className={`${
productionSetup?.isActive
productionSetup?.isActive || locked
? 'pointer-events-none'
: 'pointer-events-auto'
}`}
Expand Down
2 changes: 1 addition & 1 deletion src/components/startProduction/StartProductionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export function StartProductionButton({
<Button
className={`${
disabled
? 'bg-button-delete/50'
? 'bg-button-delete/50 pointer-events-none'
: 'bg-button-delete hover:bg-button-hover-red-bg'
}`}
onClick={() => setStopModalOpen(true)}
Expand Down
Loading