mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-29 16:45:13 +02:00
add mod/creat time sort functions
This commit is contained in:
parent
93cd3c4964
commit
0a3f9d1f44
@ -24,9 +24,11 @@ export class SortFunctions {
|
|||||||
owner: "asc",
|
owner: "asc",
|
||||||
group: "asc",
|
group: "asc",
|
||||||
size: "asc",
|
size: "asc",
|
||||||
|
modified: "asc",
|
||||||
|
created: "asc",
|
||||||
}
|
}
|
||||||
this.icons = {};
|
this.icons = {};
|
||||||
for (let option of ["name", "owner", "group", "size"]) {
|
for (let option of ["name", "owner", "group", "size", "modified", "created"]) {
|
||||||
this.icons[option] = document.getElementById(`sort-${option}-icon`);
|
this.icons[option] = document.getElementById(`sort-${option}-icon`);
|
||||||
}
|
}
|
||||||
this.current_choice = "name";
|
this.current_choice = "name";
|
||||||
@ -90,4 +92,20 @@ export class SortFunctions {
|
|||||||
size_desc(first, second) {
|
size_desc(first, second) {
|
||||||
return second.stat["size"] - first.stat["size"];
|
return second.stat["size"] - first.stat["size"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modified_asc(first, second) {
|
||||||
|
return first.stat["mtime"] - second.stat["mtime"];
|
||||||
|
}
|
||||||
|
|
||||||
|
modified_desc(first, second) {
|
||||||
|
return second.stat["mtime"] - first.stat["mtime"];
|
||||||
|
}
|
||||||
|
|
||||||
|
created_asc(first, second) {
|
||||||
|
return first.stat["ctime"] - second.stat["ctime"];
|
||||||
|
}
|
||||||
|
|
||||||
|
created_desc(first, second) {
|
||||||
|
return second.stat["ctime"] - first.stat["ctime"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user