diff --git a/apps/audits/serializers.py b/apps/audits/serializers.py index aaf9c3f68..858a9e4b7 100644 --- a/apps/audits/serializers.py +++ b/apps/audits/serializers.py @@ -9,6 +9,8 @@ from . import models class ProxyLogSerializer(serializers.ModelSerializer): class Meta: model = models.ProxyLog + fields = ['id', 'name', 'username', 'hostname', 'ip', 'system_user', 'login_type', 'terminal', + 'log_file', 'was_failed', 'is_finished', 'date_start', 'date_finished', 'get_login_type_display'] class CommandLogSerializer(serializers.ModelSerializer): diff --git a/apps/audits/templates/audits/proxy_log_detail.html b/apps/audits/templates/audits/proxy_log_detail.html new file mode 100644 index 000000000..3a1610fbd --- /dev/null +++ b/apps/audits/templates/audits/proxy_log_detail.html @@ -0,0 +1,120 @@ +{% extends 'base.html' %} +{% load common_tags %} +{% load users_tags %} +{% load bootstrap %} +{% load static %} +{% load i18n %} + +{% block custom_head_css_js %} + +{% endblock %} +{% block content %} +
+
+
+
+ +
+
+
+
+ {% trans 'Command log list' %} {{ user_object.name }} +
+ + + + + + + + + + +
+
+
+ +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +
NoCommandDatetime
+
+
+
+
+
+
+ {% trans 'Detail' %} {{ user_object.name }} +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + + {% for asset_group, system_users in asset_groups %} + + + + + + + {% endfor %} + +
{% trans 'Name' %}{% trans 'Asset count' %}{% trans 'System user' %}
+ + {{ asset_group.name }} + + {{ asset_group.assets.count }}{{ system_users|join_attr:"name" }} + +
+
+
+
+
+
+
+
+
+ +{% endblock %} +{% block custom_foot_js %} + +{% endblock %} diff --git a/apps/audits/templates/audits/proxy_log_list.html b/apps/audits/templates/audits/proxy_log_list.html new file mode 100644 index 000000000..2dc25acf0 --- /dev/null +++ b/apps/audits/templates/audits/proxy_log_list.html @@ -0,0 +1,92 @@ +{% extends '_base_list.html' %} +{% load i18n static %} +{% block custom_head_css_js %} +{{ block.super }} + +{% endblock %} +{% block table_search %}{% endblock %} +{% block table_container %} +{#
{% trans "Create user" %}
#} + + + + + + + + +{# #} + + + + + + + + + +
+
+ +
+
{% trans 'Username' %}{% trans 'IP' %}{% trans 'System user' %}{% trans 'Login type' %}{% trans 'Terminal' %}{% trans 'Success' %}{% trans 'Finished' %}{% trans 'Date start' %}{% trans 'Date finished' %}{% trans 'Action' %}
+{% endblock %} +{% block custom_foot_js %} + + +{% endblock %} diff --git a/apps/audits/urls.py b/apps/audits/urls.py index 982f7fc94..102992ea9 100644 --- a/apps/audits/urls.py +++ b/apps/audits/urls.py @@ -7,11 +7,13 @@ import views app_name = 'audits' urlpatterns = [ + url(r'^proxy-log$', views.ProxyLogListView.as_view(), name='proxy-log-list'), + url(r'^proxy-log/(?P\d+)$', views.ProxyLogDetailView.as_view(), name='proxy-log-detail'), ] urlpatterns += [ url(r'^v1/proxy-log/$', api.ProxyLogListCreateApi.as_view(), name='proxy-log-list-create-api'), url(r'^v1/proxy-log/(?P\d+)/$', api.ProxyLogDetailApi.as_view(), name='proxy-log-detail-api'), - url(r'^v1/command-log/$', api.CommandLogCreateApi.as_view(), name='command-log-create-api'), + url(r'^v1/command-log/$', api.CommandLogCreateApi.as_view(), name='command-log-create-list-api'), ] diff --git a/apps/audits/views.py b/apps/audits/views.py index 91ea44a21..221d3cd50 100644 --- a/apps/audits/views.py +++ b/apps/audits/views.py @@ -1,3 +1,28 @@ -from django.shortcuts import render +# ~*~ coding: utf-8 ~*~ +# + +from django.views.generic import ListView, UpdateView, DeleteView, DetailView +from django.utils.translation import ugettext as _ +from django.urls import reverse_lazy + +from .models import ProxyLog, CommandLog + + +class ProxyLogListView(ListView): + model = ProxyLog + template_name = 'audits/proxy_log_list.html' + + def get_context_data(self, **kwargs): + context = super(ProxyLogListView, self).get_context_data(**kwargs) + context.update({'app': _('Audits'), 'action': _('Proxy log list')}) + return context + + +class ProxyLogDetailView(DetailView): + model = ProxyLog + template_name = 'audits/proxy_log_detail.html' + + def get_context_data(self, **kwargs): + context = super(ProxyLogDetailView, self).get_context_data(**kwargs) + context.update({'app': _('Audits'), 'action': _('Proxy log detail')}) -# Create your views here. diff --git a/apps/static/css/plugins/footable/fonts/footable.eot b/apps/static/css/plugins/footable/fonts/footable.eot new file mode 100644 index 000000000..37229798b Binary files /dev/null and b/apps/static/css/plugins/footable/fonts/footable.eot differ diff --git a/apps/static/css/plugins/footable/fonts/footable.svg b/apps/static/css/plugins/footable/fonts/footable.svg new file mode 100644 index 000000000..5a6e1fda3 --- /dev/null +++ b/apps/static/css/plugins/footable/fonts/footable.svg @@ -0,0 +1,78 @@ + + + + +This is a custom SVG font generated by IcoMoon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/static/css/plugins/footable/fonts/footable.ttf b/apps/static/css/plugins/footable/fonts/footable.ttf new file mode 100644 index 000000000..2d5c84ab1 Binary files /dev/null and b/apps/static/css/plugins/footable/fonts/footable.ttf differ diff --git a/apps/static/css/plugins/footable/fonts/footable.woff b/apps/static/css/plugins/footable/fonts/footable.woff new file mode 100644 index 000000000..4864dbb5c Binary files /dev/null and b/apps/static/css/plugins/footable/fonts/footable.woff differ diff --git a/apps/static/css/plugins/footable/footable.core.css b/apps/static/css/plugins/footable/footable.core.css new file mode 100644 index 000000000..d8accfb6b --- /dev/null +++ b/apps/static/css/plugins/footable/footable.core.css @@ -0,0 +1,178 @@ +@font-face { + font-family: 'footable'; + src: url('fonts/footable.eot'); + src: url('fonts/footable.eot?#iefix') format('embedded-opentype'), url('fonts/footable.woff') format('woff'), url('fonts/footable.ttf') format('truetype'), url('fonts/footable.svg#footable') format('svg'); + font-weight: normal; + font-style: normal; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + @font-face { + font-family: 'footable'; + src: url('fonts/footable.svg#footable') format('svg'); + font-weight: normal; + font-style: normal; + } +} +.footable { + width: 100%; + /** SORTING **/ + + /** PAGINATION **/ + +} +.footable.breakpoint > tbody > tr.footable-detail-show > td { + border-bottom: none; +} +.footable.breakpoint > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e001"; +} +.footable.breakpoint > tbody > tr:hover:not(.footable-row-detail) { + cursor: pointer; +} +.footable.breakpoint > tbody > tr > td.footable-cell-detail { + background: #eee; + border-top: none; +} +.footable.breakpoint > tbody > tr > td > span.footable-toggle { + display: inline-block; + font-family: 'footable'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + -webkit-font-smoothing: antialiased; + padding-right: 5px; + font-size: 14px; + color: #888888; +} +.footable.breakpoint > tbody > tr > td > span.footable-toggle:before { + content: "\e000"; +} +.footable.breakpoint.toggle-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e005"; +} +.footable.breakpoint.toggle-circle > tbody > tr > td > span.footable-toggle:before { + content: "\e004"; +} +.footable.breakpoint.toggle-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e003"; +} +.footable.breakpoint.toggle-circle-filled > tbody > tr > td > span.footable-toggle:before { + content: "\e002"; +} +.footable.breakpoint.toggle-square > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e007"; +} +.footable.breakpoint.toggle-square > tbody > tr > td > span.footable-toggle:before { + content: "\e006"; +} +.footable.breakpoint.toggle-square-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e009"; +} +.footable.breakpoint.toggle-square-filled > tbody > tr > td > span.footable-toggle:before { + content: "\e008"; +} +.footable.breakpoint.toggle-arrow > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e00f"; +} +.footable.breakpoint.toggle-arrow > tbody > tr > td > span.footable-toggle:before { + content: "\e011"; +} +.footable.breakpoint.toggle-arrow-small > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e013"; +} +.footable.breakpoint.toggle-arrow-small > tbody > tr > td > span.footable-toggle:before { + content: "\e015"; +} +.footable.breakpoint.toggle-arrow-circle > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e01b"; +} +.footable.breakpoint.toggle-arrow-circle > tbody > tr > td > span.footable-toggle:before { + content: "\e01d"; +} +.footable.breakpoint.toggle-arrow-circle-filled > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e00b"; +} +.footable.breakpoint.toggle-arrow-circle-filled > tbody > tr > td > span.footable-toggle:before { + content: "\e00d"; +} +.footable.breakpoint.toggle-arrow-tiny > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e01f"; +} +.footable.breakpoint.toggle-arrow-tiny > tbody > tr > td > span.footable-toggle:before { + content: "\e021"; +} +.footable.breakpoint.toggle-arrow-alt > tbody > tr.footable-detail-show > td > span.footable-toggle:before { + content: "\e017"; +} +.footable.breakpoint.toggle-arrow-alt > tbody > tr > td > span.footable-toggle:before { + content: "\e019"; +} +.footable.breakpoint.toggle-medium > tbody > tr > td > span.footable-toggle { + font-size: 18px; +} +.footable.breakpoint.toggle-large > tbody > tr > td > span.footable-toggle { + font-size: 24px; +} +.footable > thead > tr > th { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: -moz-none; + -ms-user-select: none; + user-select: none; +} +.footable > thead > tr > th.footable-sortable:hover { + cursor: pointer; +} +.footable > thead > tr > th.footable-sorted > span.footable-sort-indicator:before { + content: "\e013"; +} +.footable > thead > tr > th.footable-sorted-desc > span.footable-sort-indicator:before { + content: "\e012"; +} +.footable > thead > tr > th > span.footable-sort-indicator { + display: inline-block; + font-family: 'footable'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + -webkit-font-smoothing: antialiased; + padding-left: 5px; +} +.footable > thead > tr > th > span.footable-sort-indicator:before { + content: "\e022"; +} +.footable > tfoot .pagination { + margin: 0; +} +.footable.no-paging .hide-if-no-paging { + display: none; +} +.footable-row-detail-inner { + display: table; +} +.footable-row-detail-row { + display: table-row; + line-height: 1.5em; +} +.footable-row-detail-group { + display: block; + line-height: 2em; + font-size: 1.2em; + font-weight: bold; +} +.footable-row-detail-name { + display: table-cell; + font-weight: bold; + padding-right: 0.5em; +} +.footable-row-detail-value { + display: table-cell; +} +.footable-odd { + background-color: #f7f7f7; +} diff --git a/apps/templates/_nav.html b/apps/templates/_nav.html index 45ad8d571..decfa38fc 100644 --- a/apps/templates/_nav.html +++ b/apps/templates/_nav.html @@ -39,10 +39,20 @@ {% trans 'Terminal' %} -
  • - - {% trans 'Audits' %} - +
  • + {% trans 'Audits' %} +