Commit 1888c698 authored by ibuler's avatar ibuler

[Bugfix] 修复一些bug

parent 6518ae8f
...@@ -26,7 +26,7 @@ from .hands import IsSuperUser, IsValidUser, IsSuperUserOrAppUser, \ ...@@ -26,7 +26,7 @@ from .hands import IsSuperUser, IsValidUser, IsSuperUserOrAppUser, \
get_user_granted_assets get_user_granted_assets
from .models import AssetGroup, Asset, Cluster, SystemUser, AdminUser from .models import AssetGroup, Asset, Cluster, SystemUser, AdminUser
from . import serializers from . import serializers
from .tasks import update_asset_hardware_info_manual, test_admin_user_connectability_util, \ from .tasks import update_asset_hardware_info_manual, test_admin_user_connectability_manual, \
test_asset_connectability_manual, push_system_user_to_cluster_assets_manual, \ test_asset_connectability_manual, push_system_user_to_cluster_assets_manual, \
test_system_user_connectability_manual test_system_user_connectability_manual
...@@ -52,6 +52,7 @@ class AssetViewSet(IDInFilterMixin, BulkModelViewSet): ...@@ -52,6 +52,7 @@ class AssetViewSet(IDInFilterMixin, BulkModelViewSet):
cluster_id = self.request.query_params.get('cluster_id') cluster_id = self.request.query_params.get('cluster_id')
asset_group_id = self.request.query_params.get('asset_group_id') asset_group_id = self.request.query_params.get('asset_group_id')
admin_user_id = self.request.query_params.get('admin_user_id') admin_user_id = self.request.query_params.get('admin_user_id')
system_user_id = self.request.query_params.get('system_user_id')
if cluster_id: if cluster_id:
queryset = queryset.filter(cluster__id=cluster_id) queryset = queryset.filter(cluster__id=cluster_id)
...@@ -62,6 +63,10 @@ class AssetViewSet(IDInFilterMixin, BulkModelViewSet): ...@@ -62,6 +63,10 @@ class AssetViewSet(IDInFilterMixin, BulkModelViewSet):
assets_direct = [asset.id for asset in admin_user.asset_set.all()] assets_direct = [asset.id for asset in admin_user.asset_set.all()]
clusters = [cluster.id for cluster in admin_user.cluster_set.all()] clusters = [cluster.id for cluster in admin_user.cluster_set.all()]
queryset = queryset.filter(Q(cluster__id__in=clusters)|Q(id__in=assets_direct)) queryset = queryset.filter(Q(cluster__id__in=clusters)|Q(id__in=assets_direct))
if system_user_id:
system_user = get_object_or_404(SystemUser, id=system_user_id)
clusters = system_user.get_clusters()
queryset = queryset.filter(cluster__in=clusters)
return queryset return queryset
...@@ -99,15 +104,6 @@ class GroupAddAssetsApi(generics.UpdateAPIView): ...@@ -99,15 +104,6 @@ class GroupAddAssetsApi(generics.UpdateAPIView):
return Response({'error': serializer.errors}, status=400) return Response({'error': serializer.errors}, status=400)
class ClusterUpdateAssetsApi(generics.RetrieveUpdateAPIView):
"""
Cluster update asset member
"""
queryset = Cluster.objects.all()
serializer_class = serializers.ClusterUpdateAssetsSerializer
permission_classes = (IsSuperUser,)
class ClusterViewSet(IDInFilterMixin, BulkModelViewSet): class ClusterViewSet(IDInFilterMixin, BulkModelViewSet):
""" """
Cluster api set, for add,delete,update,list,retrieve resource Cluster api set, for add,delete,update,list,retrieve resource
...@@ -117,7 +113,6 @@ class ClusterViewSet(IDInFilterMixin, BulkModelViewSet): ...@@ -117,7 +113,6 @@ class ClusterViewSet(IDInFilterMixin, BulkModelViewSet):
permission_classes = (IsSuperUser,) permission_classes = (IsSuperUser,)
# TOdo
class ClusterTestAssetsAliveApi(generics.RetrieveAPIView): class ClusterTestAssetsAliveApi(generics.RetrieveAPIView):
""" """
Test cluster asset can connect using admin user or not Test cluster asset can connect using admin user or not
...@@ -127,6 +122,9 @@ class ClusterTestAssetsAliveApi(generics.RetrieveAPIView): ...@@ -127,6 +122,9 @@ class ClusterTestAssetsAliveApi(generics.RetrieveAPIView):
def retrieve(self, request, *args, **kwargs): def retrieve(self, request, *args, **kwargs):
cluster = self.get_object() cluster = self.get_object()
admin_user = cluster.admin_user
test_admin_user_connectability_manual.delay(admin_user)
return Response("Task has been send, seen left assets status")
class ClusterAddAssetsApi(generics.UpdateAPIView): class ClusterAddAssetsApi(generics.UpdateAPIView):
...@@ -256,7 +254,7 @@ class AdminUserTestConnectiveApi(generics.RetrieveAPIView): ...@@ -256,7 +254,7 @@ class AdminUserTestConnectiveApi(generics.RetrieveAPIView):
def retrieve(self, request, *args, **kwargs): def retrieve(self, request, *args, **kwargs):
admin_user = self.get_object() admin_user = self.get_object()
test_admin_user_connectability_util.delay(admin_user) test_admin_user_connectability_manual.delay(admin_user)
return Response({"msg": "Task created"}) return Response({"msg": "Task created"})
......
...@@ -150,10 +150,19 @@ class AssetGroupForm(forms.ModelForm): ...@@ -150,10 +150,19 @@ class AssetGroupForm(forms.ModelForm):
class ClusterForm(forms.ModelForm): class ClusterForm(forms.ModelForm):
system_users = forms.ModelMultipleChoiceField(
queryset=SystemUser.objects.all(),
widget=forms.SelectMultiple(
attrs={'class': 'select2', 'data-placeholder': _('Select system users')}
),
label=_('System users'),
required=False,
help_text=_("Selected system users will be create at cluster assets"),
)
class Meta: class Meta:
model = Cluster model = Cluster
fields = ['name', "bandwidth", "operator", 'contact', 'admin_user', fields = ['name', "bandwidth", "operator", 'contact', 'admin_user', 'system_users',
'phone', 'address', 'intranet', 'extranet', 'comment'] 'phone', 'address', 'intranet', 'extranet', 'comment']
widgets = { widgets = {
'name': forms.TextInput(attrs={'placeholder': _('Name')}), 'name': forms.TextInput(attrs={'placeholder': _('Name')}),
...@@ -162,9 +171,21 @@ class ClusterForm(forms.ModelForm): ...@@ -162,9 +171,21 @@ class ClusterForm(forms.ModelForm):
} }
help_texts = { help_texts = {
'name': '* required', 'name': '* required',
'admin_user': 'The assets of this cluster will use this admin user as his admin user', 'admin_user': _("Cluster level admin user"),
} }
def __init__(self, *args, **kwargs):
if kwargs.get('instance', None):
initial = kwargs.get('initial', {})
initial['system_users'] = kwargs['instance'].systemuser_set.all()
super().__init__(*args, **kwargs)
def save(self, commit=True):
instance = super().save(commit=commit)
system_users = self.cleaned_data['system_users']
instance.systemuser_set.set(system_users)
return instance
class AdminUserForm(forms.ModelForm): class AdminUserForm(forms.ModelForm):
# Form field name can not start with `_`, so redefine it, # Form field name can not start with `_`, so redefine it,
......
...@@ -158,6 +158,7 @@ class Asset(models.Model): ...@@ -158,6 +158,7 @@ class Asset(models.Model):
class Meta: class Meta:
unique_together = ('ip', 'port') unique_together = ('ip', 'port')
verbose_name = _("Asset")
@classmethod @classmethod
def generate_fake(cls, count=100): def generate_fake(cls, count=100):
......
...@@ -37,6 +37,7 @@ class Cluster(models.Model): ...@@ -37,6 +37,7 @@ class Cluster(models.Model):
class Meta: class Meta:
ordering = ['name'] ordering = ['name']
verbose_name = _("Cluster")
@classmethod @classmethod
def generate_fake(cls, count=5): def generate_fake(cls, count=5):
......
...@@ -27,6 +27,7 @@ class AssetGroup(models.Model): ...@@ -27,6 +27,7 @@ class AssetGroup(models.Model):
class Meta: class Meta:
ordering = ['name'] ordering = ['name']
verbose_name = _("Asset group")
@classmethod @classmethod
def initial(cls): def initial(cls):
......
...@@ -170,7 +170,6 @@ class AdminUser(AssetUser): ...@@ -170,7 +170,6 @@ class AdminUser(AssetUser):
info = None info = None
return info return info
def get_related_assets(self): def get_related_assets(self):
assets = [] assets = []
for cluster in self.cluster_set.all(): for cluster in self.cluster_set.all():
...@@ -184,6 +183,7 @@ class AdminUser(AssetUser): ...@@ -184,6 +183,7 @@ class AdminUser(AssetUser):
class Meta: class Meta:
ordering = ['name'] ordering = ['name']
verbose_name = _("Admin user")
@classmethod @classmethod
def generate_fake(cls, count=10): def generate_fake(cls, count=10):
...@@ -224,7 +224,7 @@ class SystemUser(AssetUser): ...@@ -224,7 +224,7 @@ class SystemUser(AssetUser):
def get_clusters_assets(self): def get_clusters_assets(self):
from .asset import Asset from .asset import Asset
clusters = self.cluster.all() clusters = self.get_clusters()
return Asset.objects.filter(cluster__in=clusters) return Asset.objects.filter(cluster__in=clusters)
def get_clusters(self): def get_clusters(self):
...@@ -262,6 +262,7 @@ class SystemUser(AssetUser): ...@@ -262,6 +262,7 @@ class SystemUser(AssetUser):
class Meta: class Meta:
ordering = ['name'] ordering = ['name']
verbose_name = _("System user")
@classmethod @classmethod
def generate_fake(cls, count=10): def generate_fake(cls, count=10):
......
...@@ -64,6 +64,7 @@ class AdminUserSerializer(serializers.ModelSerializer): ...@@ -64,6 +64,7 @@ class AdminUserSerializer(serializers.ModelSerializer):
""" """
assets_amount = serializers.SerializerMethodField() assets_amount = serializers.SerializerMethodField()
unreachable_amount = serializers.SerializerMethodField() unreachable_amount = serializers.SerializerMethodField()
reachable_amount = serializers.SerializerMethodField()
class Meta: class Meta:
model = AdminUser model = AdminUser
...@@ -75,7 +76,15 @@ class AdminUserSerializer(serializers.ModelSerializer): ...@@ -75,7 +76,15 @@ class AdminUserSerializer(serializers.ModelSerializer):
if data: if data:
return len(data.get('dark')) return len(data.get('dark'))
else: else:
return 'Unknown' return 0
@staticmethod
def get_reachable_amount(obj):
data = cache.get(ADMIN_USER_CONN_CACHE_KEY.format(obj.name))
if data:
return len(data.get('contacted'))
else:
return 0
@staticmethod @staticmethod
def get_assets_amount(obj): def get_assets_amount(obj):
......
...@@ -77,7 +77,7 @@ def on_system_user_created_or_updated(sender, instance=None, **kwargs): ...@@ -77,7 +77,7 @@ def on_system_user_created_or_updated(sender, instance=None, **kwargs):
@receiver(post_init, sender=Cluster, dispatch_uid="my_unique_identifier") @receiver(post_init, sender=Cluster, dispatch_uid="my_unique_identifier")
def on_cluster_init(sender, instance, **kwargs): def on_cluster_init(sender, instance, **kwargs):
instance.__original_assets = tuple(instance.assets.values_list('pk', flat=True)) instance.__original_assets = tuple(instance.assets.values_list('pk', flat=True))
# instance.__origin_system_users = tuple(instance.systemuser_set.all()) instance.__origin_system_users = tuple(instance.systemuser_set.values_list('pk', flat=True))
@receiver(post_save, sender=Cluster, dispatch_uid="my_unique_identifier") @receiver(post_save, sender=Cluster, dispatch_uid="my_unique_identifier")
...@@ -103,11 +103,11 @@ def on_cluster_assets_changed(sender, instance, **kwargs): ...@@ -103,11 +103,11 @@ def on_cluster_assets_changed(sender, instance, **kwargs):
push_system_user_util.delay(system_users, assets, task_name) push_system_user_util.delay(system_users, assets, task_name)
@receiver(post_save, sender=Cluster, dispatch_uid="my_unique_identifier") @receiver(post_save, sender=Cluster, dispatch_uid="my_unique_identifier2")
def on_cluster_system_user_changed(sender, instance, **kwargs): def on_cluster_system_user_changed(sender, instance, **kwargs):
system_users_origin = instance.__origin_system_users system_users_origin = instance.__origin_system_users
system_user_new = instance.systemuser_set.values_list('pk', flat=True) system_user_new = instance.systemuser_set.values_list('pk', flat=True)
system_users_added = set(system_user_new) - system_users_origin system_users_added = set(system_user_new) - set(system_users_origin)
if system_users_added: if system_users_added:
logger.debug("Receive cluster change system users signal") logger.debug("Receive cluster change system users signal")
system_users = [] system_users = []
......
...@@ -211,6 +211,9 @@ def test_asset_connectability_util(asset, task_name=None): ...@@ -211,6 +211,9 @@ def test_asset_connectability_util(asset, task_name=None):
if task_name is None: if task_name is None:
task_name = _("Test asset connectability") task_name = _("Test asset connectability")
hosts = [asset.hostname] hosts = [asset.hostname]
if not hosts:
logger.info("No hosts, passed")
return {}
tasks = const.TEST_ADMIN_USER_CONN_TASKS tasks = const.TEST_ADMIN_USER_CONN_TASKS
task, created = update_or_create_ansible_task( task, created = update_or_create_ansible_task(
task_name=task_name, hosts=hosts, tasks=tasks, pattern='all', task_name=task_name, hosts=hosts, tasks=tasks, pattern='all',
...@@ -262,6 +265,9 @@ def test_system_user_connectability_util(system_user, task_name): ...@@ -262,6 +265,9 @@ def test_system_user_connectability_util(system_user, task_name):
assets = system_user.get_clusters_assets() assets = system_user.get_clusters_assets()
hosts = [asset.hostname for asset in assets] hosts = [asset.hostname for asset in assets]
tasks = const.TEST_SYSTEM_USER_CONN_TASKS tasks = const.TEST_SYSTEM_USER_CONN_TASKS
if not hosts:
logger.info("No hosts, passed")
return {}
task, created = update_or_create_ansible_task( task, created = update_or_create_ansible_task(
task_name, hosts=hosts, tasks=tasks, pattern='all', task_name, hosts=hosts, tasks=tasks, pattern='all',
options=const.TASK_OPTIONS, options=const.TASK_OPTIONS,
...@@ -274,7 +280,7 @@ def test_system_user_connectability_util(system_user, task_name): ...@@ -274,7 +280,7 @@ def test_system_user_connectability_util(system_user, task_name):
@shared_task @shared_task
def test_system_user_connectability_manual(system_user): def test_system_user_connectability_manual(system_user):
task_name = "Test system user connectability: {}".format(system_user) task_name = _("Test system user connectability: {}").format(system_user)
return test_system_user_connectability_util(system_user, task_name) return test_system_user_connectability_util(system_user, task_name)
...@@ -346,11 +352,14 @@ def push_system_user_util(system_users, assets, task_name): ...@@ -346,11 +352,14 @@ def push_system_user_util(system_users, assets, task_name):
for system_user in system_users: for system_user in system_users:
tasks.extend(get_push_system_user_tasks(system_user)) tasks.extend(get_push_system_user_tasks(system_user))
print("Task: ", tasks)
if not tasks: if not tasks:
return logger.info("Not tasks, passed")
return {}
hosts = [asset.hostname for asset in assets] hosts = [asset.hostname for asset in assets]
if not hosts:
logger.info("Not hosts, passed")
return {}
task, created = update_or_create_ansible_task( task, created = update_or_create_ansible_task(
task_name=task_name, hosts=hosts, tasks=tasks, pattern='all', task_name=task_name, hosts=hosts, tasks=tasks, pattern='all',
options=const.TASK_OPTIONS, run_as_admin=True, created_by='System' options=const.TASK_OPTIONS, run_as_admin=True, created_by='System'
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load static %} {% load static %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<th>{% trans 'IP' %}</th> <th>{% trans 'IP' %}</th>
<th>{% trans 'Port' %}</th> <th>{% trans 'Port' %}</th>
<th>{% trans 'Type' %}</th> <th>{% trans 'Type' %}</th>
<th>{% trans 'Alive' %}</th> <th>{% trans 'Reachable' %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -144,7 +144,7 @@ $(document).ready(function () { ...@@ -144,7 +144,7 @@ $(document).ready(function () {
url: the_url, url: the_url,
error: error, error: error,
method: 'GET', method: 'GET',
success_message: "{% trans "Task has been send, seen left asset status" %}" success_message: "{% trans 'Task has been send, seen left asset status' %}"
}); });
}) })
</script> </script>
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load static %} {% load static %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -21,8 +21,10 @@ ...@@ -21,8 +21,10 @@
</th> </th>
<th class="text-center">{% trans 'Name' %}</th> <th class="text-center">{% trans 'Name' %}</th>
<th class="text-center">{% trans 'Username' %}</th> <th class="text-center">{% trans 'Username' %}</th>
<th class="text-center">{% trans 'Asset num' %}</th> <th class="text-center">{% trans 'Asset' %}</th>
<th class="text-center">{% trans 'Reachable' %}</th>
<th class="text-center">{% trans 'Unreachable' %}</th> <th class="text-center">{% trans 'Unreachable' %}</th>
<th class="text-center">{% trans 'Ratio' %}</th>
<th class="text-center">{% trans 'Comment' %}</th> <th class="text-center">{% trans 'Comment' %}</th>
<th class="text-center">{% trans 'Action' %}</th> <th class="text-center">{% trans 'Action' %}</th>
</tr> </tr>
...@@ -42,16 +44,49 @@ $(document).ready(function(){ ...@@ -42,16 +44,49 @@ $(document).ready(function(){
var detail_btn = '<a href="{% url "assets:admin-user-detail" pk=DEFAULT_PK %}">' + cellData + '</a>'; var detail_btn = '<a href="{% url "assets:admin-user-detail" pk=DEFAULT_PK %}">' + cellData + '</a>';
$(td).html(detail_btn.replace('{{ DEFAULT_PK }}', rowData.id)); $(td).html(detail_btn.replace('{{ DEFAULT_PK }}', rowData.id));
}}, }},
{targets: 4, createdCell: function (td, cellData) {
var innerHtml = "";
if (cellData !== 0) {
innerHtml = "<span class='text-navy'>" + cellData + "</span>";
} else {
innerHtml = "<span>" + cellData + "</span>";
}
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData +'">' + innerHtml + '</span>');
}},
{targets: 5, createdCell: function (td, cellData) {
var innerHtml = "";
if (cellData !== 0) {
innerHtml = "<span class='text-danger'>" + cellData + "</span>";
} else {
innerHtml = "<span>" + cellData + "</span>";
}
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData + '">' + innerHtml + '</span>');
}},
{targets: 6, createdCell: function (td, cellData, rowData) { {targets: 6, createdCell: function (td, cellData, rowData) {
{# var script_btn = '<a href="{% url "assets:admin-user-update" pk=DEFAULT_PK %}" class="btn btn-xs btn-primary">{% trans "Script" %}</a>'.replace('{{ DEFAULT_PK }}', cellData);#} var val = 0;
var innerHtml = "";
var total = rowData.assets_amount;
var reachable = rowData.reachable_amount;
if (total !== 0) {
val = reachable/total * 100;
}
if (val === 100) {
innerHtml = "<span class='text-navy'>" + val + "% </span>";
} else {
innerHtml = "<span class='text-danger'>" + val + "% </span>";
}
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData + '">' + innerHtml + '</span>');
}},
{targets: 8, createdCell: function (td, cellData, rowData) {
var update_btn = '<a href="{% url "assets:admin-user-update" pk=DEFAULT_PK %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'.replace('{{ DEFAULT_PK }}', cellData); var update_btn = '<a href="{% url "assets:admin-user-update" pk=DEFAULT_PK %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'.replace('{{ DEFAULT_PK }}', cellData);
var del_btn = '<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'.replace('{{ DEFAULT_PK }}', cellData); var del_btn = '<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'.replace('{{ DEFAULT_PK }}', cellData);
{# $(td).html(script_btn + update_btn + del_btn)#}
$(td).html(update_btn + del_btn) $(td).html(update_btn + del_btn)
}}], }}],
ajax_url: '{% url "api-assets:admin-user-list" %}', ajax_url: '{% url "api-assets:admin-user-list" %}',
columns: [{data: function(){return ""}}, {data: "name" }, {data: "username" }, {data: "assets_amount" }, columns: [{data: function(){return ""}}, {data: "name" }, {data: "username" }, {data: "assets_amount" },
{data: "unreachable_amount"}, {data: "comment" }, {data: "id" }] {data: "reachable_amount"}, {data: "unreachable_amount"}, {data: "id"}, {data: "comment" }, {data: "id" }]
}; };
jumpserver.initDataTable(options); jumpserver.initDataTable(options);
}) })
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<style type="text/css"> <style type="text/css">
</style> </style>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<td colspan="2"> <td colspan="2">
<select data-placeholder="{% trans 'Select asset' %}" class="select2" style="width: 100%" multiple="" tabindex="4"> <select data-placeholder="{% trans 'Select asset' %}" class="select2" style="width: 100%" multiple="" tabindex="4">
{% for asset in assets_remain %} {% for asset in assets_remain %}
<option value="{{ asset.id }}" id="opt_{{ asset.id }}">{{ asset.ip}}:{{ asset.port }}</option> <option value="{{ asset.id }}" id="opt_{{ asset.id }}">{{ asset.hostname}}</option>
{% endfor %} {% endfor %}
</select> </select>
</td> </td>
...@@ -204,7 +204,12 @@ $(document).ready(function () { ...@@ -204,7 +204,12 @@ $(document).ready(function () {
addAssets(assets_id); addAssets(assets_id);
}) })
.on('click', '#btn-test-assets', function () { .on('click', '#btn-test-assets', function () {
console.log('ok'); var the_url = "{% url 'api-assets:cluster-test-connective' pk=cluster.id %}";
APIUpdateAttr({
url: the_url,
method: 'GET',
success_message: "{% trans 'Task has been send, seen left assets status' %}"
});
}) })
</script> </script>
{% endblock %} {% endblock %}
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load static %} {% load static %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<h3 class="widget-head-color-box">{% trans 'Settings' %}</h3> <h3 class="widget-head-color-box">{% trans 'Settings' %}</h3>
{% bootstrap_field form.admin_user layout="horizontal" %} {% bootstrap_field form.admin_user layout="horizontal" %}
{% bootstrap_field form.system_users layout="horizontal" %}
<div class="hr-line-dashed"></div> <div class="hr-line-dashed"></div>
<h3 class="widget-head-color-box">{% trans 'Other' %}</h3> <h3 class="widget-head-color-box">{% trans 'Other' %}</h3>
...@@ -69,10 +70,7 @@ ...@@ -69,10 +70,7 @@
{% block custom_foot_js %} {% block custom_foot_js %}
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('.select2').select2({ $('.select2').select2();
dropdownAutoWidth : true,
width: 'auto'
}); });
})
</script> </script>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
......
...@@ -27,10 +27,10 @@ urlpatterns = [ ...@@ -27,10 +27,10 @@ urlpatterns = [
url(r'^v1/groups/(?P<pk>[0-9a-zA-Z\-]{36})/assets/add/$', url(r'^v1/groups/(?P<pk>[0-9a-zA-Z\-]{36})/assets/add/$',
api.GroupAddAssetsApi.as_view(), name='group-add-assets'), api.GroupAddAssetsApi.as_view(), name='group-add-assets'),
# update the Cluster, and add or delete the assets to the Cluster # update the Cluster, and add or delete the assets to the Cluster
url(r'^v1/cluster/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$',
api.ClusterUpdateAssetsApi.as_view(), name='cluster-update-assets'),
url(r'^v1/cluster/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$', url(r'^v1/cluster/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$',
api.ClusterAddAssetsApi.as_view(), name='cluster-add-assets'), api.ClusterAddAssetsApi.as_view(), name='cluster-add-assets'),
url(r'^v1/cluster/(?P<pk>[0-9a-zA-Z\-]{36})/assets/connective/$',
api.ClusterTestAssetsAliveApi.as_view(), name='cluster-test-connective'),
url(r'^v1/admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/clusters/$', url(r'^v1/admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/clusters/$',
api.AdminUserAddClustersApi.as_view(), name='admin-user-add-clusters'), api.AdminUserAddClustersApi.as_view(), name='admin-user-add-clusters'),
url(r'^v1/admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/connective/$', url(r'^v1/admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/connective/$',
......
...@@ -109,8 +109,8 @@ class SystemUserAssetView(AdminUserRequiredMixin, DetailView): ...@@ -109,8 +109,8 @@ class SystemUserAssetView(AdminUserRequiredMixin, DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = { context = {
'app': 'assets', 'app': _('assets'),
'action': 'System user asset', 'action': _('System user asset'),
} }
kwargs.update(context) kwargs.update(context)
return super().get_context_data(**kwargs) return super().get_context_data(**kwargs)
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n" "Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-02 18:11+0800\n" "POT-Creation-Date: 2018-01-05 17:27+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n" "Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n" "Language-Team: Jumpserver team<ibuler@qq.com>\n"
...@@ -36,7 +36,7 @@ msgstr "主机级别管理用户,如果没有设置则默认使用集群级别 ...@@ -36,7 +36,7 @@ msgstr "主机级别管理用户,如果没有设置则默认使用集群级别
#: assets/forms.py:40 assets/forms.py:68 #: assets/forms.py:40 assets/forms.py:68
msgid "You need set a admin user if cluster not have" msgid "You need set a admin user if cluster not have"
msgstr "" msgstr "集群没有管理用户,你需要为集群设置管理用户或设置一个主机级别的管理用户"
#: assets/forms.py:54 #: assets/forms.py:54
msgid "Default using cluster admin user" msgid "Default using cluster admin user"
...@@ -61,7 +61,9 @@ msgstr "选择资产" ...@@ -61,7 +61,9 @@ msgstr "选择资产"
msgid "Port" msgid "Port"
msgstr "端口" msgstr "端口"
#: assets/forms.py:124 assets/templates/assets/asset_group_list.html:16 #: assets/forms.py:124 assets/models/asset.py:161
#: assets/templates/assets/admin_user_list.html:24
#: assets/templates/assets/asset_group_list.html:16
#: assets/templates/assets/system_user_list.html:26 perms/models.py:17 #: assets/templates/assets/system_user_list.html:26 perms/models.py:17
#: perms/templates/perms/asset_permission_create_update.html:40 #: perms/templates/perms/asset_permission_create_update.html:40
#: perms/templates/perms/asset_permission_list.html:28 templates/_nav.html:22 #: perms/templates/perms/asset_permission_list.html:28 templates/_nav.html:22
...@@ -75,7 +77,22 @@ msgstr "端口" ...@@ -75,7 +77,22 @@ msgstr "端口"
msgid "Asset" msgid "Asset"
msgstr "资产" msgstr "资产"
#: assets/forms.py:159 assets/forms.py:219 assets/forms.py:278 #: assets/forms.py:156 perms/forms.py:40
#: perms/templates/perms/asset_permission_detail.html:144 users/forms.py:243
msgid "Select system users"
msgstr "选择系统用户"
#: assets/forms.py:158
#: assets/templates/assets/_asset_group_bulk_update_modal.html:22
#: assets/templates/assets/cluster_list.html:22
msgid "System users"
msgstr "系统用户"
#: assets/forms.py:160
msgid "Selected system users will be create at cluster assets"
msgstr "选择的系统用户将会在该集群资产上创建"
#: assets/forms.py:168 assets/forms.py:243 assets/forms.py:302
#: assets/models/cluster.py:18 assets/models/group.py:20 #: assets/models/cluster.py:18 assets/models/group.py:20
#: assets/models/user.py:28 assets/templates/assets/admin_user_detail.html:56 #: assets/models/user.py:28 assets/templates/assets/admin_user_detail.html:56
#: assets/templates/assets/admin_user_list.html:22 #: assets/templates/assets/admin_user_list.html:22
...@@ -105,18 +122,36 @@ msgid "Name" ...@@ -105,18 +122,36 @@ msgid "Name"
msgstr "名称" msgstr "名称"
#: assets/forms.py:174 #: assets/forms.py:174
msgid "Cluster level admin user"
msgstr "集群级别管理用户"
#: assets/forms.py:195
msgid "Password or private key password" msgid "Password or private key password"
msgstr "密码或秘钥不合法" msgstr "密码或秘钥不合法"
#: assets/forms.py:202 assets/forms.py:260 assets/forms.py:321 #: assets/forms.py:196 assets/models/user.py:30 users/forms.py:16
#: users/forms.py:24 users/templates/users/login.html:56
#: users/templates/users/reset_password.html:52
#: users/templates/users/user_create.html:11
#: users/templates/users/user_password_update.html:40
#: users/templates/users/user_profile_update.html:40
#: users/templates/users/user_pubkey_update.html:40
msgid "Password"
msgstr "密码"
#: assets/forms.py:199 users/models/user.py:46
msgid "Private key"
msgstr "ssh私钥"
#: assets/forms.py:224 assets/forms.py:284 assets/forms.py:345
msgid "Invalid private key" msgid "Invalid private key"
msgstr "ssh密钥不合法" msgstr "ssh密钥不合法"
#: assets/forms.py:212 #: assets/forms.py:235
msgid "Password and private key file must be input one" msgid "Password and private key file must be input one"
msgstr "密码和私钥, 必须输入一个" msgstr "密码和私钥, 必须输入一个"
#: assets/forms.py:220 assets/forms.py:279 assets/models/user.py:29 #: assets/forms.py:244 assets/forms.py:303 assets/models/user.py:29
#: assets/templates/assets/admin_user_detail.html:60 #: assets/templates/assets/admin_user_detail.html:60
#: assets/templates/assets/admin_user_list.html:23 #: assets/templates/assets/admin_user_list.html:23
#: assets/templates/assets/system_user_detail.html:57 #: assets/templates/assets/system_user_detail.html:57
...@@ -132,14 +167,28 @@ msgstr "密码和私钥, 必须输入一个" ...@@ -132,14 +167,28 @@ msgstr "密码和私钥, 必须输入一个"
msgid "Username" msgid "Username"
msgstr "用户名" msgstr "用户名"
#: assets/forms.py:267 assets/forms.py:327 #: assets/forms.py:291 assets/forms.py:351
msgid "Auth info required, private_key or password" msgid "Auth info required, private_key or password"
msgstr "密钥和密码必须填写一个" msgstr "密钥和密码必须填写一个"
#: assets/forms.py:282 #: assets/forms.py:306
msgid " Select clusters" msgid " Select clusters"
msgstr "选择集群" msgstr "选择集群"
#: assets/forms.py:311
msgid "If auto push checked, system user will be create at cluster assets"
msgstr "如果选择了自动推送,系统用户将会创建在集群资产上"
#: assets/forms.py:312
msgid "Auto push system user to asset"
msgstr "自动推送系统用户到资产"
#: assets/forms.py:313
msgid ""
"High level will be using login asset as default, if user was granted more "
"than 2 system user"
msgstr "高优先级的系统用户将会作为默认登录用户"
#: assets/models/asset.py:24 #: assets/models/asset.py:24
msgid "In use" msgid "In use"
msgstr "使用中" msgstr "使用中"
...@@ -216,8 +265,8 @@ msgstr "主机名" ...@@ -216,8 +265,8 @@ msgstr "主机名"
msgid "Asset groups" msgid "Asset groups"
msgstr "资产组" msgstr "资产组"
#: assets/models/asset.py:47 assets/models/user.py:215 #: assets/models/asset.py:47 assets/models/cluster.py:40
#: assets/templates/assets/asset_detail.html:85 #: assets/models/user.py:215 assets/templates/assets/asset_detail.html:85
#: assets/templates/assets/asset_list.html:33 templates/_nav.html:24 #: assets/templates/assets/asset_list.html:33 templates/_nav.html:24
msgid "Cluster" msgid "Cluster"
msgstr "集群" msgstr "集群"
...@@ -239,7 +288,7 @@ msgid "Asset status" ...@@ -239,7 +288,7 @@ msgid "Asset status"
msgstr "资产状态" msgstr "资产状态"
#: assets/models/asset.py:54 assets/models/cluster.py:19 #: assets/models/asset.py:54 assets/models/cluster.py:19
#: assets/templates/assets/asset_detail.html:73 #: assets/models/user.py:186 assets/templates/assets/asset_detail.html:73
#: assets/templates/assets/cluster_list.html:20 templates/_nav.html:25 #: assets/templates/assets/cluster_list.html:20 templates/_nav.html:25
msgid "Admin user" msgid "Admin user"
msgstr "管理用户" msgstr "管理用户"
...@@ -346,7 +395,7 @@ msgstr "创建日期" ...@@ -346,7 +395,7 @@ msgstr "创建日期"
#: assets/models/asset.py:83 assets/models/cluster.py:29 #: assets/models/asset.py:83 assets/models/cluster.py:29
#: assets/models/group.py:23 assets/models/user.py:33 #: assets/models/group.py:23 assets/models/user.py:33
#: assets/templates/assets/admin_user_detail.html:72 #: assets/templates/assets/admin_user_detail.html:72
#: assets/templates/assets/admin_user_list.html:26 #: assets/templates/assets/admin_user_list.html:28
#: assets/templates/assets/asset_detail.html:157 #: assets/templates/assets/asset_detail.html:157
#: assets/templates/assets/asset_group_list.html:17 #: assets/templates/assets/asset_group_list.html:17
#: assets/templates/assets/cluster_detail.html:97 #: assets/templates/assets/cluster_detail.html:97
...@@ -391,7 +440,7 @@ msgstr "外网" ...@@ -391,7 +440,7 @@ msgstr "外网"
msgid "Operator" msgid "Operator"
msgstr "运营商" msgstr "运营商"
#: assets/models/cluster.py:36 assets/models/group.py:33 #: assets/models/cluster.py:36 assets/models/group.py:34
msgid "Default" msgid "Default"
msgstr "默认" msgstr "默认"
...@@ -403,20 +452,15 @@ msgstr "系统" ...@@ -403,20 +452,15 @@ msgstr "系统"
msgid "Default Cluster" msgid "Default Cluster"
msgstr "默认Cluster" msgstr "默认Cluster"
#: assets/models/group.py:33 #: assets/models/group.py:30 perms/models.py:18
#: perms/templates/perms/asset_permission_list.html:29 templates/_nav.html:23
msgid "Asset group"
msgstr "资产组"
#: assets/models/group.py:34
msgid "Default asset group" msgid "Default asset group"
msgstr "默认资产组" msgstr "默认资产组"
#: assets/models/user.py:30 users/forms.py:16 users/forms.py:24
#: users/templates/users/login.html:56
#: users/templates/users/reset_password.html:52
#: users/templates/users/user_create.html:11
#: users/templates/users/user_password_update.html:40
#: users/templates/users/user_profile_update.html:40
#: users/templates/users/user_pubkey_update.html:40
msgid "Password"
msgstr "密码"
#: assets/models/user.py:31 #: assets/models/user.py:31
msgid "SSH private key" msgid "SSH private key"
msgstr "ssh密钥" msgstr "ssh密钥"
...@@ -427,7 +471,7 @@ msgstr "ssh公钥" ...@@ -427,7 +471,7 @@ msgstr "ssh公钥"
#: assets/models/user.py:216 #: assets/models/user.py:216
msgid "Priority" msgid "Priority"
msgstr "" msgstr "优先级"
#: assets/models/user.py:217 assets/templates/assets/system_user_detail.html:61 #: assets/models/user.py:217 assets/templates/assets/system_user_detail.html:61
msgid "Protocol" msgid "Protocol"
...@@ -447,6 +491,19 @@ msgstr "Sudo" ...@@ -447,6 +491,19 @@ msgstr "Sudo"
msgid "Shell" msgid "Shell"
msgstr "Shell" msgstr "Shell"
#: assets/models/user.py:265 perms/models.py:19
#: perms/templates/perms/asset_permission_detail.html:136
#: perms/templates/perms/asset_permission_list.html:30 templates/_nav.html:26
#: terminal/backends/command/models.py:12 terminal/models.py:94
#: terminal/templates/terminal/command_list.html:48
#: terminal/templates/terminal/command_list.html:74
#: terminal/templates/terminal/session_list.html:49
#: terminal/templates/terminal/session_list.html:73
#: users/templates/users/user_granted_asset.html:50
#: users/templates/users/user_group_granted_asset.html:52
msgid "System user"
msgstr "系统用户"
#: assets/models/utils.py:29 #: assets/models/utils.py:29
#, python-format #, python-format
msgid "%(value)s is not an even number" msgid "%(value)s is not an even number"
...@@ -477,27 +534,30 @@ msgid "Update assets hardware info period" ...@@ -477,27 +534,30 @@ msgid "Update assets hardware info period"
msgstr "定期更新资产硬件信息" msgstr "定期更新资产硬件信息"
#: assets/tasks.py:189 #: assets/tasks.py:189
#, python-format
msgid "Test admin user connectability period: {}" msgid "Test admin user connectability period: {}"
msgstr "定期测试管理用户可以连接性: {}" msgstr "定期测试管理用户可以连接性: {}"
#: assets/tasks.py:203 #: assets/tasks.py:203
#, python-format
msgid "Test admin user connectability: {}" msgid "Test admin user connectability: {}"
msgstr "测试管理用户可连接性: {}" msgstr "测试管理用户可连接性: {}"
#: assets/tasks.py:289 #: assets/tasks.py:212
#, python-format msgid "Test asset connectability"
msgstr "测试资产可连接性"
#: assets/tasks.py:283
msgid "Test system user connectability: {}"
msgstr "测试系统用户可连接性: {}"
#: assets/tasks.py:295
msgid "Test system user connectability period: {}" msgid "Test system user connectability period: {}"
msgstr "测试系统用户可连接性: {}" msgstr "测试系统用户可连接性: {}"
#: assets/tasks.py:363 #: assets/tasks.py:372
#, python-format
msgid "Push system user to cluster assets: {}" msgid "Push system user to cluster assets: {}"
msgstr "推送系统用户到资产: {}" msgstr "推送系统用户到资产: {}"
#: assets/tasks.py:384 #: assets/tasks.py:393
#, python-format
msgid "Push system user to cluster assets period: {}->{}" msgid "Push system user to cluster assets period: {}->{}"
msgstr "定期推送系统用户到资产: {}->{}" msgstr "定期推送系统用户到资产: {}->{}"
...@@ -529,11 +589,6 @@ msgstr "资产管理" ...@@ -529,11 +589,6 @@ msgstr "资产管理"
msgid "Select Asset" msgid "Select Asset"
msgstr "选择资产" msgstr "选择资产"
#: assets/templates/assets/_asset_group_bulk_update_modal.html:22
#: assets/templates/assets/cluster_list.html:22
msgid "System users"
msgstr "系统用户"
#: assets/templates/assets/_asset_group_bulk_update_modal.html:24 #: assets/templates/assets/_asset_group_bulk_update_modal.html:24
msgid "Select System Users" msgid "Select System Users"
msgstr "选择系统用户" msgstr "选择系统用户"
...@@ -593,7 +648,7 @@ msgstr "自动生成秘钥" ...@@ -593,7 +648,7 @@ msgstr "自动生成秘钥"
#: assets/templates/assets/_system_user.html:65 #: assets/templates/assets/_system_user.html:65
#: assets/templates/assets/asset_create.html:32 #: assets/templates/assets/asset_create.html:32
#: assets/templates/assets/asset_update.html:47 #: assets/templates/assets/asset_update.html:47
#: assets/templates/assets/cluster_create_update.html:45 #: assets/templates/assets/cluster_create_update.html:46
#: perms/templates/perms/asset_permission_create_update.html:45 #: perms/templates/perms/asset_permission_create_update.html:45
#: terminal/templates/terminal/terminal_update.html:40 #: terminal/templates/terminal/terminal_update.html:40
msgid "Other" msgid "Other"
...@@ -604,7 +659,7 @@ msgstr "其它" ...@@ -604,7 +659,7 @@ msgstr "其它"
#: assets/templates/assets/asset_bulk_update.html:23 #: assets/templates/assets/asset_bulk_update.html:23
#: assets/templates/assets/asset_create.html:40 #: assets/templates/assets/asset_create.html:40
#: assets/templates/assets/asset_update.html:56 #: assets/templates/assets/asset_update.html:56
#: assets/templates/assets/cluster_create_update.html:53 #: assets/templates/assets/cluster_create_update.html:54
#: perms/templates/perms/asset_permission_create_update.html:67 #: perms/templates/perms/asset_permission_create_update.html:67
#: terminal/templates/terminal/terminal_update.html:45 #: terminal/templates/terminal/terminal_update.html:45
#: users/templates/users/_user.html:49 #: users/templates/users/_user.html:49
...@@ -623,7 +678,7 @@ msgstr "重置" ...@@ -623,7 +678,7 @@ msgstr "重置"
#: assets/templates/assets/asset_create.html:41 #: assets/templates/assets/asset_create.html:41
#: assets/templates/assets/asset_list.html:55 #: assets/templates/assets/asset_list.html:55
#: assets/templates/assets/asset_update.html:57 #: assets/templates/assets/asset_update.html:57
#: assets/templates/assets/cluster_create_update.html:54 #: assets/templates/assets/cluster_create_update.html:55
#: perms/templates/perms/asset_permission_create_update.html:68 #: perms/templates/perms/asset_permission_create_update.html:68
#: terminal/templates/terminal/terminal_update.html:46 #: terminal/templates/terminal/terminal_update.html:46
#: users/templates/users/_user.html:50 #: users/templates/users/_user.html:50
...@@ -673,11 +728,13 @@ msgid "Type" ...@@ -673,11 +728,13 @@ msgid "Type"
msgstr "类型" msgstr "类型"
#: assets/templates/assets/admin_user_assets.html:63 #: assets/templates/assets/admin_user_assets.html:63
#: assets/templates/assets/asset_group_detail.html:49 #: assets/templates/assets/admin_user_list.html:25
#: assets/templates/assets/cluster_assets.html:55 #: assets/templates/assets/asset_detail.html:376
#: terminal/templates/terminal/terminal_list.html:35 #: assets/templates/assets/asset_list.html:38
msgid "Alive" #: assets/templates/assets/system_user_asset.html:55
msgstr "在线" #: assets/templates/assets/system_user_list.html:27
msgid "Reachable"
msgstr "可连接"
#: assets/templates/assets/admin_user_assets.html:75 #: assets/templates/assets/admin_user_assets.html:75
#: assets/templates/assets/cluster_assets.html:68 #: assets/templates/assets/cluster_assets.html:68
...@@ -731,18 +788,19 @@ msgstr "使用集群管理用户" ...@@ -731,18 +788,19 @@ msgstr "使用集群管理用户"
msgid "Confirm" msgid "Confirm"
msgstr "确认" msgstr "确认"
#: assets/templates/assets/admin_user_list.html:24 #: assets/templates/assets/admin_user_list.html:26
#: assets/templates/assets/cluster_list.html:21
#: users/templates/users/_select_user_modal.html:17
msgid "Asset num"
msgstr "资产数量"
#: assets/templates/assets/admin_user_list.html:25
#: assets/templates/assets/system_user_list.html:28 #: assets/templates/assets/system_user_list.html:28
msgid "Unreachable" msgid "Unreachable"
msgstr "不可达" msgstr "不可达"
#: assets/templates/assets/admin_user_list.html:27 #: assets/templates/assets/admin_user_list.html:27
#: assets/templates/assets/system_user_list.html:29
#: ops/templates/ops/adhoc_history.html:54
#: ops/templates/ops/task_history.html:57
msgid "Ratio"
msgstr "比例"
#: assets/templates/assets/admin_user_list.html:29
#: assets/templates/assets/asset_group_detail.html:50 #: assets/templates/assets/asset_group_detail.html:50
#: assets/templates/assets/asset_group_list.html:18 #: assets/templates/assets/asset_group_list.html:18
#: assets/templates/assets/asset_list.html:39 #: assets/templates/assets/asset_list.html:39
...@@ -760,7 +818,7 @@ msgstr "不可达" ...@@ -760,7 +818,7 @@ msgstr "不可达"
msgid "Action" msgid "Action"
msgstr "动作" msgstr "动作"
#: assets/templates/assets/admin_user_list.html:47 #: assets/templates/assets/admin_user_list.html:83
#: assets/templates/assets/asset_group_detail.html:172 #: assets/templates/assets/asset_group_detail.html:172
#: assets/templates/assets/asset_group_list.html:42 #: assets/templates/assets/asset_group_list.html:42
#: assets/templates/assets/asset_list.html:95 #: assets/templates/assets/asset_list.html:95
...@@ -774,7 +832,7 @@ msgstr "动作" ...@@ -774,7 +832,7 @@ msgstr "动作"
msgid "Update" msgid "Update"
msgstr "更新" msgstr "更新"
#: assets/templates/assets/admin_user_list.html:48 #: assets/templates/assets/admin_user_list.html:84
#: assets/templates/assets/asset_group_list.html:43 #: assets/templates/assets/asset_group_list.html:43
#: assets/templates/assets/asset_list.html:96 #: assets/templates/assets/asset_list.html:96
#: assets/templates/assets/cluster_list.html:44 #: assets/templates/assets/cluster_list.html:44
...@@ -852,17 +910,16 @@ msgstr "添加到资产组" ...@@ -852,17 +910,16 @@ msgstr "添加到资产组"
msgid "Update successfully!" msgid "Update successfully!"
msgstr "更新成功" msgstr "更新成功"
#: assets/templates/assets/asset_detail.html:376
#: assets/templates/assets/asset_list.html:38
#: assets/templates/assets/system_user_asset.html:55
#: assets/templates/assets/system_user_list.html:27
msgid "Reachable"
msgstr "可连接"
#: assets/templates/assets/asset_group_detail.html:16 #: assets/templates/assets/asset_group_detail.html:16
msgid "Group assets" msgid "Group assets"
msgstr "组下资产" msgstr "组下资产"
#: assets/templates/assets/asset_group_detail.html:49
#: assets/templates/assets/cluster_assets.html:55
#: terminal/templates/terminal/terminal_list.html:35
msgid "Alive"
msgstr "在线"
#: assets/templates/assets/asset_group_detail.html:62 #: assets/templates/assets/asset_group_detail.html:62
msgid "Add assets to this group" msgid "Add assets to this group"
msgstr "添加资产到该组" msgstr "添加资产到该组"
...@@ -1016,6 +1073,11 @@ msgstr "添加资产到" ...@@ -1016,6 +1073,11 @@ msgstr "添加资产到"
msgid "Select asset" msgid "Select asset"
msgstr "选择资产" msgstr "选择资产"
#: assets/templates/assets/cluster_assets.html:211
#: assets/templates/assets/system_user_asset.html:162
msgid "Task has been send, seen left assets status"
msgstr "任务已下发,查看左侧资产状态"
#: assets/templates/assets/cluster_create_update.html:41 #: assets/templates/assets/cluster_create_update.html:41
#: users/templates/users/user_profile.html:20 #: users/templates/users/user_profile.html:20
msgid "Settings" msgid "Settings"
...@@ -1025,6 +1087,11 @@ msgstr "设置" ...@@ -1025,6 +1087,11 @@ msgstr "设置"
msgid "Create Cluster" msgid "Create Cluster"
msgstr "创建Cluster" msgstr "创建Cluster"
#: assets/templates/assets/cluster_list.html:21
#: users/templates/users/_select_user_modal.html:17
msgid "Asset num"
msgstr "资产数量"
#: assets/templates/assets/cluster_list.html:85 #: assets/templates/assets/cluster_list.html:85
msgid "This will delete the selected cluster" msgid "This will delete the selected cluster"
msgstr "删除选择Cluster" msgstr "删除选择Cluster"
...@@ -1068,10 +1135,6 @@ msgstr "推送" ...@@ -1068,10 +1135,6 @@ msgstr "推送"
msgid "Task has been send, Go to ops task list seen result" msgid "Task has been send, Go to ops task list seen result"
msgstr "任务已下发,查看ops任务列表" msgstr "任务已下发,查看ops任务列表"
#: assets/templates/assets/system_user_asset.html:162
msgid "Task has been send, seen left assets status"
msgstr "任务已下发,查看左侧资产状态"
#: assets/templates/assets/system_user_detail.html:22 #: assets/templates/assets/system_user_detail.html:22
msgid "Attached assets" msgid "Attached assets"
msgstr "关联的资产" msgstr "关联的资产"
...@@ -1092,12 +1155,6 @@ msgstr "集群" ...@@ -1092,12 +1155,6 @@ msgstr "集群"
msgid "Add to cluster" msgid "Add to cluster"
msgstr "添加到集群" msgstr "添加到集群"
#: assets/templates/assets/system_user_list.html:29
#: ops/templates/ops/adhoc_history.html:54
#: ops/templates/ops/task_history.html:57
msgid "Ratio"
msgstr "比例"
#: assets/templates/assets/system_user_list.html:130 #: assets/templates/assets/system_user_list.html:130
msgid "This will delete the selected System Users !!!" msgid "This will delete the selected System Users !!!"
msgstr "删除选择系统用户" msgstr "删除选择系统用户"
...@@ -1161,6 +1218,7 @@ msgid "Cluster list" ...@@ -1161,6 +1218,7 @@ msgid "Cluster list"
msgstr "集群列表" msgstr "集群列表"
#: assets/views/cluster.py:38 assets/views/cluster.py:65 #: assets/views/cluster.py:38 assets/views/cluster.py:65
#: assets/views/system_user.py:112
msgid "assets" msgid "assets"
msgstr "资产管理" msgstr "资产管理"
...@@ -1197,6 +1255,10 @@ msgstr "更新系统用户" ...@@ -1197,6 +1255,10 @@ msgstr "更新系统用户"
msgid "System user detail" msgid "System user detail"
msgstr "系统用户详情" msgstr "系统用户详情"
#: assets/views/system_user.py:113
msgid "System user asset"
msgstr "系统用户集群资产"
#: common/mixins.py:29 #: common/mixins.py:29
msgid "is discard" msgid "is discard"
msgstr "" msgstr ""
...@@ -1475,8 +1537,8 @@ msgstr "选择用户" ...@@ -1475,8 +1537,8 @@ msgstr "选择用户"
#: perms/forms.py:18 perms/models.py:15 #: perms/forms.py:18 perms/models.py:15
#: perms/templates/perms/asset_permission_create_update.html:36 #: perms/templates/perms/asset_permission_create_update.html:36
#: perms/templates/perms/asset_permission_list.html:26 templates/_nav.html:12 #: perms/templates/perms/asset_permission_list.html:26 templates/_nav.html:12
#: templates/_user_profile.html:14 terminal/backends/command/models.py:10 #: terminal/backends/command/models.py:10 terminal/models.py:92
#: terminal/models.py:92 terminal/templates/terminal/command_list.html:32 #: terminal/templates/terminal/command_list.html:32
#: terminal/templates/terminal/command_list.html:72 #: terminal/templates/terminal/command_list.html:72
#: terminal/templates/terminal/session_list.html:33 #: terminal/templates/terminal/session_list.html:33
#: terminal/templates/terminal/session_list.html:71 users/models/user.py:31 #: terminal/templates/terminal/session_list.html:71 users/models/user.py:31
...@@ -1488,11 +1550,6 @@ msgstr "用户" ...@@ -1488,11 +1550,6 @@ msgstr "用户"
msgid "Select user groups" msgid "Select user groups"
msgstr "选择用户组" msgstr "选择用户组"
#: perms/forms.py:40 perms/templates/perms/asset_permission_detail.html:144
#: users/forms.py:243
msgid "Select system users"
msgstr "选择系统用户"
#: perms/forms.py:52 #: perms/forms.py:52
msgid "User or group at least one required" msgid "User or group at least one required"
msgstr "用户和组至少需要选一个" msgstr "用户和组至少需要选一个"
...@@ -1518,23 +1575,6 @@ msgstr "资产 {}(组 {}) 所在集群 {} 不包含系统用户 [{}] 请检查\n ...@@ -1518,23 +1575,6 @@ msgstr "资产 {}(组 {}) 所在集群 {} 不包含系统用户 [{}] 请检查\n
msgid "User group" msgid "User group"
msgstr "用户组" msgstr "用户组"
#: perms/models.py:18 perms/templates/perms/asset_permission_list.html:29
#: templates/_nav.html:23
msgid "Asset group"
msgstr "资产组"
#: perms/models.py:19 perms/templates/perms/asset_permission_detail.html:136
#: perms/templates/perms/asset_permission_list.html:30 templates/_nav.html:26
#: terminal/backends/command/models.py:12 terminal/models.py:94
#: terminal/templates/terminal/command_list.html:48
#: terminal/templates/terminal/command_list.html:74
#: terminal/templates/terminal/session_list.html:49
#: terminal/templates/terminal/session_list.html:73
#: users/templates/users/user_granted_asset.html:50
#: users/templates/users/user_group_granted_asset.html:52
msgid "System user"
msgstr "系统用户"
#: perms/models.py:21 perms/templates/perms/asset_permission_detail.html:86 #: perms/models.py:21 perms/templates/perms/asset_permission_detail.html:86
#: users/models/user.py:50 users/templates/users/user_detail.html:94 #: users/models/user.py:50 users/templates/users/user_detail.html:94
#: users/templates/users/user_profile.html:96 #: users/templates/users/user_profile.html:96
...@@ -1676,16 +1716,38 @@ msgstr "欢迎使用Jumpserver开源跳板机系统" ...@@ -1676,16 +1716,38 @@ msgstr "欢迎使用Jumpserver开源跳板机系统"
msgid "Help" msgid "Help"
msgstr "帮助" msgstr "帮助"
#: templates/_header_bar.html:24 templates/_user_profile.html:29 #: templates/_header_bar.html:33 templates/_nav_user.html:9
#: users/templates/users/_user.html:42
#: users/templates/users/user_password_update.html:37
#: users/templates/users/user_profile.html:17
#: users/templates/users/user_profile_update.html:37
#: users/templates/users/user_profile_update.html:57
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:323
msgid "Profile"
msgstr "个人信息"
#: templates/_header_bar.html:34
msgid "Profile settings"
msgstr "个人信息设置"
#: templates/_header_bar.html:38
msgid "Admin page"
msgstr "管理页面"
#: templates/_header_bar.html:40
msgid "User page"
msgstr "用户页面"
#: templates/_header_bar.html:43
msgid "Logout" msgid "Logout"
msgstr "注销登录" msgstr "注销登录"
#: templates/_header_bar.html:28 users/templates/users/login.html:42 #: templates/_header_bar.html:47 users/templates/users/login.html:42
#: users/templates/users/login.html:61 #: users/templates/users/login.html:61
msgid "Login" msgid "Login"
msgstr "登录" msgstr "登录"
#: templates/_header_bar.html:41 templates/_nav.html:4 #: templates/_header_bar.html:60 templates/_nav.html:4
msgid "Dashboard" msgid "Dashboard"
msgstr "仪表盘" msgstr "仪表盘"
...@@ -1767,36 +1829,10 @@ msgstr "离线会话" ...@@ -1767,36 +1829,10 @@ msgstr "离线会话"
msgid "Command" msgid "Command"
msgstr "命令" msgstr "命令"
#: templates/_nav.html:73
msgid "Visit us"
msgstr "访问官网"
#: templates/_nav_user.html:4 #: templates/_nav_user.html:4
msgid "My assets" msgid "My assets"
msgstr "我的资产" msgstr "我的资产"
#: templates/_nav_user.html:9 templates/_user_profile.html:19
#: users/templates/users/_user.html:42
#: users/templates/users/user_password_update.html:37
#: users/templates/users/user_profile.html:17
#: users/templates/users/user_profile_update.html:37
#: users/templates/users/user_profile_update.html:57
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:323
msgid "Profile"
msgstr "个人信息"
#: templates/_user_profile.html:20
msgid "Profile settings"
msgstr "个人信息设置"
#: templates/_user_profile.html:24
msgid "Admin page"
msgstr "管理页面"
#: templates/_user_profile.html:26
msgid "User page"
msgstr "用户页面"
#: templates/captcha/image.html:3 #: templates/captcha/image.html:3
msgid "Play CAPTCHA as audio file" msgid "Play CAPTCHA as audio file"
msgstr "语言播放验证码" msgstr "语言播放验证码"
...@@ -1822,17 +1858,13 @@ msgstr "输出" ...@@ -1822,17 +1858,13 @@ msgstr "输出"
msgid "Session" msgid "Session"
msgstr "会话" msgstr "会话"
#: terminal/forms.py:15
msgid "A unique addr of every terminal, user browser can arrive it"
msgstr ""
#: terminal/forms.py:16 #: terminal/forms.py:16
msgid "Coco ssh listen port" msgid "Coco ssh listen port"
msgstr "" msgstr "SSH 监听端口"
#: terminal/forms.py:17 #: terminal/forms.py:17
msgid "Coco http/ws listen port" msgid "Coco http/ws listen port"
msgstr "" msgstr "Http/Websocket 监听端口"
#: terminal/models.py:15 #: terminal/models.py:15
msgid "Remote Address" msgid "Remote Address"
...@@ -1852,7 +1884,7 @@ msgstr "在线会话" ...@@ -1852,7 +1884,7 @@ msgstr "在线会话"
#: terminal/models.py:69 #: terminal/models.py:69
msgid "CPU Usage" msgid "CPU Usage"
msgstr "" msgstr "CPU使用"
#: terminal/models.py:70 #: terminal/models.py:70
msgid "Memory Used" msgid "Memory Used"
...@@ -1860,11 +1892,11 @@ msgstr "内存使用" ...@@ -1860,11 +1892,11 @@ msgstr "内存使用"
#: terminal/models.py:71 #: terminal/models.py:71
msgid "Connections" msgid "Connections"
msgstr "连接" msgstr "连接"
#: terminal/models.py:72 #: terminal/models.py:72
msgid "Threads" msgid "Threads"
msgstr "线程" msgstr "线程"
#: terminal/models.py:73 #: terminal/models.py:73
msgid "Boot Time" msgid "Boot Time"
...@@ -1884,7 +1916,7 @@ msgstr "参数" ...@@ -1884,7 +1916,7 @@ msgstr "参数"
#: terminal/templates/terminal/command_list.html:88 #: terminal/templates/terminal/command_list.html:88
msgid "Goto" msgid "Goto"
msgstr "" msgstr "转到"
#: terminal/templates/terminal/session_detail.html:17 #: terminal/templates/terminal/session_detail.html:17
#: terminal/views/session.py:115 #: terminal/views/session.py:115
...@@ -2151,10 +2183,6 @@ msgstr "微信" ...@@ -2151,10 +2183,6 @@ msgstr "微信"
msgid "Enable OTP" msgid "Enable OTP"
msgstr "二次验证" msgstr "二次验证"
#: users/models/user.py:46
msgid "Private key"
msgstr "ssh私钥"
#: users/models/user.py:47 users/templates/users/user_password_update.html:43 #: users/models/user.py:47 users/templates/users/user_password_update.html:43
#: users/templates/users/user_profile.html:71 #: users/templates/users/user_profile.html:71
#: users/templates/users/user_profile_update.html:43 #: users/templates/users/user_profile_update.html:43
...@@ -2311,13 +2339,13 @@ msgstr "已发送邮件到用户邮箱" ...@@ -2311,13 +2339,13 @@ msgstr "已发送邮件到用户邮箱"
msgid "" msgid ""
"This will reset the user's password. A password-reset email will be sent to " "This will reset the user's password. A password-reset email will be sent to "
"the user\\'s mailbox." "the user\\'s mailbox."
msgstr "" msgstr "重设密码邮件将会发送到用户邮箱"
#: users/templates/users/user_detail.html:348 #: users/templates/users/user_detail.html:348
msgid "" msgid ""
"The reset-ssh-public-key E-mail has been sent successfully. Please inform " "The reset-ssh-public-key E-mail has been sent successfully. Please inform "
"the user to update his new ssh public key." "the user to update his new ssh public key."
msgstr "" msgstr "重设秘钥邮件将会发送到用户邮箱"
#: users/templates/users/user_detail.html:349 #: users/templates/users/user_detail.html:349
#: users/templates/users/user_profile.html:144 #: users/templates/users/user_profile.html:144
...@@ -2573,7 +2601,7 @@ msgstr "编辑用户组" ...@@ -2573,7 +2601,7 @@ msgstr "编辑用户组"
#: users/views/login.py:54 #: users/views/login.py:54
msgid "Please enable cookies and try again." msgid "Please enable cookies and try again."
msgstr "" msgstr "设置你的浏览器支持cookie"
#: users/views/login.py:83 #: users/views/login.py:83
msgid "Logout success" msgid "Logout success"
...@@ -2653,6 +2681,9 @@ msgstr "密码更新" ...@@ -2653,6 +2681,9 @@ msgstr "密码更新"
msgid "Public key update" msgid "Public key update"
msgstr "秘钥更新" msgstr "秘钥更新"
#~ msgid "Visit us"
#~ msgstr "访问官网"
#~ msgid "Audits" #~ msgid "Audits"
#~ msgstr "审计中心" #~ msgstr "审计中心"
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load static %} {% load static %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% block custom_head_css_js_create %} {% endblock %} {% block custom_head_css_js_create %} {% endblock %}
{% endblock %} {% endblock %}
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/datatables/datatables.min.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/datatables/datatables.min.css" %}" rel="stylesheet">
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/datatables/datatables.min.js" %}"></script> <script src="{% static "js/plugins/datatables/datatables.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -12,7 +12,6 @@ class TerminalForm(forms.ModelForm): ...@@ -12,7 +12,6 @@ class TerminalForm(forms.ModelForm):
model = Terminal model = Terminal
fields = ['name', 'remote_addr', 'ssh_port', 'http_port', 'comment'] fields = ['name', 'remote_addr', 'ssh_port', 'http_port', 'comment']
help_texts = { help_texts = {
'remote_addr': _('A unique addr of every terminal, user browser can arrive it'),
'ssh_port': _("Coco ssh listen port"), 'ssh_port': _("Coco ssh listen port"),
'http_port': _("Coco http/ws listen port"), 'http_port': _("Coco http/ws listen port"),
} }
......
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
<thead> <thead>
<tr> <tr>
<th data-toggle="true">ID</th> <th data-toggle="true">ID</th>
<th>Command</th> <th>{% trans 'Command' %}</th>
<th data-hide="all"></th> <th data-hide="all"></th>
<th>Datetime</th> <th>{% trans 'Datetime' %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -84,24 +84,24 @@ ...@@ -84,24 +84,24 @@
<table class="table"> <table class="table">
<tbody> <tbody>
{% if object.is_finished %} {% if object.is_finished %}
<tr> <tr class="no-borders-tr">
<td class="no-borders">{% trans 'Replay session' %}:</td> <td>{% trans 'Replay session' %}:</td>
<td class="no-borders"> <td>
<span class="pull-right"> <span class="pull-right">
<button type="button" class="btn btn-primary btn-xs" id="btn_reset_password" style="width: 54px">{% trans 'Go' %}</button> <button type="button" onclick="window.open('/luna/replay/{{ object.id }}','luna', 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')" class="btn btn-primary btn-xs" id="btn_reset_password" style="width: 54px">{% trans 'Go' %}</button>
</span> </span>
</td> </td>
</tr> </tr>
{% else %} {% else %}
<tr> <!--<tr>-->
<td class="no-borders" >{% trans 'Monitor session' %}:</td> <!--<td class="no-borders" >{% trans 'Monitor session' %}:</td>-->
<td class="no-borders" > <!--<td class="no-borders" >-->
<span class="pull-right"> <!--<span class="pull-right">-->
<button type="button" class="btn btn-primary btn-xs " style="width: 54px">{% trans 'Go' %}</button> <!--<button type="button" class="btn btn-primary btn-xs " style="width: 54px">{% trans 'Go' %}</button>-->
</span> <!--</span>-->
</td> <!--</td>-->
</tr> <!--</tr>-->
<tr> <tr class="no-borders-tr">
<td>{% trans 'Terminate session' %}:</td> <td>{% trans 'Terminate session' %}:</td>
<td> <td>
<span class="pull-right"> <span class="pull-right">
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
{% if session.is_finished %} {% if session.is_finished %}
<a onclick="window.open('/luna/replay/{{ session.id }}','luna', 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')" class="btn btn-xs btn-warning btn-replay" >{% trans "Replay" %}</a> <a onclick="window.open('/luna/replay/{{ session.id }}','luna', 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')" class="btn btn-xs btn-warning btn-replay" >{% trans "Replay" %}</a>
{% else %} {% else %}
<a onclick="window.open('/luna/monitor/{{ session.id }}','luna', 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')" class="btn btn-xs btn-warning btn-monitor" >{% trans "Monitor" %}</a> <!--<a onclick="window.open('/luna/monitor/{{ session.id }}','luna', 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')" class="btn btn-xs btn-warning btn-monitor" >{% trans "Monitor" %}</a>-->
<a class="btn btn-xs btn-danger btn-term" value="{{ session.id }}" terminal="{{ session.terminal.id }}" >{% trans "Terminate" %}</a> <a class="btn btn-xs btn-danger btn-term" value="{{ session.id }}" terminal="{{ session.terminal.id }}" >{% trans "Terminate" %}</a>
{% endif %} {% endif %}
</td> </td>
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load static %} {% load static %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<link href="{% static "css/plugins/datepicker/datepicker3.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/datepicker/datepicker3.css" %}" rel="stylesheet">
{% endblock %} {% endblock %}
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load i18n %} {% load i18n %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
<link href="{% static "css/plugins/datatables/datatables.min.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/datatables/datatables.min.css" %}" rel="stylesheet">
<link href="{% static "css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" %}" rel="stylesheet"> <link href="{% static "css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script> <script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
<script src="{% static "js/plugins/datatables/datatables.min.js" %}"></script> <script src="{% static "js/plugins/datatables/datatables.min.js" %}"></script>
{% endblock %} {% endblock %}
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
{% load i18n %} {% load i18n %}
{% block custom_head_css_js %} {% block custom_head_css_js %}
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet"> <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script> <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
......
...@@ -82,6 +82,7 @@ class UserLogoutView(TemplateView): ...@@ -82,6 +82,7 @@ class UserLogoutView(TemplateView):
context = { context = {
'title': _('Logout success'), 'title': _('Logout success'),
'messages': _('Logout success, return login page'), 'messages': _('Logout success, return login page'),
'interval': 1,
'redirect_url': reverse('users:login'), 'redirect_url': reverse('users:login'),
'auto_redirect': True, 'auto_redirect': True,
} }
......
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