fix: direct K8s scaling, replicas from K8s API, button labels, modify fetch
- Add ScaleClient using K8s API (like kubectl scale deploy --replicas=N) - ScaleDeployment: patch Deployment.Spec.Replicas directly - GetDeploymentReplicas: query actual K8s deployment replicas - Search by labels then fallback to deployment name match - Wire ScaleClient to InstanceService via SetScaleClient in main.go - ModifyModal: fetch full instance detail on open (list excludes values) - InstanceCard: add text labels to action buttons (Entries/Diag/Modify/Delete) - Text visible on sm+ screens, icon-only on xs
This commit is contained in:
@ -566,17 +566,6 @@ func formatTime(value time.Time) string {
|
||||
}
|
||||
|
||||
func convertInstanceResponse(instance *entity.Instance, includeValues bool) *dto.InstanceResponse {
|
||||
replicas := 0
|
||||
if v, ok := instance.Values["replicaCount"]; ok {
|
||||
switch n := v.(type) {
|
||||
case float64:
|
||||
replicas = int(n)
|
||||
case int:
|
||||
replicas = n
|
||||
case int64:
|
||||
replicas = int(n)
|
||||
}
|
||||
}
|
||||
response := &dto.InstanceResponse{
|
||||
ID: instance.ID,
|
||||
ClusterID: instance.ClusterID,
|
||||
@ -594,7 +583,7 @@ func convertInstanceResponse(instance *entity.Instance, includeValues bool) *dto
|
||||
LastOperation: string(instance.LastOperation),
|
||||
LastError: instance.LastError,
|
||||
Revision: instance.Revision,
|
||||
Replicas: replicas,
|
||||
Replicas: 0,
|
||||
AllowedActions: []string{"view", "update", "delete"},
|
||||
CreatedAt: instance.CreatedAt.Format("2006-01-02T15:04:05Z07:00"),
|
||||
UpdatedAt: instance.UpdatedAt.Format("2006-01-02T15:04:05Z07:00"),
|
||||
|
||||
Reference in New Issue
Block a user