From 726ccd38d8fb5fa6b3c71b6222faceecc61ec423 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 29 Aug 2022 12:24:06 +0100 Subject: [PATCH] Implement widget spawning --- core/templates/base.html | 4 ++- core/templates/modals/drilldown.html | 2 +- core/templates/partials/magnet.html | 10 +++---- core/templates/ui/drilldown/drilldown.html | 4 ++- .../ui/drilldown/table_results_partial.html | 13 +++++++- core/templates/widgets/drilldown.html | 30 +++++++++++++++++++ .../{panels => window-content}/context.html | 0 .../context_table.html | 0 .../{panels => window-content}/drilldown.html | 0 core/templates/windows/drilldown.html | 2 +- core/views/ui/drilldown.py | 2 ++ 11 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 core/templates/widgets/drilldown.html rename core/templates/{panels => window-content}/context.html (100%) rename core/templates/{panels => window-content}/context_table.html (100%) rename core/templates/{panels => window-content}/drilldown.html (100%) diff --git a/core/templates/base.html b/core/templates/base.html index d7004e6..11ec52b 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -203,6 +203,9 @@ .ui-close { float: right; } + .grid-stack-item:hover .ui-resizable-handle { + display: block !important; + } @@ -274,7 +277,6 @@ Logout {% endif %} - diff --git a/core/templates/modals/drilldown.html b/core/templates/modals/drilldown.html index 539d39f..cb3be77 100644 --- a/core/templates/modals/drilldown.html +++ b/core/templates/modals/drilldown.html @@ -8,7 +8,7 @@ diff --git a/core/templates/partials/magnet.html b/core/templates/partials/magnet.html index baddf8f..5f9bbfc 100644 --- a/core/templates/partials/magnet.html +++ b/core/templates/partials/magnet.html @@ -1,10 +1,8 @@ {% extends 'partials/panel.html' %} + {% block heading %} + {% endblock %} - {% block heading %} - {% endblock %} - - {% block panel_content %} - {% endblock %} - + {% block panel_content %} + {% endblock %} \ No newline at end of file diff --git a/core/templates/ui/drilldown/drilldown.html b/core/templates/ui/drilldown/drilldown.html index 8b85ed0..f276c6d 100644 --- a/core/templates/ui/drilldown/drilldown.html +++ b/core/templates/ui/drilldown/drilldown.html @@ -54,7 +54,7 @@ } -
+
+ \ No newline at end of file diff --git a/core/templates/panels/context.html b/core/templates/window-content/context.html similarity index 100% rename from core/templates/panels/context.html rename to core/templates/window-content/context.html diff --git a/core/templates/panels/context_table.html b/core/templates/window-content/context_table.html similarity index 100% rename from core/templates/panels/context_table.html rename to core/templates/window-content/context_table.html diff --git a/core/templates/panels/drilldown.html b/core/templates/window-content/drilldown.html similarity index 100% rename from core/templates/panels/drilldown.html rename to core/templates/window-content/drilldown.html diff --git a/core/templates/windows/drilldown.html b/core/templates/windows/drilldown.html index e311f1f..b8aebb9 100644 --- a/core/templates/windows/drilldown.html +++ b/core/templates/windows/drilldown.html @@ -5,5 +5,5 @@ {% endblock %} {% block panel_content %} - {% include 'panels/drilldown.html' %} + {% include 'window-content/drilldown.html' %} {% endblock %} \ No newline at end of file diff --git a/core/views/ui/drilldown.py b/core/views/ui/drilldown.py index 35dba46..a331421 100644 --- a/core/views/ui/drilldown.py +++ b/core/views/ui/drilldown.py @@ -422,6 +422,8 @@ class ThresholdInfoModal(APIView): return JsonResponse({"success": False}) if type == "window": self.template_name = "windows/drilldown.html" + elif type == "widget": + self.template_name = "widgets/drilldown.html" net = request.data["net"] nick = request.data["nick"]