mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
fix(UI): update-log-viewer-ui [EE-3522] (#7202)
* fix update log viewer layout * use por-switch in logs Co-authored-by: Hao Zhang <hao.zhang@portainer.io>
This commit is contained in:
parent
82fb5f7ac1
commit
4cc672f902
2 changed files with 40 additions and 16 deletions
|
@ -3,10 +3,11 @@ import _ from 'lodash-es';
|
|||
import { NEW_LINE_BREAKER } from '@/constants';
|
||||
|
||||
angular.module('portainer.docker').controller('LogViewerController', [
|
||||
'$scope',
|
||||
'clipboard',
|
||||
'Blob',
|
||||
'FileSaver',
|
||||
function (clipboard, Blob, FileSaver) {
|
||||
function ($scope, clipboard, Blob, FileSaver) {
|
||||
this.state = {
|
||||
availableSinceDatetime: [
|
||||
{ desc: 'Last day', value: moment().subtract(1, 'days').format() },
|
||||
|
@ -23,6 +24,30 @@ angular.module('portainer.docker').controller('LogViewerController', [
|
|||
selectedLines: [],
|
||||
};
|
||||
|
||||
this.handleLogsCollectionChange = handleLogsCollectionChange.bind(this);
|
||||
this.handleLogsWrapLinesChange = handleLogsWrapLinesChange.bind(this);
|
||||
this.handleDisplayTimestampsChange = handleDisplayTimestampsChange.bind(this);
|
||||
|
||||
function handleLogsCollectionChange(enabled) {
|
||||
$scope.$evalAsync(() => {
|
||||
this.state.logCollection = enabled;
|
||||
this.state.autoScroll = enabled;
|
||||
this.logCollectionChange(enabled);
|
||||
});
|
||||
}
|
||||
|
||||
function handleLogsWrapLinesChange(enabled) {
|
||||
$scope.$evalAsync(() => {
|
||||
this.state.wrapLines = enabled;
|
||||
});
|
||||
}
|
||||
|
||||
function handleDisplayTimestampsChange(enabled) {
|
||||
$scope.$evalAsync(() => {
|
||||
this.displayTimestamps = enabled;
|
||||
});
|
||||
}
|
||||
|
||||
this.copy = function () {
|
||||
clipboard.copyText(this.state.filteredLogs.map((log) => log.line).join(NEW_LINE_BREAKER));
|
||||
$('#refreshRateChange').show();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue