Revision c49defb8
Corrections suite aux changements apportés dans le modèles.
Corrections des tests.
Ajout d'une image pour la flèche affichant les détails : cas où severity = NULL dans la base de données.
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@804 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/controllers/root.py | ||
---|---|---|
131 | 131 |
search = search, |
132 | 132 |
) |
133 | 133 |
|
134 |
@validate(validators={'idaggregate':validators.Int(not_empty=True)},
|
|
134 |
@validate(validators={'idaggregate':validators.String(not_empty=True)},
|
|
135 | 135 |
error_handler=process_form_errors) |
136 | 136 |
@expose('json') |
137 | 137 |
@require(Any(not_anonymous(), msg=_("You need to be authenticated"))) |
... | ... | |
179 | 179 |
_('None'), _('OK'), _('Suppressed'), _('Initial'), |
180 | 180 |
_('Maintenance'), _('Minor'), _('Major'), _('Critical') |
181 | 181 |
) |
182 |
if event.severity is None: |
|
183 |
current_state = _('Unknown') |
|
184 |
else: |
|
185 |
current_state = severity[event.severity] |
|
186 |
|
|
182 | 187 |
eventdetails = {} |
183 | 188 |
for edname, edlink in \ |
184 | 189 |
config['vigiboard_links.eventdetails'].iteritems(): |
... | ... | |
191 | 196 |
|
192 | 197 |
return dict( |
193 | 198 |
initial_state = severity[int(initial_state)], |
194 |
current_state = severity[event.severity],
|
|
199 |
current_state = current_state,
|
|
195 | 200 |
idaggregate = idaggregate, |
196 | 201 |
host = event.hostname, |
197 | 202 |
service = event.servicename, |
198 |
eventdetails = eventdetails |
|
203 |
eventdetails = eventdetails,
|
|
199 | 204 |
) |
200 | 205 |
|
201 |
@validate(validators={'idaggregate':validators.Int(not_empty=True)},
|
|
206 |
@validate(validators={'idaggregate':validators.String(not_empty=True)},
|
|
202 | 207 |
error_handler=process_form_errors) |
203 | 208 |
@expose('vigiboard.templates.vigiboard') |
204 | 209 |
@require(Any(not_anonymous(), msg=_("You need to be authenticated"))) |
... | ... | |
294 | 299 |
) |
295 | 300 |
|
296 | 301 |
@validate(validators={ |
297 |
"id":validators.Regex(r'^[0-9]+(,[0-9]*)*,?$'),
|
|
302 |
"id":validators.Regex(r'^[^,]+(,[^,]*)*,?$'),
|
|
298 | 303 |
# "trouble_ticket":validators.Regex(r'^[0-9]*$'), |
299 | 304 |
"status":validators.OneOf(['NoChange', 'None', 'Acknowledged', |
300 | 305 |
'AAClosed']) |
Also available in: Unified diff