diff --git a/opt/torero-ui/torero_ui/static/css/dashboard.css b/opt/torero-ui/torero_ui/static/css/dashboard.css index 7b1ba2d..61b7267 100644 --- a/opt/torero-ui/torero_ui/static/css/dashboard.css +++ b/opt/torero-ui/torero_ui/static/css/dashboard.css @@ -145,11 +145,24 @@ body { transform: translateY(-2px); } +.service-header { + display: flex; + align-items: center; + margin-bottom: 10px; +} + +.service-logo { + width: 24px; + height: 24px; + margin-right: 10px; + flex-shrink: 0; +} + .service-name { color: #ccff00; font-size: 18px; - margin-bottom: 10px; font-weight: bold; + flex-grow: 1; } .status-info { @@ -251,6 +264,18 @@ body { margin-bottom: 8px; } +.execution-service-with-logo { + display: flex; + align-items: center; +} + +.execution-logo { + width: 20px; + height: 20px; + margin-right: 8px; + flex-shrink: 0; +} + .execution-service { color: #ccff00; font-weight: bold; diff --git a/opt/torero-ui/torero_ui/static/img/ansible.svg b/opt/torero-ui/torero_ui/static/img/ansible.svg new file mode 100644 index 0000000..0b0b51e --- /dev/null +++ b/opt/torero-ui/torero_ui/static/img/ansible.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/opt/torero-ui/torero_ui/static/img/opentofu.svg b/opt/torero-ui/torero_ui/static/img/opentofu.svg new file mode 100644 index 0000000..ca71ade --- /dev/null +++ b/opt/torero-ui/torero_ui/static/img/opentofu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/opt/torero-ui/torero_ui/static/img/python.svg b/opt/torero-ui/torero_ui/static/img/python.svg new file mode 100644 index 0000000..1c2739b --- /dev/null +++ b/opt/torero-ui/torero_ui/static/img/python.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/opt/torero-ui/torero_ui/static/js/dashboard.js b/opt/torero-ui/torero_ui/static/js/dashboard.js index be3c5db..5e99a65 100644 --- a/opt/torero-ui/torero_ui/static/js/dashboard.js +++ b/opt/torero-ui/torero_ui/static/js/dashboard.js @@ -144,12 +144,25 @@ function updateServiceStatus(services) { const statusClass = service.latest_status ? `status-${service.latest_status}` : 'status-value'; const statusText = service.latest_status ? service.latest_status.toUpperCase() : 'NEVER RUN'; + // Determine logo based on service type + let logoHtml = ''; + if (service.service_type === 'ansible-playbook') { + logoHtml = ''; + } else if (service.service_type === 'opentofu-plan') { + logoHtml = ''; + } else if (service.service_type === 'python-script') { + logoHtml = ''; + } + const card = document.createElement('div'); card.className = 'status-card'; card.dataset.service = service.name; card.innerHTML = ` -
${service.name}
+
+ ${logoHtml} +
${service.name}
+
Type: ${service.service_type} @@ -210,9 +223,22 @@ function updateExecutionList(listId, executions) { minute: '2-digit' }); + // Determine logo based on service type + let logoHtml = ''; + if (execution.service_type === 'ansible-playbook') { + logoHtml = ''; + } else if (execution.service_type === 'opentofu-plan') { + logoHtml = ''; + } else if (execution.service_type === 'python-script') { + logoHtml = ''; + } + item.innerHTML = `
- ${execution.service_name} + ${execution.status.toUpperCase()}
diff --git a/opt/torero-ui/torero_ui/templates/dashboard/index.html b/opt/torero-ui/torero_ui/templates/dashboard/index.html index fe0ced0..ffa62bf 100644 --- a/opt/torero-ui/torero_ui/templates/dashboard/index.html +++ b/opt/torero-ui/torero_ui/templates/dashboard/index.html @@ -1,4 +1,5 @@ {% extends "dashboard/base.html" %} +{% load static %} {% block content %} @@ -36,7 +37,16 @@
{% for service in services %}
-
{{ service.name }}
+
+ {% if service.service_type == "ansible-playbook" %} + + {% elif service.service_type == "opentofu-plan" %} + + {% elif service.service_type == "python-script" %} + + {% endif %} +
{{ service.name }}
+
Type: {{ service.service_type }} @@ -76,7 +86,16 @@ {% for execution in recent_executions %}
  • - {{ execution.service_name }} + {{ execution.status|upper }}
    @@ -101,7 +120,16 @@ {% if execution.status == 'success' %}
  • - {{ execution.service_name }} + SUCCESS
    @@ -127,7 +155,16 @@ {% if execution.status == 'failed' %}
  • - {{ execution.service_name }} + FAILED