mirror of https://github.com/portainer/portainer
fix(logs): copy issues caused by extra CR (#6150)
parent
0928d1832d
commit
97b8da9d10
|
@ -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…
Reference in New Issue