mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(edge/templates): introduce edge specific settings [EE-6276] (#10609)
This commit is contained in:
parent
68950fbb24
commit
e43d076269
42 changed files with 885 additions and 319 deletions
24
app/react/edge/edge-stacks/components/PrePullToggle.tsx
Normal file
24
app/react/edge/edge-stacks/components/PrePullToggle.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { SwitchField } from '@@/form-components/SwitchField';
|
||||
|
||||
export function PrePullToggle({
|
||||
value,
|
||||
onChange,
|
||||
}: {
|
||||
value: boolean;
|
||||
onChange: (value: boolean) => void;
|
||||
}) {
|
||||
return (
|
||||
<div className="form-group">
|
||||
<div className="col-sm-12">
|
||||
<SwitchField
|
||||
checked={value}
|
||||
name="prePullImage"
|
||||
label="Pre-pull images"
|
||||
tooltip="When enabled, redeployment will be executed when image(s) is pulled successfully"
|
||||
labelClass="col-sm-3 col-lg-2"
|
||||
onChange={onChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
24
app/react/edge/edge-stacks/components/RetryDeployToggle.tsx
Normal file
24
app/react/edge/edge-stacks/components/RetryDeployToggle.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { SwitchField } from '@@/form-components/SwitchField';
|
||||
|
||||
export function RetryDeployToggle({
|
||||
value,
|
||||
onChange,
|
||||
}: {
|
||||
value: boolean;
|
||||
onChange: (value: boolean) => void;
|
||||
}) {
|
||||
return (
|
||||
<div className="form-group">
|
||||
<div className="col-sm-12">
|
||||
<SwitchField
|
||||
checked={value}
|
||||
name="retryDeploy"
|
||||
label="Retry deployment"
|
||||
tooltip="When enabled, this will allow the edge agent to retry deployment if failed to deploy initially"
|
||||
labelClass="col-sm-3 col-lg-2"
|
||||
onChange={onChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
export type StaggerConfig = {
|
||||
StaggerOption: StaggerOption;
|
||||
StaggerParallelOption?: StaggerParallelOption;
|
||||
DeviceNumber?: number;
|
||||
DeviceNumberStartFrom?: number;
|
||||
DeviceNumberIncrementBy?: number;
|
||||
Timeout?: string;
|
||||
UpdateDelay?: string;
|
||||
UpdateFailureAction?: UpdateFailureAction;
|
||||
};
|
||||
|
||||
export enum StaggerOption {
|
||||
AllAtOnce = 1,
|
||||
Parallel,
|
||||
}
|
||||
|
||||
export enum StaggerParallelOption {
|
||||
Fixed = 1,
|
||||
Incremental,
|
||||
}
|
||||
|
||||
export enum UpdateFailureAction {
|
||||
Continue = 1,
|
||||
Pause,
|
||||
Rollback,
|
||||
}
|
||||
|
||||
export function getDefaultStaggerConfig(): StaggerConfig {
|
||||
return {
|
||||
StaggerOption: StaggerOption.AllAtOnce,
|
||||
StaggerParallelOption: StaggerParallelOption.Fixed,
|
||||
DeviceNumber: 1,
|
||||
DeviceNumberStartFrom: 0,
|
||||
DeviceNumberIncrementBy: 2,
|
||||
Timeout: '',
|
||||
UpdateDelay: '',
|
||||
UpdateFailureAction: UpdateFailureAction.Continue,
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue