Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Peter Lundin
cmdb
Commits
10c9bd60
Commit
10c9bd60
authored
Jan 09, 2018
by
a001188
Browse files
Sort implemented
parent
02a7df6c
Changes
4
Hide whitespace changes
Inline
Side-by-side
public/javascripts/dashlets/search-ci-table.js
View file @
10c9bd60
function
search_ciTable
(
family_name
){
$
(
'
#cmdb-table
'
).
jtable
(
createSearchCiTable
(
search_ciColumnDef
(),
family_name
));
//**************************************************
// family_type: filterparamter, value from database
// family_name: from database, value from database
// sub_queries_included: if filter should be included in subqueries
//**************************************************
function
ciTable
(
family_type
,
family_name
,
sub_queries_included
){
$
(
'
#cmdb-table
'
).
jtable
(
createSearchCiTable
(
ciColumnDef
(),
family_type
,
family_name
,
sub_queries_included
));
$
(
'
#cmdb-table
'
).
jtable
(
'
load
'
);
}
function
search_
ciColumnDef
(){
function
ciColumnDef
(){
var
cd
=
{
prev
:
{
title
:
''
,
...
...
@@ -95,11 +102,11 @@ function search_ciColumnDef(){
function
createSearchCiTable
(
ciColumnDef
,
family_
name
){
function
createSearchCiTable
(
ciColumnDef
,
family_
type
,
family_name
,
sub_queries_included
){
var
table
=
{
title
:
function
(){
if
(
family_name
!==
'
Sök
'
)
return
'
Sök:
'
+
family_name
;
return
'
Sök:
'
+
family_type
+
family_name
;
else
return
'
Sök
'
;
},
...
...
@@ -120,7 +127,7 @@ function search_ciColumnDef(){
return
$
.
Deferred
(
function
(
$dfd
)
{
$
.
ajax
({
url
:
'
/cmdb/api/v1/ci/
search/list
/
'
+
family_name
+
'
?jtStartIndex=
'
+
jtParams
.
jtStartIndex
+
'
&jtPageSize=
'
+
jtParams
.
jtPageSize
+
'
&jtSorting=
'
+
jtParams
.
jtSorting
,
url
:
'
/cmdb/api/v1/ci/
list/
'
+
family_type
+
'
/
'
+
family_name
+
'
?jtStartIndex=
'
+
jtParams
.
jtStartIndex
+
'
&jtPageSize=
'
+
jtParams
.
jtPageSize
+
'
&jtSorting=
'
+
jtParams
.
jtSorting
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
data
:
postData
,
...
...
@@ -163,7 +170,7 @@ function createSearchCiChildTable(data, row){
actions
:
{
listAction
:
'
/cmdb/api/v1/ci/child/list/
'
+
data
.
record
.
ci_id
},
fields
:
search_
ciColumnDef
()
fields
:
ciColumnDef
()
},
function
(
data
)
{
//opened handler
data
.
childTable
.
jtable
(
'
load
'
);
...
...
@@ -193,7 +200,7 @@ function createSearchCiSiblingTable(data, row){
actions
:
{
listAction
:
'
/cmdb/api/v1/ci/child/list/
'
+
data
.
record
.
ci_parent_id
},
fields
:
search_
ciColumnDef
()
fields
:
ciColumnDef
()
},
function
(
data
)
{
//opened handler
data
.
childTable
.
jtable
(
'
load
'
);
...
...
@@ -223,7 +230,7 @@ function renderSearchCiParentTable (data) {
actions
:
{
listAction
:
'
/cmdb/api/v1/ci/parent/list/
'
+
data
.
record
.
ci_parent_id
},
fields
:
search_
ciColumnDef
()
fields
:
ciColumnDef
()
},
function
(
data
)
{
//opened handler
data
.
childTable
.
jtable
(
'
load
'
);
...
...
public/javascripts/select.js
View file @
10c9bd60
...
...
@@ -4,8 +4,15 @@ $(document).ready(function () {
if
(
ref
.
includes
(
'
/family-and-class/
'
)){
structureTable
();
}
if
(
ref
.
includes
(
'
/ec-ci/
'
)){
ec_ciTable
();
if
(
ref
.
includes
(
'
/ec-system-ci/
'
)){
ciTable
(
'
IT-Tjänst
'
,
'
Drift av System
'
,
false
);
// ec_ciTable();
}
if
(
ref
.
includes
(
'
/ec-file-ci/
'
)){
ciTable
(
'
IT-Tjänst
'
,
'
Filtjänst
'
,
false
);
}
if
(
ref
.
includes
(
'
/ec-office-ci/
'
)){
ciTable
(
'
IT-Tjänst
'
,
'
Klientarbetsplats
'
,
false
);
}
if
(
ref
.
includes
(
'
/tfo-ci/
'
)){
tfo_ciTable
();
...
...
@@ -21,7 +28,10 @@ $(document).ready(function () {
accessNodesTable
();
accessGraph
(
-
1
);
}
if
(
ref
.
includes
(
'
/person/
'
)){
ciTable
(
''
,
'
Anställd
'
);
}
if
(
ref
.
includes
(
'
/search/
'
)){
search_
ciTable
(
'
Sök
'
);
ciTable
(
'
All
'
,
'
Sök
'
,
false
);
}
});
\ No newline at end of file
routes/ci.js
View file @
10c9bd60
...
...
@@ -135,7 +135,7 @@ function formateResult(req, res, result){
}
router
.
post
(
'
/
search/list
/:family_name
'
,
(
req
,
res
,
next
)
=>
{
router
.
post
(
'
/
list/:family_type
/:family_name
'
,
(
req
,
res
,
next
)
=>
{
var
family_name
=
req
.
params
[
'
family_name
'
];
var
sql
=
getSQLSearchQuery
(
SEARCH
,
family_name
,
req
);
...
...
views/menu.pug
View file @
10c9bd60
...
...
@@ -25,11 +25,11 @@ block menu
a(href="#") IT-Tjänster
ul
li
a(href="/view/ec-ci/
1
") Drift av System (CI)
a(href="/view/ec-
system-
ci/
3
") Drift av System (CI)
li
a(href="/") Kontorsarbetsplats (CI)
- Ej implementerad
a(href="/
view/ec-office-ci/3
") Kontorsarbetsplats (CI)
li
a(href="/") Filtjänst (CI)
- Ej implementerad
a(href="/
view/ec-file-ci/3
") Filtjänst (CI)
li
a(href="#") Infrastruktur
ul
...
...
@@ -46,7 +46,7 @@ block menu
li
a(href="/view/organisation/2") Organisation
li
a(href="/view/person/
1
") Person
a(href="/view/person/
3
") Person
li
a(href="/view/financial-account/1") Kontoplan
li
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment