skip stage configured and working
This commit is contained in:
@@ -0,0 +1,48 @@
|
|||||||
|
# Generated migration for automation stage enabled toggles
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('automation', '0006_automationrun_initial_snapshot'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='automationconfig',
|
||||||
|
name='stage_1_enabled',
|
||||||
|
field=models.BooleanField(default=True, help_text='Process Stage 1: Keywords → Clusters'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='automationconfig',
|
||||||
|
name='stage_2_enabled',
|
||||||
|
field=models.BooleanField(default=True, help_text='Process Stage 2: Clusters → Ideas'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='automationconfig',
|
||||||
|
name='stage_3_enabled',
|
||||||
|
field=models.BooleanField(default=True, help_text='Process Stage 3: Ideas → Tasks'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='automationconfig',
|
||||||
|
name='stage_4_enabled',
|
||||||
|
field=models.BooleanField(default=True, help_text='Process Stage 4: Tasks → Content'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='automationconfig',
|
||||||
|
name='stage_5_enabled',
|
||||||
|
field=models.BooleanField(default=True, help_text='Process Stage 5: Content → Image Prompts'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='automationconfig',
|
||||||
|
name='stage_6_enabled',
|
||||||
|
field=models.BooleanField(default=True, help_text='Process Stage 6: Image Prompts → Images'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='automationconfig',
|
||||||
|
name='stage_7_enabled',
|
||||||
|
field=models.BooleanField(default=True, help_text='Process Stage 7: Review → Published'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -23,6 +23,15 @@ class AutomationConfig(models.Model):
|
|||||||
frequency = models.CharField(max_length=20, choices=FREQUENCY_CHOICES, default='daily')
|
frequency = models.CharField(max_length=20, choices=FREQUENCY_CHOICES, default='daily')
|
||||||
scheduled_time = models.TimeField(default='02:00', help_text="Time to run (e.g., 02:00)")
|
scheduled_time = models.TimeField(default='02:00', help_text="Time to run (e.g., 02:00)")
|
||||||
|
|
||||||
|
# Stage processing toggles
|
||||||
|
stage_1_enabled = models.BooleanField(default=True, help_text="Process Stage 1: Keywords → Clusters")
|
||||||
|
stage_2_enabled = models.BooleanField(default=True, help_text="Process Stage 2: Clusters → Ideas")
|
||||||
|
stage_3_enabled = models.BooleanField(default=True, help_text="Process Stage 3: Ideas → Tasks")
|
||||||
|
stage_4_enabled = models.BooleanField(default=True, help_text="Process Stage 4: Tasks → Content")
|
||||||
|
stage_5_enabled = models.BooleanField(default=True, help_text="Process Stage 5: Content → Image Prompts")
|
||||||
|
stage_6_enabled = models.BooleanField(default=True, help_text="Process Stage 6: Image Prompts → Images")
|
||||||
|
stage_7_enabled = models.BooleanField(default=True, help_text="Process Stage 7: Review → Published")
|
||||||
|
|
||||||
# Batch sizes per stage
|
# Batch sizes per stage
|
||||||
stage_1_batch_size = models.IntegerField(default=50, help_text="Keywords per batch")
|
stage_1_batch_size = models.IntegerField(default=50, help_text="Keywords per batch")
|
||||||
stage_2_batch_size = models.IntegerField(default=1, help_text="Clusters at a time")
|
stage_2_batch_size = models.IntegerField(default=1, help_text="Clusters at a time")
|
||||||
|
|||||||
@@ -81,42 +81,64 @@ def run_automation_task(self, run_id: str):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
service = AutomationService.from_run_id(run_id)
|
service = AutomationService.from_run_id(run_id)
|
||||||
|
config = service.config
|
||||||
|
|
||||||
# Run all stages sequentially, checking for pause/cancel between stages
|
# Run all stages sequentially, checking for enabled status, pause/cancel between stages
|
||||||
service.run_stage_1()
|
if config.stage_1_enabled:
|
||||||
if service.run.status in ['paused', 'cancelled']:
|
service.run_stage_1()
|
||||||
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 1")
|
if service.run.status in ['paused', 'cancelled']:
|
||||||
return
|
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 1")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage 1 is disabled, skipping")
|
||||||
|
|
||||||
service.run_stage_2()
|
if config.stage_2_enabled:
|
||||||
if service.run.status in ['paused', 'cancelled']:
|
service.run_stage_2()
|
||||||
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 2")
|
if service.run.status in ['paused', 'cancelled']:
|
||||||
return
|
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 2")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage 2 is disabled, skipping")
|
||||||
|
|
||||||
service.run_stage_3()
|
if config.stage_3_enabled:
|
||||||
if service.run.status in ['paused', 'cancelled']:
|
service.run_stage_3()
|
||||||
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 3")
|
if service.run.status in ['paused', 'cancelled']:
|
||||||
return
|
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 3")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage 3 is disabled, skipping")
|
||||||
|
|
||||||
service.run_stage_4()
|
if config.stage_4_enabled:
|
||||||
if service.run.status in ['paused', 'cancelled']:
|
service.run_stage_4()
|
||||||
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 4")
|
if service.run.status in ['paused', 'cancelled']:
|
||||||
return
|
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 4")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage 4 is disabled, skipping")
|
||||||
|
|
||||||
service.run_stage_5()
|
if config.stage_5_enabled:
|
||||||
if service.run.status in ['paused', 'cancelled']:
|
service.run_stage_5()
|
||||||
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 5")
|
if service.run.status in ['paused', 'cancelled']:
|
||||||
return
|
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 5")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage 5 is disabled, skipping")
|
||||||
|
|
||||||
service.run_stage_6()
|
if config.stage_6_enabled:
|
||||||
if service.run.status in ['paused', 'cancelled']:
|
service.run_stage_6()
|
||||||
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 6")
|
if service.run.status in ['paused', 'cancelled']:
|
||||||
return
|
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 6")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage 6 is disabled, skipping")
|
||||||
|
|
||||||
service.run_stage_7()
|
if config.stage_7_enabled:
|
||||||
if service.run.status in ['paused', 'cancelled']:
|
service.run_stage_7()
|
||||||
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 7")
|
if service.run.status in ['paused', 'cancelled']:
|
||||||
return
|
logger.info(f"[AutomationTask] Automation {service.run.status} after stage 7")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage 7 is disabled, skipping")
|
||||||
|
|
||||||
logger.info(f"[AutomationTask] Completed automation run: {run_id}")
|
logger.info(f"[AutomationTask] Completed automation run: {run_id}")
|
||||||
|
|
||||||
@@ -147,6 +169,7 @@ def resume_automation_task(self, run_id: str):
|
|||||||
try:
|
try:
|
||||||
service = AutomationService.from_run_id(run_id)
|
service = AutomationService.from_run_id(run_id)
|
||||||
run = service.run
|
run = service.run
|
||||||
|
config = service.config
|
||||||
|
|
||||||
# Continue from current stage
|
# Continue from current stage
|
||||||
stage_methods = [
|
stage_methods = [
|
||||||
@@ -159,9 +182,22 @@ def resume_automation_task(self, run_id: str):
|
|||||||
service.run_stage_7,
|
service.run_stage_7,
|
||||||
]
|
]
|
||||||
|
|
||||||
# Run from current_stage to end
|
stage_enabled = [
|
||||||
|
config.stage_1_enabled,
|
||||||
|
config.stage_2_enabled,
|
||||||
|
config.stage_3_enabled,
|
||||||
|
config.stage_4_enabled,
|
||||||
|
config.stage_5_enabled,
|
||||||
|
config.stage_6_enabled,
|
||||||
|
config.stage_7_enabled,
|
||||||
|
]
|
||||||
|
|
||||||
|
# Run from current_stage to end, only if stage is enabled
|
||||||
for stage in range(run.current_stage - 1, 7):
|
for stage in range(run.current_stage - 1, 7):
|
||||||
stage_methods[stage]()
|
if stage_enabled[stage]:
|
||||||
|
stage_methods[stage]()
|
||||||
|
else:
|
||||||
|
logger.info(f"[AutomationTask] Stage {stage + 1} is disabled, skipping")
|
||||||
|
|
||||||
logger.info(f"[AutomationTask] Resumed automation run: {run_id}")
|
logger.info(f"[AutomationTask] Resumed automation run: {run_id}")
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ class AutomationViewSet(viewsets.ViewSet):
|
|||||||
'is_enabled': config.is_enabled,
|
'is_enabled': config.is_enabled,
|
||||||
'frequency': config.frequency,
|
'frequency': config.frequency,
|
||||||
'scheduled_time': str(config.scheduled_time),
|
'scheduled_time': str(config.scheduled_time),
|
||||||
|
'stage_1_enabled': config.stage_1_enabled,
|
||||||
|
'stage_2_enabled': config.stage_2_enabled,
|
||||||
|
'stage_3_enabled': config.stage_3_enabled,
|
||||||
|
'stage_4_enabled': config.stage_4_enabled,
|
||||||
|
'stage_5_enabled': config.stage_5_enabled,
|
||||||
|
'stage_6_enabled': config.stage_6_enabled,
|
||||||
|
'stage_7_enabled': config.stage_7_enabled,
|
||||||
'stage_1_batch_size': config.stage_1_batch_size,
|
'stage_1_batch_size': config.stage_1_batch_size,
|
||||||
'stage_2_batch_size': config.stage_2_batch_size,
|
'stage_2_batch_size': config.stage_2_batch_size,
|
||||||
'stage_3_batch_size': config.stage_3_batch_size,
|
'stage_3_batch_size': config.stage_3_batch_size,
|
||||||
@@ -102,6 +109,22 @@ class AutomationViewSet(viewsets.ViewSet):
|
|||||||
config.frequency = request.data['frequency']
|
config.frequency = request.data['frequency']
|
||||||
if 'scheduled_time' in request.data:
|
if 'scheduled_time' in request.data:
|
||||||
config.scheduled_time = request.data['scheduled_time']
|
config.scheduled_time = request.data['scheduled_time']
|
||||||
|
# Stage enabled toggles
|
||||||
|
if 'stage_1_enabled' in request.data:
|
||||||
|
config.stage_1_enabled = request.data['stage_1_enabled']
|
||||||
|
if 'stage_2_enabled' in request.data:
|
||||||
|
config.stage_2_enabled = request.data['stage_2_enabled']
|
||||||
|
if 'stage_3_enabled' in request.data:
|
||||||
|
config.stage_3_enabled = request.data['stage_3_enabled']
|
||||||
|
if 'stage_4_enabled' in request.data:
|
||||||
|
config.stage_4_enabled = request.data['stage_4_enabled']
|
||||||
|
if 'stage_5_enabled' in request.data:
|
||||||
|
config.stage_5_enabled = request.data['stage_5_enabled']
|
||||||
|
if 'stage_6_enabled' in request.data:
|
||||||
|
config.stage_6_enabled = request.data['stage_6_enabled']
|
||||||
|
if 'stage_7_enabled' in request.data:
|
||||||
|
config.stage_7_enabled = request.data['stage_7_enabled']
|
||||||
|
# Batch sizes
|
||||||
if 'stage_1_batch_size' in request.data:
|
if 'stage_1_batch_size' in request.data:
|
||||||
config.stage_1_batch_size = request.data['stage_1_batch_size']
|
config.stage_1_batch_size = request.data['stage_1_batch_size']
|
||||||
if 'stage_2_batch_size' in request.data:
|
if 'stage_2_batch_size' in request.data:
|
||||||
@@ -133,6 +156,13 @@ class AutomationViewSet(viewsets.ViewSet):
|
|||||||
'is_enabled': config.is_enabled,
|
'is_enabled': config.is_enabled,
|
||||||
'frequency': config.frequency,
|
'frequency': config.frequency,
|
||||||
'scheduled_time': str(config.scheduled_time),
|
'scheduled_time': str(config.scheduled_time),
|
||||||
|
'stage_1_enabled': config.stage_1_enabled,
|
||||||
|
'stage_2_enabled': config.stage_2_enabled,
|
||||||
|
'stage_3_enabled': config.stage_3_enabled,
|
||||||
|
'stage_4_enabled': config.stage_4_enabled,
|
||||||
|
'stage_5_enabled': config.stage_5_enabled,
|
||||||
|
'stage_6_enabled': config.stage_6_enabled,
|
||||||
|
'stage_7_enabled': config.stage_7_enabled,
|
||||||
'stage_1_batch_size': config.stage_1_batch_size,
|
'stage_1_batch_size': config.stage_1_batch_size,
|
||||||
'stage_2_batch_size': config.stage_2_batch_size,
|
'stage_2_batch_size': config.stage_2_batch_size,
|
||||||
'stage_3_batch_size': config.stage_3_batch_size,
|
'stage_3_batch_size': config.stage_3_batch_size,
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ const ConfigModal: React.FC<ConfigModalProps> = ({ config, onSave, onCancel }) =
|
|||||||
is_enabled: config.is_enabled,
|
is_enabled: config.is_enabled,
|
||||||
frequency: config.frequency,
|
frequency: config.frequency,
|
||||||
scheduled_time: config.scheduled_time,
|
scheduled_time: config.scheduled_time,
|
||||||
|
stage_1_enabled: config.stage_1_enabled ?? true,
|
||||||
|
stage_2_enabled: config.stage_2_enabled ?? true,
|
||||||
|
stage_3_enabled: config.stage_3_enabled ?? true,
|
||||||
|
stage_4_enabled: config.stage_4_enabled ?? true,
|
||||||
|
stage_5_enabled: config.stage_5_enabled ?? true,
|
||||||
|
stage_6_enabled: config.stage_6_enabled ?? true,
|
||||||
|
stage_7_enabled: config.stage_7_enabled ?? true,
|
||||||
stage_1_batch_size: config.stage_1_batch_size,
|
stage_1_batch_size: config.stage_1_batch_size,
|
||||||
stage_2_batch_size: config.stage_2_batch_size,
|
stage_2_batch_size: config.stage_2_batch_size,
|
||||||
stage_3_batch_size: config.stage_3_batch_size,
|
stage_3_batch_size: config.stage_3_batch_size,
|
||||||
@@ -97,8 +104,68 @@ const ConfigModal: React.FC<ConfigModalProps> = ({ config, onSave, onCancel }) =
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Stage Processing Toggles */}
|
||||||
|
<div className="mb-4 border-t pt-4">
|
||||||
|
<h3 className="font-semibold mb-2">Stage Processing</h3>
|
||||||
|
<p className="text-sm text-gray-600 mb-3">
|
||||||
|
Enable or disable individual stages. Disabled stages will be skipped during automation.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-1 gap-2">
|
||||||
|
<Checkbox
|
||||||
|
label="Stage 1: Keywords → Clusters"
|
||||||
|
checked={formData.stage_1_enabled ?? true}
|
||||||
|
onChange={(checked) =>
|
||||||
|
setFormData({ ...formData, stage_1_enabled: checked })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label="Stage 2: Clusters → Ideas"
|
||||||
|
checked={formData.stage_2_enabled ?? true}
|
||||||
|
onChange={(checked) =>
|
||||||
|
setFormData({ ...formData, stage_2_enabled: checked })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label="Stage 3: Ideas → Tasks"
|
||||||
|
checked={formData.stage_3_enabled ?? true}
|
||||||
|
onChange={(checked) =>
|
||||||
|
setFormData({ ...formData, stage_3_enabled: checked })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label="Stage 4: Tasks → Content"
|
||||||
|
checked={formData.stage_4_enabled ?? true}
|
||||||
|
onChange={(checked) =>
|
||||||
|
setFormData({ ...formData, stage_4_enabled: checked })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label="Stage 5: Content → Image Prompts"
|
||||||
|
checked={formData.stage_5_enabled ?? true}
|
||||||
|
onChange={(checked) =>
|
||||||
|
setFormData({ ...formData, stage_5_enabled: checked })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label="Stage 6: Image Prompts → Images"
|
||||||
|
checked={formData.stage_6_enabled ?? true}
|
||||||
|
onChange={(checked) =>
|
||||||
|
setFormData({ ...formData, stage_6_enabled: checked })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label="Stage 7: Review → Published"
|
||||||
|
checked={formData.stage_7_enabled ?? true}
|
||||||
|
onChange={(checked) =>
|
||||||
|
setFormData({ ...formData, stage_7_enabled: checked })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Batch Sizes */}
|
{/* Batch Sizes */}
|
||||||
<div className="mb-4">
|
<div className="mb-4 border-t pt-4">
|
||||||
<h3 className="font-semibold mb-2">Batch Sizes</h3>
|
<h3 className="font-semibold mb-2">Batch Sizes</h3>
|
||||||
<p className="text-sm text-gray-600 mb-3">
|
<p className="text-sm text-gray-600 mb-3">
|
||||||
Configure how many items to process in each stage
|
Configure how many items to process in each stage
|
||||||
|
|||||||
@@ -923,6 +923,10 @@ const AutomationPage: React.FC = () => {
|
|||||||
const stageBorderColors = ['border-l-brand-500', 'border-l-purple-500', 'border-l-warning-500', 'border-l-gray-600'];
|
const stageBorderColors = ['border-l-brand-500', 'border-l-purple-500', 'border-l-warning-500', 'border-l-gray-600'];
|
||||||
const stageBorderColor = stageBorderColors[index] || 'border-l-brand-500';
|
const stageBorderColor = stageBorderColors[index] || 'border-l-brand-500';
|
||||||
|
|
||||||
|
// Check if this stage is enabled in config
|
||||||
|
const stageEnabledKey = `stage_${stage.number}_enabled` as keyof AutomationConfig;
|
||||||
|
const isStageEnabled = config?.[stageEnabledKey] ?? true;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={stage.number}
|
key={stage.number}
|
||||||
@@ -947,9 +951,11 @@ const AutomationPage: React.FC = () => {
|
|||||||
<StageIcon className="size-4 text-white" />
|
<StageIcon className="size-4 text-white" />
|
||||||
</div>
|
</div>
|
||||||
<span className="text-base font-bold text-gray-900 dark:text-white">Stage {stage.number}</span>
|
<span className="text-base font-bold text-gray-900 dark:text-white">Stage {stage.number}</span>
|
||||||
{isActive && <span className="text-xs px-2 py-0.5 bg-brand-500 text-white rounded-full font-medium">● Active</span>}
|
{isActive && isStageEnabled && <span className="text-xs px-2 py-0.5 bg-brand-500 text-white rounded-full font-medium">● Active</span>}
|
||||||
|
{isActive && !isStageEnabled && <span className="text-xs px-2 py-0.5 bg-orange-500 text-white rounded-full font-medium">Skipped</span>}
|
||||||
{isComplete && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">✓</span>}
|
{isComplete && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">✓</span>}
|
||||||
{!isActive && !isComplete && stage.pending > 0 && <span className="text-xs px-2 py-0.5 bg-gray-400 text-white rounded-full font-medium">Ready</span>}
|
{!isActive && !isComplete && stage.pending > 0 && !isStageEnabled && <span className="text-xs px-2 py-0.5 bg-orange-500 text-white rounded-full font-medium">Skipped</span>}
|
||||||
|
{!isActive && !isComplete && stage.pending > 0 && isStageEnabled && <span className="text-xs px-2 py-0.5 bg-gray-400 text-white rounded-full font-medium">Ready</span>}
|
||||||
</div>
|
</div>
|
||||||
{/* Stage Function Name - Right side, larger font */}
|
{/* Stage Function Name - Right side, larger font */}
|
||||||
<div className={`text-sm font-bold ${stageConfig.textColor}`}>{stageConfig.name}</div>
|
<div className={`text-sm font-bold ${stageConfig.textColor}`}>{stageConfig.name}</div>
|
||||||
@@ -1053,6 +1059,10 @@ const AutomationPage: React.FC = () => {
|
|||||||
const stageBorderColors56 = ['border-l-brand-500', 'border-l-purple-500'];
|
const stageBorderColors56 = ['border-l-brand-500', 'border-l-purple-500'];
|
||||||
const stageBorderColor = stageBorderColors56[index] || 'border-l-brand-500';
|
const stageBorderColor = stageBorderColors56[index] || 'border-l-brand-500';
|
||||||
|
|
||||||
|
// Check if this stage is enabled in config
|
||||||
|
const stageEnabledKey = `stage_${stage.number}_enabled` as keyof AutomationConfig;
|
||||||
|
const isStageEnabled = config?.[stageEnabledKey] ?? true;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={stage.number}
|
key={stage.number}
|
||||||
@@ -1076,9 +1086,11 @@ const AutomationPage: React.FC = () => {
|
|||||||
<StageIcon className="size-4 text-white" />
|
<StageIcon className="size-4 text-white" />
|
||||||
</div>
|
</div>
|
||||||
<span className="text-base font-bold text-gray-900 dark:text-white">Stage {stage.number}</span>
|
<span className="text-base font-bold text-gray-900 dark:text-white">Stage {stage.number}</span>
|
||||||
{isActive && <span className="text-xs px-2 py-0.5 bg-brand-500 text-white rounded-full font-medium">● Active</span>}
|
{isActive && isStageEnabled && <span className="text-xs px-2 py-0.5 bg-brand-500 text-white rounded-full font-medium">● Active</span>}
|
||||||
|
{isActive && !isStageEnabled && <span className="text-xs px-2 py-0.5 bg-orange-500 text-white rounded-full font-medium">Skipped</span>}
|
||||||
{isComplete && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">✓</span>}
|
{isComplete && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">✓</span>}
|
||||||
{!isActive && !isComplete && stage.pending > 0 && <span className="text-xs px-2 py-0.5 bg-gray-400 text-white rounded-full font-medium">Ready</span>}
|
{!isActive && !isComplete && stage.pending > 0 && !isStageEnabled && <span className="text-xs px-2 py-0.5 bg-orange-500 text-white rounded-full font-medium">Skipped</span>}
|
||||||
|
{!isActive && !isComplete && stage.pending > 0 && isStageEnabled && <span className="text-xs px-2 py-0.5 bg-gray-400 text-white rounded-full font-medium">Ready</span>}
|
||||||
</div>
|
</div>
|
||||||
{/* Stage Function Name - Right side, larger font */}
|
{/* Stage Function Name - Right side, larger font */}
|
||||||
<div className={`text-sm font-bold ${stageConfig.textColor}`}>{stageConfig.name}</div>
|
<div className={`text-sm font-bold ${stageConfig.textColor}`}>{stageConfig.name}</div>
|
||||||
@@ -1162,6 +1174,9 @@ const AutomationPage: React.FC = () => {
|
|||||||
|
|
||||||
const progressPercent = totalReview > 0 ? Math.min(Math.round((approvedCount / totalReview) * 100), 100) : 0;
|
const progressPercent = totalReview > 0 ? Math.min(Math.round((approvedCount / totalReview) * 100), 100) : 0;
|
||||||
|
|
||||||
|
// Check if stage 7 is enabled in config
|
||||||
|
const isStage7Enabled = config?.stage_7_enabled ?? true;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`
|
className={`
|
||||||
@@ -1184,9 +1199,12 @@ const AutomationPage: React.FC = () => {
|
|||||||
<PaperPlaneIcon className="size-4 text-white" />
|
<PaperPlaneIcon className="size-4 text-white" />
|
||||||
</div>
|
</div>
|
||||||
<span className="text-base font-bold text-gray-900 dark:text-white">Stage 7</span>
|
<span className="text-base font-bold text-gray-900 dark:text-white">Stage 7</span>
|
||||||
{isActive && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">● Active</span>}
|
{isActive && isStage7Enabled && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">● Active</span>}
|
||||||
|
{isActive && !isStage7Enabled && <span className="text-xs px-2 py-0.5 bg-orange-500 text-white rounded-full font-medium">Skipped</span>}
|
||||||
|
{isActive && !isStage7Enabled && <span className="text-xs px-2 py-0.5 bg-orange-500 text-white rounded-full font-medium">Skipped</span>}
|
||||||
{isComplete && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">✓</span>}
|
{isComplete && <span className="text-xs px-2 py-0.5 bg-success-500 text-white rounded-full font-medium">✓</span>}
|
||||||
{!isActive && !isComplete && pendingReview > 0 && <span className="text-xs px-2 py-0.5 bg-gray-400 text-white rounded-full font-medium">Ready</span>}
|
{!isActive && !isComplete && pendingReview > 0 && !isStage7Enabled && <span className="text-xs px-2 py-0.5 bg-orange-500 text-white rounded-full font-medium">Skipped</span>}
|
||||||
|
{!isActive && !isComplete && pendingReview > 0 && isStage7Enabled && <span className="text-xs px-2 py-0.5 bg-gray-400 text-white rounded-full font-medium">Ready</span>}
|
||||||
</div>
|
</div>
|
||||||
{/* Stage Function Name - Right side, larger font */}
|
{/* Stage Function Name - Right side, larger font */}
|
||||||
<div className={`text-sm font-bold ${stageConfig.textColor}`}>{stageConfig.name}</div>
|
<div className={`text-sm font-bold ${stageConfig.textColor}`}>{stageConfig.name}</div>
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ export interface AutomationConfig {
|
|||||||
is_enabled: boolean;
|
is_enabled: boolean;
|
||||||
frequency: 'daily' | 'weekly' | 'monthly';
|
frequency: 'daily' | 'weekly' | 'monthly';
|
||||||
scheduled_time: string;
|
scheduled_time: string;
|
||||||
|
stage_1_enabled: boolean;
|
||||||
|
stage_2_enabled: boolean;
|
||||||
|
stage_3_enabled: boolean;
|
||||||
|
stage_4_enabled: boolean;
|
||||||
|
stage_5_enabled: boolean;
|
||||||
|
stage_6_enabled: boolean;
|
||||||
|
stage_7_enabled: boolean;
|
||||||
stage_1_batch_size: number;
|
stage_1_batch_size: number;
|
||||||
stage_2_batch_size: number;
|
stage_2_batch_size: number;
|
||||||
stage_3_batch_size: number;
|
stage_3_batch_size: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user