-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
#669 - feat(services) - add service logs #671
Conversation
Service logs is still experimental, this won't be merge in Portainer until it's out of experimental state. FYI, you can use the |
Still experimental in 17.04, waiting next release ! |
This will be available in 17.05 : |
Conflicts: app/app.js
I just rebase and test, I'm facing this issue |
Now that 17.06 is out, service logs seems to be stable. Could you rebase? Is this still in WIP status? Or should I give it a try? |
I rebase and test soon, and remove wip if ok |
Okay seems to work well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, just need to display logs if API version >= 1.30.
Check my comments for minor changes / questions too.
Forget the pretty print for now.
}); | ||
} | ||
|
||
// initial call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you place this code in an initView()
function ?
}, function (data, status, headers, config) { | ||
// Replace carriage returns with newlines to clean up output | ||
data = data.replace(/[\r]/g, '\n'); | ||
// Strip 8 byte header from each line of output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with the header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 8 bytes due to stream protocol, really no information on that but I found that https://docs.docker.com/engine/api/v1.30/#operation/ContainerAttach
// Strip 8 byte header from each line of output | ||
data = data.substring(8); | ||
data = data.replace(/\n(.{8})/g, '\n'); | ||
// Delete 156 Chars // com.docker.swarm.node.id=sov730ei4f0s26940rdmcgeql,com.docker.swarm.service.id=bobi0ougfe8fg6ewxvmft7ph2,com.docker.swarm.task.id=vx1oxavbdz0654dbp8a70dxmx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No in my firsts tests, logs send node/service/tack id (156 chars) but in api v1.30, nothing, so I'll delete those comments
}, function (data, status, headers, config) { | ||
// Replace carriage returns with newlines to clean up output | ||
data = data.replace(/[\r]/g, '\n'); | ||
// Strip 8 byte header from each line of output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments below.
// Strip 8 byte header from each line of output | ||
data = data.substring(8); | ||
data = data.replace(/\n(.{8})/g, '\n'); | ||
// Delete 156 Chars // com.docker.swarm.node.id=sov730ei4f0s26940rdmcgeql,com.docker.swarm.service.id=bobi0ougfe8fg6ewxvmft7ph2,com.docker.swarm.task.id=vx1oxavbdz0654dbp8a70dxmx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments below.
$scope.tailLines = 2000; | ||
|
||
$('#loadingViewSpinner').show(); | ||
Service.get({id: $stateParams.id}, function (d) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you relocate this into the initView
function?
<rd-widget> | ||
<rd-widget-body> | ||
<div class="widget-icon grey pull-left"> | ||
<i class="fa fa-server"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use fa-list-alt
here.
app/components/service/service.html
Outdated
@@ -72,6 +72,13 @@ | |||
<input type="text" class="form-control" ng-model="service.Image" ng-change="updateServiceAttribute(service, 'Image')" ng-disabled="isUpdating" /> | |||
</td> | |||
</tr> | |||
<tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add a condition on this, only display this section for API version >= 1.30
Ok for me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small display issue, can you update it? See my comment.
app/components/service/service.html
Outdated
@@ -72,6 +72,13 @@ | |||
<input type="text" class="form-control" ng-model="service.Image" ng-change="updateServiceAttribute(service, 'Image')" ng-disabled="isUpdating" /> | |||
</td> | |||
</tr> | |||
<tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @WTFKr0 👍 |
Closes #669
Need to wait for service logs Generally Available,17.06 / API v1.30