Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion opt/torero-ui/torero_ui/static/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions opt/torero-ui/torero_ui/static/img/ansible.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions opt/torero-ui/torero_ui/static/img/opentofu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions opt/torero-ui/torero_ui/static/img/python.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 28 additions & 2 deletions opt/torero-ui/torero_ui/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<img src="/static/img/ansible.svg" alt="Ansible" class="service-logo">';
} else if (service.service_type === 'opentofu-plan') {
logoHtml = '<img src="/static/img/opentofu.svg" alt="OpenTofu" class="service-logo">';
} else if (service.service_type === 'python-script') {
logoHtml = '<img src="/static/img/python.svg" alt="Python" class="service-logo">';
}

const card = document.createElement('div');
card.className = 'status-card';
card.dataset.service = service.name;

card.innerHTML = `
<div class="service-name">${service.name}</div>
<div class="service-header">
${logoHtml}
<div class="service-name">${service.name}</div>
</div>
<div class="status-info">
<span class="status-label">Type:</span>
<span class="status-value">${service.service_type}</span>
Expand Down Expand Up @@ -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 = '<img src="/static/img/ansible.svg" alt="Ansible" class="execution-logo">';
} else if (execution.service_type === 'opentofu-plan') {
logoHtml = '<img src="/static/img/opentofu.svg" alt="OpenTofu" class="execution-logo">';
} else if (execution.service_type === 'python-script') {
logoHtml = '<img src="/static/img/python.svg" alt="Python" class="execution-logo">';
}

item.innerHTML = `
<div class="execution-header">
<span class="execution-service">${execution.service_name}</span>
<div class="execution-service-with-logo">
${logoHtml}
<span class="execution-service">${execution.service_name}</span>
</div>
<span class="execution-status ${execution.status}">${execution.status.toUpperCase()}</span>
</div>
<div class="execution-details">
Expand Down
45 changes: 41 additions & 4 deletions opt/torero-ui/torero_ui/templates/dashboard/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "dashboard/base.html" %}
{% load static %}

{% block content %}
<!-- summary statistics -->
Expand Down Expand Up @@ -36,7 +37,16 @@
<div class="status-grid" id="service-status">
{% for service in services %}
<div class="status-card" data-service="{{ service.name }}">
<div class="service-name">{{ service.name }}</div>
<div class="service-header">
{% if service.service_type == "ansible-playbook" %}
<img src="{% static 'img/ansible.svg' %}" alt="Ansible" class="service-logo">
{% elif service.service_type == "opentofu-plan" %}
<img src="{% static 'img/opentofu.svg' %}" alt="OpenTofu" class="service-logo">
{% elif service.service_type == "python-script" %}
<img src="{% static 'img/python.svg' %}" alt="Python" class="service-logo">
{% endif %}
<div class="service-name">{{ service.name }}</div>
</div>
<div class="status-info">
<span class="status-label">Type:</span>
<span class="status-value">{{ service.service_type }}</span>
Expand Down Expand Up @@ -76,7 +86,16 @@
{% for execution in recent_executions %}
<li class="execution-item" onclick="showExecutionDetails({{ execution.id }})">
<div class="execution-header">
<span class="execution-service">{{ execution.service_name }}</span>
<div class="execution-service-with-logo">
{% if execution.service_type == "ansible-playbook" %}
<img src="{% static 'img/ansible.svg' %}" alt="Ansible" class="execution-logo">
{% elif execution.service_type == "opentofu-plan" %}
<img src="{% static 'img/opentofu.svg' %}" alt="OpenTofu" class="execution-logo">
{% elif execution.service_type == "python-script" %}
<img src="{% static 'img/python.svg' %}" alt="Python" class="execution-logo">
{% endif %}
<span class="execution-service">{{ execution.service_name }}</span>
</div>
<span class="execution-status {{ execution.status }}">{{ execution.status|upper }}</span>
</div>
<div class="execution-details">
Expand All @@ -101,7 +120,16 @@
{% if execution.status == 'success' %}
<li class="execution-item" onclick="showExecutionDetails({{ execution.id }})">
<div class="execution-header">
<span class="execution-service">{{ execution.service_name }}</span>
<div class="execution-service-with-logo">
{% if execution.service_type == "ansible-playbook" %}
<img src="{% static 'img/ansible.svg' %}" alt="Ansible" class="execution-logo">
{% elif execution.service_type == "opentofu-plan" %}
<img src="{% static 'img/opentofu.svg' %}" alt="OpenTofu" class="execution-logo">
{% elif execution.service_type == "python-script" %}
<img src="{% static 'img/python.svg' %}" alt="Python" class="execution-logo">
{% endif %}
<span class="execution-service">{{ execution.service_name }}</span>
</div>
<span class="execution-status success">SUCCESS</span>
</div>
<div class="execution-details">
Expand All @@ -127,7 +155,16 @@
{% if execution.status == 'failed' %}
<li class="execution-item" onclick="showExecutionDetails({{ execution.id }})">
<div class="execution-header">
<span class="execution-service">{{ execution.service_name }}</span>
<div class="execution-service-with-logo">
{% if execution.service_type == "ansible-playbook" %}
<img src="{% static 'img/ansible.svg' %}" alt="Ansible" class="execution-logo">
{% elif execution.service_type == "opentofu-plan" %}
<img src="{% static 'img/opentofu.svg' %}" alt="OpenTofu" class="execution-logo">
{% elif execution.service_type == "python-script" %}
<img src="{% static 'img/python.svg' %}" alt="Python" class="execution-logo">
{% endif %}
<span class="execution-service">{{ execution.service_name }}</span>
</div>
<span class="execution-status failed">FAILED</span>
</div>
<div class="execution-details">
Expand Down