Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Peter Lundin
cmdb
Commits
ff6eec68
Commit
ff6eec68
authored
Dec 04, 2017
by
Peter Lundin
Browse files
Some functions work
parent
a8f01407
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
public/index.html
View file @
ff6eec68
...
...
@@ -65,7 +65,7 @@
</div>
<form
class=
'cmdbguiSearchForm'
>
Sök:
<input
type=
"text"
name=
"searchString"
id=
"searchString"
/></form>
<p
class=
'cmdbguiSmallText'
>
Innehåll
</p>
<div
id=
"
displayarea
"
></div>
<div
id=
"
cmdb-table
"
></div>
<p
class=
'cmdbguiSmallText'
>
Relationer
</p>
<div
id=
"mynetwork"
></div>
</body>
...
...
public/javascripts/dashlets/_people.js
0 → 100644
View file @
ff6eec68
This diff is collapsed.
Click to expand it.
public/javascripts/dashlets/_scribble.js
0 → 100644
View file @
ff6eec68
subOrg1
:
{
title
:
''
,
width
:
'
1%
'
,
sorting
:
false
,
edit
:
false
,
create
:
false
,
delete
:
false
,
display
:
function
(
data
){
var
$imgSubOrg
=
$
(
'
<img src="/images/organisation.png" title="Nivå 2" />
'
);
$imgSubOrg
.
click
(
function
()
{
$
(
'
#displayarea
'
).
jtable
(
'
openChildTable
'
,
$imgSubOrg
.
closest
(
'
tr
'
),{
title
:
'
Organisation nivå 2
'
,
showCloseButton
:
false
,
actions
:
{
listAction
:
'
/cmdb/api/v1/organisation/list/5
'
,
// select all rows with parent === data.record.id
},
fields
:
{
closeChild
:
{
title
:
''
,
width
:
'
1%
'
,
sorting
:
false
,
edit
:
false
,
create
:
false
,
delete
:
false
,
display
:
function
(){
var
$imgClose
=
$
(
'
img src="/images/cross.png
'
);
$imgClose
.
click
(
function
()
{
$
(
'
#displayarea
'
).
jtable
(
'
closeChildTable
'
,
$
(
$imgClose
.
closest
(
'
tr
'
)));
});
return
$imgClose
;
}
},
id
:
{
title
:
'
id
'
,
width
:
'
15%
'
,
list
:
false
,
key
:
true
},
display_name
:
{
title
:
'
Namn
'
,
width
:
'
15%
'
},
description
:
{
title
:
'
Beskrivning
'
,
width
:
'
30%
'
},
organisation_type
:
{
title
:
'
Typ
'
,
options
:
'
/cmdb/api/v1/organisation/types
'
,
width
:
'
15%
'
},
organisation_level
:
{
title
:
'
Nivå
'
,
options
:
'
/cmdb/api/v1/organisation/levels
'
,
width
:
'
15%
'
},
parent_organisation_id
:
{
list
:
false
,
title
:
'
Överordnad organisation
'
,
options
:
'
/cmdb/api/v1/organisation/parents
'
,
width
:
'
15%
'
}
},
},
function
(
data
){
data
.
childTable
.
jtable
(
'
load
'
);
});
});
return
$imgSubOrg
;
}
},
public/javascripts/dashlets/organisation-table.js
View file @
ff6eec68
$
(
document
).
ready
(
function
()
{
$
(
'
#
displayarea
'
).
jtable
({
$
(
'
#
cmdb-table
'
).
jtable
({
title
:
"
Organisation
"
,
paging
:
false
,
//Enable paging
pageSize
:
10
,
//Set page size (default: 10)
pageList
:
'
minimal
'
,
sorting
:
tru
e
,
//Enable sorting
multiSorting
:
tru
e
,
sorting
:
fals
e
,
//Enable sorting
multiSorting
:
fals
e
,
defaultSorting
:
'
display_name ASC
'
,
//Set default sorting
actions
:
{
listAction
:
'
/cmdb/api/v1/organisation/list/0
'
,
...
...
@@ -39,31 +39,16 @@ $(document).ready(function () {
create
:
false
,
delete
:
false
,
display
:
function
(
data
){
display
:
function
(
parentOrganisation
){
var
$imgSubOrg
=
$
(
'
<img src="/images/organisation.png" title="Nivå 2" />
'
);
$imgSubOrg
.
click
(
function
()
{
$
(
'
#displayarea
'
).
jtable
(
'
openChildTable
'
,
$imgSubOrg
.
closest
(
'
tr
'
),{
title
:
'
Organisation
nivå 2
'
,
showCloseButton
:
fals
e
,
$
(
'
#cmdb-table
'
).
jtable
(
'
openChildTable
'
,
$imgSubOrg
.
closest
(
'
tr
'
),{
title
:
parent
Organisation
.
record
.
display_name
+
'
:s underliggande organisationer
'
,
showCloseButton
:
tru
e
,
actions
:
{
listAction
:
'
/cmdb/api/v1/organisation/list/
'
+
data
.
record
.
id
,
// select all rows with parent === data.record.id
listAction
:
'
/cmdb/api/v1/organisation/list/
'
+
parentOrganisation
.
record
.
id
,
// select all rows with parent === data.record.id
},
fields
:
{
closeChild
:
{
title
:
''
,
width
:
'
1%
'
,
sorting
:
false
,
edit
:
false
,
create
:
false
,
delete
:
false
,
display
:
function
(){
var
$imgClose
=
$
(
'
img src="/images/cross.png
'
);
$imgClose
.
click
(
function
()
{
$
(
'
#displayarea
'
).
jtable
(
'
closeChildTable
'
,
$
(
$imgClose
.
closest
(
'
tr
'
)));
});
return
$imgClose
;
}
},
id
:
{
title
:
'
id
'
,
width
:
'
15%
'
,
...
...
@@ -94,7 +79,7 @@ $(document).ready(function () {
options
:
'
/cmdb/api/v1/organisation/parents
'
,
width
:
'
15%
'
}
},
}
},
function
(
data
){
data
.
childTable
.
jtable
(
'
load
'
);
...
...
@@ -135,14 +120,6 @@ $(document).ready(function () {
}
}
});
//Re-load records when user click 'load records' button.
$
(
'
#displayarea
'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
$
(
'
#displayarea
'
).
jtable
(
'
load
'
);
});
//Load all records when page is first shown
$
(
'
#displayarea
'
).
click
();
$
(
'
#cmdb-table
'
).
jtable
(
'
load
'
);
});
Write
Preview
Supports
Markdown
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