constants.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Events
  2. EVENT_CREATE = 'create'
  3. EVENT_UPDATE = 'update'
  4. EVENT_DELETE = 'delete'
  5. EVENT_JOB_START = 'job_start'
  6. EVENT_JOB_END = 'job_end'
  7. # Webhooks
  8. HTTP_CONTENT_TYPE_JSON = 'application/json'
  9. WEBHOOK_EVENT_TYPES = {
  10. EVENT_CREATE: 'created',
  11. EVENT_UPDATE: 'updated',
  12. EVENT_DELETE: 'deleted',
  13. EVENT_JOB_START: 'job_started',
  14. EVENT_JOB_END: 'job_ended',
  15. }
  16. # Dashboard
  17. DEFAULT_DASHBOARD = [
  18. {
  19. 'widget': 'extras.ObjectCountsWidget',
  20. 'width': 4,
  21. 'height': 2,
  22. 'title': 'Organization',
  23. 'config': {
  24. 'models': [
  25. 'dcim.site',
  26. 'tenancy.tenant',
  27. 'tenancy.contact',
  28. ]
  29. }
  30. },
  31. {
  32. 'widget': 'extras.ObjectCountsWidget',
  33. 'width': 4,
  34. 'height': 3,
  35. 'title': 'IPAM',
  36. 'config': {
  37. 'models': [
  38. 'ipam.vrf',
  39. 'ipam.aggregate',
  40. 'ipam.prefix',
  41. 'ipam.iprange',
  42. 'ipam.ipaddress',
  43. 'ipam.vlan',
  44. ]
  45. }
  46. },
  47. {
  48. 'widget': 'extras.NoteWidget',
  49. 'width': 4,
  50. 'height': 2,
  51. 'title': 'Welcome!',
  52. 'color': 'green',
  53. 'config': {
  54. 'content': (
  55. 'This is your personal dashboard. Feel free to customize it by rearranging, resizing, or removing '
  56. 'widgets. You can also add new widgets using the "add widget" button below. Any changes affect only '
  57. '_your_ dashboard, so feel free to experiment!'
  58. )
  59. }
  60. },
  61. {
  62. 'widget': 'extras.ObjectCountsWidget',
  63. 'width': 4,
  64. 'height': 2,
  65. 'title': 'Circuits',
  66. 'config': {
  67. 'models': [
  68. 'circuits.provider',
  69. 'circuits.circuit',
  70. 'circuits.providernetwork',
  71. ]
  72. }
  73. },
  74. {
  75. 'widget': 'extras.RSSFeedWidget',
  76. 'width': 4,
  77. 'height': 4,
  78. 'title': 'NetBox News',
  79. 'config': {
  80. 'feed_url': 'http://netbox.dev/rss/',
  81. 'max_entries': 10,
  82. 'cache_timeout': 14400,
  83. }
  84. },
  85. {
  86. 'widget': 'extras.ObjectCountsWidget',
  87. 'width': 4,
  88. 'height': 3,
  89. 'title': 'DCIM',
  90. 'config': {
  91. 'models': [
  92. 'dcim.site',
  93. 'dcim.rack',
  94. 'dcim.devicetype',
  95. 'dcim.device',
  96. 'dcim.cable',
  97. ],
  98. }
  99. },
  100. {
  101. 'widget': 'extras.ObjectCountsWidget',
  102. 'width': 4,
  103. 'height': 2,
  104. 'title': 'Virtualization',
  105. 'config': {
  106. 'models': [
  107. 'virtualization.cluster',
  108. 'virtualization.virtualmachine',
  109. ]
  110. }
  111. },
  112. {
  113. 'widget': 'extras.ObjectListWidget',
  114. 'width': 12,
  115. 'height': 5,
  116. 'title': 'Change Log',
  117. 'color': 'blue',
  118. 'config': {
  119. 'model': 'extras.objectchange',
  120. 'page_size': 25,
  121. }
  122. },
  123. ]