diff --git a/frontend/src/api/files.js b/frontend/src/api/files.js index 23620e92..37d9fe72 100644 --- a/frontend/src/api/files.js +++ b/frontend/src/api/files.js @@ -185,3 +185,9 @@ export async function unarchive(path, name, override) { const url = `${path}?action=${action}&destination=${to}&override=${override}`; return resourceAction(url, "PATCH"); } + +export async function chmod(path, perms, recursive = false) { + const action = `chmod`; + const url = `${path}?action=${action}&permissions=${perms}&recursive=${recursive}`; + return resourceAction(url, "PATCH"); +} diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 89fc61e9..65aaac22 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -41,6 +41,8 @@
+ + @@ -68,6 +70,7 @@ export default { "url", "type", "size", + "mode", "modified", "index", "readOnly", @@ -116,6 +119,26 @@ export default { }, methods: { ...mapMutations(["addSelected", "removeSelected", "resetSelected"]), + permissions() { + let s = ""; + if (this.isSymlink) { + s += "l"; + } else if (this.isDir) { + s += "d"; + } else { + s += "-"; + } + s += (this.mode & 256) != 0 ? "r" : "-"; + s += (this.mode & 128) != 0 ? "w" : "-"; + s += (this.mode & 64) != 0 ? "x" : "-"; + s += (this.mode & 32) != 0 ? "r" : "-"; + s += (this.mode & 16) != 0 ? "w" : "-"; + s += (this.mode & 8) != 0 ? "x" : "-"; + s += (this.mode & 4) != 0 ? "r" : "-"; + s += (this.mode & 2) != 0 ? "w" : "-"; + s += (this.mode & 1) != 0 ? "x" : "-"; + return s; + }, humanSize: function () { return filesize(this.size); }, diff --git a/frontend/src/components/prompts/Permissions.vue b/frontend/src/components/prompts/Permissions.vue new file mode 100644 index 00000000..aa34b2d5 --- /dev/null +++ b/frontend/src/components/prompts/Permissions.vue @@ -0,0 +1,207 @@ + +
| + | {{ $t("prompts.read") }} | +{{ $t("prompts.write") }} | +{{ $t("prompts.execute") }} | +
| {{ $t("prompts.owner") }} | ++ + | ++ + | ++ + | +
| {{ $t("prompts.group") }} | ++ + | ++ + | ++ + | +
| {{ $t("prompts.others") }} | ++ + | ++ + | ++ + | +
+ {{ permModeString }} ({{ permMode.toString(8) }})
+
+ + {{ $t("prompts.recursive") }} +
+