Skip to content

Commit

Permalink
Merge branch '#105'
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Mar 17, 2022
2 parents 1d3139d + 4553de1 commit 3cc3477
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 9 deletions.
16 changes: 16 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.red {
color: red;
}

.gray {
color: #b3b7bb;
}


.yellow {
color: #ffc107;
}

.green {
color: #28a745;
}
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom styles for text color etc
# Relative to html_static_path
html_css_files = ['css/custom.css']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
Expand Down
36 changes: 30 additions & 6 deletions docs/user-manual.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.. role:: red
.. role:: gray
.. role:: green
.. role:: yellow

User manual
===========

Expand Down Expand Up @@ -53,12 +58,14 @@ The purpose of this page is to receive the runs data based on the number and typ
- **Get Open Runs**:
This will return the requested open runs, either by using a list of run numbers or a range of run numbers. This is meant to work in such a way that each shifter will get his open runs at the beginning of the week and go through them one by one afterwards.

.. image:: images/openruns-table.png
\
Grayed out row means the openrun is taken by somebody else.
Yellow run type button means run not certified
Green run type button means run is certified
.. image:: images/openruns-table.png

:gray:`Grayed` out row means the openrun is taken by somebody else.

:yellow:`Yellow` run type button means run not certified

:green:`Green` run type button means run is certified

The table also gives the user the option to delete an entry from his account(this is completely safe, the run can be retrieved back anytime). Main reason for this is in case a run has to be moved from one user to another, it first has to be removed from the first user and then retrieved back by the second.


Expand Down Expand Up @@ -183,10 +190,27 @@ By using the Tracker Maps tile button you can access the page where you can gene

.. image:: images/tracker-maps-tile.png

Here the shiftleader can generate tracker maps for a range of runs. All he/she has to do is add the number range and the type. Once that is done on press of the "Generate Tracker Maps" button will start the process. The shiftleader can follow the process by looking at the logs of the generating script.
Here the shiftleader can generate tracker maps for specific runs. All they have to do is add the run number
list (either comma or space separated values) and select the type.
Once that is done, pressing the :guilabel:`Generate Tracker Maps` button will
start the process. The shiftleader can follow the process in real time by observing the logs of
the generating script.

.. image:: images/tracker-maps.png


.. note::

If multiple Shift Leader have visited the page, they will all be updated with execution logs of the
running scripts at the same time.


.. warning::

Currently, a Shift Leader can execute the tracker map generation script multiple times. This
can overload the ``vocms066`` machine, so please wait for previous map generation to complete
before invoking the script again.


Shift Leader View
~~~~~~~~~~~~~~~~~
Expand Down
7 changes: 4 additions & 3 deletions trackermaps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.shortcuts import render
from django.http import JsonResponse
from django.conf import settings
from django.contrib.auth.decorators import login_required
from channels.layers import get_channel_layer
from channels_redis.core import RedisChannelLayer
from asgiref.sync import async_to_sync
Expand Down Expand Up @@ -36,7 +37,7 @@ def send_channel_message(channel_layer: RedisChannelLayer, group_name: str,
})


def run_tracker_maps(run_type: str, run_number_list: list) -> Bool:
def run_tracker_maps(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.
Expand Down Expand Up @@ -71,8 +72,7 @@ def line_buffered(f):

# Spit out output to channel layer
for line in line_buffered(ssh_stdout):
line = line.decode('utf-8', errors='ignore')
print(line)
line = line.decode('utf-8', errors='ignore') # Convert bytes to str
send_channel_message(channel_layer, "output_group", f"{line}")

send_channel_message(channel_layer, "output_group", "GENERATION ENDED\n")
Expand All @@ -86,6 +86,7 @@ def line_buffered(f):
return True


@login_required
def maps(request):
"""
View for the trackermaps/ url
Expand Down

0 comments on commit 3cc3477

Please sign in to comment.