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
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
ff6eec68
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
</div>
</div>
<form
class=
'cmdbguiSearchForm'
>
Sök:
<input
type=
"text"
name=
"searchString"
id=
"searchString"
/></form>
<form
class=
'cmdbguiSearchForm'
>
Sök:
<input
type=
"text"
name=
"searchString"
id=
"searchString"
/></form>
<p
class=
'cmdbguiSmallText'
>
Innehåll
</p>
<p
class=
'cmdbguiSmallText'
>
Innehåll
</p>
<div
id=
"
displayarea
"
></div>
<div
id=
"
cmdb-table
"
></div>
<p
class=
'cmdbguiSmallText'
>
Relationer
</p>
<p
class=
'cmdbguiSmallText'
>
Relationer
</p>
<div
id=
"mynetwork"
></div>
<div
id=
"mynetwork"
></div>
</body>
</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
()
{
$
(
document
).
ready
(
function
()
{
$
(
'
#
displayarea
'
).
jtable
({
$
(
'
#
cmdb-table
'
).
jtable
({
title
:
"
Organisation
"
,
title
:
"
Organisation
"
,
paging
:
false
,
//Enable paging
paging
:
false
,
//Enable paging
pageSize
:
10
,
//Set page size (default: 10)
pageSize
:
10
,
//Set page size (default: 10)
pageList
:
'
minimal
'
,
pageList
:
'
minimal
'
,
sorting
:
true
,
//Enable sorting
sorting
:
false
,
//Enable sorting
multiSorting
:
true
,
multiSorting
:
false
,
defaultSorting
:
'
display_name ASC
'
,
//Set default sorting
defaultSorting
:
'
display_name ASC
'
,
//Set default sorting
actions
:
{
actions
:
{
listAction
:
'
/cmdb/api/v1/organisation/list/0
'
,
listAction
:
'
/cmdb/api/v1/organisation/list/0
'
,
createAction
:
'
/cmdb/api/v1/organisation/create
'
,
createAction
:
'
/cmdb/api/v1/organisation/create
'
,
updateAction
:
function
(
postData
)
{
updateAction
:
function
(
postData
)
{
return
$
.
Deferred
(
function
(
$dfd
)
{
return
$
.
Deferred
(
function
(
$dfd
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'
/cmdb/api/v1/organisation/update
'
,
url
:
'
/cmdb/api/v1/organisation/update
'
,
type
:
'
POST
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
data
:
postData
,
data
:
postData
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$dfd
.
resolve
(
data
);
$dfd
.
resolve
(
data
);
var
records
=
data
[
'
Records
'
];
var
records
=
data
[
'
Records
'
];
},
},
error
:
function
()
{
error
:
function
()
{
$dfd
.
reject
();
$dfd
.
reject
();
}
}
});
});
});
},
});
deleteAction
:
'
/cmdb/api/v1/organisation/delete
'
},
},
fields
:
{
deleteAction
:
'
/cmdb/api/v1/organisation/delete
'
subOrg1
:
{
},
title
:
''
,
fields
:
{
width
:
'
1%
'
,
subOrg1
:
{
sorting
:
false
,
title
:
''
,
edit
:
false
,
width
:
'
1%
'
,
create
:
false
,
sorting
:
false
,
delete
:
false
,
edit
:
false
,
create
:
false
,
delete
:
false
,
display
:
function
(
data
){
display
:
function
(
parentOrganisation
){
var
$imgSubOrg
=
$
(
'
<img src="/images/organisation.png" title="Nivå 2" />
'
);
var
$imgSubOrg
=
$
(
'
<img src="/images/organisation.png" title="Nivå 2" />
'
);
$imgSubOrg
.
click
(
function
()
{
$imgSubOrg
.
click
(
function
()
{
$
(
'
#displayarea
'
).
jtable
(
'
openChildTable
'
,
$imgSubOrg
.
closest
(
'
tr
'
),{
$
(
'
#cmdb-table
'
).
jtable
(
'
openChildTable
'
,
$imgSubOrg
.
closest
(
'
tr
'
),{
title
:
'
Organisation nivå 2
'
,
title
:
parentOrganisation
.
record
.
display_name
+
'
:s underliggande organisationer
'
,
showCloseButton
:
false
,
showCloseButton
:
true
,
actions
:
{
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
:
{
id
:
{
title
:
'
id
'
,
width
:
'
15%
'
,
list
:
false
,
key
:
true
},
},
fields
:
{
display_name
:
{
closeChild
:
{
title
:
'
Namn
'
,
title
:
''
,
width
:
'
15%
'
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%
'
}
},
},
},
description
:
{
function
(
data
){
title
:
'
Beskrivning
'
,
data
.
childTable
.
jtable
(
'
load
'
);
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
;
return
$imgSubOrg
;
}
}
},
},
...
@@ -134,15 +119,7 @@ $(document).ready(function () {
...
@@ -134,15 +119,7 @@ $(document).ready(function () {
width
:
'
15%
'
,
width
:
'
15%
'
,
}
}
}
}
});
});
$
(
'
#cmdb-table
'
).
jtable
(
'
load
'
);
//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
();
});
});
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