Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update repo trash #6148

Merged
merged 33 commits into from
Jul 18, 2024
Merged

update repo trash #6148

merged 33 commits into from
Jul 18, 2024

Conversation

awu0403
Copy link
Contributor

@awu0403 awu0403 commented May 31, 2024

No description provided.

@@ -561,7 +562,9 @@ def delete(self, request, repo_id, format=None):
username = request.user.username
parent_dir = os.path.dirname(path)
dir_name = os.path.basename(path)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件没有变化,把改动和import等内容删掉

@@ -5,6 +5,7 @@
import logging
import posixpath
import requests
import datetime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@@ -144,6 +144,7 @@

from constance import config


logger = logging.getLogger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删掉改动

@@ -1095,6 +1095,7 @@ def react_fake_view(request, **kwargs):
'upload_link_expire_days_max': UPLOAD_LINK_EXPIRE_DAYS_MAX,
'enable_encrypted_library': config.ENABLE_ENCRYPTED_LIBRARY,
'enable_repo_history_setting': config.ENABLE_REPO_HISTORY_SETTING,
'enable_clean': config.ENABLE_USER_CLEAN_TRASH,
'enable_reset_encrypted_repo_password': ENABLE_RESET_ENCRYPTED_REPO_PASSWORD,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable_clean --> enable_user_clean_trash

@@ -109,6 +109,7 @@
canPublishRepo: {% if user.permissions.can_publish_repo %} true {% else %} false {% endif %},
enableEncryptedLibrary: {% if enable_encrypted_library %} true {% else %} false {% endif %},
enableRepoHistorySetting: {% if enable_repo_history_setting %} true {% else %} false {% endif %},
enableClean: {% if enable_clean %} true {% else %} false {% endif %},
isSystemStaff: {% if request.user.is_staff %} true {% else %} false {% endif %},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enableClean-->enableUserCleanTrash

sql/mysql.sql Outdated
`size` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `ix_FileTrash_repo_id` (`repo_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHARSET=utf8mb4 COLLATE=utf8_general_ci;


# argument check
path = request.data.get('path', '/')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个请求参数不需要了, 直接写 path = '/' 就可以了

for item in deleted_entries:
item_info = self.get_item_info(item)
items.append(item_info)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在seafevents层面直接排序后返回, 不需要直接在这里进行排序

current_page = int(request.GET.get('page', '1'))
per_page = int(request.GET.get('per_page', '100'))
if per_page > 100:
per_page = 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大于100这个判断不用加, 这里只是默认返回100条目, 具体请求多少条目不需要判断

@freeplant freeplant merged commit 0981a0d into 12.0 Jul 18, 2024
1 check passed
@freeplant freeplant deleted the update-repo-trash branch July 18, 2024 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants