]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Show correct token expiration date in Manage Clusters
authorAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Tue, 10 Dec 2024 07:03:47 +0000 (12:33 +0530)
committerAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Tue, 10 Dec 2024 07:03:47 +0000 (12:33 +0530)
page

Currently wrong date is being displayed if we hover of the Token Expires
filed in the Clusters list table in Manage Clusters page. This PR
intends to fix this issue.

Fixes: https://tracker.ceph.com/issues/69172
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-list/multi-cluster-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-list/multi-cluster-list.component.ts

index b05d07fb31b55379c32286708f71e5a191561c13..79cd60c970ff7703a851ad8ee04f4ca3c995108e 100644 (file)
@@ -77,7 +77,7 @@
        [class.icon-danger-color]="row.remainingDays < 2"
        [class.icon-warning-color]="row.remainingDays < 8"
        class="{{ icons.warning }}"></i>
-    <span title="{{ value | cdDate }}">{{ row.remainingTimeWithoutSeconds / 1000 | duration }}</span>
+    <span title="{{ row.expiryDate }}">{{ row.remainingTimeWithoutSeconds / 1000 | duration }}</span>
   </span>
   <span *ngIf="row.remainingTimeWithoutSeconds <= 0 && row.remainingDays <=0 && row.cluster_alias !== 'local-cluster'">
     <i i18n-title
index 78b4c9c1859f74ce1f7987a83b16f3343e9c4347..cfdc2e1720e8f35aeb2b57511a9c74de9481f0e0 100644 (file)
@@ -115,6 +115,7 @@ export class MultiClusterListComponent extends ListWithDetails implements OnInit
                 cluster['ttl']
               );
               cluster['remainingDays'] = this.getRemainingDays(cluster['ttl']);
+              cluster['expiryDate'] = new Date(Date.now() + cluster['ttl']).toLocaleString();
             }
           });
         }