You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/07/09 16:16:14 UTC

[GitHub] [brooklyn-ui] algairim opened a new pull request #243: WIP Add option to auto-refresh logbook widget with latest update

algairim opened a new pull request #243:
URL: https://github.com/apache/brooklyn-ui/pull/243


   Signed-off-by: Mykola Mandra <my...@cloudsoftcorp.com>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-ui] algairim commented on pull request #243: WIP Add option to auto-refresh logbook widget with latest update

Posted by GitBox <gi...@apache.org>.
algairim commented on pull request #243:
URL: https://github.com/apache/brooklyn-ui/pull/243#issuecomment-877306088


   Proposed UI changes to support tail option, apart from query:
   
   https://user-images.githubusercontent.com/81319331/125108898-8c85bf80-e0da-11eb-8ddd-1ea980de82da.mov
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-ui] algairim commented on a change in pull request #243: Add option to auto-refresh logbook widget with latest update

Posted by GitBox <gi...@apache.org>.
algairim commented on a change in pull request #243:
URL: https://github.com/apache/brooklyn-ui/pull/243#discussion_r668523710



##########
File path: ui-modules/utils/logbook/logbook.js
##########
@@ -177,9 +177,27 @@ export function logbook() {
 
             logbookApi.logbookQuery(params, true).then((logEntries) => {
 
-                // TODO: implement logic for make output as table.
+                if ($scope.isLatest && $scope.logEntries.length !== 0) {
+                    if (logEntries.length > 0) {
+
+                        // Calculate date-time to display up to. Note, calendar does not take into account milliseconds,
+                        // round down to seconds.
+                        let latestDateTimeToDisplay = Math.floor(logEntries.slice(-1)[0].datetime / DEFAULT_NUMBER_OF_ITEMS) * DEFAULT_NUMBER_OF_ITEMS;
+
+                        // Display new log entries.
+                        let newLogEntries = logEntries.filter(entry => entry.datetime <= latestDateTimeToDisplay);

Review comment:
       Noted




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-ui] jcabrerizo merged pull request #243: Add option to auto-refresh logbook widget with latest update

Posted by GitBox <gi...@apache.org>.
jcabrerizo merged pull request #243:
URL: https://github.com/apache/brooklyn-ui/pull/243


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-ui] jathanasiou commented on a change in pull request #243: Add option to auto-refresh logbook widget with latest update

Posted by GitBox <gi...@apache.org>.
jathanasiou commented on a change in pull request #243:
URL: https://github.com/apache/brooklyn-ui/pull/243#discussion_r667892342



##########
File path: ui-modules/utils/logbook/logbook.js
##########
@@ -177,9 +177,27 @@ export function logbook() {
 
             logbookApi.logbookQuery(params, true).then((logEntries) => {
 
-                // TODO: implement logic for make output as table.
+                if ($scope.isLatest && $scope.logEntries.length !== 0) {
+                    if (logEntries.length > 0) {
+
+                        // Calculate date-time to display up to. Note, calendar does not take into account milliseconds,
+                        // round down to seconds.
+                        let latestDateTimeToDisplay = Math.floor(logEntries.slice(-1)[0].datetime / DEFAULT_NUMBER_OF_ITEMS) * DEFAULT_NUMBER_OF_ITEMS;
+
+                        // Display new log entries.
+                        let newLogEntries = logEntries.filter(entry => entry.datetime <= latestDateTimeToDisplay);

Review comment:
       Would be a bit cleaner as
   `const newEntries = logEntries.filter(({datetime})=> datetime <= latestDateTimeToDisplay);`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org