Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
c95a9ee8
Commit
c95a9ee8
authored
Oct 28, 2019
by
Piotr Gawron
Browse files
provide new structurized log information in the Gui
parent
bd6f29a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/gui/admin/LogListDialog.js
View file @
c95a9ee8
...
...
@@ -48,7 +48,13 @@ LogListDialog.prototype.createLogListDialogGui = function () {
type
:
"
thead
"
,
content
:
"
<tr>
"
+
"
<th>ID</th>
"
+
"
<th>Type</th>
"
+
"
<th>Severity</th>
"
+
"
<th>Object ID</th>
"
+
"
<th>Object Class</th>
"
+
"
<th>Map name</th>
"
+
"
<th>Content</th>
"
+
"
<th>Source</th>
"
+
"
</tr>
"
});
var
body
=
Functions
.
createElement
({
...
...
@@ -85,11 +91,8 @@ LogListDialog.prototype.createLogListDialogGui = function () {
});
var
FileSaver
=
require
(
"
file-saver
"
);
return
FileSaver
.
saveAs
(
blob
,
self
.
_projectId
+
"
-logs.txt
"
);
}).
then
(
function
()
{
}).
catch
(
GuiConnector
.
alert
).
finally
(
function
()
{
GuiConnector
.
hideProcessing
();
},
function
(
error
)
{
GuiConnector
.
hideProcessing
();
GuiConnector
.
alert
(
error
);
});
},
xss
:
false
...
...
@@ -98,6 +101,34 @@ LogListDialog.prototype.createLogListDialogGui = function () {
};
function
removeNull
(
object
)
{
if
(
object
===
null
||
object
===
undefined
)
{
return
""
;
}
return
object
;
}
function
extractTypeName
(
type
)
{
if
(
type
===
undefined
||
type
===
null
)
{
return
""
;
}
var
result
=
type
.
toLowerCase
().
replace
(
"
_
"
,
"
"
);
return
result
[
0
].
toUpperCase
()
+
result
.
slice
(
1
);
}
function
entryToRow
(
entry
)
{
var
row
=
[];
row
[
0
]
=
removeNull
(
entry
.
id
);
row
[
1
]
=
removeNull
(
extractTypeName
(
entry
.
type
));
row
[
2
]
=
removeNull
(
entry
.
level
);
row
[
3
]
=
removeNull
(
entry
.
objectIdentifier
);
row
[
4
]
=
removeNull
(
entry
.
objectClass
);
row
[
5
]
=
removeNull
(
entry
.
mapName
);
row
[
6
]
=
removeNull
(
entry
.
content
);
row
[
7
]
=
removeNull
(
entry
.
source
);
return
row
;
}
/**
*
* @param {Object} data
...
...
@@ -121,12 +152,11 @@ LogListDialog.prototype._dataTableAjaxCall = function (data, callback) {
projectId
:
self
.
_projectId
}).
then
(
function
(
logEntries
)
{
var
out
=
[];
for
(
var
i
=
0
;
i
<
logEntries
.
data
.
length
;
i
++
)
{
var
entry
=
logEntries
.
data
[
i
];
var
row
=
[];
row
[
0
]
=
entry
.
id
;
row
[
1
]
=
entry
.
content
;
var
row
=
entryToRow
(
entry
);
out
.
push
(
row
);
}
callback
({
...
...
@@ -150,7 +180,7 @@ LogListDialog.prototype.downloadAll = function () {
}).
then
(
function
(
logEntries
)
{
var
tmp
=
[];
for
(
var
i
=
0
;
i
<
logEntries
.
data
.
length
;
i
++
)
{
tmp
.
push
(
logEntries
.
data
[
i
]
.
content
);
tmp
.
push
(
entryToRow
(
logEntries
.
data
[
i
]
).
join
(
"
\t
"
)
);
}
return
tmp
.
join
(
"
\n
"
);
});
...
...
@@ -196,8 +226,20 @@ LogListDialog.prototype.open = function () {
LogListDialog
.
prototype
.
getColumnsDefinition
=
function
()
{
return
[{
name
:
"
id
"
},
{
name
:
"
type
"
},
{
name
:
"
level
"
},
{
name
:
"
objectIdentifier
"
},
{
name
:
"
objectClass
"
},
{
name
:
"
mapName
"
},
{
name
:
"
content
"
},
{
name
:
"
source
"
}];
};
...
...
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