33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- import type { ScaleRule } from "@azure/arm-appcontainers" ;
6+ import { KnownActiveRevisionsMode , type ScaleRule } from "@azure/arm-appcontainers" ;
77import { nonNullProp } from "@microsoft/vscode-azext-utils" ;
88import { Progress } from "vscode" ;
99import { ScaleRuleTypes } from "../../../constants" ;
@@ -22,7 +22,17 @@ export class AddScaleRuleStep<T extends IAddScaleRuleContext> extends RevisionDr
2222 }
2323
2424 public async execute ( context : IAddScaleRuleContext , progress : Progress < { message ?: string | undefined ; increment ?: number | undefined } > ) : Promise < void > {
25- context . activityTitle = localize ( 'addingScaleRule' , 'Add {0} rule "{1}" to "{2}" (draft)' , context . ruleType , context . ruleName , context . containerApp . name ) ;
25+ let adding : string | undefined ;
26+ let added : string | undefined ;
27+ if ( context . containerApp . revisionsMode === KnownActiveRevisionsMode . Single ) {
28+ adding = localize ( 'addingScaleRuleSingle' , 'Add {0} rule "{1}" to container app "{2}" (draft)' , context . ruleType , context . ruleName , context . containerApp . name ) ;
29+ added = localize ( 'addedScaleRuleSingle' , 'Added {0} rule "{1}" to container app "{2}" (draft).' , context . ruleType , context . ruleName , context . containerApp . name ) ;
30+ } else {
31+ adding = localize ( 'addingScaleRuleMultiple' , 'Add {0} rule "{1}" to revision "{2}" (draft)' , context . ruleType , context . ruleName , this . baseItem . revision . name ) ;
32+ added = localize ( 'addedScaleRuleMultiple' , 'Added {0} rule "{1}" to revision "{2}" (draft)' , context . ruleType , context . ruleName , this . baseItem . revision . name ) ;
33+ }
34+
35+ context . activityTitle = adding ;
2636 progress . report ( { message : localize ( 'addingRule' , 'Adding scale rule...' ) } ) ;
2737
2838 this . revisionDraftTemplate . scale ||= { } ;
@@ -35,7 +45,6 @@ export class AddScaleRuleStep<T extends IAddScaleRuleContext> extends RevisionDr
3545 // Artificial delay to make the activity log look like it's performing an action
3646 await delay ( 1000 ) ;
3747
38- const added = localize ( 'addedScaleRule' , 'Added {0} rule "{1}" to "{2}" (draft).' , context . ruleType , context . ruleName , context . containerApp . name ) ;
3948 ext . outputChannel . appendLog ( added ) ;
4049 }
4150
0 commit comments