Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed May 30, 2022
2 parents bf03553 + 357c8e4 commit a982b4b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 16 deletions.
9 changes: 9 additions & 0 deletions cablingmap/templates/cablingmap/cablingmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ <h4 class="text-center font-weight-bold mt-1 mb-1">Strip Detector</h4>
</div>
</div>
</div>
<div class="card col-sm col-md bg-dark text-light" onclick="location.href='{% url 'remotescripts:list' %}'">
<div class="card-header">
<h4 class="text-center font-weight-bold mt-1 mb-1">Remote tools</h4>
</div>
<img class="card-img-top" src="{% static 'home/img/trackermaps.png' %}" alt="Card image cap">
<div class="card-body">
<p class="card-text text-center" style="font-size: 18px">Tools running on remote machines</p>
</div>
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion dqmhelper/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
messages.ERROR: "danger",
}
# Version to display in order to keep track of changes
CERTHELPER_VERSION = "1.5.0"
CERTHELPER_VERSION = "1.5.1"

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down
7 changes: 4 additions & 3 deletions home/templates/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,16 @@ <h4 class="text-center font-weight-bold mt-1 mb-1">Cabling Map & DCS Trend</h4>
</p>
</div>
</div>
<div class="card col-sm col-md bg-dark text-light" onclick="location.href='{% url 'remotescripts:list' %}'">
<div class="card col-sm col-md bg-dark text-light" onclick="location.href='{% url 'remotescripts:trackermaps' %}'">
<div class="card-header">
<h4 class="text-center font-weight-bold mt-1 mb-1">Remote tools</h4>
<h4 class="text-center font-weight-bold mt-1 mb-1">Tracker Maps</h4>
</div>
<img class="card-img-top" src="{% static 'home/img/trackermaps.png' %}" alt="Card image cap">
<div class="card-body">
<p class="card-text text-center" style="font-size: 18px">Tools running on remote machines</p>
<p class="card-text text-center" style="font-size: 18px">Generate tracker maps</p>
</div>
</div>

{% endif %}
</div>
{% else %}
Expand Down
8 changes: 4 additions & 4 deletions remotescripts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,15 @@ def execute(self, *args, **kwargs) -> int:
)

# Get output files from remote machine
for i, f in enumerate(output_files):
localpath = os.path.join(tempfile.gettempdir(), f[1])
remotepath = os.path.join(f[0].directory, f[1])
for f_db, f_remote in output_files:
localpath = os.path.join(tempfile.gettempdir(), f_remote)
remotepath = os.path.join(f_db.directory, f_remote)
logger.info(f"Copying remote file '{remotepath}' to '{localpath}'")
ftp.get(
remotepath=remotepath,
localpath=localpath,
)
self.on_new_output_file(i, localpath)
self.on_new_output_file(f_db.id, localpath)
ftp.close()
ssh.close()
return exit_status
Expand Down
4 changes: 2 additions & 2 deletions remotescripts/templates/remotescripts/remote.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h5>Script arguments</h5>
<h5>{{ output_file.filename_regex }}</h5>
</div>
<div class="card-body">
<img id="output-img-{{ output_file.id }}"></img>
<img class="img-fluid" id="output-img-{{ output_file.id }}"></img>
</div>
</div>
{% endfor %}
Expand Down Expand Up @@ -86,7 +86,7 @@ <h5>{{ output_file.filename_regex }}</h5>
for(var key of Object.keys(data['message'])){
if (key.startsWith('file'))
{
var file_id = Number(key.substring(key.indexOf('file') + 4)) + 1;
var file_id = Number(key.substring(key.indexOf('file') + 4));
img_div = document.getElementById(`output-img-${file_id}`);
img_div.src = `data:image/png;base64,${data['message'][key]}`
}
Expand Down
3 changes: 3 additions & 0 deletions remotescripts/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
urlpatterns = [
path("remote/list/", views.RemoteScriptListView.as_view(), name="list"),
path("remote/<int:pk>/", views.RemoteScriptView.as_view(), name="detail"),
path(
"trackermaps_standalone/", views.TrackerMapsView.as_view(), name="trackermaps"
),
]
12 changes: 6 additions & 6 deletions remotescripts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ def run_tracker_maps(self, run_type: str, run_number_list: list) -> bool:
Function that connects to vocms066 using the env-supplied username/password
and executes the script to generate specific tracker maps.
"""
# tracker_maps_command = (
# "cd /data/users/event_display/ShiftRun3/TkMapGeneration/CMS* &&"
# " bash /data/users/event_display/ShiftRun3/TkMapGeneration/tkmapsFromCertHelper.sh"
# f" {str(run_type)} {''.join(str(run_number)+' ' for run_number in run_number_list)}"
# )
tracker_maps_command = TEST_BASH_SCRIPT
tracker_maps_command = (
"cd /data/users/event_display/ShiftRun3/TkMapGeneration/CMS* &&"
" bash /data/users/event_display/ShiftRun3/TkMapGeneration/tkmapsFromCertHelper.sh"
f" {str(run_type)} {''.join(str(run_number)+' ' for run_number in run_number_list)}"
)
# tracker_maps_command = TEST_BASH_SCRIPT

channel_layer = get_channel_layer()

Expand Down

0 comments on commit a982b4b

Please sign in to comment.