IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

50 lignes
1.3KB

  1. import dash_bootstrap_components as dbc
  2. import dash_html_components as html
  3. from .users import get_user
  4. def list_processes(arv, parent, limit=100):
  5. res = arv.container_requests().list(where={
  6. 'owner_uuid': parent
  7. }, limit=100).execute()['items']
  8. return res
  9. def list_processes_html(arv, parent, limit=100):
  10. processes = list_processes(arv, parent, limit=limit)
  11. header = html.Tr([
  12. html.Th('Name'),
  13. html.Th('Description'),
  14. html.Th('Owner')
  15. ])
  16. header = [ html.Thead(header) ]
  17. rows = []
  18. for a in processes:
  19. owner = get_user(arv, a['owner_uuid'])
  20. rows.append(
  21. html.Tr([
  22. html.Td([
  23. html.Div(html.A(href='/processes/' + a['uuid'],
  24. children=a['name'])),
  25. html.Div(a['uuid'])
  26. ]),
  27. html.Td(a['description'] or 'Process'),
  28. html.Td([
  29. html.Div(html.A(href='mailto:' + owner['email'],
  30. children=owner['first_name'] + ' ' + owner['last_name'])),
  31. html.Div(a['owner_uuid'])
  32. ])
  33. ]))
  34. rows = [ html.Tbody(rows) ]
  35. res = dbc.Table(header + rows,
  36. striped=True,
  37. hover=True,
  38. responsive=True)
  39. return res