mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
Merge pull request #27613 from Devp00l/wip-issue-23858
mgr/dashboard: RBD snapshot name suggestion with local time suffix Reviewed-by: Alfonso Martínez <almartin@redhat.com> Reviewed-by: Ricardo Marques <rimarques@suse.com>
This commit is contained in:
commit
3ec1130719
@ -206,7 +206,7 @@ describe('RbdSnapshotListComponent', () => {
|
||||
it('should display suggested snapshot name', () => {
|
||||
component.openCreateSnapshotModal();
|
||||
expect(component.modalRef.content.snapName).toMatch(
|
||||
RegExp(`^${component.rbdName}-\\d+T\\d+Z\$`)
|
||||
RegExp(`^${component.rbdName}_[\\d-]+T[\\d.:]+\\+[\\d:]+\$`)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -167,9 +167,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
|
||||
} else {
|
||||
// Auto-create a name for the snapshot: <image_name>_<timestamp_ISO_8601>
|
||||
// https://en.wikipedia.org/wiki/ISO_8601
|
||||
snapName = `${this.rbdName}-${moment()
|
||||
.utc()
|
||||
.format('YYYYMMDD[T]HHmmss[Z]')}`;
|
||||
snapName = `${this.rbdName}_${moment().toISOString(true)}`;
|
||||
}
|
||||
this.modalRef.content.setSnapName(snapName);
|
||||
this.modalRef.content.onSubmit.subscribe((snapshotName: string) => {
|
||||
|
Loading…
Reference in New Issue
Block a user