Skip to content

Commit

Permalink
fix: small ui-fixes (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saelmala authored Nov 14, 2024
1 parent e832afb commit cd22b61
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
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 @@ -100,7 +100,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 @@ -119,7 +119,7 @@ export default function SourceCard({
{source && (
<ImageComponent
className={`${
productionSetup?.isActive
productionSetup?.isActive || locked
? 'pointer-events-none'
: 'pointer-events-auto'
}`}
Expand All @@ -129,7 +129,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

0 comments on commit cd22b61

Please sign in to comment.