Revision f82ad767
Un clic sur un graphe dans la page de métrologie d'un hôte ouvre désormais ce graphe dans VigiGraph (#419).
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@5850 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigigraph/controllers/rpc.py | ||
---|---|---|
299 | 299 |
duration = validators.Int(if_missing=86400) |
300 | 300 |
|
301 | 301 |
# VIGILO_EXIG_VIGILO_PERF_0010:Visualisation globale des graphes |
302 |
# VIGILO_EXIG_VIGILO_PERF_0020:Visualisation unitaire des graphes |
|
303 |
# On utilise la même page pour les 2 fonctionalités. |
|
302 | 304 |
@validate( |
303 | 305 |
validators = FullHostPageSchema(), |
304 | 306 |
error_handler = process_form_errors) |
... | ... | |
363 | 365 |
presets=self.presets, graphs=graphs) |
364 | 366 |
|
365 | 367 |
|
366 |
class SingleGraphSchema(schema.Schema): |
|
367 |
"""Schéma de validation pour la méthode L{singleGraph}.""" |
|
368 |
host = validators.String(not_empty=True) |
|
369 |
graph = validators.String(not_empty=True) |
|
370 |
start = validators.Int(if_missing=None) |
|
371 |
duration = validators.Int(if_missing=86400) |
|
372 |
|
|
373 |
# VIGILO_EXIG_VIGILO_PERF_0020:Visualisation unitaire des graphes |
|
374 |
@validate( |
|
375 |
validators = SingleGraphSchema(), |
|
376 |
error_handler = process_form_errors) |
|
377 |
@expose('singlegraph.html') |
|
378 |
def singleGraph(self, host, graph, start, duration): |
|
379 |
""" |
|
380 |
Affichage d un graphe associe a un hote et un graphe |
|
381 |
* d apres les donnees RRD |
|
382 |
* avec une date-heure de debut |
|
383 |
* pour une plage de temps |
|
384 |
|
|
385 |
@param host : hôte |
|
386 |
@type host : C{str} |
|
387 |
@param graph : graphe |
|
388 |
@type graph : C{str} |
|
389 |
@param start : date-heure de debut des donnees |
|
390 |
@type start : C{str} |
|
391 |
@param duration : plage de temps des données |
|
392 |
@type duration : C{str} |
|
393 |
(parametre optionnel, initialise a 86400 = plage de 1 jour) |
|
394 |
|
|
395 |
@return: page avec l image du graphe et boutons de deplacement dans le temps |
|
396 |
@rtype: page html |
|
397 |
""" |
|
398 |
|
|
399 |
if start is None: |
|
400 |
start = int(time.time()) - int(duration) |
|
401 |
|
|
402 |
start = int(start) |
|
403 |
duration = int(duration) |
|
404 |
|
|
405 |
return dict(host=host, graph=graph, start=start, duration=duration, \ |
|
406 |
presets=self.presets) |
|
407 |
|
|
408 | 368 |
@expose('searchhost.html') |
409 | 369 |
@paginate('hosts', items_per_page=10) |
410 | 370 |
def searchHost(self, *args, **kwargs): |
Also available in: Unified diff