Commit 829cf402 authored by sebastien letort's avatar sebastien letort

Merge branch 'metrics' of https://gitlab.inria.fr/allgo/allgo into metrics

parents 31c9beed 8192af9f
......@@ -10,9 +10,12 @@ RUN apt-getq update && apt-getq install \
python-mysqldb python3-crypto gunicorn3 python3-redis python-mysqldb \
python3-crypto python3-natsort python3-aiohttp python3-aioredis supervisor \
python3-ipy python3-django-taggit python3-iso8601 python3-robot-detection \
python3-sqlparse python3-pydotplus \
python3-sqlparse \
# documentation
python3-sphinx \
make
make \
# generate the DB schema with graph_models, cf docs/generate_models_png.sh
python3-django-extensions python3-pydotplus
COPY requirements.txt /tmp/
RUN cd /tmp && pip3 install -r requirements.txt && rm requirements.txt
......
......@@ -182,6 +182,7 @@ class WebappList(AllAccessMixin, ListView):
def get_queryset(self):
return query_webapps_for_user(self.request.user).order_by('-created_at')
class UserWebappList(AllAccessMixin, ListView):
"""List of user's webapp
......@@ -361,6 +362,7 @@ def get_rails_webapp_metadata(*, webapp_id=None, docker_name=None):
log.error("webapp import error: failed to get %s (%s)", url, e)
raise
class WebappImport(ProviderAccessMixin, SuccessMessageMixin, FormView):
"""Import a new webapp
......@@ -472,6 +474,7 @@ class WebappImport(ProviderAccessMixin, SuccessMessageMixin, FormView):
self.object = webapp
return super().form_valid(form)
class WebappVersionImport(UserAccessMixin, DetailView):
"""Import version
......@@ -586,6 +589,7 @@ class WebappJson(UserAccessMixin, DetailView):
"sandbox_state": webapp.get_sandbox_state_display(),
})
class WebappSandboxPanel(UserAccessMixin, TemplateView):
"""Create a new sandbox for a given application
......@@ -731,7 +735,6 @@ class WebappSandboxPanel(UserAccessMixin, TemplateView):
# TAGS
# -----------------------------------------------------------------------------
class TagList(AllAccessMixin, ListView):
"""List all available tag along with their number of occurences
......@@ -947,6 +950,7 @@ class UserPasswordUpdate(LoginRequiredMixin, SuccessMessageMixin, UpdateView):
return super(UserPasswordUpdate, self) \
.dispatch(request, *args, **kwargs)
class UserNeedValidation(LoginRequiredMixin, DetailView):
"""This page is displayed when the user has not completed the registration process
......@@ -1225,6 +1229,7 @@ class JobCreate(AllAccessMixin, SuccessMessageMixin, CreateView):
kwargs['webapp'] = queryset
return kwargs
class JobAbort(JobAuthMixin, View):
def post(self, request, *, pk):
job_id = int(pk)
......@@ -1238,6 +1243,7 @@ class JobAbort(JobAuthMixin, View):
messages.error(request, "unable to abort job %s because is not running" % job_id)
return redirect('main:job_detail', job_id)
class JobDelete(JobAuthMixin, DeleteView):
"""Delete a job from the database
......@@ -1296,6 +1302,7 @@ class JobDelete(JobAuthMixin, DeleteView):
messages.success(self.request, self.success_message)
return redirect(self.get_success_url())
class JobFileDownload(JobAuthMixin, View):
"""Download a given file"""
......@@ -1459,6 +1466,7 @@ class RunnerUpdate(UserAccessMixin, SuccessMessageMixin, UpdateView):
"allgo/runner", "-", self.object.token, get_base_url(self.request)]
return super().get_context_data(**kwargs)
class RunnerDelete(UserAccessMixin, DeleteView):
"""Delete a runner
......@@ -1483,7 +1491,6 @@ class RunnerDelete(UserAccessMixin, DeleteView):
# -----------------------------------------------------------------------------
class Metrics(ProviderAccessMixin, TemplateView):
template_name = 'metrics.html'
print( "##Site Metrics" )
def get(self, request ):
if request.user.is_superuser:
......
......@@ -115,7 +115,6 @@ THIRD_PARTY_APPS = [
'allauth.socialaccount',
'allauth.socialaccount.providers.gitlab',
'taggit',
'django_extensions',
]
LOCAL_APPS = [
'main',
......
......@@ -9,5 +9,3 @@ pytest==3.4.2
click==6.7
pypandoc==1.4
beautifulsoup4==4.6.0
python-jose==2.0.2
django-extensions
......@@ -17,14 +17,10 @@ pid=$!
wait-socket /var/run/mysqld/mysqld.sock
# https://stackoverflow.com/questions/21351251/database-returned-an-invalid-value-in-queryset-dates
# Need to be tested (works on a working container, what about on initialization)
# This is necessary to use django Extract/Trunc function (for date management in QuerySets)
mysql_tzinfo_to_sql /usr/share/zoneinfo \
| mysql -D mysql -u root
# maybe useless
# mysql -u root -e "flush tables;"
mysql -uroot mysql <<EOF
GRANT ALL ON allgo.* TO allgo@'%' IDENTIFIED BY 'allgo';
GRANT ALL ON allgo_test.* TO allgo@'%';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment