mirror of https://github.com/jumpserver/jumpserver
Add asset group view
parent
246fcb8efa
commit
4855e86a3f
|
@ -130,8 +130,12 @@ class Asset(models.Model):
|
|||
def __unicode__(self):
|
||||
return self.ip
|
||||
|
||||
def initial(self):
|
||||
pass
|
||||
|
||||
class Meta:
|
||||
db_table = 'asset'
|
||||
index_together = ('ip', 'port')
|
||||
|
||||
|
||||
class Label(models.Model):
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<div class="col-sm-9">
|
||||
<select name="assets" id="assets" data-placeholder="{% trans 'Select asset' %}" class="select2 form-control m-b" multiple tabindex="2">
|
||||
{% for asset in assets %}
|
||||
<option value="{{ asset.id }}">{{ asset.hostname }}</option>
|
||||
<option value="{{ asset.id }}">{{ asset.ip }}:{{ asset.port }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
@ -46,8 +46,8 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-white" type="reset">取消</button>
|
||||
<button id="submit_button" class="btn btn-primary" type="submit">确认保存</button>
|
||||
<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>
|
||||
|
|
|
@ -19,18 +19,18 @@
|
|||
{% for assetgroup in assetgroups %}
|
||||
<tr class="gradeX">
|
||||
<td class="text-center">
|
||||
<input type="checkbox" name="checked" value="{{ user.id }}">
|
||||
<input type="checkbox" name="checked" value="{{ assetgroup.id }}">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{% url 'assets:assetgroup-detail' pk=user.id %}">
|
||||
<a href="{% url 'assets:assetgroup-detail' pk=assetgroup.id %}">
|
||||
{{ assetgroup.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">{{ assetgroup.comment }}</td>
|
||||
<td class="text-center">{{ assetgroup.asset_set.count }}</td>
|
||||
<td class="text-center">{{ assetgroup.comment }}</td>
|
||||
<td class="text-center">
|
||||
<a href="{% url 'users:user-edit' pk=user.id %}" class="btn btn-xs btn-info">{% trans 'Edit' %}</a>
|
||||
<a href="{% url 'users:user-delete' pk=user.id %}" class="btn btn-xs btn-danger del {% if user.id == request.user.id or user.username == 'admin' %} disabled {% endif %}">{% trans 'Delete' %}</a>
|
||||
<a href="{% url 'assets:assetgroup-edit' pk=assetgroup.id %}" class="btn btn-xs btn-info">{% trans 'Edit' %}</a>
|
||||
<a href="{% url 'assets:assetgroup-delete' pk=assetgroup.id %}" class="btn btn-xs btn-danger del">{% trans 'Delete' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
<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 'Commit' %}
|
||||
{% trans 'Submit' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ urlpatterns = [
|
|||
url(r'^assetgroup$', views.AssetGroupListView.as_view(), name='assetgroup-list'),
|
||||
url(r'^assetgroup/add$', views.AssetGroupAddView.as_view(), name='assetgroup-add'),
|
||||
url(r'^assetgroup/(?P<pk>[0-9]+)$', views.AssetGroupDetailView.as_view(), name='assetgroup-detail'),
|
||||
url(r'^assetgroup/(?P<pk>[0-9]+)$/edit', views.AssetGroupEditView.as_view(), name='assetgroup-edit'),
|
||||
url(r'^assetgroup/(?P<pk>[0-9]+)/edit$', views.AssetGroupEditView.as_view(), name='assetgroup-edit'),
|
||||
url(r'^assetgroup/(?P<pk>[0-9]+)/delete$', views.AssetGroupDeleteView.as_view(), name='assetgroup-delete'),
|
||||
# url(r'^api/v1.0/', include(router.urls)),
|
||||
]
|
||||
|
|
|
@ -52,6 +52,7 @@ class AssetGroupAddView(CreateView):
|
|||
model = AssetGroup
|
||||
form_class = AssetGroupForm
|
||||
template_name = 'assets/assetgroup_add.html'
|
||||
success_url = reverse_lazy('assets:assetgroup-list')
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
<ul class="nav navbar-top-links navbar-right">
|
||||
<li>
|
||||
<span class="m-r-sm text-muted welcome-message">{% trans 'Welcome use Jumpserver system' %}</span>
|
||||
<span class="m-r-sm text-muted welcome-message">{% trans 'Welcome to use Jumpserver system' %}</span>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
|
||||
|
|
|
@ -135,7 +135,7 @@ msgstr ""
|
|||
#: users/templates/users/_user.html:70
|
||||
#: users/templates/users/forget_password.html:44
|
||||
#: users/templates/users/user_list.html:63
|
||||
msgid "Commit"
|
||||
msgid "Submit"
|
||||
msgstr ""
|
||||
|
||||
#: users/templates/users/forget_password.html:26
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<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 'Commit' %}</button>
|
||||
<button id="submit_button" class="btn btn-primary" type="submit">{% trans 'Submit' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<input type="email" name="email" class="form-control" placeholder="Email address" required="">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary block full-width m-b">{% trans 'Commit' %}</button>
|
||||
<button type="submit" class="btn btn-primary block full-width m-b">{% trans 'Submit' %}</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
<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 'Commit' %}
|
||||
{% trans 'Submit' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue