1
0
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:
Adolfo Gómez García 2015-11-11 12:15:41 +01:00
commit 163245401b
4 changed files with 13 additions and 8 deletions

View File

@ -51,7 +51,7 @@ import requests
import json import json
import logging import logging
__updated__ = '2015-11-10' __updated__ = '2015-11-11'
logger = logging.getLogger(__name__) 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) # Now try to locate 1 from cache already "ready" (must be usable and at level 1)
with transaction.atomic(): 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: if len(cache) > 0:
cache = cache[0] cache = cache[0]
cache.assignToUser(user) cache.assignToUser(user)

View File

@ -222,7 +222,7 @@
#if( data.length > 1000 ) #if( data.length > 1000 )
gui.tools.blockUI() gui.tools.blockUI()
setTimeout (-> setTimeout (->
self.rest.overview (data) -> # Restore overview self.rest.overview( ((data) -> # Restore overview
tblParams.onData data if tblParams.onData tblParams.onData data if tblParams.onData
tbl.rows().remove() tbl.rows().remove()
if data.length > 0 # Only adds data if data is available if data.length > 0 # Only adds data if data is available
@ -231,7 +231,8 @@
tbl.columns.adjust().draw() tbl.columns.adjust().draw()
gui.doLog "onRefresh", tblParams.onRefresh gui.doLog "onRefresh", tblParams.onRefresh
tblParams.onRefresh self tblParams.onRefresh self
gui.tools.unblockUI() gui.tools.unblockUI()), gui.failRequestModalFnc(gettext("Refresh operation failed"))
)
return return
), 0 ), 0
return return

View File

@ -128,8 +128,10 @@
gui.failRequestModalFnc = (title) -> gui.failRequestModalFnc = (title) ->
(jqXHR, textStatus, errorThrown) -> # fail on put (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.tools.unblockUI()
gui.launchModal "<b class=\"text-danger\">" + title + "</b>", jqXHR.responseText, gui.launchModal "<b class=\"text-danger\">" + title + "</b>", errorText,
actionButton: " " actionButton: " "
return return

View File

@ -30,12 +30,12 @@ uds.counterGranurality = 2 # Every this seconds, reload time will be checked
blockUI = (message) -> blockUI = (message) ->
message = message or "<h1><span class=\"fa fa-spinner fa-spin\"></span> " + gettext("Contacting service...") + "</h1>" message = message or "<h1><span class=\"fa fa-spinner fa-spin\"></span> " + gettext("Contacting service...") + "</h1>"
$.blockUI # $.blockUI
message: message # message: message
return return
unblockUI = -> unblockUI = ->
$.unblockUI() # $.unblockUI()
return return