mirror of
https://github.com/haiwen/seafile.git
synced 2025-01-09 04:17:30 +08:00
[client] Correct display of sync status.
Should display "auto sync is turned off" when auto-sync is disabled.
This commit is contained in:
parent
aa86471ef2
commit
30b0f6ca73
@ -533,7 +533,8 @@ def seaf_status(args):
|
||||
print "# Name\tStatus"
|
||||
repos = seafile_rpc.get_repo_list(-1, -1)
|
||||
for repo in repos:
|
||||
if not repo.auto_sync:
|
||||
auto_sync_enabled = seafile_rpc.is_auto_sync_enabled()
|
||||
if not auto_sync_enabled or not repo.auto_sync:
|
||||
print "%s\t%s" % (repo.name, "auto sync disabled")
|
||||
continue
|
||||
|
||||
|
@ -150,6 +150,10 @@ class SeafileRpcClient(ccnet.RpcClientBase):
|
||||
pass
|
||||
get_repo_sync_info = seafile_get_repo_sync_info
|
||||
|
||||
@searpc_func("int", [])
|
||||
def seafile_is_auto_sync_enabled():
|
||||
pass
|
||||
is_auto_sync_enabled = seafile_is_auto_sync_enabled
|
||||
|
||||
###### Property Management #########
|
||||
|
||||
|
@ -319,7 +319,8 @@ class repo_sync_status:
|
||||
# No sync task yet: seafile maybe have just been started
|
||||
sync_status['state'] = 'waiting for sync'
|
||||
|
||||
if sync_status['state'] == 'waiting for sync' and not repo.props.auto_sync:
|
||||
auto_sync_enabled = seafile_rpc.is_auto_sync_enabled()
|
||||
if not auto_sync_enabled or not repo.props.auto_sync:
|
||||
sync_status['state'] = 'auto sync is turned off'
|
||||
|
||||
return json.dumps(sync_status)
|
||||
|
Loading…
Reference in New Issue
Block a user