mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-03 01:17:56 +03:00
Merging 1.9 fixes
This commit is contained in:
commit
163245401b
@ -51,7 +51,7 @@ import requests
|
||||
import json
|
||||
import logging
|
||||
|
||||
__updated__ = '2015-11-10'
|
||||
__updated__ = '2015-11-11'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -259,7 +259,9 @@ class UserServiceManager(object):
|
||||
|
||||
# Now try to locate 1 from cache already "ready" (must be usable and at level 1)
|
||||
with transaction.atomic():
|
||||
cache = ds.cachedUserServices().select_for_update().filter(cache_level=services.UserDeployment.L1_CACHE, state=State.USABLE)[:1]
|
||||
cache = ds.cachedUserServices().select_for_update().filter(cache_level=services.UserDeployment.L1_CACHE, state=State.USABLE, os_state=State.USABLE)[:1]
|
||||
if len(cache) == 0:
|
||||
cache = ds.cachedUserServices().select_for_update().filter(cache_level=services.UserDeployment.L1_CACHE, state=State.USABLE)[:1]
|
||||
if len(cache) > 0:
|
||||
cache = cache[0]
|
||||
cache.assignToUser(user)
|
||||
|
@ -222,7 +222,7 @@
|
||||
#if( data.length > 1000 )
|
||||
gui.tools.blockUI()
|
||||
setTimeout (->
|
||||
self.rest.overview (data) -> # Restore overview
|
||||
self.rest.overview( ((data) -> # Restore overview
|
||||
tblParams.onData data if tblParams.onData
|
||||
tbl.rows().remove()
|
||||
if data.length > 0 # Only adds data if data is available
|
||||
@ -231,7 +231,8 @@
|
||||
tbl.columns.adjust().draw()
|
||||
gui.doLog "onRefresh", tblParams.onRefresh
|
||||
tblParams.onRefresh self
|
||||
gui.tools.unblockUI()
|
||||
gui.tools.unblockUI()), gui.failRequestModalFnc(gettext("Refresh operation failed"))
|
||||
)
|
||||
return
|
||||
), 0
|
||||
return
|
||||
|
@ -128,8 +128,10 @@
|
||||
|
||||
gui.failRequestModalFnc = (title) ->
|
||||
(jqXHR, textStatus, errorThrown) -> # fail on put
|
||||
# gui.doLog jqXHR, textStatus, errorThrown, jqXHR.status == 0
|
||||
errorText = if jqXHR.status == 0 then gettext('Connection failed') else jqXHR.responseText
|
||||
gui.tools.unblockUI()
|
||||
gui.launchModal "<b class=\"text-danger\">" + title + "</b>", jqXHR.responseText,
|
||||
gui.launchModal "<b class=\"text-danger\">" + title + "</b>", errorText,
|
||||
actionButton: " "
|
||||
|
||||
return
|
||||
|
@ -30,12 +30,12 @@ uds.counterGranurality = 2 # Every this seconds, reload time will be checked
|
||||
|
||||
blockUI = (message) ->
|
||||
message = message or "<h1><span class=\"fa fa-spinner fa-spin\"></span> " + gettext("Contacting service...") + "</h1>"
|
||||
$.blockUI
|
||||
message: message
|
||||
# $.blockUI
|
||||
# message: message
|
||||
return
|
||||
|
||||
unblockUI = ->
|
||||
$.unblockUI()
|
||||
# $.unblockUI()
|
||||
return
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user