From c73dae361fe82644660354085166a90de4fb315e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 17 May 2016 09:35:53 +0200 Subject: [PATCH] Fixed headers replication on UDS Reports --- server/src/uds/core/reports/tools/report.py | 8 ++++---- server/src/uds/reports/stats/login.py | 5 +++-- server/src/uds/reports/stats/pool_performance.py | 6 ++++-- server/src/uds/reports/stats/usage_by_pool.py | 2 +- server/src/uds/transports/RDP/RDPFile.py | 5 ++--- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/server/src/uds/core/reports/tools/report.py b/server/src/uds/core/reports/tools/report.py index 670f4b81..f4cfcac7 100644 --- a/server/src/uds/core/reports/tools/report.py +++ b/server/src/uds/core/reports/tools/report.py @@ -46,7 +46,7 @@ import logging logger = logging.getLogger(__name__) -__updated__ = '2016-01-20' +__updated__ = '2016-05-17' class UDSGeraldoReport(Report): @@ -65,7 +65,7 @@ class UDSGeraldoReport(Report): class band_page_header(ReportBand): height = 1.8 * cm - elements = [ + bElements = [ SystemField(expression='%(report_title)s', top=0.5 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER}), @@ -77,7 +77,7 @@ class UDSGeraldoReport(Report): class band_page_footer(ReportBand): height = 0.5 * cm - elements = [ + bElements = [ Label(text=_('Generated by UDS'), top=0.1 * cm), SystemField(expression=_('Printed in %(now:%Y, %b %d)s at %(now:%H:%M)s'), top=0.1 * cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), @@ -85,7 +85,7 @@ class UDSGeraldoReport(Report): borders = {'top': True} def __init__(self, queryset=None): - self.band_page_header.elements += self.header_elements + self.band_page_header.elements = self.band_page_header.bElements + self.header_elements self.band_page_header.height = self.header_height Report.__init__(self, queryset=queryset) diff --git a/server/src/uds/reports/stats/login.py b/server/src/uds/reports/stats/login.py index 6f9e5461..3f0bb901 100644 --- a/server/src/uds/reports/stats/login.py +++ b/server/src/uds/reports/stats/login.py @@ -60,7 +60,7 @@ import logging logger = logging.getLogger(__name__) -__updated__ = '2015-09-04' +__updated__ = '2016-05-17' # several constants as Width height, margins, .. WIDTH, HEIGHT = 1800, 1000 @@ -69,6 +69,7 @@ GERALDO_HEIGHT = GERALDO_WIDTH * HEIGHT / WIDTH class AccessReport(UDSGeraldoReport): + header_elements = [] class band_detail(ReportBand): height = 400 * mm # Height bigger than a page, so a new page is launched @@ -225,7 +226,7 @@ class StatsReportLogin(StatsReport): # User access by date graph # - surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT) + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT) # @UndefinedVariable dataset = ((ugettext('Users access to UDS'), data),) diff --git a/server/src/uds/reports/stats/pool_performance.py b/server/src/uds/reports/stats/pool_performance.py index b3cacaf1..752edb81 100644 --- a/server/src/uds/reports/stats/pool_performance.py +++ b/server/src/uds/reports/stats/pool_performance.py @@ -64,7 +64,7 @@ import logging logger = logging.getLogger(__name__) -__updated__ = '2016-05-04' +__updated__ = '2016-05-17' # several constants as Width height, margins, .. WIDTH, HEIGHT = 1800, 1000 @@ -74,6 +74,8 @@ GERALDO_HEIGHT = GERALDO_WIDTH * HEIGHT / WIDTH class AccessReport(UDSGeraldoReport): + header_elements = [] + class band_detail(ReportBand): height = 400 * mm # Height bigger than a page, so a new page is launched for listings # auto_expand_height = True @@ -244,7 +246,7 @@ class PoolPerformanceReport(StatsReport): xLabelFormat, poolsData, reportData = self.getRangeData() - surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT) + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT) # @UndefinedVariable options = { 'encoding': 'utf-8', diff --git a/server/src/uds/reports/stats/usage_by_pool.py b/server/src/uds/reports/stats/usage_by_pool.py index eca21955..ce33901e 100644 --- a/server/src/uds/reports/stats/usage_by_pool.py +++ b/server/src/uds/reports/stats/usage_by_pool.py @@ -56,7 +56,7 @@ import logging logger = logging.getLogger(__name__) -__updated__ = '2016-01-20' +__updated__ = '2016-05-17' # several constants as Width height, margins, .. WIDTH, HEIGHT = 1800, 1000 diff --git a/server/src/uds/transports/RDP/RDPFile.py b/server/src/uds/transports/RDP/RDPFile.py index 4662b697..6feab82b 100644 --- a/server/src/uds/transports/RDP/RDPFile.py +++ b/server/src/uds/transports/RDP/RDPFile.py @@ -40,7 +40,7 @@ from uds.core.util import OsDetector import six import os -__updated__ = '2015-08-31' +__updated__ = '2016-05-13' class RDPFile(object): @@ -141,7 +141,7 @@ class RDPFile(object): Note that server is not added ''' - params = ['-TUDS Connection', '-P', '-rclipboard:PRIMARYCLIPBOARD]'] + params = ['-TUDS Connection', '-P', '-rclipboard:PRIMARYCLIPBOARD'] if self.redirectSmartcards: params.append('-rsdcard') @@ -152,7 +152,6 @@ class RDPFile(object): params.append('-rsound:off') if self.redirectDrives is True: - params.append('-rdisk:home=' + os.environ['HOME']) params.append('-rdisk:media=/media') if self.redirectSerials is True: