diff --git a/embark/dashboard/views.py b/embark/dashboard/views.py index 41eae02d..287155bc 100644 --- a/embark/dashboard/views.py +++ b/embark/dashboard/views.py @@ -16,7 +16,7 @@ from uploader.boundedexecutor import BoundedExecutor from uploader.forms import LabelForm -from uploader.models import FirmwareAnalysis +from uploader.models import FirmwareAnalysis, Label from dashboard.models import Result from dashboard.forms import LabelSelectForm, StopAnalysisForm from porter.views import make_zip @@ -294,7 +294,9 @@ def rm_label(request, analysis_id, label_name): logger.info("User %s tryied to rm label %s", request.user.username, label_name) # get analysis obj analysis = FirmwareAnalysis.objects.get(id=analysis_id) - analysis.label.remove(label_name) + # get lobel obj + label_obj = Label.objects.get(label_name=label_name) + analysis.label.remove(label_obj) analysis.save() messages.info(request, 'removing successful of ' + str(label_name)) return redirect('..') diff --git a/embark/static/content/css/reportDashboard.css b/embark/static/content/css/reportDashboard.css index 44551b0c..aa8633a3 100644 --- a/embark/static/content/css/reportDashboard.css +++ b/embark/static/content/css/reportDashboard.css @@ -55,4 +55,12 @@ table.dataTable td, table.dataTable th { .buttonRowElem { margin: 2px; -} \ No newline at end of file +} + +.hidden { + display: none; +} + +.label:hover form button, .label:focus form button { + display: block; +} diff --git a/embark/templates/dashboard/reportDashboard.html b/embark/templates/dashboard/reportDashboard.html index 33c18c8b..996ca366 100644 --- a/embark/templates/dashboard/reportDashboard.html +++ b/embark/templates/dashboard/reportDashboard.html @@ -60,14 +60,13 @@ {% if firmware.label.all is not None %} {% for label in firmware.label.all %}
- - - -
+ + {{ label.label_name }} + {% csrf_token %} + - - {{ label.label_name }} +
{% endfor %} {% endif %} diff --git a/embark/uploader/boundedexecutor.py b/embark/uploader/boundedexecutor.py index 6a5c027a..ac169e07 100644 --- a/embark/uploader/boundedexecutor.py +++ b/embark/uploader/boundedexecutor.py @@ -38,7 +38,7 @@ semaphore = BoundedSemaphore(MAX_QUEUE) # emba directories -EMBA_SCRIPT_LOCATION = f"cd {settings.EMBA_ROOT} && sudo ./emba" +EMBA_SCRIPT_LOCATION = f"cd {settings.EMBA_ROOT} && sudo -E ./emba" class BoundedException(Exception): diff --git a/installer.sh b/installer.sh index 02b518ad..8a7dbbaf 100755 --- a/installer.sh +++ b/installer.sh @@ -416,12 +416,14 @@ install_embark_dev(){ # install pipenv pip3 install pipenv - #Add user nosudo + # Add user nosudo echo "${SUDO_USER:-${USER}}"" ALL=(ALL) NOPASSWD: ""${PWD}""/emba/emba" | EDITOR='tee -a' visudo echo "${SUDO_USER:-${USER}}"" ALL=(ALL) NOPASSWD: /bin/pkill" | EDITOR='tee -a' visudo echo "root ALL=(ALL) NOPASSWD: ""${PWD}""/emba/emba" | EDITOR='tee -a' visudo echo "root ALL=(ALL) NOPASSWD: /bin/pkill" | EDITOR='tee -a' visudo + # Set some globals + echo "NO_UPDATE_CHECK=1" >> /etc/environment #pipenv MYSQLCLIENT_LDFLAGS='-L/usr/mysql/lib -lmysqlclient -lssl -lcrypto -lresolv' MYSQLCLIENT_CFLAGS='-I/usr/include/mysql/' PIPENV_VENV_IN_PROJECT=1 pipenv install --dev