mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
* Updated URLS for NX (to 3.5 version ones)
* Added urls to a new configuration pannel (NX)
This commit is contained in:
parent
47ea0a3bcb
commit
158ac77727
@ -33,10 +33,15 @@
|
|||||||
|
|
||||||
from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs
|
from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs
|
||||||
from uds.core.managers.DownloadsManager import DownloadsManager
|
from uds.core.managers.DownloadsManager import DownloadsManager
|
||||||
|
from uds.core.util.Config import Config
|
||||||
from NXTransport import NXTransport
|
from NXTransport import NXTransport
|
||||||
from django.utils.translation import ugettext_noop as _
|
from django.utils.translation import ugettext_noop as _
|
||||||
import os.path, sys
|
import os.path, sys
|
||||||
|
|
||||||
|
Config.section('NX').value('downloadUrl', 'http://www.nomachine.com/download-3').get()
|
||||||
|
Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get()
|
||||||
|
|
||||||
|
|
||||||
UserPrefsManager.manager().registerPrefs('nx', _('NX Protocol'),
|
UserPrefsManager.manager().registerPrefs('nx', _('NX Protocol'),
|
||||||
[
|
[
|
||||||
CommonPrefs.screenSizePref
|
CommonPrefs.screenSizePref
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from uds.core.util import OsDetector
|
from uds.core.util import OsDetector
|
||||||
|
from uds.core.util.Config import Config
|
||||||
import logging, os, sys
|
import logging, os, sys
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -75,24 +76,24 @@ def generateHtmlForNX(transport, idUserService, idTransport, ip, os, user, passw
|
|||||||
]))
|
]))
|
||||||
if isMac is True:
|
if isMac is True:
|
||||||
msg = '<p>' + _('In order to use this transport, you need to install first OpenNX Client for mac') + '</p>'
|
msg = '<p>' + _('In order to use this transport, you need to install first OpenNX Client for mac') + '</p>'
|
||||||
msg += '<p>' + _('You can oibtain it from ') + '<a href="http://opennx.net/download.html">' + _('OpenNx Website') + '</a></p>'
|
msg += '<p>' + _('You can oibtain it from ') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get()) + _('OpenNx Website') + '</a></p>'
|
||||||
else:
|
else:
|
||||||
msg = '<p>' + _('In order to use this transport, you need to install first Nomachine Nx Client version 3.5.x') + '</p>'
|
msg = '<p>' + _('In order to use this transport, you need to install first Nomachine Nx Client version 3.5.x') + '</p>'
|
||||||
msg +='<p>' + _('you can obtain it for your platform from') + '<a href="http://www.nomachine.com/download.php">' + _('nochamine web site') + '</a></p>'
|
msg +='<p>' + _('you can obtain it for your platform from') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrl', 'http://www.nomachine.com/download-3').get()) + _('nochamine web site') + '</a></p>'
|
||||||
res = '<div idTransport="applet"><applet code="NxTransportApplet.class" codebase="%s" archive="%s" width="140" height="22"><param name="data" value="%s"/><param name="permissions" value="all-permissions"/></applet></div>' % (codebase, '1', data )
|
res = '<div idTransport="applet"><applet code="NxTransportApplet.class" codebase="%s" archive="%s" width="140" height="22"><param name="data" value="%s"/><param name="permissions" value="all-permissions"/></applet></div>' % (codebase, '1', data )
|
||||||
res += '<div>' + msg + '</div>'
|
res += '<div>' + msg + '</div>'
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def getHtmlComponent(module, componentId):
|
def getHtmlComponent(module, componentId):
|
||||||
dict = { '1' : ['nxtransport.jar', 'application/java-archive' ]}
|
dct = { '1' : ['nxtransport.jar', 'application/java-archive' ]}
|
||||||
|
|
||||||
if dict.has_key(componentId) == False:
|
if dct.has_key(componentId) == False:
|
||||||
return ['text/plain', 'no component']
|
return ['text/plain', 'no component']
|
||||||
fname = os.path.dirname(sys.modules[module].__file__) + '/applet/' + dict[componentId][0]
|
fname = os.path.dirname(sys.modules[module].__file__) + '/applet/' + dct[componentId][0]
|
||||||
logger.debug('Loading component {0} from {1}'.format(componentId, fname))
|
logger.debug('Loading component {0} from {1}'.format(componentId, fname))
|
||||||
|
|
||||||
f = open(fname, 'rb')
|
f = open(fname, 'rb')
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
return [ dict[componentId][1], data ]
|
return [ dct[componentId][1], data ]
|
Loading…
Reference in New Issue
Block a user