mirror of https://github.com/jumpserver/jumpserver
Modify asset
parent
7fd224e690
commit
502c7e756b
|
@ -5,20 +5,42 @@ from .models import IDC, Asset, AssetGroup, AdminUser, SystemUser
|
|||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AssetForm(forms.ModelForm):
|
||||
# class AssetForm(forms.ModelForm):
|
||||
# class Meta:
|
||||
# model = Asset
|
||||
#
|
||||
# fields = [
|
||||
# 'ip', 'other_ip', 'remote_card_ip', 'hostname', 'port', 'groups', 'username', 'password',
|
||||
# 'idc', 'mac_address', 'brand', 'cpu', 'memory', 'disk', 'os', 'cabinet_no', 'cabinet_pos',
|
||||
# 'number', 'status', 'type', 'env', 'sn', 'is_active', 'comment', 'admin_user', 'system_users'
|
||||
# ]
|
||||
#
|
||||
# widgets = {
|
||||
# 'groups': forms.SelectMultiple(attrs={'class': 'select2-groups', 'data-placeholder': _('Select asset groups')}),
|
||||
# 'system_user': forms.SelectMultiple(attrs={'class': 'select2-system-user', 'data-placeholder': _('Select asset system user')}),
|
||||
# 'admin_user': forms.SelectMultiple(attrs={'class': 'select2-admin-user', 'data-placeholder': _('Select asset admin user')}),
|
||||
# }
|
||||
#
|
||||
|
||||
class AssetCreateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Asset
|
||||
|
||||
fields = [
|
||||
"ip", "other_ip", "remote_card_ip", "hostname", "port", "groups", "username", "password",
|
||||
"idc", "mac_address", "brand", "cpu", "memory", "disk", "os", "cabinet_no", "cabinet_pos",
|
||||
"number", "status", "type", "env", "sn", "is_active", "comment", "admin_user", "system_users"
|
||||
'hostname', 'ip', 'port', 'type', 'zone', 'comment', 'admin_user', 'system_users', 'idc', 'groups'
|
||||
]
|
||||
|
||||
widgets = {
|
||||
'groups': forms.SelectMultiple(attrs={'class': 'select2-groups', 'data-placeholder': _('Select asset groups')}),
|
||||
'system_user': forms.SelectMultiple(attrs={'class': 'select2-system-user', 'data-placeholder': _('Select asset system user')}),
|
||||
# 'admin_user': forms.SelectMultiple(attrs={'class': 'select2-admin-user', 'data-placeholder': _('Select asset admin user')}),
|
||||
'groups': forms.SelectMultiple(attrs={'class': 'select2',
|
||||
'data-placeholder': _('Select asset groups')}),
|
||||
'system_users': forms.SelectMultiple(attrs={'class': 'select2',
|
||||
'data-placeholder': _('Select asset system users')}),
|
||||
'admin_user': forms.Select(attrs={'class': 'select2', 'data-placeholder': _('Select asset admin user')}),
|
||||
}
|
||||
help_texts = {
|
||||
'hostname': '* required',
|
||||
'ip': '* required',
|
||||
'type': '* required',
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -271,38 +271,38 @@ class AssetGroup(models.Model):
|
|||
|
||||
|
||||
class Asset(models.Model):
|
||||
ip = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('IP'))
|
||||
ip = models.CharField(max_length=32, verbose_name=_('IP'))
|
||||
other_ip = models.CharField(max_length=255, null=True, blank=True, verbose_name=_('Other IP'))
|
||||
remote_card_ip = models.CharField(max_length=16, null=True, blank=True, verbose_name=_('Remote card IP'))
|
||||
hostname = models.CharField(max_length=128, unique=True, null=True, blank=True, verbose_name=_('Hostname'))
|
||||
port = models.IntegerField(default=22, null=True, blank=True, verbose_name=_('Port'))
|
||||
hostname = models.CharField(max_length=128, blank=True, verbose_name=_('Hostname'))
|
||||
port = models.IntegerField(default=22, verbose_name=_('Port'))
|
||||
groups = models.ManyToManyField(AssetGroup, blank=True, related_name='assets', verbose_name=_('Asset groups'))
|
||||
username = models.CharField(max_length=16, null=True, blank=True, verbose_name=_('Admin user'))
|
||||
password = models.CharField(max_length=256, null=True, blank=True, verbose_name=_("Admin password"))
|
||||
admin_user = models.ForeignKey(AdminUser, null=True, blank=True, related_name='assets',
|
||||
on_delete=models.SET_NULL, verbose_name=_("Admin user"))
|
||||
system_users = models.ManyToManyField(SystemUser, blank=True, related_name='assets', verbose_name=_("System User"))
|
||||
idc = models.ForeignKey(IDC, null=True, related_name='assets', on_delete=models.SET_NULL, verbose_name=_('IDC'))
|
||||
mac_address = models.CharField(max_length=20, null=True, blank=True, verbose_name=_("Mac address"))
|
||||
brand = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('Brand'))
|
||||
cpu = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('CPU'))
|
||||
cpu = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('CPU'))
|
||||
memory = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('Memory'))
|
||||
disk = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('Disk'))
|
||||
os = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('OS'))
|
||||
cabinet_no = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Cabinet number'))
|
||||
cabinet_pos = models.IntegerField(null=True, blank=True, verbose_name=_('Cabinet position'))
|
||||
number = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Asset number'))
|
||||
status = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="asset_status_extend",
|
||||
status = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="status_asset",
|
||||
verbose_name=_('Asset status'))
|
||||
type = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="asset_type_extend",
|
||||
type = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="type_asset",
|
||||
verbose_name=_('Asset type'))
|
||||
env = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="asset_env_extend",
|
||||
env = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="env_asset",
|
||||
verbose_name=_('Asset environment'))
|
||||
zone = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="zone_asset",
|
||||
verbose_name=_('Asset zone'))
|
||||
sn = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('Serial number'))
|
||||
created_by = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Created by'))
|
||||
is_active = models.BooleanField(default=True, verbose_name=_('Is active'))
|
||||
date_created = models.DateTimeField(auto_now=True, null=True, blank=True, verbose_name=_('Date added'))
|
||||
comment = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('Comment'))
|
||||
comment = models.TextField(max_length=128, null=True, blank=True, verbose_name=_('Comment'))
|
||||
|
||||
def __unicode__(self):
|
||||
return '%(ip)s:%(port)s' % {'ip': self.ip, 'port': self.port}
|
||||
|
@ -322,8 +322,8 @@ class Asset(models.Model):
|
|||
|
||||
seed()
|
||||
for i in range(count):
|
||||
asset = cls(ip='%s.%s.%s.%s' % tuple([forgery_py.forgery.basic.text(length=3, digits=True)
|
||||
for i in range(0, 4)]),
|
||||
asset = cls(ip='%s.%s.%s.%s' % (i, i, i, i),
|
||||
hostname=forgery_py.internet.user_name(True),
|
||||
admin_user=choice(AdminUser.objects.all()),
|
||||
idc=choice(IDC.objects.all()),
|
||||
port=22,
|
||||
|
@ -338,13 +338,12 @@ class Asset(models.Model):
|
|||
continue
|
||||
|
||||
|
||||
class Label(models.Model):
|
||||
key = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('KEY'))
|
||||
value = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('VALUE'))
|
||||
class Tag(models.Model):
|
||||
key = models.CharField(max_length=64, blank=True, verbose_name=_('KEY'))
|
||||
value = models.CharField(max_length=64, verbose_name=_('VALUE'))
|
||||
asset = models.ForeignKey(Asset, null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_('Asset'))
|
||||
created_by = models.CharField(max_length=32, blank=True, verbose_name=_("Created by"))
|
||||
date_created = models.DateTimeField(auto_now=True, null=True)
|
||||
comment = models.CharField(max_length=128, blank=True, verbose_name=_('Comment'))
|
||||
|
||||
def __unicode__(self):
|
||||
return self.key
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends '_list_base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% load bootstrap %}
|
||||
{% block custom_head_css_js %}
|
||||
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet">
|
||||
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<div class="ibox float-e-margins">
|
||||
<div id="ibox-content" class="ibox-title">
|
||||
<h5> 添加资产 </h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<div class="panel blank-panel">
|
||||
<div class="tab-content">
|
||||
<form id="assetForm" method="post" class="form-horizontal">
|
||||
{% csrf_token %}
|
||||
<h3 class="widget-head-color-box">基本信息</h3>
|
||||
|
||||
{{ form.hostname|bootstrap_horizontal }}
|
||||
|
||||
{{ form.ip|bootstrap_horizontal }}
|
||||
|
||||
{{ form.port|bootstrap_horizontal }}
|
||||
|
||||
{{ form.type|bootstrap_horizontal }}
|
||||
|
||||
{{ form.comment|bootstrap_horizontal }}
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<h3>关联资产用户</h3>
|
||||
<div class="form-group">
|
||||
<label for="j_group" class="col-sm-2 control-label">管理用户</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="radio i-checks">
|
||||
<label><input type="radio" checked="checked" id="id_use_default_auth" name="use_default_auth"><span>使用预定义管理用户</span></label>
|
||||
<label><input type="radio" id="id_use_default_auth" name="use_default_auth"><span>自定义</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form.admin_user|bootstrap_horizontal }}
|
||||
<p class="col-sm-offset-2">Tips: 管理用户是服务器存在的root或拥有sudo的用户,用来推送系统用户</p>
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
{{ form.system_user|bootstrap_horizontal }}
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<h3>所属</h3>
|
||||
{{ form.idc|bootstrap_horizontal }}
|
||||
|
||||
{{ form.groups|bootstrap_horizontal }}
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<h3>标签</h3>
|
||||
<div class="form-group" id="id_label">
|
||||
<label class="col-sm-2 control-label">Label</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" placeholder="Key" name="key" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" placeholder="Value" name="value" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-offset-2">
|
||||
<i class="fa fa-plus-circle"></i> <span class="nav-label">添加</span><span class="fa arrow"></span>
|
||||
</div>
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-5">
|
||||
<button class="btn btn-white" type="reset"> 重置 </button>
|
||||
<button class="btn btn-primary" type="submit"> 提交 </button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block custom_foot_js %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.select2-groups').select2();
|
||||
$('.select2-admin-user').select2();
|
||||
$('.select2-system-user').select2();
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -0,0 +1,59 @@
|
|||
{% extends '_base_create_update.html' %}
|
||||
{% load static %}
|
||||
{% load bootstrap %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block custom_head_css_js_create %}
|
||||
<link href="{% static "css/plugins/inputTags.css" %}" rel="stylesheet">
|
||||
<script src="{% static "js/plugins/inputTags.jquery.min.js" %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
{% csrf_token %}
|
||||
<h3>{% trans 'Basic' %}</h3>
|
||||
{{ form.hostname|bootstrap_horizontal }}
|
||||
{{ form.ip|bootstrap_horizontal }}
|
||||
{{ form.port|bootstrap_horizontal }}
|
||||
{{ form.type|bootstrap_horizontal }}
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<h3>{% trans 'Group' %}</h3>
|
||||
{{ form.idc|bootstrap_horizontal }}
|
||||
{{ form.groups|bootstrap_horizontal }}
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<h3>{% trans 'Asset user' %}</h3>
|
||||
{{ form.admin_user|bootstrap_horizontal }}
|
||||
{{ form.system_users|bootstrap_horizontal }}
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<h3>{% trans 'Other' %}</h3>
|
||||
<div class="form-group">
|
||||
<label for="tags" class="col-sm-2 control-label">Tags</label>
|
||||
<div class="col-sm-9 col-lg-9 " style="background-color: #fff">
|
||||
<input id="tags" name="tags" type="text" class="form-control">
|
||||
<p class="help-block" >{% trans 'Tips: Use `,` split' %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form.comment|bootstrap_horizontal }}
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-white" type="reset">{% trans 'Reset' %}</button>
|
||||
<button id="submit_button" class="btn btn-primary" type="submit">{% trans 'Submit' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block custom_foot_js %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.select2').select2();
|
||||
$('#tags').inputTags();
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -1,4 +1,4 @@
|
|||
{% extends '_list_base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
|
|
|
@ -1,431 +1,71 @@
|
|||
{% extends 'base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
<a href="{% url 'assets:asset-create' %}" class="btn btn-sm btn-primary "> {% trans "Create asset" %} </a>
|
||||
{% endblock %}
|
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins" id="all">
|
||||
<div class="ibox-title">
|
||||
<h5> 资产列表</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% block table_head %}
|
||||
<th class="text-center">
|
||||
<input type="checkbox" id="check_all" onclick="checkAll('check_all', 'checked')">
|
||||
</th>
|
||||
<th class="text-center"><a href="{% url 'assets:asset-list' %}?sort=hostname">{% trans 'Hostname' %}</a></th>
|
||||
<th class="text-center"><a href="{% url 'assets:asset-list' %}?sort=username">{% trans 'IP' %}</a></th>
|
||||
<th class="text-center">{% trans 'Port' %}</th>
|
||||
<th class="text-center">{% trans 'Type' %}</th>
|
||||
<th class="text-center">{% trans 'Hardware' %}</th>
|
||||
<th class="text-center">{% trans 'Valid' %}</th>
|
||||
<th class="text-center"></th>
|
||||
{% endblock %}
|
||||
|
||||
<div class="ibox-content">
|
||||
<form id="asset_form">
|
||||
<div class="col-sm-1" style="padding-left: 0">
|
||||
<a href="{% url 'assets:asset-create' %}" class="btn btn-sm btn-primary "> {% trans 'Create asset' %}</a>
|
||||
</div>
|
||||
{% block table_body %}
|
||||
{% for asset in asset_list %}
|
||||
<tr class="gradeX">
|
||||
<td class="text-center">
|
||||
<input type="checkbox" name="checked" value="{{ asset.id }}">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{% url 'users:user-detail' pk=user.id %}">
|
||||
{{ asset.hostname }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">{{ asset.ip }}</td>
|
||||
<td class="text-center">{{ asset.port }}</td>
|
||||
<td class="text-center">{{ asset.type }}</td>
|
||||
<td class="text-center">{{ asset.cpu }} {{ asset.memory }} {{ asset.disk }} </td>
|
||||
<td class="text-center">
|
||||
{% if asset.is_expired %}
|
||||
<i class="fa fa-times text-danger"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-check text-navy"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{% url 'assets:asset-update' pk=user.id %}" class="btn btn-xs btn-info">{% trans 'Update' %}</a>
|
||||
<a href="{% url 'assets:asset-delete' pk=user.id %}" class="btn btn-xs btn-danger del">{% trans 'Delete' %}</a>-
|
||||
{# <a href="{% url '' %}">{% trans 'Delete' %}</a>#}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
<div class="col-sm-7" style="padding-left: 0px">
|
||||
<label>
|
||||
<select name="idc" class="form-control m-b input-sm" onchange="change_info()">
|
||||
<option value="">机房</option>
|
||||
{% for idc in idc_all %}
|
||||
{% ifequal idc.name idc_name %}
|
||||
<option value="{{idc.name}}" selected> {{ idc.name|slice:":20" }}</option>
|
||||
{% else %}
|
||||
<option value="{{idc.name}}"> {{ idc.name|slice:":20" }}</option>
|
||||
{% endifequal %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
{% block content_bottom_left %}
|
||||
<form id="" method="get" action="" class=" mail-search">
|
||||
<div class="input-group">
|
||||
<select class="form-control m-b" style="width: auto">
|
||||
<option>{% trans 'Delete selected' %}</option>
|
||||
<option>{% trans 'Update selected' %}</option>
|
||||
<option>{% trans 'Deactive selected' %}</option>
|
||||
<option>{% trans 'Export selected' %}</option>
|
||||
</select>
|
||||
|
||||
<label>
|
||||
<select name="group" class="form-control m-b input-sm" onchange="change_info()">
|
||||
<option value="">主机组</option>
|
||||
{% for asset_group in asset_group_all %}
|
||||
{% ifequal asset_group.name group_name %}
|
||||
<option value="{{ asset_group.name }}" selected> {{ asset_group.name|slice:":20" }} </option>
|
||||
{% else %}
|
||||
<option value="{{ asset_group.name }}"> {{ asset_group.name|slice:":20" }} </option>
|
||||
{% endifequal %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<select name="asset_type" class="form-control m-b input-sm" onchange="change_info()">
|
||||
<option value="">资产类型</option>
|
||||
{# {% for type in asset_types %}#}
|
||||
{# {% ifequal type.0|int2str asset_type %}#}
|
||||
{# <option value="{{ type.0 }}" selected> {{ type.1 }}</option>#}
|
||||
{# {% else %}#}
|
||||
{# <option value="{{ type.0 }}"> {{ type.1 }}</option>#}
|
||||
{# {% endifequal %}#}
|
||||
{# {% endfor %}#}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<select name="status" class="form-control m-b input-sm" onchange="change_info()">
|
||||
<option value="">资产状态</option>
|
||||
{# {% for s in asset_status %}#}
|
||||
{# {% ifequal s.0|int2str status %}#}
|
||||
{# <option value="{{ s.0 }}" selected> {{ s.1 }}</option>#}
|
||||
{# {% else %}#}
|
||||
{# <option value="{{ s.0 }}"> {{ s.1 }}</option>#}
|
||||
{# {% endifequal %}#}
|
||||
{# {% endfor %}#}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4" style="padding-right: 0">
|
||||
<div class="input-group inline-group">
|
||||
<input type="text" class="form-control m-b input-sm" id="search_input" name="keyword" value="{{ keyword }}" placeholder="Search">
|
||||
<input type="text" style="display: none">
|
||||
<div class="input-group-btn">
|
||||
<button id='search_btn' href="{% url 'assets:asset-list' %}?search=true" type="button" class="btn btn-sm btn-primary search-btn" onclick="change_info()">
|
||||
- 搜索 -
|
||||
</button>
|
||||
<button type="button" href="{% url 'assets:asset-list' %}?export=true" name="export" class="btn btn-sm btn-success search-btn-excel" onclick="return false">
|
||||
- 导出 -
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="export"></div>
|
||||
<table class="table table-striped table-bordered table-hover " id="editable" name="editable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<input id="checkall" type="checkbox" class="i-checks" name="checkall" value="checkall" data-editable='false' onclick="check_all('asset_form')">
|
||||
</th>
|
||||
<th class="text-center"> 主机名 </th>
|
||||
<th class="text-center" name="ip"> IP </th>
|
||||
<th class="text-center"> 类型 </th>
|
||||
<th class="text-center"> 配置 </th>
|
||||
<th class="text-center"> 资产组 </th>
|
||||
<th class="text-center"> 状态 </th>
|
||||
<th class="text-center"> 操作 </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for asset in assets %}
|
||||
<tr class="gradeX">
|
||||
<td class="text-center" name="id" value="{{ asset.id }}" data-editable='false'>
|
||||
<input name="id" value="{{ asset.id }}" type="checkbox" class="i-checks">
|
||||
</td>
|
||||
<td class="text-center"> <a href="{% url 'assets:asset-detail' pk=asset.id %}">{{ asset.hostname }}</a></td>
|
||||
<td class="text-center"> {{ asset.ip }} </td>
|
||||
<td class="text-center">{{ asset.system_type }}</td>
|
||||
<td class="text-center"> {{ asset.cpu }} | {{ asset.memory }} | {{ asset.disk }}</td>
|
||||
<td class="text-center"> {% for group in asset.group.all %} {{ group.name }} {% endfor %}</td>
|
||||
<td class="text-center">
|
||||
{% if asset.is_active %}
|
||||
<i class="fa fa-circle text-navy"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-circle text-danger"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center" data-editable='false'>
|
||||
{# <a href="{% url 'asset_edit' %}?id={{ asset.id }}" class="btn btn-xs btn-info">编辑</a>#}
|
||||
<a value="{{ asset.id }}" class="conn btn btn-xs btn-warning">连接</a>
|
||||
{# <a value="{% url 'asset_del' %}?id={{ asset.id }}" class="btn btn-xs btn-danger asset_del">删除</a>#}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<input type="button" id="asset_del" class="btn btn-danger btn-sm" name="del_button" value="删除"/>
|
||||
{# <a value="{% url 'asset_edit_batch' %}" type="button" class="btn btn-sm btn-warning iframe">修改</a>#}
|
||||
<input type="button" id="asset_update" class="btn btn-info btn-sm" name="update_button" value="更新"/>
|
||||
{# <input type="button" id="asset_update_all" class="btn btn-primary btn-sm" name="update_button" value="更新全部"/>#}
|
||||
<input type="button" id="exec_cmd" class="btn btn-sm btn-primary" name="exec_cmd" value="执行命令"/>
|
||||
</div>
|
||||
{% include '_pagination.html' %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="input-group-btn pull-left" style="padding-left: 5px;">
|
||||
<button id='search_btn' type="submit" style="height: 32px;" class="btn btn-sm btn-primary">
|
||||
{% trans 'Submit' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block self_footer_js %}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.asset_del').click(function(){
|
||||
var row = $(this).closest('tr');
|
||||
if (confirm("确定删除?")) {
|
||||
$.get(
|
||||
$(this).attr('value'),
|
||||
{},
|
||||
function (data) {
|
||||
row.remove()
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
$('#exec_cmd').click(function(){
|
||||
var url = '{% url "role_get" %}';
|
||||
var new_url = '{% url "exec_cmd" %}?role=';
|
||||
var check_array = [];
|
||||
$(".gradeX input:checked").closest('tr').find('.hostname a').each(function() {
|
||||
check_array.push($(this).text())
|
||||
});
|
||||
check_assets = check_array.join(':');
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
data: {},
|
||||
success: function(data){
|
||||
var dataArray = data.split(',');
|
||||
if (dataArray.length == 1 && data != 'error'){
|
||||
var title = 'Jumpserver Exec Terminal';
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
maxmin: true,
|
||||
shade: false,
|
||||
area: ['725px', '600px'],
|
||||
content: new_url+data+'&check_assets='+check_assets
|
||||
});
|
||||
//window.open(new_url + data, '', 'location=no, resizeable=no, height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,status=no');
|
||||
} else if (dataArray.length == '1' && data == 'error'){
|
||||
layer.alert('没有授权系统用户')
|
||||
} else {
|
||||
aUrl = '';
|
||||
$.each(dataArray, function(index, value){
|
||||
aUrl += '<a onclick="windowOpenExec(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + '&check_assets=' + check_assets + '>' + value + '</a> '
|
||||
});
|
||||
layer.alert(aUrl, {
|
||||
skin: 'layui-layer-molv',
|
||||
title: '授权多个系统用户,请选择一个连接',
|
||||
shade: false,
|
||||
closeBtn: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
return false
|
||||
|
||||
});
|
||||
|
||||
$('.conn').click(function(){
|
||||
var url='{% url "role_get" %}?id=' + $(this).attr('value'); // 获取用户有权限的角色
|
||||
var href = $(this).attr('href');
|
||||
var new_url = '{% url "terminal" %}?id=' + $(this).attr('value') + '&role='; // webterminal socket url
|
||||
var hostname = $(this).closest('tr').find('.hostname a')[0].innerHTML;
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
data: {},
|
||||
success: function(data){
|
||||
var dataArray = data.split(',');
|
||||
if (data == 'error' || data == '' || data == null || data == undefined){
|
||||
layer.alert('没有授权系统用户')
|
||||
}
|
||||
else if (dataArray.length == 1 && data != 'error' && navigator.platform == 'Win32'){
|
||||
/*
|
||||
var title = 'Jumpserver Web Terminal' + '<span class="text-info"> '+ hostname +'</span>';
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
maxmin: true,
|
||||
shade: false,
|
||||
area: ['628px', '420px'],
|
||||
content: new_url+data
|
||||
});
|
||||
window.open(new_url+data, '_blank', 'toolbar=yes, location=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=628, height=400')
|
||||
*/
|
||||
window.open(new_url+data, "_blank");
|
||||
} else if (dataArray.length == 1 && data != 'error'){
|
||||
/*layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
maxmin: true,
|
||||
shade: false,
|
||||
area: ['628px', '452px'],
|
||||
content: new_url+data
|
||||
});
|
||||
*/
|
||||
window.open(new_url+data, '_blank');
|
||||
}
|
||||
else {
|
||||
aUrl = '';
|
||||
$.each(dataArray, function(index, value){
|
||||
aUrl += '<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + ' value=' + hostname + '>' + value + '</a> '
|
||||
});
|
||||
console.log(aUrl);
|
||||
layer.alert(aUrl, {
|
||||
skin: 'layui-layer-molv',
|
||||
title: '授权多个系统用户,请选择一个连接',
|
||||
shade: false,
|
||||
closeBtn: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
return false
|
||||
});
|
||||
});
|
||||
|
||||
function windowOpen(a){
|
||||
var new_url = $(a).attr('href');
|
||||
var hostname = $(a).attr('value');
|
||||
var title = 'Jumpserver Web Terminal - ' + '<span class="text-info"> '+ hostname +'</span>';
|
||||
if (navigator.platform == 'Win32'){
|
||||
/*
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
maxmin: true,
|
||||
area: ['628px', '420px'],
|
||||
shade: false,
|
||||
content: new_url
|
||||
});
|
||||
*/
|
||||
window.open(new_url, '_blank')
|
||||
|
||||
} else {
|
||||
/*
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
maxmin: true,
|
||||
area: ['628px', '452px'],
|
||||
shade: false,
|
||||
content: new_url
|
||||
});
|
||||
*/
|
||||
window.open(new_url, '_blank');
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
function windowOpenExec(a){
|
||||
var new_url = $(a).attr('href');
|
||||
var title = 'Jumpserver Exec Terminal';
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
maxmin: true,
|
||||
area: ['725px', '600px'],
|
||||
shade: false,
|
||||
content: new_url
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
$(".iframe").on('click', function(){
|
||||
var asset_id_all = getIDall();
|
||||
if (asset_id_all == ''){
|
||||
alert("请至少选择一行!");
|
||||
return false;
|
||||
}
|
||||
var url= $(this).attr("value") + '?asset_id_all=' + asset_id_all;
|
||||
parent.layer.open({
|
||||
type: 2,
|
||||
title: 'JumpServer - 批量修改主机',
|
||||
maxmin: true,
|
||||
shift: 'top',
|
||||
border: [2, 0.3, '#1AB394'],
|
||||
shade: [0.5, '#000000'],
|
||||
area: ['800px', '600px'],
|
||||
shadeClose: true,
|
||||
content: url,
|
||||
cancel: function(){
|
||||
location.replace(location.href);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.search-btn-excel').unbind('click').bind('click',function(){
|
||||
var url= $(this).attr("href");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: $("#asset_form").serialize(),
|
||||
success: function (data) {
|
||||
$("#export").html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#asset_del').click(function () {
|
||||
var asset_id_all = getIDall();
|
||||
if (asset_id_all == ''){
|
||||
alert("请至少选择一行!");
|
||||
return false;
|
||||
}
|
||||
if (confirm("确定删除?")) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
data: {asset_id_all: asset_id_all},
|
||||
url: "{% url 'asset_del' %}?arg=batch",
|
||||
success: function () {
|
||||
parent.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#asset_update').click(function () {
|
||||
var asset_id_all = getIDall();
|
||||
if (asset_id_all == ''){
|
||||
if (confirm("更新全部资产信息?")) {
|
||||
layer.msg('玩命更新中...', {time: 200000});
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{% url 'asset_update_batch' %}?arg=all",
|
||||
success: function () {
|
||||
parent.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
layer.msg('玩命更新中...', {time: 200000});
|
||||
$.ajax({
|
||||
type: "post",
|
||||
data: {asset_id_all: asset_id_all},
|
||||
url: "{% url 'asset_update_batch' %}",
|
||||
success: function () {
|
||||
parent.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
{# $('#asset_update_all').click(function () {#}
|
||||
{# layer.msg('玩命更新中...', {time: 200000});#}
|
||||
{# $.ajax({#}
|
||||
{# type: "post",#}
|
||||
{# url: "/jasset/asset_update_batch/?arg=all",#}
|
||||
{# success: function () {#}
|
||||
{# parent.location.reload();#}
|
||||
{# }#}
|
||||
{# });#}
|
||||
{# });#}
|
||||
|
||||
function change_info(){
|
||||
var args = $("#asset_form").serialize();
|
||||
window.location = "{% url 'asset_list' %}?" + args
|
||||
}
|
||||
|
||||
$("#search_input").keydown(function(e){
|
||||
if(e.keyCode==13){
|
||||
change_info()
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends '_list_base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends '_list_base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
|
|
|
@ -10,15 +10,30 @@ from django.urls import reverse_lazy
|
|||
from django.contrib.messages.views import SuccessMessageMixin
|
||||
from django.views.generic.detail import DetailView, SingleObjectMixin
|
||||
|
||||
from .models import Asset, AssetGroup, IDC, AssetExtend, AdminUser, SystemUser, Label
|
||||
from .forms import AssetForm, AssetGroupForm, IDCForm, AdminUserForm, SystemUserForm
|
||||
from .models import Asset, AssetGroup, IDC, AssetExtend, AdminUser, SystemUser, Tag
|
||||
from .forms import AssetCreateForm, AssetGroupForm, IDCForm, AdminUserForm, SystemUserForm
|
||||
from .hands import AdminUserRequiredMixin
|
||||
|
||||
|
||||
class AssetListView(ListView):
|
||||
paginate_by = settings.CONFIG.DISPLAY_PER_PAGE
|
||||
model = Asset
|
||||
context_object_name = 'asset_list'
|
||||
template_name = 'assets/asset_list.html'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = {
|
||||
'app': 'Assets',
|
||||
'action': 'Asset list',
|
||||
}
|
||||
kwargs.update(context)
|
||||
return super(AssetListView, self).get_context_data(**kwargs)
|
||||
|
||||
|
||||
class AssetCreateView(AdminUserRequiredMixin, CreateView):
|
||||
model = Asset
|
||||
form_class = AssetForm
|
||||
template_name = 'assets/asset_create.html'
|
||||
form_class = AssetCreateForm
|
||||
template_name = 'assets/asset_create_update.html'
|
||||
success_url = reverse_lazy('assets:asset-list')
|
||||
|
||||
def form_valid(self, form):
|
||||
|
@ -26,14 +41,15 @@ class AssetCreateView(AdminUserRequiredMixin, CreateView):
|
|||
key = self.request.POST.get('key', '')
|
||||
value = self.request.POST.get('value', '')
|
||||
asset.save()
|
||||
Label.objects.create(key=key, value=value, asset=asset)
|
||||
return super(AssetCreateView, self).form_valid(form)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(AssetCreateView, self).get_context_data(**kwargs)
|
||||
context.update({'admin_users': AdminUser.objects.all()})
|
||||
assert isinstance(context, object)
|
||||
return context
|
||||
context = {
|
||||
'app': 'Assets',
|
||||
'action': 'Create asset',
|
||||
}
|
||||
kwargs.update(context)
|
||||
return super(AssetCreateView, self).get_context_data(**kwargs)
|
||||
|
||||
|
||||
class AssetUpdateView(UpdateView):
|
||||
|
@ -45,12 +61,6 @@ class AssetDeleteView(DeleteView):
|
|||
success_url = reverse_lazy('assets:asset-list')
|
||||
|
||||
|
||||
class AssetListView(ListView):
|
||||
model = Asset
|
||||
context_object_name = 'assets'
|
||||
template_name = 'assets/asset_list.html'
|
||||
|
||||
|
||||
class AssetDetailView(DetailView):
|
||||
model = Asset
|
||||
context_object_name = 'asset'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends '_list_base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
|
|
|
@ -0,0 +1,214 @@
|
|||
@import url("https://fonts.useso.com/css?family=Open+Sans:300,400,600,700");
|
||||
@import url("https://fonts.useso.com/css?family=Roboto:400,300,500,700");
|
||||
/** {*/
|
||||
/*box-sizing: border-box;*/
|
||||
/*}*/
|
||||
/*.color {*/
|
||||
/*color: #19BC9C !important;*/
|
||||
/*}*/
|
||||
/*html,*/
|
||||
/*body {*/
|
||||
/*width: 100%;*/
|
||||
/*height: 100%;*/
|
||||
/*margin: 0;*/
|
||||
/*font-family: 'Ubuntu Condensed', sans-serif;*/
|
||||
/*background-color: #fff;*/
|
||||
/*}*/
|
||||
/*h1 {*/
|
||||
/*text-align: center;*/
|
||||
/*margin-bottom: 32px;*/
|
||||
/*}*/
|
||||
div.container {
|
||||
display: block;
|
||||
width: 50%;
|
||||
margin: 32px auto;
|
||||
padding: 16px 32px;
|
||||
background-color: #fff;
|
||||
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
div.inputTags-list {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
padding: 6px;
|
||||
border: 1px solid rgba(25, 188, 156, 0.35);
|
||||
/*background-color: #f9f9f9;*/
|
||||
box-shadow: 1px 2px 2px rgba(221, 221, 221, 0.2);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-moz-background-clip: padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
div.inputTags-list span.inputTags-item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin: 2px;
|
||||
padding: 3px 22px 4px 8px;
|
||||
background-color: #19BC9C;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
opacity: 1;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-moz-background-clip: padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
div.inputTags-list span.inputTags-item.is-edit {
|
||||
display: none;
|
||||
}
|
||||
div.inputTags-list span.inputTags-item.is-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
div.inputTags-list span.inputTags-item.is-exists {
|
||||
background-color: rgba(231, 76, 60, 0.7);
|
||||
}
|
||||
div.inputTags-list span.inputTags-item span.value {
|
||||
cursor: pointer;
|
||||
}
|
||||
div.inputTags-list span.inputTags-item i {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 6px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
z-index: 10;
|
||||
font-weight: 400;
|
||||
font-family: sans-serif;
|
||||
line-height: 1;
|
||||
font-style: normal;
|
||||
-webkit-transition: color 0.2s;
|
||||
-khtml-transition: color 0.2s;
|
||||
-moz-transition: color 0.2s;
|
||||
-ms-transition: color 0.2s;
|
||||
-o-transition: color 0.2s;
|
||||
-webkit-transform: translateY(-50%);
|
||||
-khtml-transform: translateY(-50%);
|
||||
-moz-transform: translateY(-50%);
|
||||
-ms-transform: translateY(-50%);
|
||||
-o-transform: translateY(-50%);
|
||||
}
|
||||
div.inputTags-list span.inputTags-item i:hover {
|
||||
color: #e74c3c;
|
||||
}
|
||||
div.inputTags-list input.inputTags-field {
|
||||
border: none;
|
||||
margin-left: 4px;
|
||||
background-color: transparent;
|
||||
}
|
||||
div.inputTags-list input.inputTags-field:focus,
|
||||
div.inputTags-list input.inputTags-field:active {
|
||||
outline: none;
|
||||
}
|
||||
div.inputTags-list input.inputTags-field.is-edit {
|
||||
margin: 0 2px;
|
||||
padding: 4px 8px 3px 8px;
|
||||
border: 1px dashed #c4c4c4;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-moz-background-clip: padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
div.inputTags-list ul.inputTags-autocomplete-list {
|
||||
position: absolute;
|
||||
max-height: 192px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
overflow-y: auto;
|
||||
z-index: 100;
|
||||
opacity: 0;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-moz-background-clip: padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
-webkit-transform: scaleY(0);
|
||||
-khtml-transform: scaleY(0);
|
||||
-moz-transform: scaleY(0);
|
||||
-ms-transform: scaleY(0);
|
||||
-o-transform: scaleY(0);
|
||||
-webkit-transform-origin: 50% 0;
|
||||
-khtml-transform-origin: 50% 0;
|
||||
-moz-transform-origin: 50% 0;
|
||||
-ms-transform-origin: 50% 0;
|
||||
-o-transform-origin: 50% 0;
|
||||
-webkit-transition-duration: 0.2s;
|
||||
-khtml-transition-duration: 0.2s;
|
||||
-moz-transition-duration: 0.2s;
|
||||
-ms-transition-duration: 0.2s;
|
||||
-o-transition-duration: 0.2s;
|
||||
}
|
||||
div.inputTags-list ul.inputTags-autocomplete-list.is-active {
|
||||
opacity: 1;
|
||||
-webkit-transform: scaleY(1);
|
||||
-khtml-transform: scaleY(1);
|
||||
-moz-transform: scaleY(1);
|
||||
-ms-transform: scaleY(1);
|
||||
-o-transform: scaleY(1);
|
||||
}
|
||||
div.inputTags-list ul.inputTags-autocomplete-list li {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 16px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #ddd;
|
||||
-webkit-transition-duration: 0.3s;
|
||||
-khtml-transition-duration: 0.3s;
|
||||
-moz-transition-duration: 0.3s;
|
||||
-ms-transition-duration: 0.3s;
|
||||
-o-transition-duration: 0.3s;
|
||||
-webkit-transition-duration: 0.2s;
|
||||
-khtml-transition-duration: 0.2s;
|
||||
-moz-transition-duration: 0.2s;
|
||||
-ms-transition-duration: 0.2s;
|
||||
-o-transition-duration: 0.2s;
|
||||
}
|
||||
div.inputTags-list ul.inputTags-autocomplete-list li:last-child {
|
||||
border: none;
|
||||
}
|
||||
div.inputTags-list ul.inputTags-autocomplete-list li:hover {
|
||||
background-color: #19BC9C;
|
||||
color: #fff;
|
||||
}
|
||||
div.inputTags-list ul.inputTags-autocomplete-list li.is-disabled {
|
||||
cursor: default;
|
||||
background-color: #f7f7f7;
|
||||
color: initial;
|
||||
}
|
||||
p.inputTags-error {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0.5em 1em;
|
||||
color: #fff;
|
||||
background-color: rgba(231, 76, 60, 0.7);
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-moz-background-clip: padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
p.inputTags-error:first-of-type {
|
||||
margin-top: 8px;
|
||||
}
|
||||
p.inputTags-error:after {
|
||||
position: absolute;
|
||||
content: "\000D7";
|
||||
top: 50%;
|
||||
right: 0.5em;
|
||||
-webkit-transform: translateY(-50%);
|
||||
-khtml-transform: translateY(-50%);
|
||||
-moz-transform: translateY(-50%);
|
||||
-ms-transform: translateY(-50%);
|
||||
-o-transform: translateY(-50%);
|
||||
font-size: 28px;
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,37 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load bootstrap %}
|
||||
{% block custom_head_css_js %}
|
||||
<link href="{% static "css/plugins/select2/select2.min.css" %}" rel="stylesheet">
|
||||
<script src="{% static "js/plugins/select2/select2.full.min.js" %}"></script>
|
||||
{% block custom_head_css_js_create %} {% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>{{ action }}</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
{% block form %} {% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,6 +1,7 @@
|
|||
{% extends 'users/_user.html' %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap %}
|
||||
{% block user_template_title %}{% trans "Create user" %}{% endblock %}
|
||||
{% block username %}
|
||||
{{ form.username|bootstrap_horizontal }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends '_list_base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends '_list_base.html' %}
|
||||
{% extends '_base_list.html' %}
|
||||
{% load i18n %}
|
||||
{% load common_tags %}
|
||||
{% block content_left_head %}
|
||||
|
|
Loading…
Reference in New Issue