@@ -188,7 +188,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
188
188
{ tag : null , Title : _ ( "Create snapshot" ) } ,
189
189
] ;
190
190
191
- const getLocalStorageSnapshotLocs = ( ) => {
191
+ const get_local_storage_snapshots_locs = ( ) => {
192
192
const localstorage_snapshot_data = localStorage . getItem ( localstorage_key ) ;
193
193
if ( localstorage_snapshot_data === null )
194
194
return null ;
@@ -201,14 +201,14 @@ async function snapshot_create(volume, subvol, subvolume_path) {
201
201
}
202
202
} ;
203
203
204
- const getSavedSnapshotLocation = subvol => {
205
- const snapshot_locations = getLocalStorageSnapshotLocs ( ) ;
204
+ const get_localstorage_snapshot_location = subvol => {
205
+ const snapshot_locations = get_local_storage_snapshots_locs ( ) ;
206
206
if ( snapshot_locations != null )
207
207
return snapshot_locations [ subvol . id ] || null ;
208
208
return snapshot_locations ;
209
209
} ;
210
210
211
- const getCurrentDate = async ( ) => {
211
+ const get_current_date = async ( ) => {
212
212
const out = await cockpit . spawn ( [ "date" , "+%s" ] ) ;
213
213
const now = parseInt ( out . trim ( ) ) * 1000 ;
214
214
const d = new Date ( now ) ;
@@ -227,7 +227,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
227
227
}
228
228
} ;
229
229
230
- const date = await getCurrentDate ( ) ;
230
+ const date = await get_current_date ( ) ;
231
231
// Convert dates to ISO-8601
232
232
const current_date = date . toISOString ( ) . split ( "T" ) [ 0 ] ;
233
233
const current_date_time = date . toISOString ( ) . replace ( ":00.000Z" , "" ) ;
@@ -269,7 +269,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
269
269
} ) ,
270
270
TextInput ( "snapshots_location" , _ ( "Snapshots location" ) ,
271
271
{
272
- value : getSavedSnapshotLocation ( subvol ) ,
272
+ value : get_localstorage_snapshot_location ( subvol ) ,
273
273
placeholder : cockpit . format ( _ ( "Example, $0" ) , "/.snapshots" ) ,
274
274
explanation : ( < >
275
275
< p > { _ ( "Snapshots must reside within the same btrfs volume." ) } </ p >
@@ -315,7 +315,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
315
315
console . log ( [ ...cmd , subvolume_path , `${ vals . snapshots_location } /${ snapshot_name } ` ] ) ;
316
316
const snapshot_location = `${ vals . snapshots_location } /${ snapshot_name } ` ;
317
317
await cockpit . spawn ( [ ...cmd , subvolume_path , snapshot_location ] , { superuser : "require" , err : "message" } ) ;
318
- localStorage . setItem ( localstorage_key , JSON . stringify ( { ...getLocalStorageSnapshotLocs ( ) , [ subvol . id ] : vals . snapshots_location } ) ) ;
318
+ localStorage . setItem ( localstorage_key , JSON . stringify ( { ...get_local_storage_snapshots_locs ( ) , [ subvol . id ] : vals . snapshots_location } ) ) ;
319
319
320
320
// Re-trigger btrfs poll so the users sees the created snapshot in the overview or subvolume detail page
321
321
await btrfs_poll ( ) ;
0 commit comments