mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 01:41:39 +00:00
update multi storages backend
1. use $.isEmptyObject() check if app.pageOptions.storages is empty 2. return [] if no storage_ids setting for user role
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
</select>
|
||||
<br/>
|
||||
<% } %>
|
||||
<% if (!$.isEmptyObject(app.pageOptions.storages)) { %>
|
||||
<% if (app.pageOptions.storages.length > 1) { %>
|
||||
<label for="storage">{% trans "Storage backend"%}</label><br/>
|
||||
<select name="storage" id="storage" class="select">
|
||||
@@ -27,6 +28,7 @@
|
||||
</select>
|
||||
<br/>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if (showSharePerm) { %>
|
||||
<label for="share-permission">{% trans "Share Permission" %}</label><br />
|
||||
<select id="share-permission" name="permission" class="select">
|
||||
@@ -1613,8 +1615,8 @@
|
||||
<th width="14%"><span class="sr-only">{% trans "Actions" %}</span></th>
|
||||
<% if (app.pageOptions.storages.length > 0) { %>
|
||||
<th width="10%">{% trans "Size" %}</th>
|
||||
<th width="20%">{% trans "Storage backend" %}</th>
|
||||
<th width="10%"><a class="table-sort-op by-time" href="#">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></a></th>
|
||||
<th width="15%">{% trans "Storage backend" %}</th>
|
||||
<th width="15%"><a class="table-sort-op by-time" href="#">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></a></th>
|
||||
<% } else { %>
|
||||
<th width="20%">{% trans "Size" %}</th>
|
||||
<th width="20%"><a class="table-sort-op by-time" href="#">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></a></th>
|
||||
|
@@ -99,7 +99,7 @@ def get_library_storages(request):
|
||||
elif STORAGE_CLASS_MAPPING_POLICY == 'ROLE_BASED':
|
||||
user_role_storage_ids = request.user.permissions.storage_ids()
|
||||
if not user_role_storage_ids:
|
||||
return all_storages
|
||||
return []
|
||||
|
||||
user_role_storages = []
|
||||
for user_role_storage_id in user_role_storage_ids:
|
||||
|
@@ -13,7 +13,6 @@ define([
|
||||
return {
|
||||
showSharePerm: true,
|
||||
enable_encrypted_library: app.pageOptions.enable_encrypted_library,
|
||||
storages: app.pageOptions.storages,
|
||||
library_templates: app.pageOptions.library_templates
|
||||
};
|
||||
},
|
||||
|
@@ -13,7 +13,6 @@ define([
|
||||
return {
|
||||
showSharePerm: true,
|
||||
enable_encrypted_library: app.pageOptions.enable_encrypted_library,
|
||||
storages: app.pageOptions.storages,
|
||||
library_templates: app.pageOptions.library_templates
|
||||
};
|
||||
},
|
||||
|
Reference in New Issue
Block a user