mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
fix(logs): copy issues caused by extra CR (#6150)
This commit is contained in:
parent
0928d1832d
commit
97b8da9d10
1 changed files with 4 additions and 3 deletions
|
@ -24,13 +24,13 @@ angular.module('portainer.docker').controller('LogViewerController', [
|
||||||
};
|
};
|
||||||
|
|
||||||
this.copy = function () {
|
this.copy = function () {
|
||||||
clipboard.copyText(this.state.filteredLogs.map((log) => log.line).join(''));
|
clipboard.copyText(this.state.filteredLogs.map((log) => log.line).join(NEW_LINE_BREAKER));
|
||||||
$('#refreshRateChange').show();
|
$('#refreshRateChange').show();
|
||||||
$('#refreshRateChange').fadeOut(2000);
|
$('#refreshRateChange').fadeOut(2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.copySelection = function () {
|
this.copySelection = function () {
|
||||||
clipboard.copyText(this.state.selectedLines.join(''));
|
clipboard.copyText(this.state.selectedLines.join(NEW_LINE_BREAKER));
|
||||||
$('#refreshRateChange').show();
|
$('#refreshRateChange').show();
|
||||||
$('#refreshRateChange').fadeOut(2000);
|
$('#refreshRateChange').fadeOut(2000);
|
||||||
};
|
};
|
||||||
|
@ -49,7 +49,8 @@ angular.module('portainer.docker').controller('LogViewerController', [
|
||||||
};
|
};
|
||||||
|
|
||||||
this.downloadLogs = function () {
|
this.downloadLogs = function () {
|
||||||
// To make the feature of downloading container logs working both on Windows and Linux, we need to use correct new line breakers on corresponding OS.
|
// To make the feature of downloading container logs working both on Windows and Linux,
|
||||||
|
// we need to use correct new line breakers on corresponding OS.
|
||||||
const data = new Blob([_.reduce(this.state.filteredLogs, (acc, log) => acc + log.line + NEW_LINE_BREAKER, '')]);
|
const data = new Blob([_.reduce(this.state.filteredLogs, (acc, log) => acc + log.line + NEW_LINE_BREAKER, '')]);
|
||||||
FileSaver.saveAs(data, this.resourceName + '_logs.txt');
|
FileSaver.saveAs(data, this.resourceName + '_logs.txt');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue