Skip to content

Commit

Permalink
fix: Resolved broken run history problem
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Oct 24, 2024
1 parent e3eb477 commit d571ae4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@

<tr>
<td>{{run.data.time}}</td>

{% if run.data.version_short != None %}
<td><a href="#" onclick="page_load('{% url 'control_element_runs_analyze' id=control_library run_sha=run.id %}');event.preventDefault();" class="library_item_a">
<span class="uk-badge">{{run.data.version_short}}</span></a></td>
{% else %}
<td><a href="#" onclick="page_load('{% url 'control_element_runs_analyze' id=control_library run_sha=run.id %}');event.preventDefault();" class="library_item_a">
<span class="uk-badge">No Version</span></a></td>
{% endif %}

<td>{{run.data.cpu_usage}}%</td>
<td>{{run.data.memory_usage}}mb</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ <h3 class="uk-card-title">Records</h3>
align-items: center;
justify-content: flex-start; /* Align items to the left */" >
<span uk-icon="server" class="uk-margin-small-right uk-icon"></span>
{% if run.version_short != None %}
{{run.version_short}}
{% else %}
No Version
{% endif %}
</button>

<button Server class="uk-button uk-button-primary uk-width-1-1 " style=" display: flex;
Expand Down
26 changes: 16 additions & 10 deletions upsonic_on_prem/dash/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,11 +1215,14 @@ def control_element_runs(request, id):
each_run["data"]["version_short"] = "Latest"
each_run["data"]["version_tag"] = "Latest"
else:
each_run["data"]["version_short"] = (
each_run["data"]["version"][:4]
+ "..."
+ each_run["data"]["version"][-4:]
)
try:
each_run["data"]["version_short"] = (
each_run["data"]["version"][:4]
+ "..."
+ each_run["data"]["version"][-4:]
)
except:
pass

number = float(each_run["data"]["cpu_usage"])
each_run["data"]["cpu_usage"] = float(f"{number:.1f}")
Expand Down Expand Up @@ -1292,11 +1295,14 @@ def control_element_runs_analyze(request, id, run_sha):
get_last_run["data"]["version_short"] = "Latest"
get_last_run["data"]["version_tag"] = "Latest"
else:
get_last_run["data"]["version_short"] = (
get_last_run["data"]["version"][:4]
+ "..."
+ get_last_run["data"]["version"][-4:]
)
try:
get_last_run["data"]["version_short"] = (
get_last_run["data"]["version"][:4]
+ "..."
+ get_last_run["data"]["version"][-4:]
)
except:
pass

number = float(get_last_run["data"]["cpu_usage"])
get_last_run["data"]["cpu_usage"] = float(f"{number:.1f}")
Expand Down

0 comments on commit d571ae4

Please sign in to comment.