Skip to content

Commit 0babff9

Browse files
committed
variable shuffling
1 parent f037172 commit 0babff9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/storaged/btrfs/subvolume.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
188188
{ tag: null, Title: _("Create snapshot") },
189189
];
190190

191-
const getLocalStorageSnapshotLocs = () => {
191+
const get_local_storage_snapshots_locs = () => {
192192
const localstorage_snapshot_data = localStorage.getItem(localstorage_key);
193193
if (localstorage_snapshot_data === null)
194194
return null;
@@ -201,14 +201,14 @@ async function snapshot_create(volume, subvol, subvolume_path) {
201201
}
202202
};
203203

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();
206206
if (snapshot_locations != null)
207207
return snapshot_locations[subvol.id] || null;
208208
return snapshot_locations;
209209
};
210210

211-
const getCurrentDate = async () => {
211+
const get_current_date = async () => {
212212
const out = await cockpit.spawn(["date", "+%s"]);
213213
const now = parseInt(out.trim()) * 1000;
214214
const d = new Date(now);
@@ -227,7 +227,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
227227
}
228228
};
229229

230-
const date = await getCurrentDate();
230+
const date = await get_current_date();
231231
// Convert dates to ISO-8601
232232
const current_date = date.toISOString().split("T")[0];
233233
const current_date_time = date.toISOString().replace(":00.000Z", "");
@@ -269,7 +269,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
269269
}),
270270
TextInput("snapshots_location", _("Snapshots location"),
271271
{
272-
value: getSavedSnapshotLocation(subvol),
272+
value: get_localstorage_snapshot_location(subvol),
273273
placeholder: cockpit.format(_("Example, $0"), "/.snapshots"),
274274
explanation: (<>
275275
<p>{_("Snapshots must reside within the same btrfs volume.")}</p>
@@ -315,7 +315,7 @@ async function snapshot_create(volume, subvol, subvolume_path) {
315315
console.log([...cmd, subvolume_path, `${vals.snapshots_location}/${snapshot_name}`]);
316316
const snapshot_location = `${vals.snapshots_location}/${snapshot_name}`;
317317
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 }));
319319

320320
// Re-trigger btrfs poll so the users sees the created snapshot in the overview or subvolume detail page
321321
await btrfs_poll();

0 commit comments

Comments
 (0)