Changeset 6220


Ignore:
Timestamp:
Nov 10, 2017, 6:40:03 PM (2 years ago)
Author:
Juanma
Message:

Added N4d login component

Location:
zero-lliurex-mirror-redirect/trunk/fuentes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zero-lliurex-mirror-redirect/trunk/fuentes/debian/changelog

    r6092 r6220  
     1zero-lliurex-mirror-redirect (0.5) xenial; urgency=medium
     2
     3  * Added N4d login component.
     4
     5 -- Juanma Navarro Mañez <juanma1980@gmail.com>  Fri, 10 Nov 2017 18:37:20 +0100
     6
    17zero-lliurex-mirror-redirect (0.4) xenial; urgency=high
    28
  • zero-lliurex-mirror-redirect/trunk/fuentes/zero-lliurex-mirror-redirect.install/usr/sbin/mirror-redirect.py

    r6191 r6220  
    11#!/usr/bin/env python
     2# -*- coding: utf-8 -*-
    23import gi
    34gi.require_version('Gtk', '3.0')
     
    1112import xmlrpclib as n4d
    1213import lliurex.interfacesparser
    13 
     14from n4dgtklogin import *
    1415import gettext
    1516gettext.textdomain('zero-lliurex-mirror-redirect')
     
    4950                else:
    5051                        self.master_ip=self.n4d.get_variable("","VariablesManager","SRV_IP")
    51         #def _et_server_data
     52        #def _set_server_data
    5253
    5354        def is_enabled(self):
     
    6061        def enable_redirect(self):
    6162                try:
    62                         sw_add=self.n4dMaster.add_mirror(["lliurex","lliurex"],"NfsManager",self.mirror_dir,self.slave_ip)['status']
     63                        sw_add=self.n4dMaster.add_mirror(self.credentials,"NfsManager",self.mirror_dir,self.slave_ip)['status']
    6364                        print(sw_add)
    64                         if not self.n4d.is_mount_configured("","NfsManager",self.mirror_dir)['status']:
    65                                 self.n4d.configure_mount_on_boot(["lliurex","lliurex"],"NfsManager",self.master_ip+":"+self.mirror_dir,self.mirror_dir)
     65                        if not self.n4d.is_mount_configured(self.credentials,"NfsManager",self.mirror_dir)['status']:
     66                                self.n4d.configure_mount_on_boot(self.credentials,"NfsManager",self.master_ip+":"+self.mirror_dir,self.mirror_dir)
    6667                                print("Mounting on boot")
    6768                except Exception as e:
     
    7475        def disable_redirect(self):
    7576                try:
    76                         self.n4d.remove_mount_on_boot("","NfsManager",self.mirror_dir)
    77                         sw_rm=self.n4dMaster.remove_ip_from_mirror(["lliurex","lliurex"],"NfsManager",self.mirror_dir,self.slave_ip)['status']
     77                        self.n4d.remove_mount_on_boot(self.credentials,"NfsManager",self.mirror_dir)
     78                        sw_rm=self.n4dMaster.remove_ip_from_mirror(self.credentials,"NfsManager",self.mirror_dir,self.slave_ip)['status']
    7879                except:
    7980                        sw_rm=False
     
    140141                self.dbg=1
    141142                Gtk.Window.__init__(self,title=_("Mirror Redirect"))
     143                self.stack=Gtk.Stack()
     144                self.stack.set_transition_duration(1000)
     145                self.stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT)
    142146                self.set_position(Gtk.WindowPosition.CENTER)
    143147                self.connect("delete-event", Gtk.main_quit)
     
    155159                box.set_column_spacing(20)
    156160                box.set_row_spacing(30)
    157                 self.add(vbox)
     161                login=N4dGtkLogin()
     162                login.set_info_text("<span foreground='black'>Mirror Redirect</span>","Redireccionar el mirror","<span foreground='black'>Desde aquí puedes redireccionar el mirror en un servidor esclavo para usar el del servidor maestro.</span>")
     163                login.set_info_background(image='/usr/share/backgrounds/lliurex/lliurex-blueprint.png',cover=True)
     164                login.after_validation_goto(self._signin)
     165                loginBox=login.render_form()
     166                self.stack.add_titled(loginBox, "login", "Login")
     167                self.stack.add_titled(vbox, "gui", "Gui")
     168                self.add(self.stack)
    158169                vbox.add(img_area)
    159170                vbox.add(frame)
     
    173184                self.lbl_State.set_text(_(service_label))
    174185                self.sw_Enable.connect("state-set",self._on_sw_state)
     186                self.stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT)
     187                self.stack.set_visible_child_name("login")
     188
    175189                self.show_all()
    176190        #def __init__
    177191                               
     192        def _signin(self,lm,user,pwd):
     193                self.credentials=[user,pwd]
     194                self.stack.set_visible_child_name("gui")
    178195        def _debug(self,msg):
    179196                if self.dbg==1:
     
    217234
    218235status=read_key()
     236status=True
    219237
    220238if not status:
     
    227245        response = dialog.run()
    228246        dialog.destroy()
    229         sys.exit(0)
     247#       sys.exit(0)
    230248
    231249GObject.threads_init()
Note: See TracChangeset for help on using the changeset viewer.