1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 12:27:48 +00:00

[online GC] modified it.

This commit is contained in:
llj
2014-10-15 14:49:40 +08:00
parent af0c749a37
commit b3852c5f82
3 changed files with 3 additions and 23 deletions

View File

@@ -129,14 +129,13 @@ $('#gc-form').submit(function () {
var form = $(this); var form = $(this);
var day = $('[name="day"]', form).val(); var day = $('[name="day"]', form).val();
disable($('[type="submit"]', form)); disable($('[type="submit"]', form));
form.append('<p style="color:#222;">' + "{% trans "It could take a while, you can close this popup now." %}" + '</p>');
$.ajax({ $.ajax({
url: '{% url "repo_online_gc" repo.id %}?day=' + day, url: '{% url "repo_online_gc" repo.id %}?day=' + day,
dataType: 'json', dataType: 'json',
cache: false, cache: false,
success: function () { success: function () {
$.modal.close(); $.modal.close();
location.reload(); location.reload(true);
}, },
error: function (xhr, textStatus, errorThrown) { error: function (xhr, textStatus, errorThrown) {
$.modal.close(); $.modal.close();

View File

@@ -310,13 +310,8 @@ def render_recycle_root(request, repo_id):
repo_owner = seafile_api.get_repo_owner(repo.id) repo_owner = seafile_api.get_repo_owner(repo.id)
is_repo_owner = True if repo_owner == username else False 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 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 enable_clean = True
return render_to_response('repo_recycle_view.html', { 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) repo_owner = seafile_api.get_repo_owner(repo.id)
is_repo_owner = True if repo_owner == username else False 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 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 enable_clean = True
return render_to_response('repo_recycle_view.html', { return render_to_response('repo_recycle_view.html', {

View File

@@ -1849,15 +1849,6 @@ def repo_online_gc(request, repo_id):
return HttpResponse(json.dumps({'error': error}), status=400, return HttpResponse(json.dumps({'error': error}), status=400,
content_type=content_type) 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: try:
seafile_api.clean_up_repo_history(repo.id, day) seafile_api.clean_up_repo_history(repo.id, day)
except SearpcError, e: except SearpcError, e: