Improved shown idoit information. Moved title of object to foreground (title is more important then the id).
This commit is contained in:
parent
8895e878f0
commit
95779712b5
3 changed files with 13 additions and 8 deletions
|
@ -3,6 +3,7 @@ class App.IdoitObjectSelector extends App.ControllerModal
|
||||||
buttonCancel: true
|
buttonCancel: true
|
||||||
buttonSubmit: true
|
buttonSubmit: true
|
||||||
head: 'i-doit'
|
head: 'i-doit'
|
||||||
|
lastSearchTermEmpty: false
|
||||||
|
|
||||||
content: ->
|
content: ->
|
||||||
@ajax(
|
@ajax(
|
||||||
|
@ -44,18 +45,24 @@ class App.IdoitObjectSelector extends App.ControllerModal
|
||||||
''
|
''
|
||||||
|
|
||||||
search: (filter) =>
|
search: (filter) =>
|
||||||
|
if _.isEmpty(filter.type) && _.isEmpty(filter.title)
|
||||||
|
@lastSearchTermEmpty = true
|
||||||
|
@renderResult()
|
||||||
|
return
|
||||||
if _.isEmpty(filter.type)
|
if _.isEmpty(filter.type)
|
||||||
delete filter.type
|
delete filter.type
|
||||||
if _.isEmpty(filter.title)
|
if _.isEmpty(filter.title)
|
||||||
delete filter.title
|
delete filter.title
|
||||||
else
|
else
|
||||||
filter.title = "%#{filter.title}%"
|
filter.title = "%#{filter.title}%"
|
||||||
|
@lastSearchTermEmpty = false
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'idoit-object-selector'
|
id: 'idoit-object-selector'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: "#{@apiPath}/integration/idoit"
|
url: "#{@apiPath}/integration/idoit"
|
||||||
data: JSON.stringify(method: 'cmdb.objects', filter: filter)
|
data: JSON.stringify(method: 'cmdb.objects', filter: filter)
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
return if @lastSearchTermEmpty
|
||||||
@renderResult(data.response.result)
|
@renderResult(data.response.result)
|
||||||
|
|
||||||
error: (xhr, status, error) =>
|
error: (xhr, status, error) =>
|
||||||
|
|
|
@ -5,19 +5,17 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<th style="width: 30px"></th>
|
<th style="width: 30px"></th>
|
||||||
<th style="width: 50px"><%- @T('ID') %></th>
|
<th style="width: 100px"><%- @T('ID') %></th>
|
||||||
<th><%- @T('Name') %></th>
|
<th><%- @T('Name') %></th>
|
||||||
<th><%- @T('Status') %></th>
|
<th style="width: 100px;"><%- @T('Status') %></th>
|
||||||
<th><%- @T('Link') %></th>
|
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% for item in @items: %>
|
<% for item in @items: %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" name="object_id" value="<%= item.id %>"/></td>
|
<td><input type="checkbox" name="object_id" value="<%= item.id %>"/></td>
|
||||||
<td><%= item.id %></td>
|
<td title="<%= item.id %>"><%= item.id %></td>
|
||||||
<td><%= item.title %></td>
|
<td title="<%= item.title %>"><a href="<%- item.link %>" target="_blank"><%= item.title %></a></td>
|
||||||
<td><%= item.cmdb_status_title %></td>
|
<td><%= item.cmdb_status_title %></td>
|
||||||
<td><a href="<%- item.link %>" target="_blank">i-doit</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<% for object in @objects: %>
|
<% for object in @objects: %>
|
||||||
<div class="sidebar-block">
|
<div class="sidebar-block">
|
||||||
<label class="horizontal">
|
<label class="horizontal">
|
||||||
<%- @T(object.title) %>
|
<%- @T('ID') %>: <%- @T(object.id) %>
|
||||||
<div class="list-item-delete js-delete" data-object-id="<%= object.id %>" data-type="remove">
|
<div class="list-item-delete js-delete" data-object-id="<%= object.id %>" data-type="remove">
|
||||||
<%- @Icon('diagonal-cross') %>
|
<%- @Icon('diagonal-cross') %>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<%- @T('ID') %>: <a href="<%- object.link %>" target="_blank"><%= object.id %><br></a>
|
<a href="<%- object.link %>" target="_blank"><%= object.title %><br></a>
|
||||||
<%- @T('Status') %>: <%= object.cmdb_status_title %><br>
|
<%- @T('Status') %>: <%= object.cmdb_status_title %><br>
|
||||||
<%- @T('Type') %>: <%= object.type_title %><br>
|
<%- @T('Type') %>: <%= object.type_title %><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue