diff --git a/apps/files_external/ajax/applicable.php b/apps/files_external/ajax/applicable.php deleted file mode 100644 index ece913ffc068a..0000000000000 --- a/apps/files_external/ajax/applicable.php +++ /dev/null @@ -1,42 +0,0 @@ -search($pattern, $limit, $offset) as $group) { - $groups[$group->getGID()] = $group->getDisplayName(); -} - -$users = []; -foreach (Server::get(IUserManager::class)->searchDisplayName($pattern, $limit, $offset) as $user) { - $users[$user->getUID()] = $user->getDisplayName(); -} - -$results = ['groups' => $groups, 'users' => $users]; - -\OC_JSON::success($results); diff --git a/apps/files_external/ajax/oauth2.php b/apps/files_external/ajax/oauth2.php deleted file mode 100644 index d961d41ea6bcc..0000000000000 --- a/apps/files_external/ajax/oauth2.php +++ /dev/null @@ -1,13 +0,0 @@ -getL10N('files_external'); - -// TODO: implement redirect to which storage backend requested this diff --git a/apps/files_external/appinfo/routes.php b/apps/files_external/appinfo/routes.php index 5602e1c0d11ea..fb695eafefead 100644 --- a/apps/files_external/appinfo/routes.php +++ b/apps/files_external/appinfo/routes.php @@ -6,13 +6,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ - -$this->create('files_external_oauth2', 'apps/files_external/ajax/oauth2.php') - ->actionInclude('files_external/ajax/oauth2.php'); - -$this->create('files_external_list_applicable', '/apps/files_external/applicable') - ->actionInclude('files_external/ajax/applicable.php'); - return [ 'resources' => [ 'global_storages' => ['url' => '/globalstorages'], @@ -20,11 +13,20 @@ 'user_global_storages' => ['url' => '/userglobalstorages'], ], 'routes' => [ + [ + 'name' => 'Ajax#getApplicableEntities', + 'url' => '/ajax/applicable', + 'verb' => 'GET', + ], + [ + 'name' => 'Ajax#oauth2Callback', + 'url' => '/ajax/oauth2.php', + 'verb' => 'GET', + ], [ 'name' => 'Ajax#getSshKeys', 'url' => '/ajax/public_key.php', 'verb' => 'POST', - 'requirements' => [], ], [ 'name' => 'Ajax#saveGlobalCredentials', diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php index 5cee642253010..2953ae8a056a0 100644 --- a/apps/files_external/lib/Controller/AjaxController.php +++ b/apps/files_external/lib/Controller/AjaxController.php @@ -17,6 +17,7 @@ use OCP\IGroupManager; use OCP\IL10N; use OCP\IRequest; +use OCP\IUserManager; use OCP\IUserSession; class AjaxController extends Controller { @@ -35,11 +36,45 @@ public function __construct( private GlobalAuth $globalAuth, private IUserSession $userSession, private IGroupManager $groupManager, + private IUserManager $userManager, private IL10N $l10n, ) { parent::__construct($appName, $request); } + + /** + * Legacy endpoint for oauth2 callback + */ + #[NoAdminRequired()] + public function oauth2Callback(): JSONResponse { + return new JSONResponse(['status' => 'success']); + } + + /** + * Returns a list of users and groups that match the given pattern. + * Used for user and group picker in the admin settings. + * + * @param string $pattern The search pattern + * @param int|null $limit The maximum number of results to return + * @param int|null $offset The offset from which to start returning results + * @return JSONResponse + */ + public function getApplicableEntities(string $pattern = '', ?int $limit = null, ?int $offset = null): JSONResponse { + $groups = []; + foreach ($this->groupManager->search($pattern, $limit, $offset) as $group) { + $groups[$group->getGID()] = $group->getDisplayName(); + } + + $users = []; + foreach ($this->userManager->searchDisplayName($pattern, $limit, $offset) as $user) { + $users[$user->getUID()] = $user->getDisplayName(); + } + + $results = ['groups' => $groups, 'users' => $users]; + return new JSONResponse($results); + } + /** * @param int $keyLength * @return array diff --git a/apps/files_external/src/settings.js b/apps/files_external/src/settings.js index 574dad35a3c75..08543fbc6a991 100644 --- a/apps/files_external/src/settings.js +++ b/apps/files_external/src/settings.js @@ -120,7 +120,7 @@ function initApplicableUsersMultiselect($elements, userListLimit) { dropdownCssClass: 'files-external-select2', // minimumInputLength: 1, ajax: { - url: OC.generateUrl('apps/files_external/applicable'), + url: OC.generateUrl('apps/files_external/ajax/applicable'), dataType: 'json', quietMillis: 100, data(term, page) { // page is the one-based page number tracked by Select2 @@ -131,26 +131,21 @@ function initApplicableUsersMultiselect($elements, userListLimit) { } }, results(data) { - if (data.status === 'success') { - - const results = [] - let userCount = 0 // users is an object + const results = [] + let userCount = 0 // users is an object - // add groups - $.each(data.groups, function(gid, group) { - results.push({ name: gid + '(group)', displayname: group, type: 'group' }) - }) - // add users - $.each(data.users, function(id, user) { - userCount++ - results.push({ name: id, displayname: user, type: 'user' }) - }) + // add groups + $.each(data.groups, function(gid, group) { + results.push({ name: gid + '(group)', displayname: group, type: 'group' }) + }) + // add users + $.each(data.users, function(id, user) { + userCount++ + results.push({ name: id, displayname: user, type: 'user' }) + }) - const more = (userCount >= userListLimit) || (data.groups.length >= userListLimit) - return { results, more } - } else { - // FIXME add error handling - } + const more = (userCount >= userListLimit) || (data.groups.length >= userListLimit) + return { results, more } }, }, initSelection(element, callback) { diff --git a/apps/files_external/tests/Controller/AjaxControllerTest.php b/apps/files_external/tests/Controller/AjaxControllerTest.php index b1ea7a2b1b1b6..144564df61dc3 100644 --- a/apps/files_external/tests/Controller/AjaxControllerTest.php +++ b/apps/files_external/tests/Controller/AjaxControllerTest.php @@ -15,6 +15,7 @@ use OCP\IL10N; use OCP\IRequest; use OCP\IUser; +use OCP\IUserManager; use OCP\IUserSession; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; @@ -25,6 +26,7 @@ class AjaxControllerTest extends TestCase { private GlobalAuth&MockObject $globalAuth; private IUserSession&MockObject $userSession; private IGroupManager&MockObject $groupManager; + private IUserManager&MockObject $userManager; private IL10N&MockObject $l10n; private AjaxController $ajaxController; @@ -34,6 +36,7 @@ protected function setUp(): void { $this->globalAuth = $this->createMock(GlobalAuth::class); $this->userSession = $this->createMock(IUserSession::class); $this->groupManager = $this->createMock(IGroupManager::class); + $this->userManager = $this->createMock(IUserManager::class); $this->l10n = $this->createMock(IL10N::class); $this->ajaxController = new AjaxController( @@ -43,6 +46,7 @@ protected function setUp(): void { $this->globalAuth, $this->userSession, $this->groupManager, + $this->userManager, $this->l10n, ); diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 58bcde00400e5..032fcd92a8e09 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1339,27 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/files_external-settings.js b/dist/files_external-settings.js index e5332033c374e..522c1e3d85033 100644 --- a/dist/files_external-settings.js +++ b/dist/files_external-settings.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t,n,s={80655:(e,t,n)=>{var s=n(56760),a=n(63814),i=n(85168),o=n(53334),r=n(65043),l=n(74692),c=n.n(l);function d(e,t){return e.toggleClass("warning-input",t),t}function u(e){const t=e.hasClass("optional");switch(e.attr("type")){case"text":case"password":if(""===e.val()&&!t)return!1}return!0}function p(e){switch(e.attr("type")){case"text":case"password":return d(e,!u(e))}}function h(e,t){const n=function(e){return e.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")};if(e.length)return e.select2({placeholder:(0,o.t)("files_external","Type to select account or group."),allowClear:!0,multiple:!0,toggleSelect:!0,dropdownCssClass:"files-external-select2",ajax:{url:OC.generateUrl("apps/files_external/applicable"),dataType:"json",quietMillis:100,data:(e,n)=>({pattern:e,limit:t,offset:t*(n-1)}),results(e){if("success"===e.status){const n=[];let s=0;$.each(e.groups,function(e,t){n.push({name:e+"(group)",displayname:t,type:"group"})}),$.each(e.users,function(e,t){s++,n.push({name:e,displayname:t,type:"user"})});const a=s>=t||e.groups.length>=t;return{results:n,more:a}}}},initSelection(e,t){const n={users:[]},s=e.val().split(",");for(let e=0;ee.name,formatResult(e){const t=$('
'+n(e.displayname)+"
"),s=t.find(".avatardiv").attr("data-type",e.type).attr("data-name",e.name).attr("data-displayname",e.displayname);if("group"===e.type){const e=OC.imagePath("core","actions/group");s.html('')}return t.get(0).outerHTML},formatSelection:e=>"group"===e.type?''+n(e.displayname+" "+(0,o.t)("files_external","(Group)"))+"":''+n(e.displayname)+"",escapeMarkup:e=>e}).on("select2-loaded",function(){$.each($(".avatardiv"),function(e,t){const n=$(t);"user"===n.data("type")&&n.avatar(n.data("name"),32)})}).on("change",function(e){d($(e.target).closest(".applicableUsersContainer").find(".select2-choices"),!e.val.length)})}(0,s.IF)(r.Ay);const f=function(e){this.id=e,this.backendOptions={}};f.Status={IN_PROGRESS:-1,SUCCESS:0,ERROR:1,INDETERMINATE:2},f.Visibility={NONE:0,PERSONAL:1,ADMIN:2,DEFAULT:3},f.prototype={_url:null,id:null,mountPoint:"",backend:null,authMechanism:null,backendOptions:null,mountOptions:null,save(e){let t=OC.generateUrl(this._url),n="POST";_.isNumber(this.id)&&(n="PUT",t=OC.generateUrl(this._url+"/{id}",{id:this.id})),this._save(n,t,e)},async _save(e,t,n){try{const a=(await r.Ay.request({confirmPassword:s.mH.Strict,method:e,url:t,data:this.getData()})).data;this.id=a.id,n.success(a)}catch(e){n.error(e)}},getData(){const e={mountPoint:this.mountPoint,backend:this.backend,authMechanism:this.authMechanism,backendOptions:this.backendOptions,testOnly:!0};return this.id&&(e.id=this.id),this.mountOptions&&(e.mountOptions=this.mountOptions),e},recheck(e){_.isNumber(this.id)?$.ajax({type:"GET",url:OC.generateUrl(this._url+"/{id}",{id:this.id}),data:{testOnly:!0},success:e.success,error:e.error}):_.isFunction(e.error)&&e.error()},async destroy(e){if(_.isNumber(this.id))try{await r.Ay.request({method:"DELETE",url:OC.generateUrl(this._url+"/{id}",{id:this.id}),confirmPassword:s.mH.Strict}),e.success()}catch(t){e.error(t)}else _.isFunction(e.success)&&e.success()},validate(){return""!==this.mountPoint&&!!this.backend&&!this.errors}};const g=function(e){this.id=e,this.applicableUsers=[],this.applicableGroups=[]};g.prototype=_.extend({},f.prototype,{_url:"apps/files_external/globalstorages",applicableUsers:null,applicableGroups:null,priority:null,getData(){const e=f.prototype.getData.apply(this,arguments);return _.extend(e,{applicableUsers:this.applicableUsers,applicableGroups:this.applicableGroups,priority:this.priority})}});const m=function(e){this.id=e};m.prototype=_.extend({},f.prototype,{_url:"apps/files_external/userstorages"});const b=function(e){this.id=e};b.prototype=_.extend({},f.prototype,{_url:"apps/files_external/userglobalstorages"});const v=function(){};v.prototype={$el:null,show(e,t,n){v._last&&v._last.hide();const s=$(OCA.Files_External.Templates.mountOptionsDropDown({mountOptionsEncodingLabel:(0,o.t)("files_external","Compatibility with Mac NFD encoding (slow)"),mountOptionsEncryptLabel:(0,o.t)("files_external","Enable encryption"),mountOptionsPreviewsLabel:(0,o.t)("files_external","Enable previews"),mountOptionsSharingLabel:(0,o.t)("files_external","Enable sharing"),mountOptionsFilesystemCheckLabel:(0,o.t)("files_external","Check for changes"),mountOptionsFilesystemCheckOnce:(0,o.t)("files_external","Never"),mountOptionsFilesystemCheckDA:(0,o.t)("files_external","Once every direct access"),mountOptionsReadOnlyLabel:(0,o.t)("files_external","Read only"),deleteLabel:(0,o.t)("files_external","Disconnect")}));this.$el=s;const a=e[0].parentNode.className;this.setOptions(t,n,a),this.$el.appendTo(e),v._last=this,this.$el.trigger("show")},hide(){this.$el&&(this.$el.trigger("hide"),this.$el.remove(),this.$el=null,v._last=null)},getOptions(){const e={};return this.$el.find("input, select").each(function(){const t=$(this),n=t.attr("name");let s=null;s="checkbox"===t.attr("type")?t.prop("checked"):t.val(),"int"===t.attr("data-type")&&(s=parseInt(s,10)),e[n]=s}),e},setOptions(e,t,n){if("owncloud"===n){const e=t.indexOf("encrypt");e>0&&t.splice(e,1)}const s=this.$el;_.each(e,function(e,t){const n=s.find("input, select").filterAttr("name",t);"checkbox"===n.attr("type")?(_.isString(e)&&(e="true"===e),n.prop("checked",!!e)):n.val(e)}),s.find(".optionRow").each(function(e,n){const s=$(n),a=s.find("input, select").attr("name");-1!==t.indexOf(a)||s.hasClass("persistent")?s.show():s.hide()})}};const y=function(e,t){this.initialize(e,t)};y.ParameterFlags={OPTIONAL:1,USER_PROVIDED:2,HIDDEN:4},y.ParameterTypes={TEXT:0,BOOLEAN:1,PASSWORD:2},y.prototype=_.extend({$el:null,_storageConfigClass:null,_isPersonal:!1,_userListLimit:30,_allBackends:null,_allAuthMechanisms:null,_encryptionEnabled:!1,initialize(e,t){this.$el=e,this._isPersonal=!0!==e.data("admin"),this._isPersonal?this._storageConfigClass=OCA.Files_External.Settings.UserStorageConfig:this._storageConfigClass=OCA.Files_External.Settings.GlobalStorageConfig,t&&!_.isUndefined(t.userListLimit)&&(this._userListLimit=t.userListLimit),this._encryptionEnabled=t.encryptionEnabled,this._canCreateLocal=t.canCreateLocal,this._allBackends=this.$el.find(".selectBackend").data("configurations"),this._allAuthMechanisms=this.$el.find("#addMountPoint .authentication").data("mechanisms"),this._initEvents()},whenSelectBackend(e){this.$el.find("tbody tr:not(#addMountPoint):not(.externalStorageLoading)").each(function(t,n){const s=$(n).find(".backend").data("identifier");e($(n),s)}),this.on("selectBackend",e)},whenSelectAuthMechanism(e){const t=this;this.$el.find("tbody tr:not(#addMountPoint):not(.externalStorageLoading)").each(function(n,s){const a=$(s).find(".selectAuthMechanism").val();e($(s),a,t._allAuthMechanisms[a].scheme)}),this.on("selectAuthMechanism",e)},_initEvents(){const e=this,t=_.bind(this._onChange,this);this.$el.on("keyup","td input",t),this.$el.on("paste","td input",t),this.$el.on("change","td input:checkbox",t),this.$el.on("change",".applicable",t),this.$el.on("click",".status>span",function(){e.recheckStorageConfig($(this).closest("tr"))}),this.$el.on("click","td.mountOptionsToggle .icon-delete",function(){e.deleteStorageConfig($(this).closest("tr"))}),this.$el.on("click","td.save>.icon-checkmark",function(){e.saveStorageConfig($(this).closest("tr"))}),this.$el.on("click","td.mountOptionsToggle>.icon-more",function(){$(this).attr("aria-expanded","true"),e._showMountOptionsDropdown($(this).closest("tr"))}),this.$el.on("change",".selectBackend",_.bind(this._onSelectBackend,this)),this.$el.on("change",".selectAuthMechanism",_.bind(this._onSelectAuthMechanism,this)),this.$el.on("change",".applicableToAllUsers",_.bind(this._onChangeApplicableToAllUsers,this))},_onChange(e){const t=$(e.target);if(t.closest(".dropdown").length)return;p(t);const n=t.closest("tr");this.updateStatus(n,null)},_onSelectBackend(e){const t=$(e.target);let n=t.closest("tr");const s=new this._storageConfigClass;s.mountPoint=n.find(".mountPoint input").val(),s.backend=t.val(),n.find(".mountPoint input").val(""),n.find(".selectBackend").prop("selectedIndex",0);const a=c().Deferred();n=this.newStorage(s,a),n.find(".applicableToAllUsers").prop("checked",!1).trigger("change"),a.resolve(),n.find("td.configuration").children().not("[type=hidden]").first().focus(),this.saveStorageConfig(n)},_onSelectAuthMechanism(e){const t=$(e.target),n=t.closest("tr"),s=t.val(),a=c().Deferred();this.configureAuthMechanism(n,s,a),a.resolve(),this.saveStorageConfig(n)},_onChangeApplicableToAllUsers(e){const t=$(e.target),n=t.closest("tr"),s=t.is(":checked");n.find(".applicableUsersContainer").toggleClass("hidden",s),s||n.find(".applicableUsers").select2("val","",!0),this.saveStorageConfig(n)},configureAuthMechanism(e,t,n){const s=this._allAuthMechanisms[t],a=e.find("td.configuration");a.find(".auth-param").remove(),$.each(s.configuration,_.partial(this.writeParameterInput,a,_,_,["auth-param"]).bind(this)),this.trigger("selectAuthMechanism",e,t,s.scheme,n)},newStorage(e,t,n){let s=e.mountPoint,a=this._allBackends[e.backend];a||(a={name:"Unknown: "+e.backend,invalid:!0});const i=this.$el.find("tr#addMountPoint"),r=i.clone();if(n||r.insertBefore(i),r.data("storageConfig",e),r.show(),r.find("td.mountOptionsToggle, td.save, td.remove").removeClass("hidden"),r.find("td").last().removeAttr("style"),r.removeAttr("id"),r.find("select#selectBackend"),n||h(r.find(".applicableUsers"),this._userListLimit),e.id&&r.data("id",e.id),r.find(".backend").text(a.name),""===s&&(s=this._suggestMountPoint(a.name)),r.find(".mountPoint input").val(s),r.addClass(a.identifier),r.find(".backend").data("identifier",a.identifier),a.invalid||"local"===a.identifier&&!this._canCreateLocal)return r.find("[name=mountPoint]").prop("disabled",!0),r.find(".applicable,.mountOptionsToggle").empty(),r.find(".save").empty(),a.invalid&&this.updateStatus(r,!1,(0,o.t)("files_external","Unknown backend: {backendName}",{backendName:a.name})),r;const l=$(''),c=this._isPersonal?f.Visibility.PERSONAL:f.Visibility.ADMIN;$.each(this._allAuthMechanisms,function(e,t){a.authSchemes[t.scheme]&&t.visibility&c&&l.append($('"))}),e.authMechanism?l.val(e.authMechanism):e.authMechanism=l.val(),r.find("td.authentication").append(l);const d=r.find("td.configuration");$.each(a.configuration,_.partial(this.writeParameterInput,d).bind(this)),this.trigger("selectBackend",r,a.identifier,t),this.configureAuthMechanism(r,e.authMechanism,t),e.backendOptions&&d.find("input, select").each(function(){const t=$(this),n=e.backendOptions[t.data("parameter")];void 0!==n&&(t.is("input:checkbox")&&t.prop("checked",n),t.val(e.backendOptions[t.data("parameter")]),p(t))});let u=[];e.applicableUsers&&(u=u.concat(e.applicableUsers)),e.applicableGroups&&(u=u.concat(_.map(e.applicableGroups,function(e){return e+"(group)"}))),u.length?(r.find(".applicableUsers").val(u).trigger("change"),r.find(".applicableUsersContainer").removeClass("hidden")):r.find(".applicableUsersContainer").addClass("hidden"),r.find(".applicableToAllUsers").prop("checked",!u.length);const g=$('');return r.append(g),e.mountOptions?r.find("input.mountOptions").val(JSON.stringify(e.mountOptions)):r.find("input.mountOptions").val(JSON.stringify({encrypt:!0,previews:!0,enable_sharing:!1,filesystem_check_changes:1,encoding_compatibility:!1,readonly:!1})),r},loadStorages(){const e=this,t=$.Deferred(),n=$.Deferred();this.$el.find(".externalStorageLoading").removeClass("hidden"),$.when(t,n).always(()=>{e.$el.find(".externalStorageLoading").addClass("hidden")}),this._isPersonal?$.ajax({type:"GET",url:OC.generateUrl("apps/files_external/userglobalstorages"),data:{testOnly:!0},contentType:"application/json",success(n){n=Object.values(n);const s=c().Deferred();let a=$();n.forEach(function(t){let i;const r="system"===t.type&&e._isPersonal;t.mountPoint=t.mountPoint.substr(1),i=r?new b:new e._storageConfigClass,_.extend(i,t);const l=e.newStorage(i,s,!0);l.detach(),e.$el.prepend(l);const c=l.find(".authentication");c.text(c.find("select option:selected").text()),l.find(".mountOptionsToggle, .remove").empty(),l.find("input:not(.user_provided), select:not(.user_provided)").attr("disabled","disabled"),r?l.find(".configuration").find(":not(.user_provided)").remove():l.find(".configuration").text((0,o.t)("files_external","Admin defined")),n.length<20?e.recheckStorageConfig(l):e.updateStatus(l,f.Status.INDETERMINATE,(0,o.t)("files_external","Automatic status checking is disabled due to the large number of configured storages, click to check status")),a=a.add(l)}),h(e.$el.find(".applicableUsers"),this._userListLimit),e.$el.find("tr#addMountPoint").before(a);const i=$("#files_external");0===n.length&&"false"===i.attr("data-can-create")&&(i.hide(),$('a[href="#external-storage"]').parent().hide(),$(".emptycontent").show()),s.resolve(),t.resolve()}}):t.resolve();const s=this._storageConfigClass.prototype._url;$.ajax({type:"GET",url:OC.generateUrl(s),contentType:"application/json",success(t){t=Object.values(t);const s=c().Deferred();let a=$();t.forEach(function(n){n.mountPoint="/"===n.mountPoint?"/":n.mountPoint.substr(1);const i=new e._storageConfigClass;_.extend(i,n);const r=e.newStorage(i,s,!0);t.length<20?e.recheckStorageConfig(r):e.updateStatus(r,f.Status.INDETERMINATE,(0,o.t)("files_external","Automatic status checking is disabled due to the large number of configured storages, click to check status")),a=a.add(r)}),h(a.find(".applicableUsers"),this._userListLimit),e.$el.find("tr#addMountPoint").before(a),s.resolve(),n.resolve()}})},writeParameterInput(e,t,n,s){const a=function(e){return(n.flags&e)===e};if((s=$.isArray(s)?s:[]).push("added"),a(y.ParameterFlags.OPTIONAL)&&s.push("optional"),a(y.ParameterFlags.USER_PROVIDED)){if(!this._isPersonal)return;s.push("user_provided")}let i;const o=n.value;if(a(y.ParameterFlags.HIDDEN))i=$('');else if(n.type===y.ParameterTypes.PASSWORD)i=$('');else if(n.type===y.ParameterTypes.BOOLEAN){const e=_.uniqueId("checkbox_");i=$('
")}else i=$('');return n.defaultValue&&(n.type===y.ParameterTypes.BOOLEAN?i.find("input").prop("checked",n.defaultValue):i.val(n.defaultValue)),n.tooltip&&i.attr("title",n.tooltip),p(i),e.append(i),i},getStorageConfig(e){let t=e.data("id");t||(t=null);let n=e.data("storageConfig");n||(n=new this._storageConfigClass(t)),n.errors=null,n.mountPoint=e.find(".mountPoint input").val(),n.backend=e.find(".backend").data("identifier"),n.authMechanism=e.find(".selectAuthMechanism").val();const s={},a=e.find(".configuration input"),i=[];if($.each(a,function(e,t){const n=$(t),a=n.data("parameter");"button"!==n.attr("type")&&(u(n)||n.hasClass("optional")?$(t).is(":checkbox")?$(t).is(":checked")?s[a]=!0:s[a]=!1:s[a]=$(t).val():i.push(a))}),n.backendOptions=s,i.length&&(n.errors={backendOptions:i}),!this._isPersonal){const t=function(e){const t=[],n=[],s=function(e){let t=e.find(".applicableUsers").select2("val");return t&&0!==t.length||(t=[]),t}(e);return $.each(s,function(e,s){const a=s.indexOf?s.indexOf("(group)"):-1;-1!==a?n.push(s.substr(0,a)):t.push(s)}),e.find(".applicable").data("applicable-groups",n).data("applicable-users",t),{users:t,groups:n}}(e),s=t.users||[],a=t.groups||[];e.find(".applicableToAllUsers").is(":checked")?(n.applicableUsers=[],n.applicableGroups=[]):(n.applicableUsers=s,n.applicableGroups=a,n.applicableUsers.length||n.applicableGroups.length||(n.errors||(n.errors={}),n.errors.requiredApplicable=!0)),n.priority=parseInt(e.find("input.priority").val()||"100",10)}const o=e.find("input.mountOptions").val();return o&&(n.mountOptions=JSON.parse(o)),n},deleteStorageConfig(e){const t=this,n=e.data("id");if(!_.isNumber(n))return void e.remove();const s=new this._storageConfigClass(n);OC.dialogs.confirm((0,o.t)("files_external","Are you sure you want to disconnect this external storage?")+" "+(0,o.t)("files_external","It will make the storage unavailable in {instanceName} and will lead to a deletion of these files and folders on any sync client that is currently connected but will not delete any files and folders on the external storage itself.",{storage:this.mountPoint,instanceName:window.OC.theme.name}),(0,o.t)("files_external","Delete storage?"),function(n){n&&(t.updateStatus(e,f.Status.IN_PROGRESS),s.destroy({success(){e.remove()},error(n){const s=n&&n.responseJSON?n.responseJSON.message:void 0;t.updateStatus(e,f.Status.ERROR,s)}}))})},saveStorageConfig(e,t,n){const s=this,a=this.getStorageConfig(e);if(!a||!a.validate())return!1;this.updateStatus(e,f.Status.IN_PROGRESS),a.save({success(i){void 0!==n&&e.data("save-timer")!==n||(s.updateStatus(e,i.status,i.statusMessage),e.data("id",i.id),_.isFunction(t)&&t(a))},error(t){if(void 0===n||e.data("save-timer")===n){const n=t&&t.responseJSON?t.responseJSON.message:void 0;s.updateStatus(e,f.Status.ERROR,n)}}})},recheckStorageConfig(e){const t=this,n=this.getStorageConfig(e);if(!n.validate())return!1;this.updateStatus(e,f.Status.IN_PROGRESS),n.recheck({success(n){t.updateStatus(e,n.status,n.statusMessage)},error(n){const s=n&&n.responseJSON?n.responseJSON.message:void 0;t.updateStatus(e,f.Status.ERROR,s)}})},updateStatus(e,t,n){const s=e.find(".status span");switch(t){case null:s.hide();break;case f.Status.IN_PROGRESS:s.attr("class","icon-loading-small");break;case f.Status.SUCCESS:s.attr("class","success icon-checkmark-white");break;case f.Status.INDETERMINATE:s.attr("class","indeterminate icon-info-white");break;default:s.attr("class","error icon-error-white")}null!==t&&s.show(),"string"!=typeof n&&(n=(0,o.t)("files_external","Click to recheck the configuration")),s.attr("title",n)},_suggestMountPoint(e){const t=this.$el,n=e.indexOf("/");-1!==n&&(e=e.substring(0,n)),e=e.replace(/\s+/g,"");let s=1,a="",i=!0;for(;i&&s<20&&(i=!1,t.find("tbody td.mountPoint input").each(function(t,n){if($(n).val()===e+a)return i=!0,!1}),i);)a=s,s++;return e+a},_showMountOptionsDropdown(e){const t=this,n=this.getStorageConfig(e),s=e.find(".mountOptionsToggle"),a=new v,i=["previews","filesystem_check_changes","enable_sharing","encoding_compatibility","readonly","delete"];this._encryptionEnabled&&i.push("encrypt"),a.show(s,n.mountOptions||[],i),$("body").on("mouseup.mountOptionsDropdown",function(e){$(e.target).closest(".popovermenu").length||a.hide()}),a.$el.on("hide",function(){const n=a.getOptions();$("body").off("mouseup.mountOptionsDropdown"),e.find("input.mountOptions").val(JSON.stringify(n)),e.find("td.mountOptionsToggle>.icon-more").attr("aria-expanded","false"),t.saveStorageConfig(e)})}},OC.Backbone.Events),window.addEventListener("DOMContentLoaded",function(){const e=$("#files_external").attr("data-encryption-enabled"),t=$("#files_external").attr("data-can-create-local"),n="true"===e,l=new y($("#externalStorage"),{encryptionEnabled:n,canCreateLocal:"true"===t});l.loadStorages();const c=$("#allowUserMounting");c.bind("change",function(){OC.msg.startSaving("#userMountingMsg"),this.checked?(OCP.AppConfig.setValue("files_external","allow_user_mounting","yes"),$('input[name="allowUserMountingBackends\\[\\]"]').prop("checked",!0),$("#userMountingBackends").removeClass("hidden"),$('input[name="allowUserMountingBackends\\[\\]"]').eq(0).trigger("change")):(OCP.AppConfig.setValue("files_external","allow_user_mounting","no"),$("#userMountingBackends").addClass("hidden")),OC.msg.finishedSaving("#userMountingMsg",{status:"success",data:{message:(0,o.t)("files_external","Saved")}})}),$('input[name="allowUserMountingBackends\\[\\]"]').bind("change",function(){OC.msg.startSaving("#userMountingMsg");let e=$('input[name="allowUserMountingBackends\\[\\]"]:checked').map(function(){return $(this).val()}).get();const t=$('input[name="allowUserMountingBackends\\[\\]"][data-deprecate-to]').map(function(){return-1!==$.inArray($(this).data("deprecate-to"),e)?$(this).val():null}).get();e=e.concat(t),OCP.AppConfig.setValue("files_external","user_mounting_backends",e.join()),OC.msg.finishedSaving("#userMountingMsg",{status:"success",data:{message:(0,o.t)("files_external","Saved")}}),0===e.length&&(c.prop("checked",!1),c.trigger("change"))}),$("#global_credentials").on("submit",async function(e){e.preventDefault();const t=$(this),n=t.find("[type=submit]");n.val((0,o.t)("files_external","Saving …"));const l=t.find("[name=uid]").val(),c=t.find("[name=username]").val(),d=t.find("[name=password]").val();try{await r.Ay.request({method:"POST",data:{uid:l,user:c,password:d},url:(0,a.Jv)("apps/files_external/globalcredentials"),confirmPassword:s.mH.Strict}),n.val((0,o.t)("files_external","Saved")),setTimeout(function(){n.val((0,o.t)("files_external","Save"))},2500)}catch(e){if(n.val((0,o.t)("files_external","Save")),(0,r.F0)(e)){const t=e.response?.data?.message||(0,o.t)("files_external","Failed to save global credentials");(0,i.Qg)((0,o.t)("files_external","Failed to save global credentials: {message}",{message:t}))}}return!1}),OCA.Files_External.Settings.mountConfig=l,OC.MountConfig={saveStorage:_.bind(l.saveStorageConfig,l)}}),OCA.Files_External=OCA.Files_External||{},OCA.Files_External.Settings=OCA.Files_External.Settings||{},OCA.Files_External.Settings.GlobalStorageConfig=g,OCA.Files_External.Settings.UserStorageConfig=m,OCA.Files_External.Settings.MountConfigListView=y}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return s[e].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}i.m=s,e=[],i.O=(t,n,s,a)=>{if(!n){var o=1/0;for(d=0;d=a)&&Object.keys(i.O).every(e=>i.O[e](n[l]))?n.splice(l--,1):(r=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[n,s,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>e+"-"+e+".js?v="+{640:"d4c5c018803ee8751b2a",780:"e3ee44fa7690af29d8d7",3564:"29e8338d43e0d4bd3995",5810:"b550a24d46f75f92c2d5",7471:"6423b9b898ffefeb7d1d"}[e],i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="nextcloud:",i.l=(e,s,a,o)=>{if(t[e])t[e].push(s);else{var r,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),d=0;d{r.onerror=r.onload=null,clearTimeout(h);var a=t[e];if(delete t[e],r.parentNode&&r.parentNode.removeChild(r),a&&a.forEach(e=>e(s)),n)return n(s)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=5808,(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var s=n.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{i.b=document.baseURI||self.location.href;var e={5808:0};i.f.j=(t,n)=>{var s=i.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var a=new Promise((n,a)=>s=e[t]=[n,a]);n.push(s[2]=a);var o=i.p+i.u(t),r=new Error;i.l(o,n=>{if(i.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",r.name="ChunkLoadError",r.type=a,r.request=o,s[1](r)}},"chunk-"+t,t)}},i.O.j=t=>0===e[t];var t=(t,n)=>{var s,a,o=n[0],r=n[1],l=n[2],c=0;if(o.some(t=>0!==e[t])){for(s in r)i.o(r,s)&&(i.m[s]=r[s]);if(l)var d=l(i)}for(t&&t(n);ci(80655));o=i.O(o)})(); -//# sourceMappingURL=files_external-settings.js.map?v=aa025a3435f99b76fe24 \ No newline at end of file +(()=>{"use strict";var e,t,n,s={80655:(e,t,n)=>{var s=n(56760),a=n(63814),i=n(85168),o=n(53334),r=n(65043),l=n(74692),c=n.n(l);function d(e,t){return e.toggleClass("warning-input",t),t}function u(e){const t=e.hasClass("optional");switch(e.attr("type")){case"text":case"password":if(""===e.val()&&!t)return!1}return!0}function p(e){switch(e.attr("type")){case"text":case"password":return d(e,!u(e))}}function h(e,t){const n=function(e){return e.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")};if(e.length)return e.select2({placeholder:(0,o.t)("files_external","Type to select account or group."),allowClear:!0,multiple:!0,toggleSelect:!0,dropdownCssClass:"files-external-select2",ajax:{url:OC.generateUrl("apps/files_external/ajax/applicable"),dataType:"json",quietMillis:100,data:(e,n)=>({pattern:e,limit:t,offset:t*(n-1)}),results(e){const n=[];let s=0;$.each(e.groups,function(e,t){n.push({name:e+"(group)",displayname:t,type:"group"})}),$.each(e.users,function(e,t){s++,n.push({name:e,displayname:t,type:"user"})});const a=s>=t||e.groups.length>=t;return{results:n,more:a}}},initSelection(e,t){const n={users:[]},s=e.val().split(",");for(let e=0;ee.name,formatResult(e){const t=$('
'+n(e.displayname)+"
"),s=t.find(".avatardiv").attr("data-type",e.type).attr("data-name",e.name).attr("data-displayname",e.displayname);if("group"===e.type){const e=OC.imagePath("core","actions/group");s.html('')}return t.get(0).outerHTML},formatSelection:e=>"group"===e.type?''+n(e.displayname+" "+(0,o.t)("files_external","(Group)"))+"":''+n(e.displayname)+"",escapeMarkup:e=>e}).on("select2-loaded",function(){$.each($(".avatardiv"),function(e,t){const n=$(t);"user"===n.data("type")&&n.avatar(n.data("name"),32)})}).on("change",function(e){d($(e.target).closest(".applicableUsersContainer").find(".select2-choices"),!e.val.length)})}(0,s.IF)(r.Ay);const f=function(e){this.id=e,this.backendOptions={}};f.Status={IN_PROGRESS:-1,SUCCESS:0,ERROR:1,INDETERMINATE:2},f.Visibility={NONE:0,PERSONAL:1,ADMIN:2,DEFAULT:3},f.prototype={_url:null,id:null,mountPoint:"",backend:null,authMechanism:null,backendOptions:null,mountOptions:null,save(e){let t=OC.generateUrl(this._url),n="POST";_.isNumber(this.id)&&(n="PUT",t=OC.generateUrl(this._url+"/{id}",{id:this.id})),this._save(n,t,e)},async _save(e,t,n){try{const a=(await r.Ay.request({confirmPassword:s.mH.Strict,method:e,url:t,data:this.getData()})).data;this.id=a.id,n.success(a)}catch(e){n.error(e)}},getData(){const e={mountPoint:this.mountPoint,backend:this.backend,authMechanism:this.authMechanism,backendOptions:this.backendOptions,testOnly:!0};return this.id&&(e.id=this.id),this.mountOptions&&(e.mountOptions=this.mountOptions),e},recheck(e){_.isNumber(this.id)?$.ajax({type:"GET",url:OC.generateUrl(this._url+"/{id}",{id:this.id}),data:{testOnly:!0},success:e.success,error:e.error}):_.isFunction(e.error)&&e.error()},async destroy(e){if(_.isNumber(this.id))try{await r.Ay.request({method:"DELETE",url:OC.generateUrl(this._url+"/{id}",{id:this.id}),confirmPassword:s.mH.Strict}),e.success()}catch(t){e.error(t)}else _.isFunction(e.success)&&e.success()},validate(){return""!==this.mountPoint&&!!this.backend&&!this.errors}};const g=function(e){this.id=e,this.applicableUsers=[],this.applicableGroups=[]};g.prototype=_.extend({},f.prototype,{_url:"apps/files_external/globalstorages",applicableUsers:null,applicableGroups:null,priority:null,getData(){const e=f.prototype.getData.apply(this,arguments);return _.extend(e,{applicableUsers:this.applicableUsers,applicableGroups:this.applicableGroups,priority:this.priority})}});const m=function(e){this.id=e};m.prototype=_.extend({},f.prototype,{_url:"apps/files_external/userstorages"});const b=function(e){this.id=e};b.prototype=_.extend({},f.prototype,{_url:"apps/files_external/userglobalstorages"});const v=function(){};v.prototype={$el:null,show(e,t,n){v._last&&v._last.hide();const s=$(OCA.Files_External.Templates.mountOptionsDropDown({mountOptionsEncodingLabel:(0,o.t)("files_external","Compatibility with Mac NFD encoding (slow)"),mountOptionsEncryptLabel:(0,o.t)("files_external","Enable encryption"),mountOptionsPreviewsLabel:(0,o.t)("files_external","Enable previews"),mountOptionsSharingLabel:(0,o.t)("files_external","Enable sharing"),mountOptionsFilesystemCheckLabel:(0,o.t)("files_external","Check for changes"),mountOptionsFilesystemCheckOnce:(0,o.t)("files_external","Never"),mountOptionsFilesystemCheckDA:(0,o.t)("files_external","Once every direct access"),mountOptionsReadOnlyLabel:(0,o.t)("files_external","Read only"),deleteLabel:(0,o.t)("files_external","Disconnect")}));this.$el=s;const a=e[0].parentNode.className;this.setOptions(t,n,a),this.$el.appendTo(e),v._last=this,this.$el.trigger("show")},hide(){this.$el&&(this.$el.trigger("hide"),this.$el.remove(),this.$el=null,v._last=null)},getOptions(){const e={};return this.$el.find("input, select").each(function(){const t=$(this),n=t.attr("name");let s=null;s="checkbox"===t.attr("type")?t.prop("checked"):t.val(),"int"===t.attr("data-type")&&(s=parseInt(s,10)),e[n]=s}),e},setOptions(e,t,n){if("owncloud"===n){const e=t.indexOf("encrypt");e>0&&t.splice(e,1)}const s=this.$el;_.each(e,function(e,t){const n=s.find("input, select").filterAttr("name",t);"checkbox"===n.attr("type")?(_.isString(e)&&(e="true"===e),n.prop("checked",!!e)):n.val(e)}),s.find(".optionRow").each(function(e,n){const s=$(n),a=s.find("input, select").attr("name");-1!==t.indexOf(a)||s.hasClass("persistent")?s.show():s.hide()})}};const y=function(e,t){this.initialize(e,t)};y.ParameterFlags={OPTIONAL:1,USER_PROVIDED:2,HIDDEN:4},y.ParameterTypes={TEXT:0,BOOLEAN:1,PASSWORD:2},y.prototype=_.extend({$el:null,_storageConfigClass:null,_isPersonal:!1,_userListLimit:30,_allBackends:null,_allAuthMechanisms:null,_encryptionEnabled:!1,initialize(e,t){this.$el=e,this._isPersonal=!0!==e.data("admin"),this._isPersonal?this._storageConfigClass=OCA.Files_External.Settings.UserStorageConfig:this._storageConfigClass=OCA.Files_External.Settings.GlobalStorageConfig,t&&!_.isUndefined(t.userListLimit)&&(this._userListLimit=t.userListLimit),this._encryptionEnabled=t.encryptionEnabled,this._canCreateLocal=t.canCreateLocal,this._allBackends=this.$el.find(".selectBackend").data("configurations"),this._allAuthMechanisms=this.$el.find("#addMountPoint .authentication").data("mechanisms"),this._initEvents()},whenSelectBackend(e){this.$el.find("tbody tr:not(#addMountPoint):not(.externalStorageLoading)").each(function(t,n){const s=$(n).find(".backend").data("identifier");e($(n),s)}),this.on("selectBackend",e)},whenSelectAuthMechanism(e){const t=this;this.$el.find("tbody tr:not(#addMountPoint):not(.externalStorageLoading)").each(function(n,s){const a=$(s).find(".selectAuthMechanism").val();e($(s),a,t._allAuthMechanisms[a].scheme)}),this.on("selectAuthMechanism",e)},_initEvents(){const e=this,t=_.bind(this._onChange,this);this.$el.on("keyup","td input",t),this.$el.on("paste","td input",t),this.$el.on("change","td input:checkbox",t),this.$el.on("change",".applicable",t),this.$el.on("click",".status>span",function(){e.recheckStorageConfig($(this).closest("tr"))}),this.$el.on("click","td.mountOptionsToggle .icon-delete",function(){e.deleteStorageConfig($(this).closest("tr"))}),this.$el.on("click","td.save>.icon-checkmark",function(){e.saveStorageConfig($(this).closest("tr"))}),this.$el.on("click","td.mountOptionsToggle>.icon-more",function(){$(this).attr("aria-expanded","true"),e._showMountOptionsDropdown($(this).closest("tr"))}),this.$el.on("change",".selectBackend",_.bind(this._onSelectBackend,this)),this.$el.on("change",".selectAuthMechanism",_.bind(this._onSelectAuthMechanism,this)),this.$el.on("change",".applicableToAllUsers",_.bind(this._onChangeApplicableToAllUsers,this))},_onChange(e){const t=$(e.target);if(t.closest(".dropdown").length)return;p(t);const n=t.closest("tr");this.updateStatus(n,null)},_onSelectBackend(e){const t=$(e.target);let n=t.closest("tr");const s=new this._storageConfigClass;s.mountPoint=n.find(".mountPoint input").val(),s.backend=t.val(),n.find(".mountPoint input").val(""),n.find(".selectBackend").prop("selectedIndex",0);const a=c().Deferred();n=this.newStorage(s,a),n.find(".applicableToAllUsers").prop("checked",!1).trigger("change"),a.resolve(),n.find("td.configuration").children().not("[type=hidden]").first().focus(),this.saveStorageConfig(n)},_onSelectAuthMechanism(e){const t=$(e.target),n=t.closest("tr"),s=t.val(),a=c().Deferred();this.configureAuthMechanism(n,s,a),a.resolve(),this.saveStorageConfig(n)},_onChangeApplicableToAllUsers(e){const t=$(e.target),n=t.closest("tr"),s=t.is(":checked");n.find(".applicableUsersContainer").toggleClass("hidden",s),s||n.find(".applicableUsers").select2("val","",!0),this.saveStorageConfig(n)},configureAuthMechanism(e,t,n){const s=this._allAuthMechanisms[t],a=e.find("td.configuration");a.find(".auth-param").remove(),$.each(s.configuration,_.partial(this.writeParameterInput,a,_,_,["auth-param"]).bind(this)),this.trigger("selectAuthMechanism",e,t,s.scheme,n)},newStorage(e,t,n){let s=e.mountPoint,a=this._allBackends[e.backend];a||(a={name:"Unknown: "+e.backend,invalid:!0});const i=this.$el.find("tr#addMountPoint"),r=i.clone();if(n||r.insertBefore(i),r.data("storageConfig",e),r.show(),r.find("td.mountOptionsToggle, td.save, td.remove").removeClass("hidden"),r.find("td").last().removeAttr("style"),r.removeAttr("id"),r.find("select#selectBackend"),n||h(r.find(".applicableUsers"),this._userListLimit),e.id&&r.data("id",e.id),r.find(".backend").text(a.name),""===s&&(s=this._suggestMountPoint(a.name)),r.find(".mountPoint input").val(s),r.addClass(a.identifier),r.find(".backend").data("identifier",a.identifier),a.invalid||"local"===a.identifier&&!this._canCreateLocal)return r.find("[name=mountPoint]").prop("disabled",!0),r.find(".applicable,.mountOptionsToggle").empty(),r.find(".save").empty(),a.invalid&&this.updateStatus(r,!1,(0,o.t)("files_external","Unknown backend: {backendName}",{backendName:a.name})),r;const l=$(''),c=this._isPersonal?f.Visibility.PERSONAL:f.Visibility.ADMIN;$.each(this._allAuthMechanisms,function(e,t){a.authSchemes[t.scheme]&&t.visibility&c&&l.append($('"))}),e.authMechanism?l.val(e.authMechanism):e.authMechanism=l.val(),r.find("td.authentication").append(l);const d=r.find("td.configuration");$.each(a.configuration,_.partial(this.writeParameterInput,d).bind(this)),this.trigger("selectBackend",r,a.identifier,t),this.configureAuthMechanism(r,e.authMechanism,t),e.backendOptions&&d.find("input, select").each(function(){const t=$(this),n=e.backendOptions[t.data("parameter")];void 0!==n&&(t.is("input:checkbox")&&t.prop("checked",n),t.val(e.backendOptions[t.data("parameter")]),p(t))});let u=[];e.applicableUsers&&(u=u.concat(e.applicableUsers)),e.applicableGroups&&(u=u.concat(_.map(e.applicableGroups,function(e){return e+"(group)"}))),u.length?(r.find(".applicableUsers").val(u).trigger("change"),r.find(".applicableUsersContainer").removeClass("hidden")):r.find(".applicableUsersContainer").addClass("hidden"),r.find(".applicableToAllUsers").prop("checked",!u.length);const g=$('');return r.append(g),e.mountOptions?r.find("input.mountOptions").val(JSON.stringify(e.mountOptions)):r.find("input.mountOptions").val(JSON.stringify({encrypt:!0,previews:!0,enable_sharing:!1,filesystem_check_changes:1,encoding_compatibility:!1,readonly:!1})),r},loadStorages(){const e=this,t=$.Deferred(),n=$.Deferred();this.$el.find(".externalStorageLoading").removeClass("hidden"),$.when(t,n).always(()=>{e.$el.find(".externalStorageLoading").addClass("hidden")}),this._isPersonal?$.ajax({type:"GET",url:OC.generateUrl("apps/files_external/userglobalstorages"),data:{testOnly:!0},contentType:"application/json",success(n){n=Object.values(n);const s=c().Deferred();let a=$();n.forEach(function(t){let i;const r="system"===t.type&&e._isPersonal;t.mountPoint=t.mountPoint.substr(1),i=r?new b:new e._storageConfigClass,_.extend(i,t);const l=e.newStorage(i,s,!0);l.detach(),e.$el.prepend(l);const c=l.find(".authentication");c.text(c.find("select option:selected").text()),l.find(".mountOptionsToggle, .remove").empty(),l.find("input:not(.user_provided), select:not(.user_provided)").attr("disabled","disabled"),r?l.find(".configuration").find(":not(.user_provided)").remove():l.find(".configuration").text((0,o.t)("files_external","Admin defined")),n.length<20?e.recheckStorageConfig(l):e.updateStatus(l,f.Status.INDETERMINATE,(0,o.t)("files_external","Automatic status checking is disabled due to the large number of configured storages, click to check status")),a=a.add(l)}),h(e.$el.find(".applicableUsers"),this._userListLimit),e.$el.find("tr#addMountPoint").before(a);const i=$("#files_external");0===n.length&&"false"===i.attr("data-can-create")&&(i.hide(),$('a[href="#external-storage"]').parent().hide(),$(".emptycontent").show()),s.resolve(),t.resolve()}}):t.resolve();const s=this._storageConfigClass.prototype._url;$.ajax({type:"GET",url:OC.generateUrl(s),contentType:"application/json",success(t){t=Object.values(t);const s=c().Deferred();let a=$();t.forEach(function(n){n.mountPoint="/"===n.mountPoint?"/":n.mountPoint.substr(1);const i=new e._storageConfigClass;_.extend(i,n);const r=e.newStorage(i,s,!0);t.length<20?e.recheckStorageConfig(r):e.updateStatus(r,f.Status.INDETERMINATE,(0,o.t)("files_external","Automatic status checking is disabled due to the large number of configured storages, click to check status")),a=a.add(r)}),h(a.find(".applicableUsers"),this._userListLimit),e.$el.find("tr#addMountPoint").before(a),s.resolve(),n.resolve()}})},writeParameterInput(e,t,n,s){const a=function(e){return(n.flags&e)===e};if((s=$.isArray(s)?s:[]).push("added"),a(y.ParameterFlags.OPTIONAL)&&s.push("optional"),a(y.ParameterFlags.USER_PROVIDED)){if(!this._isPersonal)return;s.push("user_provided")}let i;const o=n.value;if(a(y.ParameterFlags.HIDDEN))i=$('');else if(n.type===y.ParameterTypes.PASSWORD)i=$('');else if(n.type===y.ParameterTypes.BOOLEAN){const e=_.uniqueId("checkbox_");i=$('
")}else i=$('');return n.defaultValue&&(n.type===y.ParameterTypes.BOOLEAN?i.find("input").prop("checked",n.defaultValue):i.val(n.defaultValue)),n.tooltip&&i.attr("title",n.tooltip),p(i),e.append(i),i},getStorageConfig(e){let t=e.data("id");t||(t=null);let n=e.data("storageConfig");n||(n=new this._storageConfigClass(t)),n.errors=null,n.mountPoint=e.find(".mountPoint input").val(),n.backend=e.find(".backend").data("identifier"),n.authMechanism=e.find(".selectAuthMechanism").val();const s={},a=e.find(".configuration input"),i=[];if($.each(a,function(e,t){const n=$(t),a=n.data("parameter");"button"!==n.attr("type")&&(u(n)||n.hasClass("optional")?$(t).is(":checkbox")?$(t).is(":checked")?s[a]=!0:s[a]=!1:s[a]=$(t).val():i.push(a))}),n.backendOptions=s,i.length&&(n.errors={backendOptions:i}),!this._isPersonal){const t=function(e){const t=[],n=[],s=function(e){let t=e.find(".applicableUsers").select2("val");return t&&0!==t.length||(t=[]),t}(e);return $.each(s,function(e,s){const a=s.indexOf?s.indexOf("(group)"):-1;-1!==a?n.push(s.substr(0,a)):t.push(s)}),e.find(".applicable").data("applicable-groups",n).data("applicable-users",t),{users:t,groups:n}}(e),s=t.users||[],a=t.groups||[];e.find(".applicableToAllUsers").is(":checked")?(n.applicableUsers=[],n.applicableGroups=[]):(n.applicableUsers=s,n.applicableGroups=a,n.applicableUsers.length||n.applicableGroups.length||(n.errors||(n.errors={}),n.errors.requiredApplicable=!0)),n.priority=parseInt(e.find("input.priority").val()||"100",10)}const o=e.find("input.mountOptions").val();return o&&(n.mountOptions=JSON.parse(o)),n},deleteStorageConfig(e){const t=this,n=e.data("id");if(!_.isNumber(n))return void e.remove();const s=new this._storageConfigClass(n);OC.dialogs.confirm((0,o.t)("files_external","Are you sure you want to disconnect this external storage?")+" "+(0,o.t)("files_external","It will make the storage unavailable in {instanceName} and will lead to a deletion of these files and folders on any sync client that is currently connected but will not delete any files and folders on the external storage itself.",{storage:this.mountPoint,instanceName:window.OC.theme.name}),(0,o.t)("files_external","Delete storage?"),function(n){n&&(t.updateStatus(e,f.Status.IN_PROGRESS),s.destroy({success(){e.remove()},error(n){const s=n&&n.responseJSON?n.responseJSON.message:void 0;t.updateStatus(e,f.Status.ERROR,s)}}))})},saveStorageConfig(e,t,n){const s=this,a=this.getStorageConfig(e);if(!a||!a.validate())return!1;this.updateStatus(e,f.Status.IN_PROGRESS),a.save({success(i){void 0!==n&&e.data("save-timer")!==n||(s.updateStatus(e,i.status,i.statusMessage),e.data("id",i.id),_.isFunction(t)&&t(a))},error(t){if(void 0===n||e.data("save-timer")===n){const n=t&&t.responseJSON?t.responseJSON.message:void 0;s.updateStatus(e,f.Status.ERROR,n)}}})},recheckStorageConfig(e){const t=this,n=this.getStorageConfig(e);if(!n.validate())return!1;this.updateStatus(e,f.Status.IN_PROGRESS),n.recheck({success(n){t.updateStatus(e,n.status,n.statusMessage)},error(n){const s=n&&n.responseJSON?n.responseJSON.message:void 0;t.updateStatus(e,f.Status.ERROR,s)}})},updateStatus(e,t,n){const s=e.find(".status span");switch(t){case null:s.hide();break;case f.Status.IN_PROGRESS:s.attr("class","icon-loading-small");break;case f.Status.SUCCESS:s.attr("class","success icon-checkmark-white");break;case f.Status.INDETERMINATE:s.attr("class","indeterminate icon-info-white");break;default:s.attr("class","error icon-error-white")}null!==t&&s.show(),"string"!=typeof n&&(n=(0,o.t)("files_external","Click to recheck the configuration")),s.attr("title",n)},_suggestMountPoint(e){const t=this.$el,n=e.indexOf("/");-1!==n&&(e=e.substring(0,n)),e=e.replace(/\s+/g,"");let s=1,a="",i=!0;for(;i&&s<20&&(i=!1,t.find("tbody td.mountPoint input").each(function(t,n){if($(n).val()===e+a)return i=!0,!1}),i);)a=s,s++;return e+a},_showMountOptionsDropdown(e){const t=this,n=this.getStorageConfig(e),s=e.find(".mountOptionsToggle"),a=new v,i=["previews","filesystem_check_changes","enable_sharing","encoding_compatibility","readonly","delete"];this._encryptionEnabled&&i.push("encrypt"),a.show(s,n.mountOptions||[],i),$("body").on("mouseup.mountOptionsDropdown",function(e){$(e.target).closest(".popovermenu").length||a.hide()}),a.$el.on("hide",function(){const n=a.getOptions();$("body").off("mouseup.mountOptionsDropdown"),e.find("input.mountOptions").val(JSON.stringify(n)),e.find("td.mountOptionsToggle>.icon-more").attr("aria-expanded","false"),t.saveStorageConfig(e)})}},OC.Backbone.Events),window.addEventListener("DOMContentLoaded",function(){const e=$("#files_external").attr("data-encryption-enabled"),t=$("#files_external").attr("data-can-create-local"),n="true"===e,l=new y($("#externalStorage"),{encryptionEnabled:n,canCreateLocal:"true"===t});l.loadStorages();const c=$("#allowUserMounting");c.bind("change",function(){OC.msg.startSaving("#userMountingMsg"),this.checked?(OCP.AppConfig.setValue("files_external","allow_user_mounting","yes"),$('input[name="allowUserMountingBackends\\[\\]"]').prop("checked",!0),$("#userMountingBackends").removeClass("hidden"),$('input[name="allowUserMountingBackends\\[\\]"]').eq(0).trigger("change")):(OCP.AppConfig.setValue("files_external","allow_user_mounting","no"),$("#userMountingBackends").addClass("hidden")),OC.msg.finishedSaving("#userMountingMsg",{status:"success",data:{message:(0,o.t)("files_external","Saved")}})}),$('input[name="allowUserMountingBackends\\[\\]"]').bind("change",function(){OC.msg.startSaving("#userMountingMsg");let e=$('input[name="allowUserMountingBackends\\[\\]"]:checked').map(function(){return $(this).val()}).get();const t=$('input[name="allowUserMountingBackends\\[\\]"][data-deprecate-to]').map(function(){return-1!==$.inArray($(this).data("deprecate-to"),e)?$(this).val():null}).get();e=e.concat(t),OCP.AppConfig.setValue("files_external","user_mounting_backends",e.join()),OC.msg.finishedSaving("#userMountingMsg",{status:"success",data:{message:(0,o.t)("files_external","Saved")}}),0===e.length&&(c.prop("checked",!1),c.trigger("change"))}),$("#global_credentials").on("submit",async function(e){e.preventDefault();const t=$(this),n=t.find("[type=submit]");n.val((0,o.t)("files_external","Saving …"));const l=t.find("[name=uid]").val(),c=t.find("[name=username]").val(),d=t.find("[name=password]").val();try{await r.Ay.request({method:"POST",data:{uid:l,user:c,password:d},url:(0,a.Jv)("apps/files_external/globalcredentials"),confirmPassword:s.mH.Strict}),n.val((0,o.t)("files_external","Saved")),setTimeout(function(){n.val((0,o.t)("files_external","Save"))},2500)}catch(e){if(n.val((0,o.t)("files_external","Save")),(0,r.F0)(e)){const t=e.response?.data?.message||(0,o.t)("files_external","Failed to save global credentials");(0,i.Qg)((0,o.t)("files_external","Failed to save global credentials: {message}",{message:t}))}}return!1}),OCA.Files_External.Settings.mountConfig=l,OC.MountConfig={saveStorage:_.bind(l.saveStorageConfig,l)}}),OCA.Files_External=OCA.Files_External||{},OCA.Files_External.Settings=OCA.Files_External.Settings||{},OCA.Files_External.Settings.GlobalStorageConfig=g,OCA.Files_External.Settings.UserStorageConfig=m,OCA.Files_External.Settings.MountConfigListView=y}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return s[e].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}i.m=s,e=[],i.O=(t,n,s,a)=>{if(!n){var o=1/0;for(d=0;d=a)&&Object.keys(i.O).every(e=>i.O[e](n[l]))?n.splice(l--,1):(r=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[n,s,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>e+"-"+e+".js?v="+{640:"d4c5c018803ee8751b2a",780:"e3ee44fa7690af29d8d7",3564:"29e8338d43e0d4bd3995",5810:"b550a24d46f75f92c2d5",7471:"6423b9b898ffefeb7d1d"}[e],i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="nextcloud:",i.l=(e,s,a,o)=>{if(t[e])t[e].push(s);else{var r,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),d=0;d{r.onerror=r.onload=null,clearTimeout(h);var a=t[e];if(delete t[e],r.parentNode&&r.parentNode.removeChild(r),a&&a.forEach(e=>e(s)),n)return n(s)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=5808,(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var s=n.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{i.b=document.baseURI||self.location.href;var e={5808:0};i.f.j=(t,n)=>{var s=i.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var a=new Promise((n,a)=>s=e[t]=[n,a]);n.push(s[2]=a);var o=i.p+i.u(t),r=new Error;i.l(o,n=>{if(i.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",r.name="ChunkLoadError",r.type=a,r.request=o,s[1](r)}},"chunk-"+t,t)}},i.O.j=t=>0===e[t];var t=(t,n)=>{var s,a,o=n[0],r=n[1],l=n[2],c=0;if(o.some(t=>0!==e[t])){for(s in r)i.o(r,s)&&(i.m[s]=r[s]);if(l)var d=l(i)}for(t&&t(n);ci(80655));o=i.O(o)})(); +//# sourceMappingURL=files_external-settings.js.map?v=d9d50325821c735a67ea \ No newline at end of file diff --git a/dist/files_external-settings.js.map b/dist/files_external-settings.js.map index ec6f0b93484d0..cae4b88879119 100644 --- a/dist/files_external-settings.js.map +++ b/dist/files_external-settings.js.map @@ -1 +1 @@ -{"version":3,"file":"files_external-settings.js?v=aa025a3435f99b76fe24","mappings":"uBAAIA,ECAAC,EACAC,E,kGC4DJ,SAASC,EAAgBC,EAAUC,GAElC,OADAD,EAASE,YAAY,gBAAiBD,GAC/BA,CACR,CAMA,SAASE,EAAaC,GACrB,MAAMC,EAAWD,EAAOE,SAAS,YACjC,OAAQF,EAAOG,KAAK,SACpB,IAAK,OACL,IAAK,WACJ,GAAqB,KAAjBH,EAAOI,QAAiBH,EAC3B,OAAO,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A7BkD,EAAgBlD,GAGxD,IAAIwD,EAAuB,CAACC,EAA4BrZ,KACvD,IAKIiU,EAAU2B,EALVnB,EAAWzU,EAAK,GAChBsZ,EAActZ,EAAK,GACnBuZ,EAAUvZ,EAAK,GAGI0B,EAAI,EAC3B,GAAG+S,EAAS+E,KAAMrY,GAAgC,IAAxB2X,EAAgB3X,IAAa,CACtD,IAAI8S,KAAYqF,EACZtF,EAAoBwB,EAAE8D,EAAarF,KACrCD,EAAoBvR,EAAEwR,GAAYqF,EAAYrF,IAGhD,GAAGsF,EAAS,IAAI5U,EAAS4U,EAAQvF,EAClC,CAEA,IADGqF,GAA4BA,EAA2BrZ,GACrD0B,EAAI+S,EAASvV,OAAQwC,IACzBkU,EAAUnB,EAAS/S,GAChBsS,EAAoBwB,EAAEsD,EAAiBlD,IAAYkD,EAAgBlD,IACrEkD,EAAgBlD,GAAS,KAE1BkD,EAAgBlD,GAAW,EAE5B,OAAO5B,EAAoBQ,EAAE7P,IAG1B8U,EAAqBnP,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FmP,EAAmB3K,QAAQsK,EAAqB3O,KAAK,KAAM,IAC3DgP,EAAmB3Y,KAAOsY,EAAqB3O,KAAK,KAAMgP,EAAmB3Y,KAAK2J,KAAKgP,G,KCvFvFzF,EAAoBkD,QAAKxJ,ECGzB,IAAIgM,EAAsB1F,EAAoBQ,OAAE9G,EAAW,CAAC,MAAO,IAAOsG,EAAoB,QAC9F0F,EAAsB1F,EAAoBQ,EAAEkF,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/webpack/runtime/load script","webpack:///nextcloud/apps/files_external/src/settings.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/get javascript chunk filename","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/publicPath","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"nextcloud:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/**\n * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-FileCopyrightText: 2012-2016 ownCloud, Inc.\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { addPasswordConfirmationInterceptors, PwdConfirmationMode } from '@nextcloud/password-confirmation'\nimport { generateUrl } from '@nextcloud/router'\nimport { showError } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\nimport axios, { isAxiosError } from '@nextcloud/axios'\n\nimport jQuery from 'jquery'\n\naddPasswordConfirmationInterceptors(axios)\n\n/**\n * Returns the selection of applicable users in the given configuration row\n *\n * @param $row configuration row\n * @return array array of user names\n */\nfunction getSelection($row) {\n\tlet values = $row.find('.applicableUsers').select2('val')\n\tif (!values || values.length === 0) {\n\t\tvalues = []\n\t}\n\treturn values\n}\n\n/**\n *\n * @param $row\n */\nfunction getSelectedApplicable($row) {\n\tconst users = []\n\tconst groups = []\n\tconst multiselect = getSelection($row)\n\t$.each(multiselect, function(index, value) {\n\t\t// FIXME: don't rely on string parts to detect groups...\n\t\tconst pos = (value.indexOf) ? value.indexOf('(group)') : -1\n\t\tif (pos !== -1) {\n\t\t\tgroups.push(value.substr(0, pos))\n\t\t} else {\n\t\t\tusers.push(value)\n\t\t}\n\t})\n\n\t// FIXME: this should be done in the multiselect change event instead\n\t$row.find('.applicable')\n\t\t.data('applicable-groups', groups)\n\t\t.data('applicable-users', users)\n\n\treturn { users, groups }\n}\n\n/**\n *\n * @param $element\n * @param highlight\n */\nfunction highlightBorder($element, highlight) {\n\t$element.toggleClass('warning-input', highlight)\n\treturn highlight\n}\n\n/**\n *\n * @param $input\n */\nfunction isInputValid($input) {\n\tconst optional = $input.hasClass('optional')\n\tswitch ($input.attr('type')) {\n\tcase 'text':\n\tcase 'password':\n\t\tif ($input.val() === '' && !optional) {\n\t\t\treturn false\n\t\t}\n\t\tbreak\n\t}\n\treturn true\n}\n\n/**\n *\n * @param $input\n */\nfunction highlightInput($input) {\n\tswitch ($input.attr('type')) {\n\tcase 'text':\n\tcase 'password':\n\t\treturn highlightBorder($input, !isInputValid($input))\n\t}\n}\n\n/**\n * Initialize select2 plugin on the given elements\n *\n * @param {Array} array of jQuery elements\n * @param $elements\n * @param {number} userListLimit page size for result list\n */\nfunction initApplicableUsersMultiselect($elements, userListLimit) {\n\tconst escapeHTML = function(text) {\n\t\treturn text.toString()\n\t\t\t.split('&').join('&')\n\t\t\t.split('<').join('<')\n\t\t\t.split('>').join('>')\n\t\t\t.split('\"').join('"')\n\t\t\t.split('\\'').join(''')\n\t}\n\tif (!$elements.length) {\n\t\treturn\n\t}\n\treturn $elements.select2({\n\t\tplaceholder: t('files_external', 'Type to select account or group.'),\n\t\tallowClear: true,\n\t\tmultiple: true,\n\t\ttoggleSelect: true,\n\t\tdropdownCssClass: 'files-external-select2',\n\t\t// minimumInputLength: 1,\n\t\tajax: {\n\t\t\turl: OC.generateUrl('apps/files_external/applicable'),\n\t\t\tdataType: 'json',\n\t\t\tquietMillis: 100,\n\t\t\tdata(term, page) { // page is the one-based page number tracked by Select2\n\t\t\t\treturn {\n\t\t\t\t\tpattern: term, // search term\n\t\t\t\t\tlimit: userListLimit, // page size\n\t\t\t\t\toffset: userListLimit * (page - 1), // page number starts with 0\n\t\t\t\t}\n\t\t\t},\n\t\t\tresults(data) {\n\t\t\t\tif (data.status === 'success') {\n\n\t\t\t\t\tconst results = []\n\t\t\t\t\tlet userCount = 0 // users is an object\n\n\t\t\t\t\t// add groups\n\t\t\t\t\t$.each(data.groups, function(gid, group) {\n\t\t\t\t\t\tresults.push({ name: gid + '(group)', displayname: group, type: 'group' })\n\t\t\t\t\t})\n\t\t\t\t\t// add users\n\t\t\t\t\t$.each(data.users, function(id, user) {\n\t\t\t\t\t\tuserCount++\n\t\t\t\t\t\tresults.push({ name: id, displayname: user, type: 'user' })\n\t\t\t\t\t})\n\n\t\t\t\t\tconst more = (userCount >= userListLimit) || (data.groups.length >= userListLimit)\n\t\t\t\t\treturn { results, more }\n\t\t\t\t} else {\n\t\t\t\t\t// FIXME add error handling\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tinitSelection(element, callback) {\n\t\t\tconst users = {}\n\t\t\tusers.users = []\n\t\t\tconst toSplit = element.val().split(',')\n\t\t\tfor (let i = 0; i < toSplit.length; i++) {\n\t\t\t\tusers.users.push(toSplit[i])\n\t\t\t}\n\n\t\t\t$.ajax(OC.generateUrl('displaynames'), {\n\t\t\t\ttype: 'POST',\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tdata: JSON.stringify(users),\n\t\t\t\tdataType: 'json',\n\t\t\t}).done(function(data) {\n\t\t\t\tconst results = []\n\t\t\t\tif (data.status === 'success') {\n\t\t\t\t\t$.each(data.users, function(user, displayname) {\n\t\t\t\t\t\tif (displayname !== false) {\n\t\t\t\t\t\t\tresults.push({ name: user, displayname, type: 'user' })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tcallback(results)\n\t\t\t\t} else {\n\t\t\t\t\t// FIXME add error handling\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tid(element) {\n\t\t\treturn element.name\n\t\t},\n\t\tformatResult(element) {\n\t\t\tconst $result = $('
' + escapeHTML(element.displayname) + '
')\n\t\t\tconst $div = $result.find('.avatardiv')\n\t\t\t\t.attr('data-type', element.type)\n\t\t\t\t.attr('data-name', element.name)\n\t\t\t\t.attr('data-displayname', element.displayname)\n\t\t\tif (element.type === 'group') {\n\t\t\t\tconst url = OC.imagePath('core', 'actions/group')\n\t\t\t\t$div.html('')\n\t\t\t}\n\t\t\treturn $result.get(0).outerHTML\n\t\t},\n\t\tformatSelection(element) {\n\t\t\tif (element.type === 'group') {\n\t\t\t\treturn '' + escapeHTML(element.displayname + ' ' + t('files_external', '(Group)')) + ''\n\t\t\t} else {\n\t\t\t\treturn '' + escapeHTML(element.displayname) + ''\n\t\t\t}\n\t\t},\n\t\tescapeMarkup(m) { return m }, // we escape the markup in formatResult and formatSelection\n\t}).on('select2-loaded', function() {\n\t\t$.each($('.avatardiv'), function(i, div) {\n\t\t\tconst $div = $(div)\n\t\t\tif ($div.data('type') === 'user') {\n\t\t\t\t$div.avatar($div.data('name'), 32)\n\t\t\t}\n\t\t})\n\t}).on('change', function(event) {\n\t\thighlightBorder($(event.target).closest('.applicableUsersContainer').find('.select2-choices'), !event.val.length)\n\t})\n}\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc External storage config\n */\nconst StorageConfig = function(id) {\n\tthis.id = id\n\tthis.backendOptions = {}\n}\n// Keep this in sync with \\OCA\\Files_External\\MountConfig::STATUS_*\nStorageConfig.Status = {\n\tIN_PROGRESS: -1,\n\tSUCCESS: 0,\n\tERROR: 1,\n\tINDETERMINATE: 2,\n}\nStorageConfig.Visibility = {\n\tNONE: 0,\n\tPERSONAL: 1,\n\tADMIN: 2,\n\tDEFAULT: 3,\n}\n/**\n * @memberof OCA.Files_External.Settings\n */\nStorageConfig.prototype = {\n\t_url: null,\n\n\t/**\n\t * Storage id\n\t *\n\t * @type int\n\t */\n\tid: null,\n\n\t/**\n\t * Mount point\n\t *\n\t * @type string\n\t */\n\tmountPoint: '',\n\n\t/**\n\t * Backend\n\t *\n\t * @type string\n\t */\n\tbackend: null,\n\n\t/**\n\t * Authentication mechanism\n\t *\n\t * @type string\n\t */\n\tauthMechanism: null,\n\n\t/**\n\t * Backend-specific configuration\n\t *\n\t * @type Object.\n\t */\n\tbackendOptions: null,\n\n\t/**\n\t * Mount-specific options\n\t *\n\t * @type Object.\n\t */\n\tmountOptions: null,\n\n\t/**\n\t * Creates or saves the storage.\n\t *\n\t * @param {Function} [options.success] success callback, receives result as argument\n\t * @param {Function} [options.error] error callback\n\t * @param options\n\t */\n\tsave(options) {\n\t\tlet url = OC.generateUrl(this._url)\n\t\tlet method = 'POST'\n\t\tif (_.isNumber(this.id)) {\n\t\t\tmethod = 'PUT'\n\t\t\turl = OC.generateUrl(this._url + '/{id}', { id: this.id })\n\t\t}\n\n\t\tthis._save(method, url, options)\n\t},\n\n\t/**\n\t * Private implementation of the save function (called after potential password confirmation)\n\t * @param {string} method\n\t * @param {string} url\n\t * @param {{success: Function, error: Function}} options\n\t */\n\tasync _save(method, url, options) {\n\t\ttry {\n\t\t\tconst response = await axios.request({\n\t\t\t\tconfirmPassword: PwdConfirmationMode.Strict,\n\t\t\t\tmethod,\n\t\t\t\turl,\n\t\t\t\tdata: this.getData(),\n\t\t\t})\n\t\t\tconst result = response.data\n\t\t\tthis.id = result.id\n\t\t\toptions.success(result)\n\t\t} catch (error) {\n\t\t\toptions.error(error)\n\t\t}\n\t},\n\n\t/**\n\t * Returns the data from this object\n\t *\n\t * @return {Array} JSON array of the data\n\t */\n\tgetData() {\n\t\tconst data = {\n\t\t\tmountPoint: this.mountPoint,\n\t\t\tbackend: this.backend,\n\t\t\tauthMechanism: this.authMechanism,\n\t\t\tbackendOptions: this.backendOptions,\n\t\t\ttestOnly: true,\n\t\t}\n\t\tif (this.id) {\n\t\t\tdata.id = this.id\n\t\t}\n\t\tif (this.mountOptions) {\n\t\t\tdata.mountOptions = this.mountOptions\n\t\t}\n\t\treturn data\n\t},\n\n\t/**\n\t * Recheck the storage\n\t *\n\t * @param {Function} [options.success] success callback, receives result as argument\n\t * @param {Function} [options.error] error callback\n\t * @param options\n\t */\n\trecheck(options) {\n\t\tif (!_.isNumber(this.id)) {\n\t\t\tif (_.isFunction(options.error)) {\n\t\t\t\toptions.error()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: OC.generateUrl(this._url + '/{id}', { id: this.id }),\n\t\t\tdata: { testOnly: true },\n\t\t\tsuccess: options.success,\n\t\t\terror: options.error,\n\t\t})\n\t},\n\n\t/**\n\t * Deletes the storage\n\t *\n\t * @param {Function} [options.success] success callback\n\t * @param {Function} [options.error] error callback\n\t * @param options\n\t */\n\tasync destroy(options) {\n\t\tif (!_.isNumber(this.id)) {\n\t\t\t// the storage hasn't even been created => success\n\t\t\tif (_.isFunction(options.success)) {\n\t\t\t\toptions.success()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tawait axios.request({\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl: OC.generateUrl(this._url + '/{id}', { id: this.id }),\n\t\t\t\tconfirmPassword: PwdConfirmationMode.Strict,\n\t\t\t})\n\t\t\toptions.success()\n\t\t} catch (e) {\n\t\t\toptions.error(e)\n\t\t}\n\t},\n\n\t/**\n\t * Validate this model\n\t *\n\t * @return {boolean} false if errors exist, true otherwise\n\t */\n\tvalidate() {\n\t\tif (this.mountPoint === '') {\n\t\t\treturn false\n\t\t}\n\t\tif (!this.backend) {\n\t\t\treturn false\n\t\t}\n\t\tif (this.errors) {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t},\n}\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.GlobalStorageConfig\n * @augments OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc Global external storage config\n */\nconst GlobalStorageConfig = function(id) {\n\tthis.id = id\n\tthis.applicableUsers = []\n\tthis.applicableGroups = []\n}\n/**\n * @memberOf OCA.Files_External.Settings\n */\nGlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,\n\t/** @lends OCA.Files_External.Settings.GlobalStorageConfig.prototype */ {\n\t\t_url: 'apps/files_external/globalstorages',\n\n\t\t/**\n\t\t * Applicable users\n\t\t *\n\t\t * @type Array.\n\t\t */\n\t\tapplicableUsers: null,\n\n\t\t/**\n\t\t * Applicable groups\n\t\t *\n\t\t * @type Array.\n\t\t */\n\t\tapplicableGroups: null,\n\n\t\t/**\n\t\t * Storage priority\n\t\t *\n\t\t * @type int\n\t\t */\n\t\tpriority: null,\n\n\t\t/**\n\t\t * Returns the data from this object\n\t\t *\n\t\t * @return {Array} JSON array of the data\n\t\t */\n\t\tgetData() {\n\t\t\tconst data = StorageConfig.prototype.getData.apply(this, arguments)\n\t\t\treturn _.extend(data, {\n\t\t\t\tapplicableUsers: this.applicableUsers,\n\t\t\t\tapplicableGroups: this.applicableGroups,\n\t\t\t\tpriority: this.priority,\n\t\t\t})\n\t\t},\n\t})\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.UserStorageConfig\n * @augments OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc User external storage config\n */\nconst UserStorageConfig = function(id) {\n\tthis.id = id\n}\nUserStorageConfig.prototype = _.extend({}, StorageConfig.prototype,\n\t/** @lends OCA.Files_External.Settings.UserStorageConfig.prototype */ {\n\t\t_url: 'apps/files_external/userstorages',\n\t})\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.UserGlobalStorageConfig\n * @augments OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc User external storage config\n */\nconst UserGlobalStorageConfig = function(id) {\n\tthis.id = id\n}\nUserGlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,\n\t/** @lends OCA.Files_External.Settings.UserStorageConfig.prototype */ {\n\n\t\t_url: 'apps/files_external/userglobalstorages',\n\t})\n\n/**\n * @class OCA.Files_External.Settings.MountOptionsDropdown\n *\n * @classdesc Dropdown for mount options\n *\n * @param {object} $container container DOM object\n */\nconst MountOptionsDropdown = function() {\n}\n/**\n * @memberof OCA.Files_External.Settings\n */\nMountOptionsDropdown.prototype = {\n\t/**\n\t * Dropdown element\n\t *\n\t * @member Object\n\t */\n\t$el: null,\n\n\t/**\n\t * Show dropdown\n\t *\n\t * @param {object} $container container\n\t * @param {object} mountOptions mount options\n\t * @param {Array} visibleOptions enabled mount options\n\t */\n\tshow($container, mountOptions, visibleOptions) {\n\t\tif (MountOptionsDropdown._last) {\n\t\t\tMountOptionsDropdown._last.hide()\n\t\t}\n\n\t\tconst $el = $(OCA.Files_External.Templates.mountOptionsDropDown({\n\t\t\tmountOptionsEncodingLabel: t('files_external', 'Compatibility with Mac NFD encoding (slow)'),\n\t\t\tmountOptionsEncryptLabel: t('files_external', 'Enable encryption'),\n\t\t\tmountOptionsPreviewsLabel: t('files_external', 'Enable previews'),\n\t\t\tmountOptionsSharingLabel: t('files_external', 'Enable sharing'),\n\t\t\tmountOptionsFilesystemCheckLabel: t('files_external', 'Check for changes'),\n\t\t\tmountOptionsFilesystemCheckOnce: t('files_external', 'Never'),\n\t\t\tmountOptionsFilesystemCheckDA: t('files_external', 'Once every direct access'),\n\t\t\tmountOptionsReadOnlyLabel: t('files_external', 'Read only'),\n\t\t\tdeleteLabel: t('files_external', 'Disconnect'),\n\t\t}))\n\t\tthis.$el = $el\n\n\t\tconst storage = $container[0].parentNode.className\n\n\t\tthis.setOptions(mountOptions, visibleOptions, storage)\n\n\t\tthis.$el.appendTo($container)\n\t\tMountOptionsDropdown._last = this\n\n\t\tthis.$el.trigger('show')\n\t},\n\n\thide() {\n\t\tif (this.$el) {\n\t\t\tthis.$el.trigger('hide')\n\t\t\tthis.$el.remove()\n\t\t\tthis.$el = null\n\t\t\tMountOptionsDropdown._last = null\n\t\t}\n\t},\n\n\t/**\n\t * Returns the mount options from the dropdown controls\n\t *\n\t * @return {object} options mount options\n\t */\n\tgetOptions() {\n\t\tconst options = {}\n\n\t\tthis.$el.find('input, select').each(function() {\n\t\t\tconst $this = $(this)\n\t\t\tconst key = $this.attr('name')\n\t\t\tlet value = null\n\t\t\tif ($this.attr('type') === 'checkbox') {\n\t\t\t\tvalue = $this.prop('checked')\n\t\t\t} else {\n\t\t\t\tvalue = $this.val()\n\t\t\t}\n\t\t\tif ($this.attr('data-type') === 'int') {\n\t\t\t\tvalue = parseInt(value, 10)\n\t\t\t}\n\t\t\toptions[key] = value\n\t\t})\n\t\treturn options\n\t},\n\n\t/**\n\t * Sets the mount options to the dropdown controls\n\t *\n\t * @param {object} options mount options\n\t * @param {Array} visibleOptions enabled mount options\n\t * @param storage\n\t */\n\tsetOptions(options, visibleOptions, storage) {\n\t\tif (storage === 'owncloud') {\n\t\t\tconst ind = visibleOptions.indexOf('encrypt')\n\t\t\tif (ind > 0) {\n\t\t\t\tvisibleOptions.splice(ind, 1)\n\t\t\t}\n\t\t}\n\t\tconst $el = this.$el\n\t\t_.each(options, function(value, key) {\n\t\t\tconst $optionEl = $el.find('input, select').filterAttr('name', key)\n\t\t\tif ($optionEl.attr('type') === 'checkbox') {\n\t\t\t\tif (_.isString(value)) {\n\t\t\t\t\tvalue = (value === 'true')\n\t\t\t\t}\n\t\t\t\t$optionEl.prop('checked', !!value)\n\t\t\t} else {\n\t\t\t\t$optionEl.val(value)\n\t\t\t}\n\t\t})\n\t\t$el.find('.optionRow').each(function(i, row) {\n\t\t\tconst $row = $(row)\n\t\t\tconst optionId = $row.find('input, select').attr('name')\n\t\t\tif (visibleOptions.indexOf(optionId) === -1 && !$row.hasClass('persistent')) {\n\t\t\t\t$row.hide()\n\t\t\t} else {\n\t\t\t\t$row.show()\n\t\t\t}\n\t\t})\n\t},\n}\n\n/**\n * @class OCA.Files_External.Settings.MountConfigListView\n *\n * @classdesc Mount configuration list view\n *\n * @param {object} $el DOM object containing the list\n * @param {object} [options]\n * @param {number} [options.userListLimit] page size in applicable users dropdown\n */\nconst MountConfigListView = function($el, options) {\n\tthis.initialize($el, options)\n}\n\nMountConfigListView.ParameterFlags = {\n\tOPTIONAL: 1,\n\tUSER_PROVIDED: 2,\n\tHIDDEN: 4,\n}\n\nMountConfigListView.ParameterTypes = {\n\tTEXT: 0,\n\tBOOLEAN: 1,\n\tPASSWORD: 2,\n}\n\n/**\n * @memberOf OCA.Files_External.Settings\n */\nMountConfigListView.prototype = _.extend({\n\n\t/**\n\t * jQuery element containing the config list\n\t *\n\t * @type Object\n\t */\n\t$el: null,\n\n\t/**\n\t * Storage config class\n\t *\n\t * @type Class\n\t */\n\t_storageConfigClass: null,\n\n\t/**\n\t * Flag whether the list is about user storage configs (true)\n\t * or global storage configs (false)\n\t *\n\t * @type bool\n\t */\n\t_isPersonal: false,\n\n\t/**\n\t * Page size in applicable users dropdown\n\t *\n\t * @type int\n\t */\n\t_userListLimit: 30,\n\n\t/**\n\t * List of supported backends\n\t *\n\t * @type Object.\n\t */\n\t_allBackends: null,\n\n\t/**\n\t * List of all supported authentication mechanisms\n\t *\n\t * @type Object.\n\t */\n\t_allAuthMechanisms: null,\n\n\t_encryptionEnabled: false,\n\n\t/**\n\t * @param {object} $el DOM object containing the list\n\t * @param {object} [options]\n\t * @param {number} [options.userListLimit] page size in applicable users dropdown\n\t */\n\tinitialize($el, options) {\n\t\tthis.$el = $el\n\t\tthis._isPersonal = ($el.data('admin') !== true)\n\t\tif (this._isPersonal) {\n\t\t\tthis._storageConfigClass = OCA.Files_External.Settings.UserStorageConfig\n\t\t} else {\n\t\t\tthis._storageConfigClass = OCA.Files_External.Settings.GlobalStorageConfig\n\t\t}\n\n\t\tif (options && !_.isUndefined(options.userListLimit)) {\n\t\t\tthis._userListLimit = options.userListLimit\n\t\t}\n\n\t\tthis._encryptionEnabled = options.encryptionEnabled\n\t\tthis._canCreateLocal = options.canCreateLocal\n\n\t\t// read the backend config that was carefully crammed\n\t\t// into the data-configurations attribute of the select\n\t\tthis._allBackends = this.$el.find('.selectBackend').data('configurations')\n\t\tthis._allAuthMechanisms = this.$el.find('#addMountPoint .authentication').data('mechanisms')\n\n\t\tthis._initEvents()\n\t},\n\n\t/**\n\t * Custom JS event handlers\n\t * Trigger callback for all existing configurations\n\t * @param callback\n\t */\n\twhenSelectBackend(callback) {\n\t\tthis.$el.find('tbody tr:not(#addMountPoint):not(.externalStorageLoading)').each(function(i, tr) {\n\t\t\tconst backend = $(tr).find('.backend').data('identifier')\n\t\t\tcallback($(tr), backend)\n\t\t})\n\t\tthis.on('selectBackend', callback)\n\t},\n\twhenSelectAuthMechanism(callback) {\n\t\tconst self = this\n\t\tthis.$el.find('tbody tr:not(#addMountPoint):not(.externalStorageLoading)').each(function(i, tr) {\n\t\t\tconst authMechanism = $(tr).find('.selectAuthMechanism').val()\n\t\t\tcallback($(tr), authMechanism, self._allAuthMechanisms[authMechanism].scheme)\n\t\t})\n\t\tthis.on('selectAuthMechanism', callback)\n\t},\n\n\t/**\n\t * Initialize DOM event handlers\n\t */\n\t_initEvents() {\n\t\tconst self = this\n\n\t\tconst onChangeHandler = _.bind(this._onChange, this)\n\t\t// this.$el.on('input', 'td input', onChangeHandler);\n\t\tthis.$el.on('keyup', 'td input', onChangeHandler)\n\t\tthis.$el.on('paste', 'td input', onChangeHandler)\n\t\tthis.$el.on('change', 'td input:checkbox', onChangeHandler)\n\t\tthis.$el.on('change', '.applicable', onChangeHandler)\n\n\t\tthis.$el.on('click', '.status>span', function() {\n\t\t\tself.recheckStorageConfig($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('click', 'td.mountOptionsToggle .icon-delete', function() {\n\t\t\tself.deleteStorageConfig($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('click', 'td.save>.icon-checkmark', function() {\n\t\t\tself.saveStorageConfig($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('click', 'td.mountOptionsToggle>.icon-more', function() {\n\t\t\t$(this).attr('aria-expanded', 'true')\n\t\t\tself._showMountOptionsDropdown($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('change', '.selectBackend', _.bind(this._onSelectBackend, this))\n\t\tthis.$el.on('change', '.selectAuthMechanism', _.bind(this._onSelectAuthMechanism, this))\n\n\t\tthis.$el.on('change', '.applicableToAllUsers', _.bind(this._onChangeApplicableToAllUsers, this))\n\t},\n\n\t_onChange(event) {\n\t\tconst $target = $(event.target)\n\t\tif ($target.closest('.dropdown').length) {\n\t\t\t// ignore dropdown events\n\t\t\treturn\n\t\t}\n\t\thighlightInput($target)\n\t\tconst $tr = $target.closest('tr')\n\t\tthis.updateStatus($tr, null)\n\t},\n\n\t_onSelectBackend(event) {\n\t\tconst $target = $(event.target)\n\t\tlet $tr = $target.closest('tr')\n\n\t\tconst storageConfig = new this._storageConfigClass()\n\t\tstorageConfig.mountPoint = $tr.find('.mountPoint input').val()\n\t\tstorageConfig.backend = $target.val()\n\t\t$tr.find('.mountPoint input').val('')\n\n\t\t$tr.find('.selectBackend').prop('selectedIndex', 0)\n\n\t\tconst onCompletion = jQuery.Deferred()\n\t\t$tr = this.newStorage(storageConfig, onCompletion)\n\t\t$tr.find('.applicableToAllUsers').prop('checked', false).trigger('change')\n\t\tonCompletion.resolve()\n\n\t\t$tr.find('td.configuration').children().not('[type=hidden]').first().focus()\n\t\tthis.saveStorageConfig($tr)\n\t},\n\n\t_onSelectAuthMechanism(event) {\n\t\tconst $target = $(event.target)\n\t\tconst $tr = $target.closest('tr')\n\t\tconst authMechanism = $target.val()\n\n\t\tconst onCompletion = jQuery.Deferred()\n\t\tthis.configureAuthMechanism($tr, authMechanism, onCompletion)\n\t\tonCompletion.resolve()\n\n\t\tthis.saveStorageConfig($tr)\n\t},\n\n\t_onChangeApplicableToAllUsers(event) {\n\t\tconst $target = $(event.target)\n\t\tconst $tr = $target.closest('tr')\n\t\tconst checked = $target.is(':checked')\n\n\t\t$tr.find('.applicableUsersContainer').toggleClass('hidden', checked)\n\t\tif (!checked) {\n\t\t\t$tr.find('.applicableUsers').select2('val', '', true)\n\t\t}\n\n\t\tthis.saveStorageConfig($tr)\n\t},\n\n\t/**\n\t * Configure the storage config with a new authentication mechanism\n\t *\n\t * @param {jQuery} $tr config row\n\t * @param {string} authMechanism\n\t * @param {jQuery.Deferred} onCompletion\n\t */\n\tconfigureAuthMechanism($tr, authMechanism, onCompletion) {\n\t\tconst authMechanismConfiguration = this._allAuthMechanisms[authMechanism]\n\t\tconst $td = $tr.find('td.configuration')\n\t\t$td.find('.auth-param').remove()\n\n\t\t$.each(authMechanismConfiguration.configuration, _.partial(\n\t\t\tthis.writeParameterInput, $td, _, _, ['auth-param'],\n\t\t).bind(this))\n\n\t\tthis.trigger('selectAuthMechanism',\n\t\t\t$tr, authMechanism, authMechanismConfiguration.scheme, onCompletion,\n\t\t)\n\t},\n\n\t/**\n\t * Create a config row for a new storage\n\t *\n\t * @param {StorageConfig} storageConfig storage config to pull values from\n\t * @param {jQuery.Deferred} onCompletion\n\t * @param {boolean} deferAppend\n\t * @return {jQuery} created row\n\t */\n\tnewStorage(storageConfig, onCompletion, deferAppend) {\n\t\tlet mountPoint = storageConfig.mountPoint\n\t\tlet backend = this._allBackends[storageConfig.backend]\n\n\t\tif (!backend) {\n\t\t\tbackend = {\n\t\t\t\tname: 'Unknown: ' + storageConfig.backend,\n\t\t\t\tinvalid: true,\n\t\t\t}\n\t\t}\n\n\t\t// FIXME: Replace with a proper Handlebar template\n\t\tconst $template = this.$el.find('tr#addMountPoint')\n\t\tconst $tr = $template.clone()\n\t\tif (!deferAppend) {\n\t\t\t$tr.insertBefore($template)\n\t\t}\n\n\t\t$tr.data('storageConfig', storageConfig)\n\t\t$tr.show()\n\t\t$tr.find('td.mountOptionsToggle, td.save, td.remove').removeClass('hidden')\n\t\t$tr.find('td').last().removeAttr('style')\n\t\t$tr.removeAttr('id')\n\t\t$tr.find('select#selectBackend')\n\t\tif (!deferAppend) {\n\t\t\tinitApplicableUsersMultiselect($tr.find('.applicableUsers'), this._userListLimit)\n\t\t}\n\n\t\tif (storageConfig.id) {\n\t\t\t$tr.data('id', storageConfig.id)\n\t\t}\n\n\t\t$tr.find('.backend').text(backend.name)\n\t\tif (mountPoint === '') {\n\t\t\tmountPoint = this._suggestMountPoint(backend.name)\n\t\t}\n\t\t$tr.find('.mountPoint input').val(mountPoint)\n\t\t$tr.addClass(backend.identifier)\n\t\t$tr.find('.backend').data('identifier', backend.identifier)\n\n\t\tif (backend.invalid || (backend.identifier === 'local' && !this._canCreateLocal)) {\n\t\t\t$tr.find('[name=mountPoint]').prop('disabled', true)\n\t\t\t$tr.find('.applicable,.mountOptionsToggle').empty()\n\t\t\t$tr.find('.save').empty()\n\t\t\tif (backend.invalid) {\n\t\t\t\tthis.updateStatus($tr, false, t('files_external', 'Unknown backend: {backendName}', { backendName: backend.name }))\n\t\t\t}\n\t\t\treturn $tr\n\t\t}\n\n\t\tconst selectAuthMechanism = $('')\n\t\tconst neededVisibility = (this._isPersonal) ? StorageConfig.Visibility.PERSONAL : StorageConfig.Visibility.ADMIN\n\t\t$.each(this._allAuthMechanisms, function(authIdentifier, authMechanism) {\n\t\t\tif (backend.authSchemes[authMechanism.scheme] && (authMechanism.visibility & neededVisibility)) {\n\t\t\t\tselectAuthMechanism.append(\n\t\t\t\t\t$(''),\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t\tif (storageConfig.authMechanism) {\n\t\t\tselectAuthMechanism.val(storageConfig.authMechanism)\n\t\t} else {\n\t\t\tstorageConfig.authMechanism = selectAuthMechanism.val()\n\t\t}\n\t\t$tr.find('td.authentication').append(selectAuthMechanism)\n\n\t\tconst $td = $tr.find('td.configuration')\n\t\t$.each(backend.configuration, _.partial(this.writeParameterInput, $td).bind(this))\n\n\t\tthis.trigger('selectBackend', $tr, backend.identifier, onCompletion)\n\t\tthis.configureAuthMechanism($tr, storageConfig.authMechanism, onCompletion)\n\n\t\tif (storageConfig.backendOptions) {\n\t\t\t$td.find('input, select').each(function() {\n\t\t\t\tconst input = $(this)\n\t\t\t\tconst val = storageConfig.backendOptions[input.data('parameter')]\n\t\t\t\tif (val !== undefined) {\n\t\t\t\t\tif (input.is('input:checkbox')) {\n\t\t\t\t\t\tinput.prop('checked', val)\n\t\t\t\t\t}\n\t\t\t\t\tinput.val(storageConfig.backendOptions[input.data('parameter')])\n\t\t\t\t\thighlightInput(input)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tlet applicable = []\n\t\tif (storageConfig.applicableUsers) {\n\t\t\tapplicable = applicable.concat(storageConfig.applicableUsers)\n\t\t}\n\t\tif (storageConfig.applicableGroups) {\n\t\t\tapplicable = applicable.concat(\n\t\t\t\t_.map(storageConfig.applicableGroups, function(group) {\n\t\t\t\t\treturn group + '(group)'\n\t\t\t\t}),\n\t\t\t)\n\t\t}\n\t\tif (applicable.length) {\n\t\t\t$tr.find('.applicableUsers').val(applicable).trigger('change')\n\t\t\t$tr.find('.applicableUsersContainer').removeClass('hidden')\n\t\t} else {\n\t\t\t// applicable to all\n\t\t\t$tr.find('.applicableUsersContainer').addClass('hidden')\n\t\t}\n\t\t$tr.find('.applicableToAllUsers').prop('checked', !applicable.length)\n\n\t\tconst priorityEl = $('')\n\t\t$tr.append(priorityEl)\n\n\t\tif (storageConfig.mountOptions) {\n\t\t\t$tr.find('input.mountOptions').val(JSON.stringify(storageConfig.mountOptions))\n\t\t} else {\n\t\t\t// FIXME default backend mount options\n\t\t\t$tr.find('input.mountOptions').val(JSON.stringify({\n\t\t\t\tencrypt: true,\n\t\t\t\tpreviews: true,\n\t\t\t\tenable_sharing: false,\n\t\t\t\tfilesystem_check_changes: 1,\n\t\t\t\tencoding_compatibility: false,\n\t\t\t\treadonly: false,\n\t\t\t}))\n\t\t}\n\n\t\treturn $tr\n\t},\n\n\t/**\n\t * Load storages into config rows\n\t */\n\tloadStorages() {\n\t\tconst self = this\n\n\t\tconst onLoaded1 = $.Deferred()\n\t\tconst onLoaded2 = $.Deferred()\n\n\t\tthis.$el.find('.externalStorageLoading').removeClass('hidden')\n\t\t$.when(onLoaded1, onLoaded2).always(() => {\n\t\t\tself.$el.find('.externalStorageLoading').addClass('hidden')\n\t\t})\n\n\t\tif (this._isPersonal) {\n\t\t\t// load userglobal storages\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: OC.generateUrl('apps/files_external/userglobalstorages'),\n\t\t\t\tdata: { testOnly: true },\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tsuccess(result) {\n\t\t\t\t\tresult = Object.values(result)\n\t\t\t\t\tconst onCompletion = jQuery.Deferred()\n\t\t\t\t\tlet $rows = $()\n\t\t\t\t\tresult.forEach(function(storageParams) {\n\t\t\t\t\t\tlet storageConfig\n\t\t\t\t\t\tconst isUserGlobal = storageParams.type === 'system' && self._isPersonal\n\t\t\t\t\t\tstorageParams.mountPoint = storageParams.mountPoint.substr(1) // trim leading slash\n\t\t\t\t\t\tif (isUserGlobal) {\n\t\t\t\t\t\t\tstorageConfig = new UserGlobalStorageConfig()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstorageConfig = new self._storageConfigClass()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_.extend(storageConfig, storageParams)\n\t\t\t\t\t\tconst $tr = self.newStorage(storageConfig, onCompletion, true)\n\n\t\t\t\t\t\t// userglobal storages must be at the top of the list\n\t\t\t\t\t\t$tr.detach()\n\t\t\t\t\t\tself.$el.prepend($tr)\n\n\t\t\t\t\t\tconst $authentication = $tr.find('.authentication')\n\t\t\t\t\t\t$authentication.text($authentication.find('select option:selected').text())\n\n\t\t\t\t\t\t// disable any other inputs\n\t\t\t\t\t\t$tr.find('.mountOptionsToggle, .remove').empty()\n\t\t\t\t\t\t$tr.find('input:not(.user_provided), select:not(.user_provided)').attr('disabled', 'disabled')\n\n\t\t\t\t\t\tif (isUserGlobal) {\n\t\t\t\t\t\t\t$tr.find('.configuration').find(':not(.user_provided)').remove()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// userglobal storages do not expose configuration data\n\t\t\t\t\t\t\t$tr.find('.configuration').text(t('files_external', 'Admin defined'))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// don't recheck config automatically when there are a large number of storages\n\t\t\t\t\t\tif (result.length < 20) {\n\t\t\t\t\t\t\tself.recheckStorageConfig($tr)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.INDETERMINATE, t('files_external', 'Automatic status checking is disabled due to the large number of configured storages, click to check status'))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$rows = $rows.add($tr)\n\t\t\t\t\t})\n\t\t\t\t\tinitApplicableUsersMultiselect(self.$el.find('.applicableUsers'), this._userListLimit)\n\t\t\t\t\tself.$el.find('tr#addMountPoint').before($rows)\n\t\t\t\t\tconst mainForm = $('#files_external')\n\t\t\t\t\tif (result.length === 0 && mainForm.attr('data-can-create') === 'false') {\n\t\t\t\t\t\tmainForm.hide()\n\t\t\t\t\t\t$('a[href=\"#external-storage\"]').parent().hide()\n\t\t\t\t\t\t$('.emptycontent').show()\n\t\t\t\t\t}\n\t\t\t\t\tonCompletion.resolve()\n\t\t\t\t\tonLoaded1.resolve()\n\t\t\t\t},\n\t\t\t})\n\t\t} else {\n\t\t\tonLoaded1.resolve()\n\t\t}\n\n\t\tconst url = this._storageConfigClass.prototype._url\n\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: OC.generateUrl(url),\n\t\t\tcontentType: 'application/json',\n\t\t\tsuccess(result) {\n\t\t\t\tresult = Object.values(result)\n\t\t\t\tconst onCompletion = jQuery.Deferred()\n\t\t\t\tlet $rows = $()\n\t\t\t\tresult.forEach(function(storageParams) {\n\t\t\t\t\tstorageParams.mountPoint = (storageParams.mountPoint === '/') ? '/' : storageParams.mountPoint.substr(1) // trim leading slash\n\t\t\t\t\tconst storageConfig = new self._storageConfigClass()\n\t\t\t\t\t_.extend(storageConfig, storageParams)\n\t\t\t\t\tconst $tr = self.newStorage(storageConfig, onCompletion, true)\n\n\t\t\t\t\t// don't recheck config automatically when there are a large number of storages\n\t\t\t\t\tif (result.length < 20) {\n\t\t\t\t\t\tself.recheckStorageConfig($tr)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.INDETERMINATE, t('files_external', 'Automatic status checking is disabled due to the large number of configured storages, click to check status'))\n\t\t\t\t\t}\n\t\t\t\t\t$rows = $rows.add($tr)\n\t\t\t\t})\n\t\t\t\tinitApplicableUsersMultiselect($rows.find('.applicableUsers'), this._userListLimit)\n\t\t\t\tself.$el.find('tr#addMountPoint').before($rows)\n\t\t\t\tonCompletion.resolve()\n\t\t\t\tonLoaded2.resolve()\n\t\t\t},\n\t\t})\n\t},\n\n\t/**\n\t * @param {jQuery} $td\n\t * @param {string} parameter\n\t * @param {string} placeholder\n\t * @param {Array} classes\n\t * @return {jQuery} newly created input\n\t */\n\twriteParameterInput($td, parameter, placeholder, classes) {\n\t\tconst hasFlag = function(flag) {\n\t\t\treturn (placeholder.flags & flag) === flag\n\t\t}\n\t\tclasses = $.isArray(classes) ? classes : []\n\t\tclasses.push('added')\n\t\tif (hasFlag(MountConfigListView.ParameterFlags.OPTIONAL)) {\n\t\t\tclasses.push('optional')\n\t\t}\n\n\t\tif (hasFlag(MountConfigListView.ParameterFlags.USER_PROVIDED)) {\n\t\t\tif (this._isPersonal) {\n\t\t\t\tclasses.push('user_provided')\n\t\t\t} else {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tlet newElement\n\n\t\tconst trimmedPlaceholder = placeholder.value\n\t\tif (hasFlag(MountConfigListView.ParameterFlags.HIDDEN)) {\n\t\t\tnewElement = $('')\n\t\t} else if (placeholder.type === MountConfigListView.ParameterTypes.PASSWORD) {\n\t\t\tnewElement = $('')\n\t\t} else if (placeholder.type === MountConfigListView.ParameterTypes.BOOLEAN) {\n\t\t\tconst checkboxId = _.uniqueId('checkbox_')\n\t\t\tnewElement = $('
')\n\t\t} else {\n\t\t\tnewElement = $('')\n\t\t}\n\n\t\tif (placeholder.defaultValue) {\n\t\t\tif (placeholder.type === MountConfigListView.ParameterTypes.BOOLEAN) {\n\t\t\t\tnewElement.find('input').prop('checked', placeholder.defaultValue)\n\t\t\t} else {\n\t\t\t\tnewElement.val(placeholder.defaultValue)\n\t\t\t}\n\t\t}\n\n\t\tif (placeholder.tooltip) {\n\t\t\tnewElement.attr('title', placeholder.tooltip)\n\t\t}\n\n\t\thighlightInput(newElement)\n\t\t$td.append(newElement)\n\t\treturn newElement\n\t},\n\n\t/**\n\t * Gets the storage model from the given row\n\t *\n\t * @param $tr row element\n\t * @return {OCA.Files_External.StorageConfig} storage model instance\n\t */\n\tgetStorageConfig($tr) {\n\t\tlet storageId = $tr.data('id')\n\t\tif (!storageId) {\n\t\t\t// new entry\n\t\t\tstorageId = null\n\t\t}\n\n\t\tlet storage = $tr.data('storageConfig')\n\t\tif (!storage) {\n\t\t\tstorage = new this._storageConfigClass(storageId)\n\t\t}\n\t\tstorage.errors = null\n\t\tstorage.mountPoint = $tr.find('.mountPoint input').val()\n\t\tstorage.backend = $tr.find('.backend').data('identifier')\n\t\tstorage.authMechanism = $tr.find('.selectAuthMechanism').val()\n\n\t\tconst classOptions = {}\n\t\tconst configuration = $tr.find('.configuration input')\n\t\tconst missingOptions = []\n\t\t$.each(configuration, function(index, input) {\n\t\t\tconst $input = $(input)\n\t\t\tconst parameter = $input.data('parameter')\n\t\t\tif ($input.attr('type') === 'button') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!isInputValid($input) && !$input.hasClass('optional')) {\n\t\t\t\tmissingOptions.push(parameter)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif ($(input).is(':checkbox')) {\n\t\t\t\tif ($(input).is(':checked')) {\n\t\t\t\t\tclassOptions[parameter] = true\n\t\t\t\t} else {\n\t\t\t\t\tclassOptions[parameter] = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tclassOptions[parameter] = $(input).val()\n\t\t\t}\n\t\t})\n\n\t\tstorage.backendOptions = classOptions\n\t\tif (missingOptions.length) {\n\t\t\tstorage.errors = {\n\t\t\t\tbackendOptions: missingOptions,\n\t\t\t}\n\t\t}\n\n\t\t// gather selected users and groups\n\t\tif (!this._isPersonal) {\n\t\t\tconst multiselect = getSelectedApplicable($tr)\n\t\t\tconst users = multiselect.users || []\n\t\t\tconst groups = multiselect.groups || []\n\t\t\tconst isApplicableToAllUsers = $tr.find('.applicableToAllUsers').is(':checked')\n\n\t\t\tif (isApplicableToAllUsers) {\n\t\t\t\tstorage.applicableUsers = []\n\t\t\t\tstorage.applicableGroups = []\n\t\t\t} else {\n\t\t\t\tstorage.applicableUsers = users\n\t\t\t\tstorage.applicableGroups = groups\n\n\t\t\t\tif (!storage.applicableUsers.length && !storage.applicableGroups.length) {\n\t\t\t\t\tif (!storage.errors) {\n\t\t\t\t\t\tstorage.errors = {}\n\t\t\t\t\t}\n\t\t\t\t\tstorage.errors.requiredApplicable = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstorage.priority = parseInt($tr.find('input.priority').val() || '100', 10)\n\t\t}\n\n\t\tconst mountOptions = $tr.find('input.mountOptions').val()\n\t\tif (mountOptions) {\n\t\t\tstorage.mountOptions = JSON.parse(mountOptions)\n\t\t}\n\n\t\treturn storage\n\t},\n\n\t/**\n\t * Deletes the storage from the given tr\n\t *\n\t * @param $tr storage row\n\t * @param Function callback callback to call after save\n\t */\n\tdeleteStorageConfig($tr) {\n\t\tconst self = this\n\t\tconst configId = $tr.data('id')\n\t\tif (!_.isNumber(configId)) {\n\t\t\t// deleting unsaved storage\n\t\t\t$tr.remove()\n\t\t\treturn\n\t\t}\n\t\tconst storage = new this._storageConfigClass(configId)\n\n\t\tOC.dialogs.confirm(\n\t\t\tt('files_external', 'Are you sure you want to disconnect this external storage?')\n\t\t\t+ ' '\n\t\t\t+ t('files_external', 'It will make the storage unavailable in {instanceName} and will lead to a deletion of these files and folders on any sync client that is currently connected but will not delete any files and folders on the external storage itself.',\n\t\t\t\t{\n\t\t\t\t\tstorage: this.mountPoint,\n\t\t\t\t\tinstanceName: window.OC.theme.name,\n\t\t\t\t},\n\t\t\t),\n\t\t\tt('files_external', 'Delete storage?'),\n\t\t\tfunction(confirm) {\n\t\t\t\tif (confirm) {\n\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.IN_PROGRESS)\n\n\t\t\t\t\tstorage.destroy({\n\t\t\t\t\t\tsuccess() {\n\t\t\t\t\t\t\t$tr.remove()\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror(result) {\n\t\t\t\t\t\t\tconst statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined\n\t\t\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage)\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t},\n\t\t)\n\t},\n\n\t/**\n\t * Saves the storage from the given tr\n\t *\n\t * @param $tr storage row\n\t * @param Function callback callback to call after save\n\t * @param callback\n\t * @param concurrentTimer only update if the timer matches this\n\t */\n\tsaveStorageConfig($tr, callback, concurrentTimer) {\n\t\tconst self = this\n\t\tconst storage = this.getStorageConfig($tr)\n\t\tif (!storage || !storage.validate()) {\n\t\t\treturn false\n\t\t}\n\n\t\tthis.updateStatus($tr, StorageConfig.Status.IN_PROGRESS)\n\t\tstorage.save({\n\t\t\tsuccess(result) {\n\t\t\t\tif (concurrentTimer === undefined\n\t\t\t\t\t|| $tr.data('save-timer') === concurrentTimer\n\t\t\t\t) {\n\t\t\t\t\tself.updateStatus($tr, result.status, result.statusMessage)\n\t\t\t\t\t$tr.data('id', result.id)\n\n\t\t\t\t\tif (_.isFunction(callback)) {\n\t\t\t\t\t\tcallback(storage)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\terror(result) {\n\t\t\t\tif (concurrentTimer === undefined\n\t\t\t\t\t|| $tr.data('save-timer') === concurrentTimer\n\t\t\t\t) {\n\t\t\t\t\tconst statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined\n\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage)\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t},\n\n\t/**\n\t * Recheck storage availability\n\t *\n\t * @param {jQuery} $tr storage row\n\t * @return {boolean} success\n\t */\n\trecheckStorageConfig($tr) {\n\t\tconst self = this\n\t\tconst storage = this.getStorageConfig($tr)\n\t\tif (!storage.validate()) {\n\t\t\treturn false\n\t\t}\n\n\t\tthis.updateStatus($tr, StorageConfig.Status.IN_PROGRESS)\n\t\tstorage.recheck({\n\t\t\tsuccess(result) {\n\t\t\t\tself.updateStatus($tr, result.status, result.statusMessage)\n\t\t\t},\n\t\t\terror(result) {\n\t\t\t\tconst statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined\n\t\t\t\tself.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage)\n\t\t\t},\n\t\t})\n\t},\n\n\t/**\n\t * Update status display\n\t *\n\t * @param {jQuery} $tr\n\t * @param {number} status\n\t * @param {string} message\n\t */\n\tupdateStatus($tr, status, message) {\n\t\tconst $statusSpan = $tr.find('.status span')\n\t\tswitch (status) {\n\t\tcase null:\n\t\t\t// remove status\n\t\t\t$statusSpan.hide()\n\t\t\tbreak\n\t\tcase StorageConfig.Status.IN_PROGRESS:\n\t\t\t$statusSpan.attr('class', 'icon-loading-small')\n\t\t\tbreak\n\t\tcase StorageConfig.Status.SUCCESS:\n\t\t\t$statusSpan.attr('class', 'success icon-checkmark-white')\n\t\t\tbreak\n\t\tcase StorageConfig.Status.INDETERMINATE:\n\t\t\t$statusSpan.attr('class', 'indeterminate icon-info-white')\n\t\t\tbreak\n\t\tdefault:\n\t\t\t$statusSpan.attr('class', 'error icon-error-white')\n\t\t}\n\t\tif (status !== null) {\n\t\t\t$statusSpan.show()\n\t\t}\n\t\tif (typeof message !== 'string') {\n\t\t\tmessage = t('files_external', 'Click to recheck the configuration')\n\t\t}\n\t\t$statusSpan.attr('title', message)\n\t},\n\n\t/**\n\t * Suggest mount point name that doesn't conflict with the existing names in the list\n\t *\n\t * @param {string} defaultMountPoint default name\n\t */\n\t_suggestMountPoint(defaultMountPoint) {\n\t\tconst $el = this.$el\n\t\tconst pos = defaultMountPoint.indexOf('/')\n\t\tif (pos !== -1) {\n\t\t\tdefaultMountPoint = defaultMountPoint.substring(0, pos)\n\t\t}\n\t\tdefaultMountPoint = defaultMountPoint.replace(/\\s+/g, '')\n\t\tlet i = 1\n\t\tlet append = ''\n\t\tlet match = true\n\t\twhile (match && i < 20) {\n\t\t\tmatch = false\n\t\t\t$el.find('tbody td.mountPoint input').each(function(index, mountPoint) {\n\t\t\t\tif ($(mountPoint).val() === defaultMountPoint + append) {\n\t\t\t\t\tmatch = true\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t})\n\t\t\tif (match) {\n\t\t\t\tappend = i\n\t\t\t\ti++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn defaultMountPoint + append\n\t},\n\n\t/**\n\t * Toggles the mount options dropdown\n\t *\n\t * @param {object} $tr configuration row\n\t */\n\t_showMountOptionsDropdown($tr) {\n\t\tconst self = this\n\t\tconst storage = this.getStorageConfig($tr)\n\t\tconst $toggle = $tr.find('.mountOptionsToggle')\n\t\tconst dropDown = new MountOptionsDropdown()\n\t\tconst visibleOptions = [\n\t\t\t'previews',\n\t\t\t'filesystem_check_changes',\n\t\t\t'enable_sharing',\n\t\t\t'encoding_compatibility',\n\t\t\t'readonly',\n\t\t\t'delete',\n\t\t]\n\t\tif (this._encryptionEnabled) {\n\t\t\tvisibleOptions.push('encrypt')\n\t\t}\n\t\tdropDown.show($toggle, storage.mountOptions || [], visibleOptions)\n\t\t$('body').on('mouseup.mountOptionsDropdown', function(event) {\n\t\t\tconst $target = $(event.target)\n\t\t\tif ($target.closest('.popovermenu').length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdropDown.hide()\n\t\t})\n\n\t\tdropDown.$el.on('hide', function() {\n\t\t\tconst mountOptions = dropDown.getOptions()\n\t\t\t$('body').off('mouseup.mountOptionsDropdown')\n\t\t\t$tr.find('input.mountOptions').val(JSON.stringify(mountOptions))\n\t\t\t$tr.find('td.mountOptionsToggle>.icon-more').attr('aria-expanded', 'false')\n\t\t\tself.saveStorageConfig($tr)\n\t\t})\n\t},\n}, OC.Backbone.Events)\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\tconst enabled = $('#files_external').attr('data-encryption-enabled')\n\tconst canCreateLocal = $('#files_external').attr('data-can-create-local')\n\tconst encryptionEnabled = (enabled === 'true')\n\tconst mountConfigListView = new MountConfigListView($('#externalStorage'), {\n\t\tencryptionEnabled,\n\t\tcanCreateLocal: (canCreateLocal === 'true'),\n\t})\n\tmountConfigListView.loadStorages()\n\n\t// TODO: move this into its own View class\n\tconst $allowUserMounting = $('#allowUserMounting')\n\t$allowUserMounting.bind('change', function() {\n\t\tOC.msg.startSaving('#userMountingMsg')\n\t\tif (this.checked) {\n\t\t\tOCP.AppConfig.setValue('files_external', 'allow_user_mounting', 'yes')\n\t\t\t$('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]').prop('checked', true)\n\t\t\t$('#userMountingBackends').removeClass('hidden')\n\t\t\t$('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]').eq(0).trigger('change')\n\t\t} else {\n\t\t\tOCP.AppConfig.setValue('files_external', 'allow_user_mounting', 'no')\n\t\t\t$('#userMountingBackends').addClass('hidden')\n\t\t}\n\t\tOC.msg.finishedSaving('#userMountingMsg', { status: 'success', data: { message: t('files_external', 'Saved') } })\n\t})\n\n\t$('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]').bind('change', function() {\n\t\tOC.msg.startSaving('#userMountingMsg')\n\n\t\tlet userMountingBackends = $('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]:checked').map(function() {\n\t\t\treturn $(this).val()\n\t\t}).get()\n\t\tconst deprecatedBackends = $('input[name=\"allowUserMountingBackends\\\\[\\\\]\"][data-deprecate-to]').map(function() {\n\t\t\tif ($.inArray($(this).data('deprecate-to'), userMountingBackends) !== -1) {\n\t\t\t\treturn $(this).val()\n\t\t\t}\n\t\t\treturn null\n\t\t}).get()\n\t\tuserMountingBackends = userMountingBackends.concat(deprecatedBackends)\n\n\t\tOCP.AppConfig.setValue('files_external', 'user_mounting_backends', userMountingBackends.join())\n\t\tOC.msg.finishedSaving('#userMountingMsg', { status: 'success', data: { message: t('files_external', 'Saved') } })\n\n\t\t// disable allowUserMounting\n\t\tif (userMountingBackends.length === 0) {\n\t\t\t$allowUserMounting.prop('checked', false)\n\t\t\t$allowUserMounting.trigger('change')\n\n\t\t}\n\t})\n\n\t$('#global_credentials').on('submit', async function(event) {\n\t\tevent.preventDefault()\n\t\tconst $form = $(this)\n\t\tconst $submit = $form.find('[type=submit]')\n\t\t$submit.val(t('files_external', 'Saving …'))\n\n\t\tconst uid = $form.find('[name=uid]').val()\n\t\tconst user = $form.find('[name=username]').val()\n\t\tconst password = $form.find('[name=password]').val()\n\n\t\ttry {\n\t\t\tawait axios.request({\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tuid,\n\t\t\t\t\tuser,\n\t\t\t\t\tpassword,\n\t\t\t\t},\n\t\t\t\turl: generateUrl('apps/files_external/globalcredentials'),\n\t\t\t\tconfirmPassword: PwdConfirmationMode.Strict,\n\t\t\t})\n\n\t\t\t$submit.val(t('files_external', 'Saved'))\n\t\t\tsetTimeout(function() {\n\t\t\t\t$submit.val(t('files_external', 'Save'))\n\t\t\t}, 2500)\n\t\t} catch (error) {\n\t\t\t$submit.val(t('files_external', 'Save'))\n\t\t\tif (isAxiosError(error)) {\n\t\t\t\tconst message = error.response?.data?.message || t('files_external', 'Failed to save global credentials')\n\t\t\t\tshowError(t('files_external', 'Failed to save global credentials: {message}', { message }))\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t})\n\n\t// global instance\n\tOCA.Files_External.Settings.mountConfig = mountConfigListView\n\n\t/**\n\t * Legacy\n\t *\n\t * @namespace\n\t * @deprecated use OCA.Files_External.Settings.mountConfig instead\n\t */\n\tOC.MountConfig = {\n\t\tsaveStorage: _.bind(mountConfigListView.saveStorageConfig, mountConfigListView),\n\t}\n})\n\n// export\n\nOCA.Files_External = OCA.Files_External || {}\n/**\n * @namespace\n */\nOCA.Files_External.Settings = OCA.Files_External.Settings || {}\n\nOCA.Files_External.Settings.GlobalStorageConfig = GlobalStorageConfig\nOCA.Files_External.Settings.UserStorageConfig = UserStorageConfig\nOCA.Files_External.Settings.MountConfigListView = MountConfigListView\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \"-\" + chunkId + \".js?v=\" + {\"640\":\"d4c5c018803ee8751b2a\",\"780\":\"e3ee44fa7690af29d8d7\",\"3564\":\"29e8338d43e0d4bd3995\",\"5810\":\"b550a24d46f75f92c2d5\",\"7471\":\"6423b9b898ffefeb7d1d\"}[chunkId] + \"\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 5808;","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t5808: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(80655)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","highlightBorder","$element","highlight","toggleClass","isInputValid","$input","optional","hasClass","attr","val","highlightInput","initApplicableUsersMultiselect","$elements","userListLimit","escapeHTML","text","toString","split","join","length","select2","placeholder","t","allowClear","multiple","toggleSelect","dropdownCssClass","ajax","url","OC","generateUrl","dataType","quietMillis","data","term","page","pattern","limit","offset","results","status","userCount","$","each","groups","gid","group","push","name","displayname","type","users","id","user","more","initSelection","element","callback","toSplit","i","contentType","JSON","stringify","done","formatResult","$result","$div","find","imagePath","html","get","outerHTML","formatSelection","escapeMarkup","m","on","div","avatar","event","target","closest","addPasswordConfirmationInterceptors","axios","StorageConfig","this","backendOptions","Status","IN_PROGRESS","SUCCESS","ERROR","INDETERMINATE","Visibility","NONE","PERSONAL","ADMIN","DEFAULT","prototype","_url","mountPoint","backend","authMechanism","mountOptions","save","options","method","_","isNumber","_save","result","request","confirmPassword","PwdConfirmationMode","Strict","getData","success","error","testOnly","recheck","isFunction","destroy","e","validate","errors","GlobalStorageConfig","applicableUsers","applicableGroups","extend","priority","apply","arguments","UserStorageConfig","UserGlobalStorageConfig","MountOptionsDropdown","$el","show","$container","visibleOptions","_last","hide","OCA","Files_External","Templates","mountOptionsDropDown","mountOptionsEncodingLabel","mountOptionsEncryptLabel","mountOptionsPreviewsLabel","mountOptionsSharingLabel","mountOptionsFilesystemCheckLabel","mountOptionsFilesystemCheckOnce","mountOptionsFilesystemCheckDA","mountOptionsReadOnlyLabel","deleteLabel","storage","parentNode","className","setOptions","appendTo","trigger","remove","getOptions","$this","key","value","prop","parseInt","ind","indexOf","splice","$optionEl","filterAttr","isString","row","$row","optionId","MountConfigListView","initialize","ParameterFlags","OPTIONAL","USER_PROVIDED","HIDDEN","ParameterTypes","TEXT","BOOLEAN","PASSWORD","_storageConfigClass","_isPersonal","_userListLimit","_allBackends","_allAuthMechanisms","_encryptionEnabled","Settings","isUndefined","encryptionEnabled","_canCreateLocal","canCreateLocal","_initEvents","whenSelectBackend","tr","whenSelectAuthMechanism","self","scheme","onChangeHandler","bind","_onChange","recheckStorageConfig","deleteStorageConfig","saveStorageConfig","_showMountOptionsDropdown","_onSelectBackend","_onSelectAuthMechanism","_onChangeApplicableToAllUsers","$target","$tr","updateStatus","storageConfig","onCompletion","jQuery","newStorage","resolve","children","not","first","focus","configureAuthMechanism","checked","is","authMechanismConfiguration","$td","configuration","partial","writeParameterInput","deferAppend","invalid","$template","clone","insertBefore","removeClass","last","removeAttr","_suggestMountPoint","addClass","identifier","empty","backendName","selectAuthMechanism","neededVisibility","authIdentifier","authSchemes","visibility","append","input","undefined","applicable","concat","map","priorityEl","encrypt","previews","enable_sharing","filesystem_check_changes","encoding_compatibility","readonly","loadStorages","onLoaded1","Deferred","onLoaded2","when","always","Object","values","$rows","forEach","storageParams","isUserGlobal","substr","detach","prepend","$authentication","add","before","mainForm","parent","parameter","classes","hasFlag","flag","flags","isArray","newElement","trimmedPlaceholder","checkboxId","uniqueId","defaultValue","tooltip","getStorageConfig","storageId","classOptions","missingOptions","index","multiselect","getSelection","pos","getSelectedApplicable","requiredApplicable","parse","configId","dialogs","confirm","instanceName","window","theme","statusMessage","responseJSON","message","concurrentTimer","$statusSpan","defaultMountPoint","substring","replace","match","$toggle","dropDown","off","Backbone","Events","addEventListener","enabled","mountConfigListView","$allowUserMounting","msg","startSaving","OCP","AppConfig","setValue","eq","finishedSaving","userMountingBackends","deprecatedBackends","inArray","async","preventDefault","$form","$submit","uid","password","setTimeout","isAxiosError","response","showError","mountConfig","MountConfig","saveStorage","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","O","chunkIds","fn","notFulfilled","Infinity","fulfilled","j","keys","every","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","f","chunkId","Promise","all","reduce","promises","u","g","globalThis","Function","obj","hasOwnProperty","l","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","removeChild","head","appendChild","Symbol","toStringTag","nmd","paths","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","p","b","baseURI","href","installedChunks","installedChunkData","promise","reject","errorType","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"files_external-settings.js?v=d9d50325821c735a67ea","mappings":"uBAAIA,ECAAC,EACAC,E,kGC4DJ,SAASC,EAAgBC,EAAUC,GAElC,OADAD,EAASE,YAAY,gBAAiBD,GAC/BA,CACR,CAMA,SAASE,EAAaC,GACrB,MAAMC,EAAWD,EAAOE,SAAS,YACjC,OAAQF,EAAOG,KAAK,SACpB,IAAK,OACL,IAAK,WACJ,GAAqB,KAAjBH,EAAOI,QAAiBH,EAC3B,OAAO,EAIT,OAAO,CACR,CAMA,SAASI,EAAeL,GACvB,OAAQA,EAAOG,KAAK,SACpB,IAAK,OACL,IAAK,WACJ,OAAOR,EAAgBK,GAASD,EAAaC,IAE/C,CASA,SAASM,EAA+BC,EAAWC,GAClD,MAAMC,EAAa,SAASC,GAC3B,OAAOA,EAAKC,WACVC,MAAM,KAAKC,KAAK,SAChBD,MAAM,KAAKC,KAAK,QAChBD,MAAM,KAAKC,KAAK,QAChBD,MAAM,KAAKC,KAAK,UAChBD,MAAM,KAAMC,KAAK,SACpB,EACA,GAAKN,EAAUO,OAGf,OAAOP,EAAUQ,QAAQ,CACxBC,aAAaC,EAAAA,EAAA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EAAUnB,EAAShT,GAChBuS,EAAoBwB,EAAEsD,EAAiBlD,IAAYkD,EAAgBlD,IACrEkD,EAAgBlD,GAAS,KAE1BkD,EAAgBlD,GAAW,EAE5B,OAAO5B,EAAoBQ,EAAE7P,IAG1B8U,EAAqBnP,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FmP,EAAmB3K,QAAQsK,EAAqB3O,KAAK,KAAM,IAC3DgP,EAAmB5Y,KAAOuY,EAAqB3O,KAAK,KAAMgP,EAAmB5Y,KAAK4J,KAAKgP,G,KCvFvFzF,EAAoBkD,QAAKxJ,ECGzB,IAAIgM,EAAsB1F,EAAoBQ,OAAE9G,EAAW,CAAC,MAAO,IAAOsG,EAAoB,QAC9F0F,EAAsB1F,EAAoBQ,EAAEkF,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/webpack/runtime/load script","webpack:///nextcloud/apps/files_external/src/settings.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/get javascript chunk filename","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/publicPath","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"nextcloud:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/**\n * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-FileCopyrightText: 2012-2016 ownCloud, Inc.\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { addPasswordConfirmationInterceptors, PwdConfirmationMode } from '@nextcloud/password-confirmation'\nimport { generateUrl } from '@nextcloud/router'\nimport { showError } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\nimport axios, { isAxiosError } from '@nextcloud/axios'\n\nimport jQuery from 'jquery'\n\naddPasswordConfirmationInterceptors(axios)\n\n/**\n * Returns the selection of applicable users in the given configuration row\n *\n * @param $row configuration row\n * @return array array of user names\n */\nfunction getSelection($row) {\n\tlet values = $row.find('.applicableUsers').select2('val')\n\tif (!values || values.length === 0) {\n\t\tvalues = []\n\t}\n\treturn values\n}\n\n/**\n *\n * @param $row\n */\nfunction getSelectedApplicable($row) {\n\tconst users = []\n\tconst groups = []\n\tconst multiselect = getSelection($row)\n\t$.each(multiselect, function(index, value) {\n\t\t// FIXME: don't rely on string parts to detect groups...\n\t\tconst pos = (value.indexOf) ? value.indexOf('(group)') : -1\n\t\tif (pos !== -1) {\n\t\t\tgroups.push(value.substr(0, pos))\n\t\t} else {\n\t\t\tusers.push(value)\n\t\t}\n\t})\n\n\t// FIXME: this should be done in the multiselect change event instead\n\t$row.find('.applicable')\n\t\t.data('applicable-groups', groups)\n\t\t.data('applicable-users', users)\n\n\treturn { users, groups }\n}\n\n/**\n *\n * @param $element\n * @param highlight\n */\nfunction highlightBorder($element, highlight) {\n\t$element.toggleClass('warning-input', highlight)\n\treturn highlight\n}\n\n/**\n *\n * @param $input\n */\nfunction isInputValid($input) {\n\tconst optional = $input.hasClass('optional')\n\tswitch ($input.attr('type')) {\n\tcase 'text':\n\tcase 'password':\n\t\tif ($input.val() === '' && !optional) {\n\t\t\treturn false\n\t\t}\n\t\tbreak\n\t}\n\treturn true\n}\n\n/**\n *\n * @param $input\n */\nfunction highlightInput($input) {\n\tswitch ($input.attr('type')) {\n\tcase 'text':\n\tcase 'password':\n\t\treturn highlightBorder($input, !isInputValid($input))\n\t}\n}\n\n/**\n * Initialize select2 plugin on the given elements\n *\n * @param {Array} array of jQuery elements\n * @param $elements\n * @param {number} userListLimit page size for result list\n */\nfunction initApplicableUsersMultiselect($elements, userListLimit) {\n\tconst escapeHTML = function(text) {\n\t\treturn text.toString()\n\t\t\t.split('&').join('&')\n\t\t\t.split('<').join('<')\n\t\t\t.split('>').join('>')\n\t\t\t.split('\"').join('"')\n\t\t\t.split('\\'').join(''')\n\t}\n\tif (!$elements.length) {\n\t\treturn\n\t}\n\treturn $elements.select2({\n\t\tplaceholder: t('files_external', 'Type to select account or group.'),\n\t\tallowClear: true,\n\t\tmultiple: true,\n\t\ttoggleSelect: true,\n\t\tdropdownCssClass: 'files-external-select2',\n\t\t// minimumInputLength: 1,\n\t\tajax: {\n\t\t\turl: OC.generateUrl('apps/files_external/ajax/applicable'),\n\t\t\tdataType: 'json',\n\t\t\tquietMillis: 100,\n\t\t\tdata(term, page) { // page is the one-based page number tracked by Select2\n\t\t\t\treturn {\n\t\t\t\t\tpattern: term, // search term\n\t\t\t\t\tlimit: userListLimit, // page size\n\t\t\t\t\toffset: userListLimit * (page - 1), // page number starts with 0\n\t\t\t\t}\n\t\t\t},\n\t\t\tresults(data) {\n\t\t\t\tconst results = []\n\t\t\t\tlet userCount = 0 // users is an object\n\n\t\t\t\t// add groups\n\t\t\t\t$.each(data.groups, function(gid, group) {\n\t\t\t\t\tresults.push({ name: gid + '(group)', displayname: group, type: 'group' })\n\t\t\t\t})\n\t\t\t\t// add users\n\t\t\t\t$.each(data.users, function(id, user) {\n\t\t\t\t\tuserCount++\n\t\t\t\t\tresults.push({ name: id, displayname: user, type: 'user' })\n\t\t\t\t})\n\n\t\t\t\tconst more = (userCount >= userListLimit) || (data.groups.length >= userListLimit)\n\t\t\t\treturn { results, more }\n\t\t\t},\n\t\t},\n\t\tinitSelection(element, callback) {\n\t\t\tconst users = {}\n\t\t\tusers.users = []\n\t\t\tconst toSplit = element.val().split(',')\n\t\t\tfor (let i = 0; i < toSplit.length; i++) {\n\t\t\t\tusers.users.push(toSplit[i])\n\t\t\t}\n\n\t\t\t$.ajax(OC.generateUrl('displaynames'), {\n\t\t\t\ttype: 'POST',\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tdata: JSON.stringify(users),\n\t\t\t\tdataType: 'json',\n\t\t\t}).done(function(data) {\n\t\t\t\tconst results = []\n\t\t\t\tif (data.status === 'success') {\n\t\t\t\t\t$.each(data.users, function(user, displayname) {\n\t\t\t\t\t\tif (displayname !== false) {\n\t\t\t\t\t\t\tresults.push({ name: user, displayname, type: 'user' })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tcallback(results)\n\t\t\t\t} else {\n\t\t\t\t\t// FIXME add error handling\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tid(element) {\n\t\t\treturn element.name\n\t\t},\n\t\tformatResult(element) {\n\t\t\tconst $result = $('
' + escapeHTML(element.displayname) + '
')\n\t\t\tconst $div = $result.find('.avatardiv')\n\t\t\t\t.attr('data-type', element.type)\n\t\t\t\t.attr('data-name', element.name)\n\t\t\t\t.attr('data-displayname', element.displayname)\n\t\t\tif (element.type === 'group') {\n\t\t\t\tconst url = OC.imagePath('core', 'actions/group')\n\t\t\t\t$div.html('')\n\t\t\t}\n\t\t\treturn $result.get(0).outerHTML\n\t\t},\n\t\tformatSelection(element) {\n\t\t\tif (element.type === 'group') {\n\t\t\t\treturn '' + escapeHTML(element.displayname + ' ' + t('files_external', '(Group)')) + ''\n\t\t\t} else {\n\t\t\t\treturn '' + escapeHTML(element.displayname) + ''\n\t\t\t}\n\t\t},\n\t\tescapeMarkup(m) { return m }, // we escape the markup in formatResult and formatSelection\n\t}).on('select2-loaded', function() {\n\t\t$.each($('.avatardiv'), function(i, div) {\n\t\t\tconst $div = $(div)\n\t\t\tif ($div.data('type') === 'user') {\n\t\t\t\t$div.avatar($div.data('name'), 32)\n\t\t\t}\n\t\t})\n\t}).on('change', function(event) {\n\t\thighlightBorder($(event.target).closest('.applicableUsersContainer').find('.select2-choices'), !event.val.length)\n\t})\n}\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc External storage config\n */\nconst StorageConfig = function(id) {\n\tthis.id = id\n\tthis.backendOptions = {}\n}\n// Keep this in sync with \\OCA\\Files_External\\MountConfig::STATUS_*\nStorageConfig.Status = {\n\tIN_PROGRESS: -1,\n\tSUCCESS: 0,\n\tERROR: 1,\n\tINDETERMINATE: 2,\n}\nStorageConfig.Visibility = {\n\tNONE: 0,\n\tPERSONAL: 1,\n\tADMIN: 2,\n\tDEFAULT: 3,\n}\n/**\n * @memberof OCA.Files_External.Settings\n */\nStorageConfig.prototype = {\n\t_url: null,\n\n\t/**\n\t * Storage id\n\t *\n\t * @type int\n\t */\n\tid: null,\n\n\t/**\n\t * Mount point\n\t *\n\t * @type string\n\t */\n\tmountPoint: '',\n\n\t/**\n\t * Backend\n\t *\n\t * @type string\n\t */\n\tbackend: null,\n\n\t/**\n\t * Authentication mechanism\n\t *\n\t * @type string\n\t */\n\tauthMechanism: null,\n\n\t/**\n\t * Backend-specific configuration\n\t *\n\t * @type Object.\n\t */\n\tbackendOptions: null,\n\n\t/**\n\t * Mount-specific options\n\t *\n\t * @type Object.\n\t */\n\tmountOptions: null,\n\n\t/**\n\t * Creates or saves the storage.\n\t *\n\t * @param {Function} [options.success] success callback, receives result as argument\n\t * @param {Function} [options.error] error callback\n\t * @param options\n\t */\n\tsave(options) {\n\t\tlet url = OC.generateUrl(this._url)\n\t\tlet method = 'POST'\n\t\tif (_.isNumber(this.id)) {\n\t\t\tmethod = 'PUT'\n\t\t\turl = OC.generateUrl(this._url + '/{id}', { id: this.id })\n\t\t}\n\n\t\tthis._save(method, url, options)\n\t},\n\n\t/**\n\t * Private implementation of the save function (called after potential password confirmation)\n\t * @param {string} method\n\t * @param {string} url\n\t * @param {{success: Function, error: Function}} options\n\t */\n\tasync _save(method, url, options) {\n\t\ttry {\n\t\t\tconst response = await axios.request({\n\t\t\t\tconfirmPassword: PwdConfirmationMode.Strict,\n\t\t\t\tmethod,\n\t\t\t\turl,\n\t\t\t\tdata: this.getData(),\n\t\t\t})\n\t\t\tconst result = response.data\n\t\t\tthis.id = result.id\n\t\t\toptions.success(result)\n\t\t} catch (error) {\n\t\t\toptions.error(error)\n\t\t}\n\t},\n\n\t/**\n\t * Returns the data from this object\n\t *\n\t * @return {Array} JSON array of the data\n\t */\n\tgetData() {\n\t\tconst data = {\n\t\t\tmountPoint: this.mountPoint,\n\t\t\tbackend: this.backend,\n\t\t\tauthMechanism: this.authMechanism,\n\t\t\tbackendOptions: this.backendOptions,\n\t\t\ttestOnly: true,\n\t\t}\n\t\tif (this.id) {\n\t\t\tdata.id = this.id\n\t\t}\n\t\tif (this.mountOptions) {\n\t\t\tdata.mountOptions = this.mountOptions\n\t\t}\n\t\treturn data\n\t},\n\n\t/**\n\t * Recheck the storage\n\t *\n\t * @param {Function} [options.success] success callback, receives result as argument\n\t * @param {Function} [options.error] error callback\n\t * @param options\n\t */\n\trecheck(options) {\n\t\tif (!_.isNumber(this.id)) {\n\t\t\tif (_.isFunction(options.error)) {\n\t\t\t\toptions.error()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: OC.generateUrl(this._url + '/{id}', { id: this.id }),\n\t\t\tdata: { testOnly: true },\n\t\t\tsuccess: options.success,\n\t\t\terror: options.error,\n\t\t})\n\t},\n\n\t/**\n\t * Deletes the storage\n\t *\n\t * @param {Function} [options.success] success callback\n\t * @param {Function} [options.error] error callback\n\t * @param options\n\t */\n\tasync destroy(options) {\n\t\tif (!_.isNumber(this.id)) {\n\t\t\t// the storage hasn't even been created => success\n\t\t\tif (_.isFunction(options.success)) {\n\t\t\t\toptions.success()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tawait axios.request({\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl: OC.generateUrl(this._url + '/{id}', { id: this.id }),\n\t\t\t\tconfirmPassword: PwdConfirmationMode.Strict,\n\t\t\t})\n\t\t\toptions.success()\n\t\t} catch (e) {\n\t\t\toptions.error(e)\n\t\t}\n\t},\n\n\t/**\n\t * Validate this model\n\t *\n\t * @return {boolean} false if errors exist, true otherwise\n\t */\n\tvalidate() {\n\t\tif (this.mountPoint === '') {\n\t\t\treturn false\n\t\t}\n\t\tif (!this.backend) {\n\t\t\treturn false\n\t\t}\n\t\tif (this.errors) {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t},\n}\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.GlobalStorageConfig\n * @augments OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc Global external storage config\n */\nconst GlobalStorageConfig = function(id) {\n\tthis.id = id\n\tthis.applicableUsers = []\n\tthis.applicableGroups = []\n}\n/**\n * @memberOf OCA.Files_External.Settings\n */\nGlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,\n\t/** @lends OCA.Files_External.Settings.GlobalStorageConfig.prototype */ {\n\t\t_url: 'apps/files_external/globalstorages',\n\n\t\t/**\n\t\t * Applicable users\n\t\t *\n\t\t * @type Array.\n\t\t */\n\t\tapplicableUsers: null,\n\n\t\t/**\n\t\t * Applicable groups\n\t\t *\n\t\t * @type Array.\n\t\t */\n\t\tapplicableGroups: null,\n\n\t\t/**\n\t\t * Storage priority\n\t\t *\n\t\t * @type int\n\t\t */\n\t\tpriority: null,\n\n\t\t/**\n\t\t * Returns the data from this object\n\t\t *\n\t\t * @return {Array} JSON array of the data\n\t\t */\n\t\tgetData() {\n\t\t\tconst data = StorageConfig.prototype.getData.apply(this, arguments)\n\t\t\treturn _.extend(data, {\n\t\t\t\tapplicableUsers: this.applicableUsers,\n\t\t\t\tapplicableGroups: this.applicableGroups,\n\t\t\t\tpriority: this.priority,\n\t\t\t})\n\t\t},\n\t})\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.UserStorageConfig\n * @augments OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc User external storage config\n */\nconst UserStorageConfig = function(id) {\n\tthis.id = id\n}\nUserStorageConfig.prototype = _.extend({}, StorageConfig.prototype,\n\t/** @lends OCA.Files_External.Settings.UserStorageConfig.prototype */ {\n\t\t_url: 'apps/files_external/userstorages',\n\t})\n\n/**\n * @param id\n * @class OCA.Files_External.Settings.UserGlobalStorageConfig\n * @augments OCA.Files_External.Settings.StorageConfig\n *\n * @classdesc User external storage config\n */\nconst UserGlobalStorageConfig = function(id) {\n\tthis.id = id\n}\nUserGlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,\n\t/** @lends OCA.Files_External.Settings.UserStorageConfig.prototype */ {\n\n\t\t_url: 'apps/files_external/userglobalstorages',\n\t})\n\n/**\n * @class OCA.Files_External.Settings.MountOptionsDropdown\n *\n * @classdesc Dropdown for mount options\n *\n * @param {object} $container container DOM object\n */\nconst MountOptionsDropdown = function() {\n}\n/**\n * @memberof OCA.Files_External.Settings\n */\nMountOptionsDropdown.prototype = {\n\t/**\n\t * Dropdown element\n\t *\n\t * @member Object\n\t */\n\t$el: null,\n\n\t/**\n\t * Show dropdown\n\t *\n\t * @param {object} $container container\n\t * @param {object} mountOptions mount options\n\t * @param {Array} visibleOptions enabled mount options\n\t */\n\tshow($container, mountOptions, visibleOptions) {\n\t\tif (MountOptionsDropdown._last) {\n\t\t\tMountOptionsDropdown._last.hide()\n\t\t}\n\n\t\tconst $el = $(OCA.Files_External.Templates.mountOptionsDropDown({\n\t\t\tmountOptionsEncodingLabel: t('files_external', 'Compatibility with Mac NFD encoding (slow)'),\n\t\t\tmountOptionsEncryptLabel: t('files_external', 'Enable encryption'),\n\t\t\tmountOptionsPreviewsLabel: t('files_external', 'Enable previews'),\n\t\t\tmountOptionsSharingLabel: t('files_external', 'Enable sharing'),\n\t\t\tmountOptionsFilesystemCheckLabel: t('files_external', 'Check for changes'),\n\t\t\tmountOptionsFilesystemCheckOnce: t('files_external', 'Never'),\n\t\t\tmountOptionsFilesystemCheckDA: t('files_external', 'Once every direct access'),\n\t\t\tmountOptionsReadOnlyLabel: t('files_external', 'Read only'),\n\t\t\tdeleteLabel: t('files_external', 'Disconnect'),\n\t\t}))\n\t\tthis.$el = $el\n\n\t\tconst storage = $container[0].parentNode.className\n\n\t\tthis.setOptions(mountOptions, visibleOptions, storage)\n\n\t\tthis.$el.appendTo($container)\n\t\tMountOptionsDropdown._last = this\n\n\t\tthis.$el.trigger('show')\n\t},\n\n\thide() {\n\t\tif (this.$el) {\n\t\t\tthis.$el.trigger('hide')\n\t\t\tthis.$el.remove()\n\t\t\tthis.$el = null\n\t\t\tMountOptionsDropdown._last = null\n\t\t}\n\t},\n\n\t/**\n\t * Returns the mount options from the dropdown controls\n\t *\n\t * @return {object} options mount options\n\t */\n\tgetOptions() {\n\t\tconst options = {}\n\n\t\tthis.$el.find('input, select').each(function() {\n\t\t\tconst $this = $(this)\n\t\t\tconst key = $this.attr('name')\n\t\t\tlet value = null\n\t\t\tif ($this.attr('type') === 'checkbox') {\n\t\t\t\tvalue = $this.prop('checked')\n\t\t\t} else {\n\t\t\t\tvalue = $this.val()\n\t\t\t}\n\t\t\tif ($this.attr('data-type') === 'int') {\n\t\t\t\tvalue = parseInt(value, 10)\n\t\t\t}\n\t\t\toptions[key] = value\n\t\t})\n\t\treturn options\n\t},\n\n\t/**\n\t * Sets the mount options to the dropdown controls\n\t *\n\t * @param {object} options mount options\n\t * @param {Array} visibleOptions enabled mount options\n\t * @param storage\n\t */\n\tsetOptions(options, visibleOptions, storage) {\n\t\tif (storage === 'owncloud') {\n\t\t\tconst ind = visibleOptions.indexOf('encrypt')\n\t\t\tif (ind > 0) {\n\t\t\t\tvisibleOptions.splice(ind, 1)\n\t\t\t}\n\t\t}\n\t\tconst $el = this.$el\n\t\t_.each(options, function(value, key) {\n\t\t\tconst $optionEl = $el.find('input, select').filterAttr('name', key)\n\t\t\tif ($optionEl.attr('type') === 'checkbox') {\n\t\t\t\tif (_.isString(value)) {\n\t\t\t\t\tvalue = (value === 'true')\n\t\t\t\t}\n\t\t\t\t$optionEl.prop('checked', !!value)\n\t\t\t} else {\n\t\t\t\t$optionEl.val(value)\n\t\t\t}\n\t\t})\n\t\t$el.find('.optionRow').each(function(i, row) {\n\t\t\tconst $row = $(row)\n\t\t\tconst optionId = $row.find('input, select').attr('name')\n\t\t\tif (visibleOptions.indexOf(optionId) === -1 && !$row.hasClass('persistent')) {\n\t\t\t\t$row.hide()\n\t\t\t} else {\n\t\t\t\t$row.show()\n\t\t\t}\n\t\t})\n\t},\n}\n\n/**\n * @class OCA.Files_External.Settings.MountConfigListView\n *\n * @classdesc Mount configuration list view\n *\n * @param {object} $el DOM object containing the list\n * @param {object} [options]\n * @param {number} [options.userListLimit] page size in applicable users dropdown\n */\nconst MountConfigListView = function($el, options) {\n\tthis.initialize($el, options)\n}\n\nMountConfigListView.ParameterFlags = {\n\tOPTIONAL: 1,\n\tUSER_PROVIDED: 2,\n\tHIDDEN: 4,\n}\n\nMountConfigListView.ParameterTypes = {\n\tTEXT: 0,\n\tBOOLEAN: 1,\n\tPASSWORD: 2,\n}\n\n/**\n * @memberOf OCA.Files_External.Settings\n */\nMountConfigListView.prototype = _.extend({\n\n\t/**\n\t * jQuery element containing the config list\n\t *\n\t * @type Object\n\t */\n\t$el: null,\n\n\t/**\n\t * Storage config class\n\t *\n\t * @type Class\n\t */\n\t_storageConfigClass: null,\n\n\t/**\n\t * Flag whether the list is about user storage configs (true)\n\t * or global storage configs (false)\n\t *\n\t * @type bool\n\t */\n\t_isPersonal: false,\n\n\t/**\n\t * Page size in applicable users dropdown\n\t *\n\t * @type int\n\t */\n\t_userListLimit: 30,\n\n\t/**\n\t * List of supported backends\n\t *\n\t * @type Object.\n\t */\n\t_allBackends: null,\n\n\t/**\n\t * List of all supported authentication mechanisms\n\t *\n\t * @type Object.\n\t */\n\t_allAuthMechanisms: null,\n\n\t_encryptionEnabled: false,\n\n\t/**\n\t * @param {object} $el DOM object containing the list\n\t * @param {object} [options]\n\t * @param {number} [options.userListLimit] page size in applicable users dropdown\n\t */\n\tinitialize($el, options) {\n\t\tthis.$el = $el\n\t\tthis._isPersonal = ($el.data('admin') !== true)\n\t\tif (this._isPersonal) {\n\t\t\tthis._storageConfigClass = OCA.Files_External.Settings.UserStorageConfig\n\t\t} else {\n\t\t\tthis._storageConfigClass = OCA.Files_External.Settings.GlobalStorageConfig\n\t\t}\n\n\t\tif (options && !_.isUndefined(options.userListLimit)) {\n\t\t\tthis._userListLimit = options.userListLimit\n\t\t}\n\n\t\tthis._encryptionEnabled = options.encryptionEnabled\n\t\tthis._canCreateLocal = options.canCreateLocal\n\n\t\t// read the backend config that was carefully crammed\n\t\t// into the data-configurations attribute of the select\n\t\tthis._allBackends = this.$el.find('.selectBackend').data('configurations')\n\t\tthis._allAuthMechanisms = this.$el.find('#addMountPoint .authentication').data('mechanisms')\n\n\t\tthis._initEvents()\n\t},\n\n\t/**\n\t * Custom JS event handlers\n\t * Trigger callback for all existing configurations\n\t * @param callback\n\t */\n\twhenSelectBackend(callback) {\n\t\tthis.$el.find('tbody tr:not(#addMountPoint):not(.externalStorageLoading)').each(function(i, tr) {\n\t\t\tconst backend = $(tr).find('.backend').data('identifier')\n\t\t\tcallback($(tr), backend)\n\t\t})\n\t\tthis.on('selectBackend', callback)\n\t},\n\twhenSelectAuthMechanism(callback) {\n\t\tconst self = this\n\t\tthis.$el.find('tbody tr:not(#addMountPoint):not(.externalStorageLoading)').each(function(i, tr) {\n\t\t\tconst authMechanism = $(tr).find('.selectAuthMechanism').val()\n\t\t\tcallback($(tr), authMechanism, self._allAuthMechanisms[authMechanism].scheme)\n\t\t})\n\t\tthis.on('selectAuthMechanism', callback)\n\t},\n\n\t/**\n\t * Initialize DOM event handlers\n\t */\n\t_initEvents() {\n\t\tconst self = this\n\n\t\tconst onChangeHandler = _.bind(this._onChange, this)\n\t\t// this.$el.on('input', 'td input', onChangeHandler);\n\t\tthis.$el.on('keyup', 'td input', onChangeHandler)\n\t\tthis.$el.on('paste', 'td input', onChangeHandler)\n\t\tthis.$el.on('change', 'td input:checkbox', onChangeHandler)\n\t\tthis.$el.on('change', '.applicable', onChangeHandler)\n\n\t\tthis.$el.on('click', '.status>span', function() {\n\t\t\tself.recheckStorageConfig($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('click', 'td.mountOptionsToggle .icon-delete', function() {\n\t\t\tself.deleteStorageConfig($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('click', 'td.save>.icon-checkmark', function() {\n\t\t\tself.saveStorageConfig($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('click', 'td.mountOptionsToggle>.icon-more', function() {\n\t\t\t$(this).attr('aria-expanded', 'true')\n\t\t\tself._showMountOptionsDropdown($(this).closest('tr'))\n\t\t})\n\n\t\tthis.$el.on('change', '.selectBackend', _.bind(this._onSelectBackend, this))\n\t\tthis.$el.on('change', '.selectAuthMechanism', _.bind(this._onSelectAuthMechanism, this))\n\n\t\tthis.$el.on('change', '.applicableToAllUsers', _.bind(this._onChangeApplicableToAllUsers, this))\n\t},\n\n\t_onChange(event) {\n\t\tconst $target = $(event.target)\n\t\tif ($target.closest('.dropdown').length) {\n\t\t\t// ignore dropdown events\n\t\t\treturn\n\t\t}\n\t\thighlightInput($target)\n\t\tconst $tr = $target.closest('tr')\n\t\tthis.updateStatus($tr, null)\n\t},\n\n\t_onSelectBackend(event) {\n\t\tconst $target = $(event.target)\n\t\tlet $tr = $target.closest('tr')\n\n\t\tconst storageConfig = new this._storageConfigClass()\n\t\tstorageConfig.mountPoint = $tr.find('.mountPoint input').val()\n\t\tstorageConfig.backend = $target.val()\n\t\t$tr.find('.mountPoint input').val('')\n\n\t\t$tr.find('.selectBackend').prop('selectedIndex', 0)\n\n\t\tconst onCompletion = jQuery.Deferred()\n\t\t$tr = this.newStorage(storageConfig, onCompletion)\n\t\t$tr.find('.applicableToAllUsers').prop('checked', false).trigger('change')\n\t\tonCompletion.resolve()\n\n\t\t$tr.find('td.configuration').children().not('[type=hidden]').first().focus()\n\t\tthis.saveStorageConfig($tr)\n\t},\n\n\t_onSelectAuthMechanism(event) {\n\t\tconst $target = $(event.target)\n\t\tconst $tr = $target.closest('tr')\n\t\tconst authMechanism = $target.val()\n\n\t\tconst onCompletion = jQuery.Deferred()\n\t\tthis.configureAuthMechanism($tr, authMechanism, onCompletion)\n\t\tonCompletion.resolve()\n\n\t\tthis.saveStorageConfig($tr)\n\t},\n\n\t_onChangeApplicableToAllUsers(event) {\n\t\tconst $target = $(event.target)\n\t\tconst $tr = $target.closest('tr')\n\t\tconst checked = $target.is(':checked')\n\n\t\t$tr.find('.applicableUsersContainer').toggleClass('hidden', checked)\n\t\tif (!checked) {\n\t\t\t$tr.find('.applicableUsers').select2('val', '', true)\n\t\t}\n\n\t\tthis.saveStorageConfig($tr)\n\t},\n\n\t/**\n\t * Configure the storage config with a new authentication mechanism\n\t *\n\t * @param {jQuery} $tr config row\n\t * @param {string} authMechanism\n\t * @param {jQuery.Deferred} onCompletion\n\t */\n\tconfigureAuthMechanism($tr, authMechanism, onCompletion) {\n\t\tconst authMechanismConfiguration = this._allAuthMechanisms[authMechanism]\n\t\tconst $td = $tr.find('td.configuration')\n\t\t$td.find('.auth-param').remove()\n\n\t\t$.each(authMechanismConfiguration.configuration, _.partial(\n\t\t\tthis.writeParameterInput, $td, _, _, ['auth-param'],\n\t\t).bind(this))\n\n\t\tthis.trigger('selectAuthMechanism',\n\t\t\t$tr, authMechanism, authMechanismConfiguration.scheme, onCompletion,\n\t\t)\n\t},\n\n\t/**\n\t * Create a config row for a new storage\n\t *\n\t * @param {StorageConfig} storageConfig storage config to pull values from\n\t * @param {jQuery.Deferred} onCompletion\n\t * @param {boolean} deferAppend\n\t * @return {jQuery} created row\n\t */\n\tnewStorage(storageConfig, onCompletion, deferAppend) {\n\t\tlet mountPoint = storageConfig.mountPoint\n\t\tlet backend = this._allBackends[storageConfig.backend]\n\n\t\tif (!backend) {\n\t\t\tbackend = {\n\t\t\t\tname: 'Unknown: ' + storageConfig.backend,\n\t\t\t\tinvalid: true,\n\t\t\t}\n\t\t}\n\n\t\t// FIXME: Replace with a proper Handlebar template\n\t\tconst $template = this.$el.find('tr#addMountPoint')\n\t\tconst $tr = $template.clone()\n\t\tif (!deferAppend) {\n\t\t\t$tr.insertBefore($template)\n\t\t}\n\n\t\t$tr.data('storageConfig', storageConfig)\n\t\t$tr.show()\n\t\t$tr.find('td.mountOptionsToggle, td.save, td.remove').removeClass('hidden')\n\t\t$tr.find('td').last().removeAttr('style')\n\t\t$tr.removeAttr('id')\n\t\t$tr.find('select#selectBackend')\n\t\tif (!deferAppend) {\n\t\t\tinitApplicableUsersMultiselect($tr.find('.applicableUsers'), this._userListLimit)\n\t\t}\n\n\t\tif (storageConfig.id) {\n\t\t\t$tr.data('id', storageConfig.id)\n\t\t}\n\n\t\t$tr.find('.backend').text(backend.name)\n\t\tif (mountPoint === '') {\n\t\t\tmountPoint = this._suggestMountPoint(backend.name)\n\t\t}\n\t\t$tr.find('.mountPoint input').val(mountPoint)\n\t\t$tr.addClass(backend.identifier)\n\t\t$tr.find('.backend').data('identifier', backend.identifier)\n\n\t\tif (backend.invalid || (backend.identifier === 'local' && !this._canCreateLocal)) {\n\t\t\t$tr.find('[name=mountPoint]').prop('disabled', true)\n\t\t\t$tr.find('.applicable,.mountOptionsToggle').empty()\n\t\t\t$tr.find('.save').empty()\n\t\t\tif (backend.invalid) {\n\t\t\t\tthis.updateStatus($tr, false, t('files_external', 'Unknown backend: {backendName}', { backendName: backend.name }))\n\t\t\t}\n\t\t\treturn $tr\n\t\t}\n\n\t\tconst selectAuthMechanism = $('')\n\t\tconst neededVisibility = (this._isPersonal) ? StorageConfig.Visibility.PERSONAL : StorageConfig.Visibility.ADMIN\n\t\t$.each(this._allAuthMechanisms, function(authIdentifier, authMechanism) {\n\t\t\tif (backend.authSchemes[authMechanism.scheme] && (authMechanism.visibility & neededVisibility)) {\n\t\t\t\tselectAuthMechanism.append(\n\t\t\t\t\t$(''),\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t\tif (storageConfig.authMechanism) {\n\t\t\tselectAuthMechanism.val(storageConfig.authMechanism)\n\t\t} else {\n\t\t\tstorageConfig.authMechanism = selectAuthMechanism.val()\n\t\t}\n\t\t$tr.find('td.authentication').append(selectAuthMechanism)\n\n\t\tconst $td = $tr.find('td.configuration')\n\t\t$.each(backend.configuration, _.partial(this.writeParameterInput, $td).bind(this))\n\n\t\tthis.trigger('selectBackend', $tr, backend.identifier, onCompletion)\n\t\tthis.configureAuthMechanism($tr, storageConfig.authMechanism, onCompletion)\n\n\t\tif (storageConfig.backendOptions) {\n\t\t\t$td.find('input, select').each(function() {\n\t\t\t\tconst input = $(this)\n\t\t\t\tconst val = storageConfig.backendOptions[input.data('parameter')]\n\t\t\t\tif (val !== undefined) {\n\t\t\t\t\tif (input.is('input:checkbox')) {\n\t\t\t\t\t\tinput.prop('checked', val)\n\t\t\t\t\t}\n\t\t\t\t\tinput.val(storageConfig.backendOptions[input.data('parameter')])\n\t\t\t\t\thighlightInput(input)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tlet applicable = []\n\t\tif (storageConfig.applicableUsers) {\n\t\t\tapplicable = applicable.concat(storageConfig.applicableUsers)\n\t\t}\n\t\tif (storageConfig.applicableGroups) {\n\t\t\tapplicable = applicable.concat(\n\t\t\t\t_.map(storageConfig.applicableGroups, function(group) {\n\t\t\t\t\treturn group + '(group)'\n\t\t\t\t}),\n\t\t\t)\n\t\t}\n\t\tif (applicable.length) {\n\t\t\t$tr.find('.applicableUsers').val(applicable).trigger('change')\n\t\t\t$tr.find('.applicableUsersContainer').removeClass('hidden')\n\t\t} else {\n\t\t\t// applicable to all\n\t\t\t$tr.find('.applicableUsersContainer').addClass('hidden')\n\t\t}\n\t\t$tr.find('.applicableToAllUsers').prop('checked', !applicable.length)\n\n\t\tconst priorityEl = $('')\n\t\t$tr.append(priorityEl)\n\n\t\tif (storageConfig.mountOptions) {\n\t\t\t$tr.find('input.mountOptions').val(JSON.stringify(storageConfig.mountOptions))\n\t\t} else {\n\t\t\t// FIXME default backend mount options\n\t\t\t$tr.find('input.mountOptions').val(JSON.stringify({\n\t\t\t\tencrypt: true,\n\t\t\t\tpreviews: true,\n\t\t\t\tenable_sharing: false,\n\t\t\t\tfilesystem_check_changes: 1,\n\t\t\t\tencoding_compatibility: false,\n\t\t\t\treadonly: false,\n\t\t\t}))\n\t\t}\n\n\t\treturn $tr\n\t},\n\n\t/**\n\t * Load storages into config rows\n\t */\n\tloadStorages() {\n\t\tconst self = this\n\n\t\tconst onLoaded1 = $.Deferred()\n\t\tconst onLoaded2 = $.Deferred()\n\n\t\tthis.$el.find('.externalStorageLoading').removeClass('hidden')\n\t\t$.when(onLoaded1, onLoaded2).always(() => {\n\t\t\tself.$el.find('.externalStorageLoading').addClass('hidden')\n\t\t})\n\n\t\tif (this._isPersonal) {\n\t\t\t// load userglobal storages\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: OC.generateUrl('apps/files_external/userglobalstorages'),\n\t\t\t\tdata: { testOnly: true },\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tsuccess(result) {\n\t\t\t\t\tresult = Object.values(result)\n\t\t\t\t\tconst onCompletion = jQuery.Deferred()\n\t\t\t\t\tlet $rows = $()\n\t\t\t\t\tresult.forEach(function(storageParams) {\n\t\t\t\t\t\tlet storageConfig\n\t\t\t\t\t\tconst isUserGlobal = storageParams.type === 'system' && self._isPersonal\n\t\t\t\t\t\tstorageParams.mountPoint = storageParams.mountPoint.substr(1) // trim leading slash\n\t\t\t\t\t\tif (isUserGlobal) {\n\t\t\t\t\t\t\tstorageConfig = new UserGlobalStorageConfig()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstorageConfig = new self._storageConfigClass()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_.extend(storageConfig, storageParams)\n\t\t\t\t\t\tconst $tr = self.newStorage(storageConfig, onCompletion, true)\n\n\t\t\t\t\t\t// userglobal storages must be at the top of the list\n\t\t\t\t\t\t$tr.detach()\n\t\t\t\t\t\tself.$el.prepend($tr)\n\n\t\t\t\t\t\tconst $authentication = $tr.find('.authentication')\n\t\t\t\t\t\t$authentication.text($authentication.find('select option:selected').text())\n\n\t\t\t\t\t\t// disable any other inputs\n\t\t\t\t\t\t$tr.find('.mountOptionsToggle, .remove').empty()\n\t\t\t\t\t\t$tr.find('input:not(.user_provided), select:not(.user_provided)').attr('disabled', 'disabled')\n\n\t\t\t\t\t\tif (isUserGlobal) {\n\t\t\t\t\t\t\t$tr.find('.configuration').find(':not(.user_provided)').remove()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// userglobal storages do not expose configuration data\n\t\t\t\t\t\t\t$tr.find('.configuration').text(t('files_external', 'Admin defined'))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// don't recheck config automatically when there are a large number of storages\n\t\t\t\t\t\tif (result.length < 20) {\n\t\t\t\t\t\t\tself.recheckStorageConfig($tr)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.INDETERMINATE, t('files_external', 'Automatic status checking is disabled due to the large number of configured storages, click to check status'))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$rows = $rows.add($tr)\n\t\t\t\t\t})\n\t\t\t\t\tinitApplicableUsersMultiselect(self.$el.find('.applicableUsers'), this._userListLimit)\n\t\t\t\t\tself.$el.find('tr#addMountPoint').before($rows)\n\t\t\t\t\tconst mainForm = $('#files_external')\n\t\t\t\t\tif (result.length === 0 && mainForm.attr('data-can-create') === 'false') {\n\t\t\t\t\t\tmainForm.hide()\n\t\t\t\t\t\t$('a[href=\"#external-storage\"]').parent().hide()\n\t\t\t\t\t\t$('.emptycontent').show()\n\t\t\t\t\t}\n\t\t\t\t\tonCompletion.resolve()\n\t\t\t\t\tonLoaded1.resolve()\n\t\t\t\t},\n\t\t\t})\n\t\t} else {\n\t\t\tonLoaded1.resolve()\n\t\t}\n\n\t\tconst url = this._storageConfigClass.prototype._url\n\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: OC.generateUrl(url),\n\t\t\tcontentType: 'application/json',\n\t\t\tsuccess(result) {\n\t\t\t\tresult = Object.values(result)\n\t\t\t\tconst onCompletion = jQuery.Deferred()\n\t\t\t\tlet $rows = $()\n\t\t\t\tresult.forEach(function(storageParams) {\n\t\t\t\t\tstorageParams.mountPoint = (storageParams.mountPoint === '/') ? '/' : storageParams.mountPoint.substr(1) // trim leading slash\n\t\t\t\t\tconst storageConfig = new self._storageConfigClass()\n\t\t\t\t\t_.extend(storageConfig, storageParams)\n\t\t\t\t\tconst $tr = self.newStorage(storageConfig, onCompletion, true)\n\n\t\t\t\t\t// don't recheck config automatically when there are a large number of storages\n\t\t\t\t\tif (result.length < 20) {\n\t\t\t\t\t\tself.recheckStorageConfig($tr)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.INDETERMINATE, t('files_external', 'Automatic status checking is disabled due to the large number of configured storages, click to check status'))\n\t\t\t\t\t}\n\t\t\t\t\t$rows = $rows.add($tr)\n\t\t\t\t})\n\t\t\t\tinitApplicableUsersMultiselect($rows.find('.applicableUsers'), this._userListLimit)\n\t\t\t\tself.$el.find('tr#addMountPoint').before($rows)\n\t\t\t\tonCompletion.resolve()\n\t\t\t\tonLoaded2.resolve()\n\t\t\t},\n\t\t})\n\t},\n\n\t/**\n\t * @param {jQuery} $td\n\t * @param {string} parameter\n\t * @param {string} placeholder\n\t * @param {Array} classes\n\t * @return {jQuery} newly created input\n\t */\n\twriteParameterInput($td, parameter, placeholder, classes) {\n\t\tconst hasFlag = function(flag) {\n\t\t\treturn (placeholder.flags & flag) === flag\n\t\t}\n\t\tclasses = $.isArray(classes) ? classes : []\n\t\tclasses.push('added')\n\t\tif (hasFlag(MountConfigListView.ParameterFlags.OPTIONAL)) {\n\t\t\tclasses.push('optional')\n\t\t}\n\n\t\tif (hasFlag(MountConfigListView.ParameterFlags.USER_PROVIDED)) {\n\t\t\tif (this._isPersonal) {\n\t\t\t\tclasses.push('user_provided')\n\t\t\t} else {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tlet newElement\n\n\t\tconst trimmedPlaceholder = placeholder.value\n\t\tif (hasFlag(MountConfigListView.ParameterFlags.HIDDEN)) {\n\t\t\tnewElement = $('')\n\t\t} else if (placeholder.type === MountConfigListView.ParameterTypes.PASSWORD) {\n\t\t\tnewElement = $('')\n\t\t} else if (placeholder.type === MountConfigListView.ParameterTypes.BOOLEAN) {\n\t\t\tconst checkboxId = _.uniqueId('checkbox_')\n\t\t\tnewElement = $('
')\n\t\t} else {\n\t\t\tnewElement = $('')\n\t\t}\n\n\t\tif (placeholder.defaultValue) {\n\t\t\tif (placeholder.type === MountConfigListView.ParameterTypes.BOOLEAN) {\n\t\t\t\tnewElement.find('input').prop('checked', placeholder.defaultValue)\n\t\t\t} else {\n\t\t\t\tnewElement.val(placeholder.defaultValue)\n\t\t\t}\n\t\t}\n\n\t\tif (placeholder.tooltip) {\n\t\t\tnewElement.attr('title', placeholder.tooltip)\n\t\t}\n\n\t\thighlightInput(newElement)\n\t\t$td.append(newElement)\n\t\treturn newElement\n\t},\n\n\t/**\n\t * Gets the storage model from the given row\n\t *\n\t * @param $tr row element\n\t * @return {OCA.Files_External.StorageConfig} storage model instance\n\t */\n\tgetStorageConfig($tr) {\n\t\tlet storageId = $tr.data('id')\n\t\tif (!storageId) {\n\t\t\t// new entry\n\t\t\tstorageId = null\n\t\t}\n\n\t\tlet storage = $tr.data('storageConfig')\n\t\tif (!storage) {\n\t\t\tstorage = new this._storageConfigClass(storageId)\n\t\t}\n\t\tstorage.errors = null\n\t\tstorage.mountPoint = $tr.find('.mountPoint input').val()\n\t\tstorage.backend = $tr.find('.backend').data('identifier')\n\t\tstorage.authMechanism = $tr.find('.selectAuthMechanism').val()\n\n\t\tconst classOptions = {}\n\t\tconst configuration = $tr.find('.configuration input')\n\t\tconst missingOptions = []\n\t\t$.each(configuration, function(index, input) {\n\t\t\tconst $input = $(input)\n\t\t\tconst parameter = $input.data('parameter')\n\t\t\tif ($input.attr('type') === 'button') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!isInputValid($input) && !$input.hasClass('optional')) {\n\t\t\t\tmissingOptions.push(parameter)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif ($(input).is(':checkbox')) {\n\t\t\t\tif ($(input).is(':checked')) {\n\t\t\t\t\tclassOptions[parameter] = true\n\t\t\t\t} else {\n\t\t\t\t\tclassOptions[parameter] = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tclassOptions[parameter] = $(input).val()\n\t\t\t}\n\t\t})\n\n\t\tstorage.backendOptions = classOptions\n\t\tif (missingOptions.length) {\n\t\t\tstorage.errors = {\n\t\t\t\tbackendOptions: missingOptions,\n\t\t\t}\n\t\t}\n\n\t\t// gather selected users and groups\n\t\tif (!this._isPersonal) {\n\t\t\tconst multiselect = getSelectedApplicable($tr)\n\t\t\tconst users = multiselect.users || []\n\t\t\tconst groups = multiselect.groups || []\n\t\t\tconst isApplicableToAllUsers = $tr.find('.applicableToAllUsers').is(':checked')\n\n\t\t\tif (isApplicableToAllUsers) {\n\t\t\t\tstorage.applicableUsers = []\n\t\t\t\tstorage.applicableGroups = []\n\t\t\t} else {\n\t\t\t\tstorage.applicableUsers = users\n\t\t\t\tstorage.applicableGroups = groups\n\n\t\t\t\tif (!storage.applicableUsers.length && !storage.applicableGroups.length) {\n\t\t\t\t\tif (!storage.errors) {\n\t\t\t\t\t\tstorage.errors = {}\n\t\t\t\t\t}\n\t\t\t\t\tstorage.errors.requiredApplicable = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstorage.priority = parseInt($tr.find('input.priority').val() || '100', 10)\n\t\t}\n\n\t\tconst mountOptions = $tr.find('input.mountOptions').val()\n\t\tif (mountOptions) {\n\t\t\tstorage.mountOptions = JSON.parse(mountOptions)\n\t\t}\n\n\t\treturn storage\n\t},\n\n\t/**\n\t * Deletes the storage from the given tr\n\t *\n\t * @param $tr storage row\n\t * @param Function callback callback to call after save\n\t */\n\tdeleteStorageConfig($tr) {\n\t\tconst self = this\n\t\tconst configId = $tr.data('id')\n\t\tif (!_.isNumber(configId)) {\n\t\t\t// deleting unsaved storage\n\t\t\t$tr.remove()\n\t\t\treturn\n\t\t}\n\t\tconst storage = new this._storageConfigClass(configId)\n\n\t\tOC.dialogs.confirm(\n\t\t\tt('files_external', 'Are you sure you want to disconnect this external storage?')\n\t\t\t+ ' '\n\t\t\t+ t('files_external', 'It will make the storage unavailable in {instanceName} and will lead to a deletion of these files and folders on any sync client that is currently connected but will not delete any files and folders on the external storage itself.',\n\t\t\t\t{\n\t\t\t\t\tstorage: this.mountPoint,\n\t\t\t\t\tinstanceName: window.OC.theme.name,\n\t\t\t\t},\n\t\t\t),\n\t\t\tt('files_external', 'Delete storage?'),\n\t\t\tfunction(confirm) {\n\t\t\t\tif (confirm) {\n\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.IN_PROGRESS)\n\n\t\t\t\t\tstorage.destroy({\n\t\t\t\t\t\tsuccess() {\n\t\t\t\t\t\t\t$tr.remove()\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror(result) {\n\t\t\t\t\t\t\tconst statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined\n\t\t\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage)\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t},\n\t\t)\n\t},\n\n\t/**\n\t * Saves the storage from the given tr\n\t *\n\t * @param $tr storage row\n\t * @param Function callback callback to call after save\n\t * @param callback\n\t * @param concurrentTimer only update if the timer matches this\n\t */\n\tsaveStorageConfig($tr, callback, concurrentTimer) {\n\t\tconst self = this\n\t\tconst storage = this.getStorageConfig($tr)\n\t\tif (!storage || !storage.validate()) {\n\t\t\treturn false\n\t\t}\n\n\t\tthis.updateStatus($tr, StorageConfig.Status.IN_PROGRESS)\n\t\tstorage.save({\n\t\t\tsuccess(result) {\n\t\t\t\tif (concurrentTimer === undefined\n\t\t\t\t\t|| $tr.data('save-timer') === concurrentTimer\n\t\t\t\t) {\n\t\t\t\t\tself.updateStatus($tr, result.status, result.statusMessage)\n\t\t\t\t\t$tr.data('id', result.id)\n\n\t\t\t\t\tif (_.isFunction(callback)) {\n\t\t\t\t\t\tcallback(storage)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\terror(result) {\n\t\t\t\tif (concurrentTimer === undefined\n\t\t\t\t\t|| $tr.data('save-timer') === concurrentTimer\n\t\t\t\t) {\n\t\t\t\t\tconst statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined\n\t\t\t\t\tself.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage)\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t},\n\n\t/**\n\t * Recheck storage availability\n\t *\n\t * @param {jQuery} $tr storage row\n\t * @return {boolean} success\n\t */\n\trecheckStorageConfig($tr) {\n\t\tconst self = this\n\t\tconst storage = this.getStorageConfig($tr)\n\t\tif (!storage.validate()) {\n\t\t\treturn false\n\t\t}\n\n\t\tthis.updateStatus($tr, StorageConfig.Status.IN_PROGRESS)\n\t\tstorage.recheck({\n\t\t\tsuccess(result) {\n\t\t\t\tself.updateStatus($tr, result.status, result.statusMessage)\n\t\t\t},\n\t\t\terror(result) {\n\t\t\t\tconst statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined\n\t\t\t\tself.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage)\n\t\t\t},\n\t\t})\n\t},\n\n\t/**\n\t * Update status display\n\t *\n\t * @param {jQuery} $tr\n\t * @param {number} status\n\t * @param {string} message\n\t */\n\tupdateStatus($tr, status, message) {\n\t\tconst $statusSpan = $tr.find('.status span')\n\t\tswitch (status) {\n\t\tcase null:\n\t\t\t// remove status\n\t\t\t$statusSpan.hide()\n\t\t\tbreak\n\t\tcase StorageConfig.Status.IN_PROGRESS:\n\t\t\t$statusSpan.attr('class', 'icon-loading-small')\n\t\t\tbreak\n\t\tcase StorageConfig.Status.SUCCESS:\n\t\t\t$statusSpan.attr('class', 'success icon-checkmark-white')\n\t\t\tbreak\n\t\tcase StorageConfig.Status.INDETERMINATE:\n\t\t\t$statusSpan.attr('class', 'indeterminate icon-info-white')\n\t\t\tbreak\n\t\tdefault:\n\t\t\t$statusSpan.attr('class', 'error icon-error-white')\n\t\t}\n\t\tif (status !== null) {\n\t\t\t$statusSpan.show()\n\t\t}\n\t\tif (typeof message !== 'string') {\n\t\t\tmessage = t('files_external', 'Click to recheck the configuration')\n\t\t}\n\t\t$statusSpan.attr('title', message)\n\t},\n\n\t/**\n\t * Suggest mount point name that doesn't conflict with the existing names in the list\n\t *\n\t * @param {string} defaultMountPoint default name\n\t */\n\t_suggestMountPoint(defaultMountPoint) {\n\t\tconst $el = this.$el\n\t\tconst pos = defaultMountPoint.indexOf('/')\n\t\tif (pos !== -1) {\n\t\t\tdefaultMountPoint = defaultMountPoint.substring(0, pos)\n\t\t}\n\t\tdefaultMountPoint = defaultMountPoint.replace(/\\s+/g, '')\n\t\tlet i = 1\n\t\tlet append = ''\n\t\tlet match = true\n\t\twhile (match && i < 20) {\n\t\t\tmatch = false\n\t\t\t$el.find('tbody td.mountPoint input').each(function(index, mountPoint) {\n\t\t\t\tif ($(mountPoint).val() === defaultMountPoint + append) {\n\t\t\t\t\tmatch = true\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t})\n\t\t\tif (match) {\n\t\t\t\tappend = i\n\t\t\t\ti++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn defaultMountPoint + append\n\t},\n\n\t/**\n\t * Toggles the mount options dropdown\n\t *\n\t * @param {object} $tr configuration row\n\t */\n\t_showMountOptionsDropdown($tr) {\n\t\tconst self = this\n\t\tconst storage = this.getStorageConfig($tr)\n\t\tconst $toggle = $tr.find('.mountOptionsToggle')\n\t\tconst dropDown = new MountOptionsDropdown()\n\t\tconst visibleOptions = [\n\t\t\t'previews',\n\t\t\t'filesystem_check_changes',\n\t\t\t'enable_sharing',\n\t\t\t'encoding_compatibility',\n\t\t\t'readonly',\n\t\t\t'delete',\n\t\t]\n\t\tif (this._encryptionEnabled) {\n\t\t\tvisibleOptions.push('encrypt')\n\t\t}\n\t\tdropDown.show($toggle, storage.mountOptions || [], visibleOptions)\n\t\t$('body').on('mouseup.mountOptionsDropdown', function(event) {\n\t\t\tconst $target = $(event.target)\n\t\t\tif ($target.closest('.popovermenu').length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdropDown.hide()\n\t\t})\n\n\t\tdropDown.$el.on('hide', function() {\n\t\t\tconst mountOptions = dropDown.getOptions()\n\t\t\t$('body').off('mouseup.mountOptionsDropdown')\n\t\t\t$tr.find('input.mountOptions').val(JSON.stringify(mountOptions))\n\t\t\t$tr.find('td.mountOptionsToggle>.icon-more').attr('aria-expanded', 'false')\n\t\t\tself.saveStorageConfig($tr)\n\t\t})\n\t},\n}, OC.Backbone.Events)\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\tconst enabled = $('#files_external').attr('data-encryption-enabled')\n\tconst canCreateLocal = $('#files_external').attr('data-can-create-local')\n\tconst encryptionEnabled = (enabled === 'true')\n\tconst mountConfigListView = new MountConfigListView($('#externalStorage'), {\n\t\tencryptionEnabled,\n\t\tcanCreateLocal: (canCreateLocal === 'true'),\n\t})\n\tmountConfigListView.loadStorages()\n\n\t// TODO: move this into its own View class\n\tconst $allowUserMounting = $('#allowUserMounting')\n\t$allowUserMounting.bind('change', function() {\n\t\tOC.msg.startSaving('#userMountingMsg')\n\t\tif (this.checked) {\n\t\t\tOCP.AppConfig.setValue('files_external', 'allow_user_mounting', 'yes')\n\t\t\t$('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]').prop('checked', true)\n\t\t\t$('#userMountingBackends').removeClass('hidden')\n\t\t\t$('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]').eq(0).trigger('change')\n\t\t} else {\n\t\t\tOCP.AppConfig.setValue('files_external', 'allow_user_mounting', 'no')\n\t\t\t$('#userMountingBackends').addClass('hidden')\n\t\t}\n\t\tOC.msg.finishedSaving('#userMountingMsg', { status: 'success', data: { message: t('files_external', 'Saved') } })\n\t})\n\n\t$('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]').bind('change', function() {\n\t\tOC.msg.startSaving('#userMountingMsg')\n\n\t\tlet userMountingBackends = $('input[name=\"allowUserMountingBackends\\\\[\\\\]\"]:checked').map(function() {\n\t\t\treturn $(this).val()\n\t\t}).get()\n\t\tconst deprecatedBackends = $('input[name=\"allowUserMountingBackends\\\\[\\\\]\"][data-deprecate-to]').map(function() {\n\t\t\tif ($.inArray($(this).data('deprecate-to'), userMountingBackends) !== -1) {\n\t\t\t\treturn $(this).val()\n\t\t\t}\n\t\t\treturn null\n\t\t}).get()\n\t\tuserMountingBackends = userMountingBackends.concat(deprecatedBackends)\n\n\t\tOCP.AppConfig.setValue('files_external', 'user_mounting_backends', userMountingBackends.join())\n\t\tOC.msg.finishedSaving('#userMountingMsg', { status: 'success', data: { message: t('files_external', 'Saved') } })\n\n\t\t// disable allowUserMounting\n\t\tif (userMountingBackends.length === 0) {\n\t\t\t$allowUserMounting.prop('checked', false)\n\t\t\t$allowUserMounting.trigger('change')\n\n\t\t}\n\t})\n\n\t$('#global_credentials').on('submit', async function(event) {\n\t\tevent.preventDefault()\n\t\tconst $form = $(this)\n\t\tconst $submit = $form.find('[type=submit]')\n\t\t$submit.val(t('files_external', 'Saving …'))\n\n\t\tconst uid = $form.find('[name=uid]').val()\n\t\tconst user = $form.find('[name=username]').val()\n\t\tconst password = $form.find('[name=password]').val()\n\n\t\ttry {\n\t\t\tawait axios.request({\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tuid,\n\t\t\t\t\tuser,\n\t\t\t\t\tpassword,\n\t\t\t\t},\n\t\t\t\turl: generateUrl('apps/files_external/globalcredentials'),\n\t\t\t\tconfirmPassword: PwdConfirmationMode.Strict,\n\t\t\t})\n\n\t\t\t$submit.val(t('files_external', 'Saved'))\n\t\t\tsetTimeout(function() {\n\t\t\t\t$submit.val(t('files_external', 'Save'))\n\t\t\t}, 2500)\n\t\t} catch (error) {\n\t\t\t$submit.val(t('files_external', 'Save'))\n\t\t\tif (isAxiosError(error)) {\n\t\t\t\tconst message = error.response?.data?.message || t('files_external', 'Failed to save global credentials')\n\t\t\t\tshowError(t('files_external', 'Failed to save global credentials: {message}', { message }))\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t})\n\n\t// global instance\n\tOCA.Files_External.Settings.mountConfig = mountConfigListView\n\n\t/**\n\t * Legacy\n\t *\n\t * @namespace\n\t * @deprecated use OCA.Files_External.Settings.mountConfig instead\n\t */\n\tOC.MountConfig = {\n\t\tsaveStorage: _.bind(mountConfigListView.saveStorageConfig, mountConfigListView),\n\t}\n})\n\n// export\n\nOCA.Files_External = OCA.Files_External || {}\n/**\n * @namespace\n */\nOCA.Files_External.Settings = OCA.Files_External.Settings || {}\n\nOCA.Files_External.Settings.GlobalStorageConfig = GlobalStorageConfig\nOCA.Files_External.Settings.UserStorageConfig = UserStorageConfig\nOCA.Files_External.Settings.MountConfigListView = MountConfigListView\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \"-\" + chunkId + \".js?v=\" + {\"640\":\"d4c5c018803ee8751b2a\",\"780\":\"e3ee44fa7690af29d8d7\",\"3564\":\"29e8338d43e0d4bd3995\",\"5810\":\"b550a24d46f75f92c2d5\",\"7471\":\"6423b9b898ffefeb7d1d\"}[chunkId] + \"\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 5808;","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t5808: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(80655)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","highlightBorder","$element","highlight","toggleClass","isInputValid","$input","optional","hasClass","attr","val","highlightInput","initApplicableUsersMultiselect","$elements","userListLimit","escapeHTML","text","toString","split","join","length","select2","placeholder","t","allowClear","multiple","toggleSelect","dropdownCssClass","ajax","url","OC","generateUrl","dataType","quietMillis","data","term","page","pattern","limit","offset","results","userCount","$","each","groups","gid","group","push","name","displayname","type","users","id","user","more","initSelection","element","callback","toSplit","i","contentType","JSON","stringify","done","status","formatResult","$result","$div","find","imagePath","html","get","outerHTML","formatSelection","escapeMarkup","m","on","div","avatar","event","target","closest","addPasswordConfirmationInterceptors","axios","StorageConfig","this","backendOptions","Status","IN_PROGRESS","SUCCESS","ERROR","INDETERMINATE","Visibility","NONE","PERSONAL","ADMIN","DEFAULT","prototype","_url","mountPoint","backend","authMechanism","mountOptions","save","options","method","_","isNumber","_save","result","request","confirmPassword","PwdConfirmationMode","Strict","getData","success","error","testOnly","recheck","isFunction","destroy","e","validate","errors","GlobalStorageConfig","applicableUsers","applicableGroups","extend","priority","apply","arguments","UserStorageConfig","UserGlobalStorageConfig","MountOptionsDropdown","$el","show","$container","visibleOptions","_last","hide","OCA","Files_External","Templates","mountOptionsDropDown","mountOptionsEncodingLabel","mountOptionsEncryptLabel","mountOptionsPreviewsLabel","mountOptionsSharingLabel","mountOptionsFilesystemCheckLabel","mountOptionsFilesystemCheckOnce","mountOptionsFilesystemCheckDA","mountOptionsReadOnlyLabel","deleteLabel","storage","parentNode","className","setOptions","appendTo","trigger","remove","getOptions","$this","key","value","prop","parseInt","ind","indexOf","splice","$optionEl","filterAttr","isString","row","$row","optionId","MountConfigListView","initialize","ParameterFlags","OPTIONAL","USER_PROVIDED","HIDDEN","ParameterTypes","TEXT","BOOLEAN","PASSWORD","_storageConfigClass","_isPersonal","_userListLimit","_allBackends","_allAuthMechanisms","_encryptionEnabled","Settings","isUndefined","encryptionEnabled","_canCreateLocal","canCreateLocal","_initEvents","whenSelectBackend","tr","whenSelectAuthMechanism","self","scheme","onChangeHandler","bind","_onChange","recheckStorageConfig","deleteStorageConfig","saveStorageConfig","_showMountOptionsDropdown","_onSelectBackend","_onSelectAuthMechanism","_onChangeApplicableToAllUsers","$target","$tr","updateStatus","storageConfig","onCompletion","jQuery","newStorage","resolve","children","not","first","focus","configureAuthMechanism","checked","is","authMechanismConfiguration","$td","configuration","partial","writeParameterInput","deferAppend","invalid","$template","clone","insertBefore","removeClass","last","removeAttr","_suggestMountPoint","addClass","identifier","empty","backendName","selectAuthMechanism","neededVisibility","authIdentifier","authSchemes","visibility","append","input","undefined","applicable","concat","map","priorityEl","encrypt","previews","enable_sharing","filesystem_check_changes","encoding_compatibility","readonly","loadStorages","onLoaded1","Deferred","onLoaded2","when","always","Object","values","$rows","forEach","storageParams","isUserGlobal","substr","detach","prepend","$authentication","add","before","mainForm","parent","parameter","classes","hasFlag","flag","flags","isArray","newElement","trimmedPlaceholder","checkboxId","uniqueId","defaultValue","tooltip","getStorageConfig","storageId","classOptions","missingOptions","index","multiselect","getSelection","pos","getSelectedApplicable","requiredApplicable","parse","configId","dialogs","confirm","instanceName","window","theme","statusMessage","responseJSON","message","concurrentTimer","$statusSpan","defaultMountPoint","substring","replace","match","$toggle","dropDown","off","Backbone","Events","addEventListener","enabled","mountConfigListView","$allowUserMounting","msg","startSaving","OCP","AppConfig","setValue","eq","finishedSaving","userMountingBackends","deprecatedBackends","inArray","async","preventDefault","$form","$submit","uid","password","setTimeout","isAxiosError","response","showError","mountConfig","MountConfig","saveStorage","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","O","chunkIds","fn","notFulfilled","Infinity","fulfilled","j","keys","every","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","f","chunkId","Promise","all","reduce","promises","u","g","globalThis","Function","obj","hasOwnProperty","l","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","removeChild","head","appendChild","Symbol","toStringTag","nmd","paths","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","Error","p","b","baseURI","href","installedChunks","installedChunkData","promise","reject","errorType","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php index 4320efc419083..e8f88d8f35b80 100644 --- a/tests/lib/UrlGeneratorTest.php +++ b/tests/lib/UrlGeneratorTest.php @@ -116,16 +116,16 @@ public static function provideRoutes(): array { public static function provideDocRootAppUrlParts(): array { return [ - ['files_external', 'ajax/oauth2.php', [], '/index.php/apps/files_external/ajax/oauth2.php'], - ['files_external', 'ajax/oauth2.php', ['trut' => 'trat', 'dut' => 'dat'], '/index.php/apps/files_external/ajax/oauth2.php?trut=trat&dut=dat'], + ['user_ldap', 'ajax/wizard.php', [], '/index.php/apps/user_ldap/ajax/wizard.php'], + ['user_ldap', 'ajax/wizard.php', ['trut' => 'trat', 'dut' => 'dat'], '/index.php/apps/user_ldap/ajax/wizard.php?trut=trat&dut=dat'], ['', 'index.php', ['trut' => 'trat', 'dut' => 'dat'], '/index.php?trut=trat&dut=dat'], ]; } public static function provideSubDirAppUrlParts(): array { return [ - ['files_external', 'ajax/oauth2.php', [], '/nextcloud/index.php/apps/files_external/ajax/oauth2.php'], - ['files_external', 'ajax/oauth2.php', ['trut' => 'trat', 'dut' => 'dat'], '/nextcloud/index.php/apps/files_external/ajax/oauth2.php?trut=trat&dut=dat'], + ['user_ldap', 'ajax/wizard.php', [], '/nextcloud/index.php/apps/user_ldap/ajax/wizard.php'], + ['user_ldap', 'ajax/wizard.php', ['trut' => 'trat', 'dut' => 'dat'], '/nextcloud/index.php/apps/user_ldap/ajax/wizard.php?trut=trat&dut=dat'], ['', 'index.php', ['trut' => 'trat', 'dut' => 'dat'], '/nextcloud/index.php?trut=trat&dut=dat'], ]; }