Skip to content

Commit 42112ca

Browse files
committed
webdav: interpret 'dcache-view.endpoints.webdav' as an override
Motivation: The admin may configure a specific WebDAV endpoint that should be used for all data transfers, and for the URL returned to the user (via a context menu). This is done with the `dcache-view.endpoints.webdav` (in configuration, which is exposed in dCache as the `frontend.static!dcache-view.endpoints.webdav` configuration property. Currently, 'dcache-view.endpoints.webdav' only takes effect if there are no auto-discovered doors; i.e., it is a fall-back. This isn't terribly useful -- a more useful behaviour would be as an override. Like this the value is used, if supplied by the admin, otherwise dCacheView will use a WebDAV door that it has discovered. Modification: Change the order of precedence: `dcache-view.endpoints.webdav` now has the highest precedence. If the admin specifies this, then it overrides the auto-discovered value. Result: The admin has more control over which WebDAV door dCacheView uses. Target: master Request: 1.6 Request: 1.5 Closes: #252 Patch: https://rb.dcache.org/r/12976/ Acked-by: Tigran Mkrtchyan
1 parent 6af5578 commit 42112ca

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/elements/dv-elements/utils/mixins/commons.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@
177177
} else {
178178
throw new TypeError("Invalid path: only absolute path is accepted.");
179179
}
180-
const arr = window.CONFIG["webdav"][operationType].length > 0 ?
181-
window.CONFIG["webdav"][operationType] : window.CONFIG["dcache-view.endpoints.webdav"] !== "" ?
182-
[window.CONFIG["dcache-view.endpoints.webdav"]] :
183-
[`${window.location.protocol}//${window.location.hostname}:2880`];
180+
const arr = window.CONFIG["dcache-view.endpoints.webdav"] !== ""
181+
? [window.CONFIG["dcache-view.endpoints.webdav"]]
182+
: window.CONFIG["webdav"][operationType].length > 0
183+
? window.CONFIG["webdav"][operationType]
184+
: [`${window.location.protocol}//${window.location.hostname}:2880`];
184185
const len = arr.length;
185186
const url = [];
186187
for (let i=0; i<len; i++) {
@@ -204,4 +205,4 @@
204205
}
205206
}
206207
})
207-
</script>
208+
</script>

src/scripts/dv.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,11 @@
478478
} else {
479479
throw new TypeError("Invalid path: only absolute path is accepted.");
480480
}
481-
const arr = window.CONFIG["webdav"][operationType].length > 0 ?
482-
window.CONFIG["webdav"][operationType] : window.CONFIG["dcache-view.endpoints.webdav"] !== "" ?
483-
[window.CONFIG["dcache-view.endpoints.webdav"]] :
484-
[`${window.location.protocol}//${window.location.hostname}:2880`];
481+
const arr = window.CONFIG["dcache-view.endpoints.webdav"] !== ""
482+
? [window.CONFIG["dcache-view.endpoints.webdav"]]
483+
: window.CONFIG["webdav"][operationType].length > 0
484+
? window.CONFIG["webdav"][operationType]
485+
: [`${window.location.protocol}//${window.location.hostname}:2880`];
485486
const len = arr.length;
486487
const url = [];
487488
for (let i=0; i<len; i++) {

0 commit comments

Comments
 (0)