Project

General

Profile

Revision ef31cc13

IDef31cc13b0ce2fa44050fcf468f785a7f6d0a670
Parent 86c3ae23
Child 780ca169

Added by Francois POIROTTE over 14 years ago

Correction de VigiBoard et ses templates pour simplifier le rafraichissement automatique de la page.
Les délais/textes de rafraichissement sont déplcés des thèmes vers VigiBoard (pour le moment, en dur dans le code, mais peut facilement être déplacé dans un fichier de configuration).

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@1301 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigiboard/config/app_cfg.py
69 69
##################################
70 70

  
71 71
# Vigiboard version
72
base_config['vigiboard_version'] = u'2.0-pre0.1'
72
base_config['vigilo_version'] = u'2.0-pre0.1'
73 73

  
74 74
# Links configuration
75 75
# XXX Should be part of ini settings.
vigiboard/controllers/root.py
6 6
    tmpl_context, request, config, session, redirect, url
7 7
from tw.forms import validators
8 8
from pylons.i18n import ugettext as _
9
from pylons.i18n import lazy_ugettext as l_
9 10
from pylons.controllers.util import abort
10 11
from sqlalchemy import not_, and_, asc
11 12
from datetime import datetime
......
23 24
__all__ = ('RootController', )
24 25

  
25 26
class RootController(VigiboardRootController):
26
    
27 27
    """
28 28
    Le controller général de vigiboard
29 29
    """
30 30

  
31
    # XXX Mettre ça dans un fichier de configuration.
32
    refresh_times = (
33
        (0, l_('Never')),
34
        (30, l_('30 seconds')),
35
        (60, l_('1 minute')),
36
        (300, l_('5 minutes')),
37
        (600, l_('10 minutes')),
38
    )
39

  
31 40
    def process_form_errors(self, *argv, **kwargv):
32 41
        """
33 42
        Gestion des erreurs de validation : On affiche les erreurs
......
121 130
        nb_pages = int(math.ceil(total_rows / (items_per_page + 0.0)))
122 131

  
123 132
        return dict(
124
               events = aggregates.events,
125
               rows_info = {
126
                   'id_first_row': id_first_row + 1,
127
                   'id_last_row': id_last_row,
128
                   'total_rows': total_rows,
129
               },
130
               pages = range(1, nb_pages + 1),
131
               page = page,
132
               event_edit_status_options = edit_event_status_options,
133
               history = [],
134
               hist_error = False,
135
               plugin_context = aggregates.context_fct,
136
               search = search,
137
            )
133
                   events = aggregates.events,
134
                   rows_info = {
135
                       'id_first_row': id_first_row + 1,
136
                       'id_last_row': id_last_row,
137
                       'total_rows': total_rows,
138
                   },
139
                   pages = range(1, nb_pages + 1),
140
                   page = page,
141
                   event_edit_status_options = edit_event_status_options,
142
                   history = [],
143
                   hist_error = False,
144
                   plugin_context = aggregates.context_fct,
145
                   search = search,
146
                   refresh_times=self.refresh_times,
147
                )
138 148
      
139 149
    @validate(validators={'idaggregate':validators.String(not_empty=True)},
140 150
            error_handler=process_form_errors)
......
237 247
                        'service': None,
238 248
                        'output': None,
239 249
                        'tt': None
240
                    }
250
                    },
251
                   refresh_times=self.refresh_times,
241 252
                )
242 253

  
243 254
    @validate(validators={'host':validators.NotEmpty(),
......
291 302
                        'service': None,
292 303
                        'output': None,
293 304
                        'tt': None
294
                    }
305
                    },
306
                    refresh_times=self.refresh_times,
295 307
                )
296 308

  
297 309
    @validate(validators={

Also available in: Unified diff