Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
64988b8a
Commit
64988b8a
authored
7 years ago
by
Kalyani
Committed by
nixonrodrigues
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1811 : UI : Audit Events are not shown in sorted order based on time sometimes.
Signed-off-by:
nixonrodrigues
<
nixon@apache.org
>
parent
bd69a4f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
AuditTableLayoutView.js
dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+18
-8
No files found.
dashboardv2/public/js/views/audit/AuditTableLayoutView.js
View file @
64988b8a
...
...
@@ -59,7 +59,7 @@ define(['require',
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'entityDef'
));
this
.
entityCollection
=
new
VEntityList
();
this
.
coun
t
=
26
;
this
.
limi
t
=
26
;
this
.
entityCollection
.
url
=
UrlLinks
.
entityCollectionaudit
(
this
.
guid
);
this
.
entityCollection
.
modelAttrName
=
"events"
;
this
.
entityModel
=
new
this
.
entityCollection
.
model
();
...
...
@@ -80,17 +80,20 @@ define(['require',
this
.
currPage
=
1
;
},
onRender
:
function
()
{
$
.
extend
(
this
.
entityCollection
.
queryParams
,
{
count
:
this
.
coun
t
});
$
.
extend
(
this
.
entityCollection
.
queryParams
,
{
count
:
this
.
limi
t
});
this
.
fetchCollection
({
next
:
this
.
ui
.
nextAuditData
,
nextClick
:
false
,
previous
:
this
.
ui
.
previousAuditData
});
this
.
entityCollection
.
comparator
=
function
(
model
)
{
return
-
model
.
get
(
'timestamp'
);
}
},
bindEvents
:
function
()
{},
getToOffset
:
function
()
{
var
toOffset
=
0
;
if
(
this
.
entityCollection
.
models
.
length
<
this
.
coun
t
)
{
if
(
this
.
entityCollection
.
models
.
length
<
this
.
limi
t
)
{
toOffset
=
(
this
.
getFromOffset
()
+
(
this
.
entityCollection
.
models
.
length
));
}
else
{
toOffset
=
(
this
.
getFromOffset
()
+
(
this
.
entityCollection
.
models
.
length
-
1
));
...
...
@@ -98,7 +101,7 @@ define(['require',
return
toOffset
;
},
getFromOffset
:
function
(
options
)
{
var
count
=
(
this
.
currPage
-
1
)
*
(
this
.
coun
t
-
1
);
var
count
=
(
this
.
currPage
-
1
)
*
(
this
.
limi
t
-
1
);
if
(
options
&&
(
options
.
nextClick
||
options
.
previousClick
||
this
.
entityCollection
.
models
.
length
))
{
return
count
+
1
;
}
else
{
...
...
@@ -106,6 +109,7 @@ define(['require',
}
},
renderOffset
:
function
(
options
)
{
var
entityLength
;
if
(
options
.
nextClick
)
{
options
.
previous
.
removeAttr
(
"disabled"
);
if
(
this
.
entityCollection
.
length
!=
0
)
{
...
...
@@ -118,7 +122,12 @@ define(['require',
this
.
currPage
--
;
}
}
this
.
ui
.
pageRecordText
.
html
(
"Showing "
+
this
.
getFromOffset
(
options
)
+
" - "
+
this
.
getToOffset
());
if
(
this
.
entityCollection
.
models
.
length
>
25
)
{
entityLength
=
this
.
entityCollection
.
models
.
length
-
1
;
}
else
{
entityLength
=
this
.
entityCollection
.
models
.
length
}
this
.
ui
.
pageRecordText
.
html
(
"Showing <u>"
+
entityLength
+
" records</u> From "
+
this
.
getFromOffset
(
options
)
+
" - "
+
this
.
getToOffset
());
},
fetchCollection
:
function
(
options
)
{
var
that
=
this
;
...
...
@@ -134,13 +143,14 @@ define(['require',
if
(
!
(
that
.
ui
.
pageRecordText
instanceof
jQuery
))
{
return
;
}
if
(
that
.
entityCollection
.
models
.
length
<
that
.
coun
t
)
{
if
(
that
.
entityCollection
.
models
.
length
<
that
.
limi
t
)
{
options
.
previous
.
attr
(
'disabled'
,
true
);
options
.
next
.
attr
(
'disabled'
,
true
);
}
that
.
renderOffset
(
options
);
that
.
entityCollection
.
sort
();
if
(
that
.
entityCollection
.
models
.
length
)
{
if
(
that
.
entityCollection
&&
(
that
.
entityCollection
.
models
.
length
<
that
.
coun
t
&&
that
.
currPage
==
1
)
&&
that
.
next
==
that
.
entityCollection
.
last
().
get
(
'eventKey'
))
{
if
(
that
.
entityCollection
&&
(
that
.
entityCollection
.
models
.
length
<
that
.
limi
t
&&
that
.
currPage
==
1
)
&&
that
.
next
==
that
.
entityCollection
.
last
().
get
(
'eventKey'
))
{
options
.
next
.
attr
(
'disabled'
,
true
);
options
.
previous
.
removeAttr
(
"disabled"
);
}
else
{
...
...
@@ -165,7 +175,7 @@ define(['require',
that
.
RAuditTableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
columns
:
cols
})));
if
(
!
(
that
.
entityCollection
.
models
.
length
<
that
.
coun
t
))
{
if
(
!
(
that
.
entityCollection
.
models
.
length
<
that
.
limi
t
))
{
that
.
RAuditTableLayoutView
.
$el
.
find
(
'table tr'
).
last
().
hide
();
}
});
...
...
This diff is collapsed.
Click to expand it.
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