mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 23:05:26 +02:00
fix(docker/container): container logs viewer error when logging is disabled (#10384)
* fix(docker/container-logs): invalid string breadcrumb * fix(docker/container): let docker select the logging driver by default on container create * fix(docker/container-logs): information panel in container logs when logging is disabled * fix(docker/container): dont include HostConfig.LogConfig if no driver is selected
This commit is contained in:
parent
d678b155ba
commit
ada6b31f69
9 changed files with 74 additions and 6 deletions
|
@ -75,7 +75,13 @@ angular.module('portainer.docker').controller('ContainerLogsController', [
|
|||
.then(function success(data) {
|
||||
var container = data;
|
||||
$scope.container = container;
|
||||
startLogPolling(!container.Config.Tty);
|
||||
|
||||
const logsEnabled = container.HostConfig && container.HostConfig.LogConfig && container.HostConfig.LogConfig.Type && container.HostConfig.LogConfig.Type !== 'none';
|
||||
$scope.logsEnabled = logsEnabled;
|
||||
|
||||
if (logsEnabled) {
|
||||
startLogPolling(!container.Config.Tty);
|
||||
}
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve container information');
|
||||
|
|
|
@ -5,14 +5,16 @@
|
|||
{
|
||||
label:(container.Name | trimcontainername),
|
||||
link: 'docker.containers.container',
|
||||
linkParams:container.Id
|
||||
linkParams: { id: container.Id }
|
||||
}, 'Logs']"
|
||||
>
|
||||
</page-header>
|
||||
|
||||
<container-log-view ng-if="!logsEnabled"></container-log-view>
|
||||
|
||||
<log-viewer
|
||||
data="logs"
|
||||
ng-if="logs"
|
||||
ng-if="logs && logsEnabled"
|
||||
log-collection-change="changeLogCollection"
|
||||
display-timestamps="state.displayTimestamps"
|
||||
line-count="state.lineCount"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue