Changeset 5551


Ignore:
Timestamp:
Jul 18, 2017, 1:40:35 PM (21 months ago)
Author:
joamuran
Message:

Added getXPRAConnections method

Location:
admin-center/trunk/fuentes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • admin-center/trunk/fuentes/admin-center.install/etc/n4d/conf.d/RemoteWebGui

    r1076 r5551  
    88close_connection=anonymous
    99run_into_connection=anonymous
     10getXpraConnections=anonymous
  • admin-center/trunk/fuentes/admin-center.install/usr/share/n4d/python-plugins/RemoteWebGui.py

    r3064 r5551  
    118118                return 0
    119119
    120        
    121 #class RemoteGuiManager
     120        def getXpraConnections(self, identifier):
     121                try:
     122                        from plumbum.cmd import grep, cut, ps
     123                        ret=list();
     124                        pipeline = ps['aux'] | grep[identifier] | grep['DISPLAY'] | cut['-d', ';', '-f', '1'] | cut['-d', '=', '-f', '2']
     125                       
     126                        display_str = pipeline().rstrip('\n') # execute
     127                        display_arr=display_str.split();
     128
     129                        for display in display_arr:
     130                                pipeline = ps['aux'] | grep[display] | grep['bind-tcp'] | cut['-d', '=', '-f', '2'] | cut['-d', ' ', '-f', '1'] | cut['-d', ':', '-f', '2']
     131                                port = pipeline().rstrip('\n') # execute
     132                               
     133                                ret.append([port, display]);
     134               
     135                        return ret;
     136                except Exception as e:
     137                        return []
     138
     139#class RemoteWebGui
  • admin-center/trunk/fuentes/debian/control

    r2185 r5551  
    1111Package: admin-center
    1212Architecture: all
    13 Depends: ${misc:Depends}, php7.0-common, libapache2-mod-php7.0, php7.0-cli, php7.0-curl, php7.0-xmlrpc, php7.0-mcrypt, python-simplewebsocketserver, python-websocket, websockify, xpra
     13Depends: ${misc:Depends}, php7.0-common, libapache2-mod-php7.0, php7.0-cli, php7.0-curl, php7.0-xmlrpc, php7.0-mcrypt, python-simplewebsocketserver, python-websocket, websockify, xpra, python-plumbum
    1414Description: Web Administration Center
    1515 This interface allows to configure n4d serives
Note: See TracChangeset for help on using the changeset viewer.