mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 04:18:21 +00:00
[online GC] modified it.
This commit is contained in:
@@ -129,14 +129,13 @@ $('#gc-form').submit(function () {
|
||||
var form = $(this);
|
||||
var day = $('[name="day"]', form).val();
|
||||
disable($('[type="submit"]', form));
|
||||
form.append('<p style="color:#222;">' + "{% trans "It could take a while, you can close this popup now." %}" + '</p>');
|
||||
$.ajax({
|
||||
url: '{% url "repo_online_gc" repo.id %}?day=' + day,
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
success: function () {
|
||||
$.modal.close();
|
||||
location.reload();
|
||||
location.reload(true);
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
$.modal.close();
|
||||
|
@@ -310,13 +310,8 @@ def render_recycle_root(request, repo_id):
|
||||
repo_owner = seafile_api.get_repo_owner(repo.id)
|
||||
is_repo_owner = True if repo_owner == username else False
|
||||
|
||||
use_sqlite = False
|
||||
db_backend = settings.DATABASES['default']['ENGINE'].split('.')[-1]
|
||||
if 'sqlite' in db_backend:
|
||||
use_sqlite = True
|
||||
|
||||
enable_clean = False
|
||||
if is_repo_owner and not use_sqlite and ENABLE_USER_CLEAN_HISTORY:
|
||||
if is_repo_owner and ENABLE_USER_CLEAN_HISTORY:
|
||||
enable_clean = True
|
||||
|
||||
return render_to_response('repo_recycle_view.html', {
|
||||
@@ -359,13 +354,8 @@ def render_recycle_dir(request, repo_id, commit_id):
|
||||
repo_owner = seafile_api.get_repo_owner(repo.id)
|
||||
is_repo_owner = True if repo_owner == username else False
|
||||
|
||||
use_sqlite = False
|
||||
db_backend = settings.DATABASES['default']['ENGINE'].split('.')[-1]
|
||||
if 'sqlite' in db_backend:
|
||||
use_sqlite = True
|
||||
|
||||
enable_clean = False
|
||||
if is_repo_owner and not use_sqlite and ENABLE_USER_CLEAN_HISTORY:
|
||||
if is_repo_owner and ENABLE_USER_CLEAN_HISTORY:
|
||||
enable_clean = True
|
||||
|
||||
return render_to_response('repo_recycle_view.html', {
|
||||
|
@@ -1849,15 +1849,6 @@ def repo_online_gc(request, repo_id):
|
||||
return HttpResponse(json.dumps({'error': error}), status=400,
|
||||
content_type=content_type)
|
||||
|
||||
use_sqlite = False
|
||||
db_backend = settings.DATABASES['default']['ENGINE'].split('.')[-1]
|
||||
if 'sqlite' in db_backend:
|
||||
use_sqlite = True
|
||||
if use_sqlite:
|
||||
error = _('It is not supported for SQLite')
|
||||
return HttpResponse(json.dumps({'error': error}), status=400,
|
||||
content_type=content_type)
|
||||
|
||||
try:
|
||||
seafile_api.clean_up_repo_history(repo.id, day)
|
||||
except SearpcError, e:
|
||||
|
Reference in New Issue
Block a user