1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

* Added alert icon for calender restricted services

* Fixed spice to add fullscreen support on transport definition & a bug
to allow using it.
* Fixed OS Detector to include "unknown" as an os on "all OSs"
This commit is contained in:
Adolfo Gómez García 2016-05-27 13:39:51 +02:00
parent c2d4e995e7
commit 0bd3e1ac72
8 changed files with 26 additions and 12 deletions

View File

@ -46,10 +46,11 @@ Macintosh = 'Mac'
Android = 'Android' Android = 'Android'
iPad = 'iPad' iPad = 'iPad'
iPhone = 'iPhone' iPhone = 'iPhone'
Unknown = 'Unknown'
knownOss = (WindowsPhone, Android, Linux, Windows, Macintosh, iPad, iPhone) # Android is linux also, so it is cheched on first place knownOss = (WindowsPhone, Android, Linux, Windows, Macintosh, iPad, iPhone) # Android is linux also, so it is cheched on first place
allOss = tuple(knownOss) allOss = tuple(knownOss) + tuple(Unknown)
desktopOss = (Linux, Windows, Macintosh) desktopOss = (Linux, Windows, Macintosh)
mobilesODD = list(set(allOss) - set(desktopOss)) mobilesODD = list(set(allOss) - set(desktopOss))
@ -93,9 +94,9 @@ def getOsFromUA(ua):
Basic OS Client detector (very basic indeed :-)) Basic OS Client detector (very basic indeed :-))
''' '''
if ua is None: if ua is None:
ua = 'Unknown' ua = Unknown
os = 'Unknown' os = Unknown
res = DictAsObj({'OS': os, 'Version': '0.0', 'Browser': 'unknown'}) res = DictAsObj({'OS': os, 'Version': '0.0', 'Browser': 'unknown'})
for os in knownOss: for os in knownOss:

View File

@ -162,7 +162,6 @@ class LinuxOsManager(osmanagers.OSManager):
ip, hostname = userService.getConnectionSource() ip, hostname = userService.getConnectionSource()
deadLine = userService.deployed_service.getDeadline() deadLine = userService.deployed_service.getDeadline()
ret = "{0}\t{1}\t{2}".format(ip, hostname, 0 if deadLine is None else deadLine) ret = "{0}\t{1}\t{2}".format(ip, hostname, 0 if deadLine is None else deadLine)
elif msg == "logout": elif msg == "logout":
self.loggedOut(userService, data, False) self.loggedOut(userService, data, False)
if self._onLogout == 'remove': if self._onLogout == 'remove':

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -239,6 +239,11 @@
to { box-shadow: 0px 0px 8px 5px #0066cc; } to { box-shadow: 0px 0px 8px 5px #0066cc; }
} }
div.notaccesible {
background-image: url("{% get_static_prefix %}/img/alert.png");
background-repeat: no-repeat;
background-size: 16px 16px;
}
div.service > img { div.service > img {
width: 100%; width: 100%;
@ -303,6 +308,7 @@
$('.with-tooltip').popover({container: 'body', trigger: 'hover', delay: { show: 500, hide: 100 }, placement: 'auto bottom'}); $('.with-tooltip').popover({container: 'body', trigger: 'hover', delay: { show: 500, hide: 100 }, placement: 'auto bottom'});
$('.inuse').popover({container: 'body', trigger: 'hover', delay: { show: 500, hide: 100 }, placement: 'auto top'}); $('.inuse').popover({container: 'body', trigger: 'hover', delay: { show: 500, hide: 100 }, placement: 'auto top'});
$('.notaccesible').popover({container: 'body', trigger: 'hover', delay: { show: 500, hide: 100 }, placement: 'auto top'});
$('div.service:not(.maintenance, .notaccesible)').on("click", function (event){ $('div.service:not(.maintenance, .notaccesible)').on("click", function (event){
var url, el; var url, el;

View File

@ -44,7 +44,7 @@ from uds.services.OVirt.OVirtProvider import Provider as oVirtProvider
import logging import logging
import os import os
__updated__ = '2016-05-19' __updated__ = '2016-05-27'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -63,7 +63,7 @@ class BaseSpiceTransport(Transport):
useEmptyCreds = gui.CheckBoxField( useEmptyCreds = gui.CheckBoxField(
order=1, order=1,
label=_('Empty creds'), label=_('Empty credentials'),
tooltip=_('If checked, the credentials used to connect will be emtpy'), tooltip=_('If checked, the credentials used to connect will be emtpy'),
tab=gui.CREDENTIALS_TAB tab=gui.CREDENTIALS_TAB
) )
@ -87,6 +87,12 @@ class BaseSpiceTransport(Transport):
tooltip=_('Server certificate (public), can be found on your ovirt engine, probably at /etc/pki/ovirt-engine/certs/ca.der (Use the contents of this file).'), tooltip=_('Server certificate (public), can be found on your ovirt engine, probably at /etc/pki/ovirt-engine/certs/ca.der (Use the contents of this file).'),
required=True required=True
) )
fullScreen = gui.CheckBoxField(
order=5,
label=_('Show fullscreen'),
tooltip=_('If checked, viewer will be shown on fullscreen mode-'),
tab=gui.ADVANCED_TAB
)
def isAvailableFor(self, userService, ip): def isAvailableFor(self, userService, ip):
''' '''

View File

@ -8,7 +8,7 @@ import six
import os import os
__updated__ = '2015-05-10' __updated__ = '2016-05-27'
TEMPLATE = '''[virt-viewer] TEMPLATE = '''[virt-viewer]
@ -56,7 +56,7 @@ class RemoteViewerFile(object):
self.password = password self.password = password
self.ca = ca self.ca = ca
self.host_subject = host_subject self.host_subject = host_subject
self.fullscreen = False self.fullscreen = fullscreen
@property @property
def as_file(self): def as_file(self):

View File

@ -39,7 +39,7 @@ from .RemoteViewerFile import RemoteViewerFile
import logging import logging
__updated__ = '2016-04-18' __updated__ = '2016-05-27'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -57,6 +57,7 @@ class SPICETransport(BaseSpiceTransport):
# fixedName = BaseSpiceTransport.fixedName # fixedName = BaseSpiceTransport.fixedName
# fixedPassword = BaseSpiceTransport.fixedPassword # fixedPassword = BaseSpiceTransport.fixedPassword
serverCertificate = BaseSpiceTransport.serverCertificate serverCertificate = BaseSpiceTransport.serverCertificate
fullScreen = BaseSpiceTransport.fullScreen
def getUDSTransportScript(self, userService, transport, ip, os, user, password, request): def getUDSTransportScript(self, userService, transport, ip, os, user, password, request):
userServiceInstance = userService.getInstance() userServiceInstance = userService.getInstance()
@ -69,7 +70,7 @@ class SPICETransport(BaseSpiceTransport):
port = -1 if port is None else port port = -1 if port is None else port
secure_port = -1 if secure_port is None else secure_port secure_port = -1 if secure_port is None else secure_port
r = RemoteViewerFile(con['address'], port, secure_port, con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=False) r = RemoteViewerFile(con['address'], port, secure_port, con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=self.fullScreen.isTrue())
m = tools.DictAsObj({ m = tools.DictAsObj({
'r': r 'r': r

View File

@ -46,7 +46,7 @@ import logging
import random import random
import string import string
__updated__ = '2016-04-18' __updated__ = '2016-05-27'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -65,6 +65,7 @@ class TSPICETransport(BaseSpiceTransport):
tunnelServer = gui.TextField(label=_('Tunnel server'), order=1, tooltip=_('IP or Hostname of tunnel server sent to client device ("public" ip) and port. (use HOST:PORT format)'), tab=gui.TUNNEL_TAB) tunnelServer = gui.TextField(label=_('Tunnel server'), order=1, tooltip=_('IP or Hostname of tunnel server sent to client device ("public" ip) and port. (use HOST:PORT format)'), tab=gui.TUNNEL_TAB)
serverCertificate = BaseSpiceTransport.serverCertificate serverCertificate = BaseSpiceTransport.serverCertificate
fullScreen = BaseSpiceTransport.fullScreen
def initialize(self, values): def initialize(self, values):
if values is not None: if values is not None:
@ -86,7 +87,7 @@ class TSPICETransport(BaseSpiceTransport):
sshHost, sshPort = self.tunnelServer.value.split(':') sshHost, sshPort = self.tunnelServer.value.split(':')
r = RemoteViewerFile('127.0.0.1', '{port}', '{secure_port}', con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=False) r = RemoteViewerFile('127.0.0.1', '{port}', '{secure_port}', con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=self.fullScreen.isTrue())
m = tools.DictAsObj({ m = tools.DictAsObj({
'r': r, 'r': r,