diff --git a/src/app/backend/api/types.go b/src/app/backend/api/types.go
index 6d5272f73f60..623bbab8f05c 100644
--- a/src/app/backend/api/types.go
+++ b/src/app/backend/api/types.go
@@ -78,6 +78,9 @@ type TypeMeta struct {
// Scalable represents whether or not an object is scalable.
Scalable bool `json:"scalable,omitempty"`
+
+ // Restartable represents wheter or not an object is restartable.
+ Restartable bool `json:"restartable,omitempty"`
}
// ListMeta describes list of objects, i.e. holds information about pagination options set for the list.
@@ -104,6 +107,7 @@ func NewTypeMeta(kind ResourceKind) TypeMeta {
return TypeMeta{
Kind: kind,
Scalable: kind.Scalable(),
+ Restartable: kind.Restartable(),
}
}
@@ -164,6 +168,24 @@ func (k ResourceKind) Scalable() bool {
return false
}
+// Restartable method return whether ResourceKind is restartable.
+func (k ResourceKind) Restartable() bool {
+ restartable := []ResourceKind{
+ ResourceKindDeployment,
+ ResourceKindReplicaSet,
+ ResourceKindReplicationController,
+ ResourceKindStatefulSet,
+ }
+
+ for _, kind := range restartable {
+ if k == kind {
+ return true
+ }
+ }
+
+ return false
+}
+
// ClientType represents type of client that is used to perform generic operations on resources.
// Different resources belong to different client, i.e. Deployments belongs to extension client
// and StatefulSets to apps client.
diff --git a/src/app/frontend/common/components/list/column/menu/component.ts b/src/app/frontend/common/components/list/column/menu/component.ts
index 7481176abb43..37076590d8ab 100644
--- a/src/app/frontend/common/components/list/column/menu/component.ts
+++ b/src/app/frontend/common/components/list/column/menu/component.ts
@@ -97,10 +97,18 @@ export class MenuComponent implements ActionColumn {
return this.typeMeta.scalable;
}
+ isRestartEnabled(): boolean {
+ return this.typeMeta.restartable;
+ }
+
onScale(): void {
this.verber_.showScaleDialog(this.typeMeta.kind, this.typeMeta, this.objectMeta);
}
+ onRestart(): void {
+ this.verber_.showRestartDialog(this.typeMeta.kind, this.typeMeta, this.objectMeta);
+ }
+
isPinEnabled(): boolean {
return pinnableResources.includes(this.typeMeta.kind);
}
diff --git a/src/app/frontend/common/components/list/column/menu/template.html b/src/app/frontend/common/components/list/column/menu/template.html
index 52a90aefe284..74cc4d67c674 100644
--- a/src/app/frontend/common/components/list/column/menu/template.html
+++ b/src/app/frontend/common/components/list/column/menu/template.html
@@ -47,6 +47,11 @@
id="edit"
(click)="onEdit()"
i18n>Edit
+