-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackupWindow.xaml
More file actions
245 lines (225 loc) · 12 KB
/
BackupWindow.xaml
File metadata and controls
245 lines (225 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<Window x:Class="NodaStack.BackupWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:local="clr-namespace:NodaStack"
Title="Backup & Import/Export - NodaStack"
Icon="Assets/NodaStackLogo.ico"
Height="600"
Width="1000"
MinHeight="550"
MinWidth="800"
ResizeMode="CanResize"
WindowStartupLocation="CenterOwner"
ShowInTaskbar="False"
Background="{DynamicResource BackgroundBrush}"
ui:WindowHelper.UseModernWindowStyle="True">
<Window.Resources>
<local:BytesToStringConverter x:Key="BytesToStringConverter"/>
</Window.Resources>
<Grid Margin="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Header -->
<Border Grid.Row="0"
Style="{StaticResource ModernCardStyle}"
Margin="0,0,0,20"
Padding="24">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="💾 Backup & Import/Export"
FontSize="22"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"/>
<TextBlock Text="Create backups and restore your NodaStack configuration"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
Margin="0,6,0,0"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button x:Name="RefreshButton"
Style="{StaticResource ModernSecondaryButtonStyle}"
Width="100"
Height="40"
Margin="0,0,8,0"
Click="RefreshButton_Click">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="🔄" FontSize="14" Margin="0,0,6,0"/>
<TextBlock Text="Refresh" FontWeight="SemiBold"/>
</StackPanel>
</Button>
<Button x:Name="CloseButton"
Style="{StaticResource ModernSecondaryButtonStyle}"
Width="100"
Height="40"
Click="CloseButton_Click">
<TextBlock Text="Close" FontWeight="SemiBold"/>
</Button>
</StackPanel>
</Grid>
</Border>
<!-- Main Content -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Left Panel - Backup History -->
<Border Grid.Column="0"
Style="{StaticResource ModernCardStyle}"
Margin="0,0,12,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="Backup History"
FontSize="18"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,16"/>
<Border Grid.Row="1"
Background="{DynamicResource SurfaceBrush}"
BorderBrush="{DynamicResource CardBorderBrush}"
BorderThickness="1"
CornerRadius="8"
Margin="0,0,0,12">
<ListView x:Name="BackupHistoryListView"
Background="Transparent"
BorderThickness="0"
SelectionChanged="BackupHistoryListView_SelectionChanged"
Style="{StaticResource DefaultListViewStyle}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" Width="220" DisplayMemberBinding="{Binding Name}"/>
<GridViewColumn Header="Type" Width="110" DisplayMemberBinding="{Binding Type}"/>
<GridViewColumn Header="Created" Width="150"
DisplayMemberBinding="{Binding CreatedAt, StringFormat='{}{0:dd/MM/yyyy HH:mm}'}"/>
<GridViewColumn Header="Size" Width="100"
DisplayMemberBinding="{Binding FileSize, Converter={StaticResource BytesToStringConverter}}"/>
</GridView>
</ListView.View>
</ListView>
</Border>
<TextBlock x:Name="StatusText"
Grid.Row="2"
Text="Loaded 0 backup(s)"
FontSize="12"
Foreground="{DynamicResource TextSecondaryBrush}"/>
</Grid>
</Border>
<!-- Right Panel - Actions -->
<ScrollViewer Grid.Column="1"
VerticalScrollBarVisibility="Auto"
Margin="12,0,0,0">
<StackPanel>
<!-- Create Backup Section -->
<Border Style="{StaticResource ModernCardStyle}" Margin="0,0,0,12">
<StackPanel>
<TextBlock Text="Create Backup"
FontSize="16"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,16"/>
<TextBox x:Name="BackupNameTextBox"
Style="{StaticResource ModernTextBoxStyle}"
Height="40"
FontSize="13"
Margin="0,0,0,8"/>
<TextBlock Text="Leave empty for auto-generated name"
FontSize="11"
Foreground="{DynamicResource TextSecondaryBrush}"
Margin="0,0,0,16"/>
<Button x:Name="CreateFullBackupButton"
Style="{StaticResource ModernButtonStyle}"
Width="160"
Height="40"
Content="Create Full Backup"
Margin="0,0,0,8"
Click="CreateFullBackupButton_Click"/>
<Button x:Name="CreateConfigBackupButton"
Style="{StaticResource ModernSecondaryButtonStyle}"
Width="160"
Height="40"
Content="Create Config Backup"
Click="CreateConfigBackupButton_Click"/>
</StackPanel>
</Border>
<!-- Import/Export Section -->
<Border Style="{StaticResource ModernCardStyle}" Margin="0,0,0,12">
<StackPanel>
<TextBlock Text="Import/Export"
FontSize="16"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,16"/>
<Button x:Name="ImportBackupButton"
Style="{StaticResource ModernButtonStyle}"
Width="160"
Height="40"
Content="Import Backup"
Margin="0,0,0,8"
Click="ImportBackupButton_Click"/>
<Button x:Name="ExportSelectedButton"
Style="{StaticResource ModernSecondaryButtonStyle}"
Width="160"
Height="40"
Content="Export Selected"
IsEnabled="False"
Click="ExportSelectedButton_Click"/>
</StackPanel>
</Border>
<!-- Backup Details Section -->
<Border Style="{StaticResource ModernCardStyle}" Margin="0,0,0,12">
<StackPanel>
<TextBlock Text="Backup Details"
FontSize="16"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,16"/>
<TextBlock x:Name="BackupDetailsText"
Text="Select a backup to view details"
FontSize="12"
Foreground="{DynamicResource TextSecondaryBrush}"
TextWrapping="Wrap"
LineHeight="20"/>
</StackPanel>
</Border>
<!-- Actions Section -->
<Border Style="{StaticResource ModernCardStyle}">
<StackPanel>
<TextBlock Text="Actions"
FontSize="16"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,16"/>
<Button x:Name="RestoreBackupButton"
Style="{StaticResource ModernButtonStyle}"
Width="160"
Height="40"
Content="Restore Backup"
Margin="0,0,0,8"
IsEnabled="False"
Click="RestoreBackupButton_Click"/>
<Button x:Name="DeleteBackupButton"
Style="{StaticResource ModernSecondaryButtonStyle}"
Width="160"
Height="40"
Content="Delete Backup"
IsEnabled="False"
Click="DeleteBackupButton_Click"/>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
</Window>