Skip to content

Commit

Permalink
enhance UI (#117)
Browse files Browse the repository at this point in the history
* split details view in 2

* typo

* fix last snapshot date

* Add dynamic CultureInfo for snapshot last date
  • Loading branch information
NathanQuellec authored Dec 31, 2024
1 parent 0182d53 commit 7566b59
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 113 deletions.
6 changes: 3 additions & 3 deletions WSLStudio/Services/SnapshotService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<bool> CreateSnapshot(Distribution distribution, string snapsho
{
Log.Information($"Creating snapshot {snapshotName} from distribution {distribution.Name} ...");

var currentDateTime = DateTime.Now.ToString("dd MMMMM yyyy HH:mm:ss");
var currentDateTime = DateTime.Now.ToString(CultureInfo.CurrentCulture.DateTimeFormat.FullDateTimePattern);
var snapshotFolder = FilesHelper.CreateDirectory(distribution.Path, "snapshots");
var snapshotId = Guid.NewGuid();
var snapshotPath = Path.Combine(snapshotFolder, $"{snapshotId}_{snapshotName}");
Expand Down Expand Up @@ -135,8 +135,8 @@ public ObservableCollection<Snapshot> GetDistributionSnapshots(string distroPath

try
{
var snapshotList = _fileStorageService.Load<Snapshot>(snapshotsInfosPath);
return snapshotList;
return new ObservableCollection<Snapshot>(
_fileStorageService.Load<Snapshot>(snapshotsInfosPath).Reverse());
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion WSLStudio/Views/Dialogs/DisplaySnapshotsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@

<controls:DataGrid.Columns>
<controls:DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
<controls:DataGridTextColumn Header="Created" Binding="{Binding CreationDate}"/>
<controls:DataGridTextColumn Header="Creation Date" Binding="{Binding CreationDate}"/>
<controls:DataGridTextColumn Header="Snapshot Size (GB)" Binding="{Binding Size}"/>
<controls:DataGridTextColumn Header="Distribution Size (GB)" Binding="{Binding DistroSize}"/>
</controls:DataGrid.Columns>
Expand Down
Loading

0 comments on commit 7566b59

Please sign in to comment.