@@ -49,6 +54,24 @@
{% endif %}
{% endfor %}
+
+
+
+
+
+
{% trans "This service is in maintenance mode." %}
+
{% trans "Please, retry access in a while." %}
+
+
+
+
+
+
{% if not java %}
@@ -58,7 +81,7 @@
{% trans "Java not found" %}
-
+
{% trans "Java is not available on your browser, and the selected transport needs it." %}
{% trans "Please, install latest version from" %} {% trans "Java website" %} {% trans "and restart browser" %}
@@ -70,6 +93,8 @@
{% endif %}
+
+
{% if user.isStaff %}
@@ -119,13 +144,23 @@
filter: alpha(opacity=40);
}
+ div.service.maintenance {
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+ }
+
+ div.service.inuse {
+ background-color: #DCDCFF;
+
+ }
+
div.service-image {
width: 128px;
height: 128px;
}
div.service.over:not(.disabled) {
- background-color: #FFFFFF;
+ background-color: #F0F0F0;
animation: pulse 0.5s infinite alternate;
-webkit-animation-name: pulse;
-webkit-animation-duration: 0.8s;
@@ -172,18 +207,12 @@
{% block js %}
{% endblock %}
diff --git a/server/src/uds/web/views/index.py b/server/src/uds/web/views/index.py
index 6a6fa331..cea39aaa 100644
--- a/server/src/uds/web/views/index.py
+++ b/server/src/uds/web/views/index.py
@@ -40,6 +40,7 @@ from uds.core.auths.auth import webLoginRequired
from uds.models import DeployedService, Transport, UserService, Network
from uds.core.util.Config import GlobalConfig
from uds.core.ui import theme
+from uds.core.managers.UserServiceManager import UserServiceManager
import logging
@@ -89,8 +90,6 @@ def index(request):
# Select assigned user services
for svr in availUserServices:
# Skip maintenance services...
- if svr.deployed_service.service.provider.maintenance_mode is True:
- continue
trans = []
for t in svr.transports.all().order_by('priority'):
typeTrans = t.getType()
@@ -100,12 +99,18 @@ def index(request):
imageId = svr.deployed_service.image.uuid
else:
imageId = 'x' # Invalid
- services.append({'id': 'A' + svr.uuid, 'name': svr['name'], 'transports': trans, 'imageId': imageId, 'show_transports': svr.deployed_service.show_transports})
+ services.append({'id': 'A' + svr.uuid,
+ 'name': svr['name'],
+ 'transports': trans,
+ 'imageId': imageId,
+ 'show_transports': svr.deployed_service.show_transports,
+ 'maintenance': svr.deployed_service.service.provider.maintenance_mode,
+ 'in_use': svr.in_use})
+
+ logger.debug(services)
# Now generic user service
for svr in availServices:
- if svr.service.provider.maintenance_mode is True:
- continue
trans = []
for t in svr.transports.all().order_by('priority'):
if t.validForIp(request.ip):
@@ -116,7 +121,16 @@ def index(request):
imageId = svr.image.uuid
else:
imageId = 'x'
- services.append({'id': 'F' + svr.uuid, 'name': svr.name, 'transports': trans, 'imageId': imageId, 'show_transports': svr.show_transports})
+
+ ads = UserServiceManager.manager().getExistingAssignationForUser(svr, request.user)
+
+ services.append({'id': 'F' + svr.uuid,
+ 'name': svr.name,
+ 'transports': trans,
+ 'imageId': imageId,
+ 'show_transports': svr.show_transports,
+ 'maintenance': svr.service.provider.maintenance_mode,
+ 'in_use': ads.in_use})
logger.debug('Services: {0}'.format(services))
diff --git a/server/src/uds/web/views/service.py b/server/src/uds/web/views/service.py
index 10438b2e..67e921e1 100644
--- a/server/src/uds/web/views/service.py
+++ b/server/src/uds/web/views/service.py
@@ -33,6 +33,7 @@ from __future__ import unicode_literals
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
+from django.views.decorators.cache import cache_page
from uds.core.auths.auth import webLoginRequired, webPassword
from uds.models import DeployedService, Transport, UserService, Image
@@ -44,11 +45,12 @@ from uds.core.ui import theme
import uds.web.errors as errors
-
import logging
logger = logging.getLogger(__name__)
+__updated__ = '2015-01-28'
+
@webLoginRequired
def service(request, idService, idTransport):
@@ -141,6 +143,7 @@ def transportIcon(request, idTrans):
return HttpResponseRedirect('/static/img/unknown.png')
+@cache_page(86400, key_prefix='img')
def serviceImage(request, idImage):
try:
icon = Image.objects.get(uuid=idImage)