@@ -467,122 +467,118 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
467467</ FormSection >
468468
469469{ allowAdvancedScheduling && (
470- < >
471- < FormSection
472- title = "Dormancy"
473- description = "When enabled, Coder will mark workspaces as dormant after a period of time with no connections. Dormant workspaces can be auto-deleted (see below) or manually reviewed by the workspace owner or admins."
474- >
475- < FormFields spacing = { FORM_FIELDS_SPACING } >
476- < Stack spacing = { DORMANT_FIELDSET_SPACING } >
477- < FormControlLabel
478- control = {
479- < Switch
480- size = "small"
481- name = "dormancyThreshold"
482- checked = { form . values . inactivity_cleanup_enabled }
483- onChange = { handleToggleInactivityCleanup }
484- />
485- }
486- label = { < StackLabel > Enable Dormancy Threshold</ StackLabel > }
487- />
488-
489- < DurationField
490- { ...getFieldHelpers ( "time_til_dormant_ms" , {
491- helperText :(
492- < DormancyTTLHelperText
493- ttl = { form . values . time_til_dormant_ms }
494- />
495- ) ,
496- } ) }
497- label = "Time until dormant"
498- valueMs = { form . values . time_til_dormant_ms ?? 0 }
499- onChange = { ( v ) => form . setFieldValue ( "time_til_dormant_ms" , v ) }
500- disabled = {
501- isSubmitting || ! form . values . inactivity_cleanup_enabled
502- }
503- />
504- </ Stack >
505-
506- < Stack spacing = { DORMANT_FIELDSET_SPACING } >
507- < FormControlLabel
508- control = {
509- < Switch
510- size = "small"
511- name = "dormancyAutoDeletion"
512- checked = { form . values . dormant_autodeletion_cleanup_enabled }
513- onChange = { handleToggleDormantAutoDeletion }
470+ < FormSection
471+ title = "Dormancy"
472+ description = "When enabled, Coder will mark workspaces as dormant after a period of time with no connections. Dormant workspaces can be auto-deleted (see below) or manually reviewed by the workspace owner or admins."
473+ >
474+ < FormFields spacing = { FORM_FIELDS_SPACING } >
475+ < Stack spacing = { DORMANT_FIELDSET_SPACING } >
476+ < FormControlLabel
477+ control = {
478+ < Switch
479+ size = "small"
480+ name = "dormancyThreshold"
481+ checked = { form . values . inactivity_cleanup_enabled }
482+ onChange = { handleToggleInactivityCleanup }
483+ />
484+ }
485+ label = { < StackLabel > Enable Dormancy Threshold</ StackLabel > }
486+ />
487+
488+ < DurationField
489+ { ...getFieldHelpers ( "time_til_dormant_ms" , {
490+ helperText :(
491+ < DormancyTTLHelperText
492+ ttl = { form . values . time_til_dormant_ms }
514493/>
515- }
516- label = {
517- < StackLabel >
518- Enable Dormancy Auto-Deletion
519- < StackLabelHelperText >
520- When enabled, Coder will permanently delete dormant
521- workspaces after a period of time.{ " " }
522- < strong >
523- Once a workspace is deleted it cannot be recovered.
524- </ strong >
525- </ StackLabelHelperText >
526- </ StackLabel >
527- }
528- />
529- < DurationField
530- { ...getFieldHelpers ( "time_til_dormant_autodelete_ms" , {
531- helperText :(
532- < DormancyAutoDeletionTTLHelperText
533- ttl = { form . values . time_til_dormant_autodelete_ms }
534- />
535- ) ,
536- } ) }
537- label = "Time until deletion"
538- valueMs = { form . values . time_til_dormant_autodelete_ms ?? 0 }
539- onChange = { ( v ) =>
540- form . setFieldValue ( "time_til_dormant_autodelete_ms" , v )
541- }
542- disabled = {
543- isSubmitting ||
544- ! form . values . dormant_autodeletion_cleanup_enabled
545- }
546- />
547- </ Stack >
548-
549- < Stack spacing = { DORMANT_FIELDSET_SPACING } >
550- < FormControlLabel
551- control = {
552- < Switch
553- size = "small"
554- name = "failureCleanupEnabled"
555- checked = { form . values . failure_cleanup_enabled }
556- onChange = { handleToggleFailureCleanup }
494+ ) ,
495+ } ) }
496+ label = "Time until dormant"
497+ valueMs = { form . values . time_til_dormant_ms ?? 0 }
498+ onChange = { ( v ) => form . setFieldValue ( "time_til_dormant_ms" , v ) }
499+ disabled = {
500+ isSubmitting || ! form . values . inactivity_cleanup_enabled
501+ }
502+ />
503+ </ Stack >
504+
505+ < Stack spacing = { DORMANT_FIELDSET_SPACING } >
506+ < FormControlLabel
507+ control = {
508+ < Switch
509+ size = "small"
510+ name = "dormancyAutoDeletion"
511+ checked = { form . values . dormant_autodeletion_cleanup_enabled }
512+ onChange = { handleToggleDormantAutoDeletion }
513+ />
514+ }
515+ label = {
516+ < StackLabel >
517+ Enable Dormancy Auto-Deletion
518+ < StackLabelHelperText >
519+ When enabled, Coder will permanently delete dormant
520+ workspaces after a period of time.{ " " }
521+ < strong >
522+ Once a workspace is deleted it cannot be recovered.
523+ </ strong >
524+ </ StackLabelHelperText >
525+ </ StackLabel >
526+ }
527+ />
528+ < DurationField
529+ { ...getFieldHelpers ( "time_til_dormant_autodelete_ms" , {
530+ helperText :(
531+ < DormancyAutoDeletionTTLHelperText
532+ ttl = { form . values . time_til_dormant_autodelete_ms }
557533/>
558- }
559- label = {
560- < StackLabel >
561- Enable Failure Cleanup
562- < StackLabelHelperText >
563- When enabled, Coder will attempt to stop workspaces that
564- are in a failed state after a period of time.
565- </ StackLabelHelperText >
566- </ StackLabel >
567- }
568- />
569- < DurationField
570- { ...getFieldHelpers ( "failure_ttl_ms" , {
571- helperText :(
572- < FailureTTLHelperText ttl = { form . values . failure_ttl_ms } />
573- ) ,
574- } ) }
575- label = "Time until cleanup"
576- valueMs = { form . values . failure_ttl_ms ?? 0 }
577- onChange = { ( v ) => form . setFieldValue ( "failure_ttl_ms" , v ) }
578- disabled = {
579- isSubmitting || ! form . values . failure_cleanup_enabled
580- }
581- />
582- </ Stack >
583- </ FormFields >
584- </ FormSection >
585- </ >
534+ ) ,
535+ } ) }
536+ label = "Time until deletion"
537+ valueMs = { form . values . time_til_dormant_autodelete_ms ?? 0 }
538+ onChange = { ( v ) =>
539+ form . setFieldValue ( "time_til_dormant_autodelete_ms" , v )
540+ }
541+ disabled = {
542+ isSubmitting ||
543+ ! form . values . dormant_autodeletion_cleanup_enabled
544+ }
545+ />
546+ </ Stack >
547+
548+ < Stack spacing = { DORMANT_FIELDSET_SPACING } >
549+ < FormControlLabel
550+ control = {
551+ < Switch
552+ size = "small"
553+ name = "failureCleanupEnabled"
554+ checked = { form . values . failure_cleanup_enabled }
555+ onChange = { handleToggleFailureCleanup }
556+ />
557+ }
558+ label = {
559+ < StackLabel >
560+ Enable Failure Cleanup
561+ < StackLabelHelperText >
562+ When enabled, Coder will attempt to stop workspaces that
563+ are in a failed state after a period of time.
564+ </ StackLabelHelperText >
565+ </ StackLabel >
566+ }
567+ />
568+ < DurationField
569+ { ...getFieldHelpers ( "failure_ttl_ms" , {
570+ helperText :(
571+ < FailureTTLHelperText ttl = { form . values . failure_ttl_ms } />
572+ ) ,
573+ } ) }
574+ label = "Time until cleanup"
575+ valueMs = { form . values . failure_ttl_ms ?? 0 }
576+ onChange = { ( v ) => form . setFieldValue ( "failure_ttl_ms" , v ) }
577+ disabled = { isSubmitting || ! form . values . failure_cleanup_enabled }
578+ />
579+ </ Stack >
580+ </ FormFields >
581+ </ FormSection >
586582) }
587583{ showScheduleDialog && (
588584< ScheduleDialog