1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 06:19:41 +02:00

Merge branch 'develop' into feat1654-colorize-logs

This commit is contained in:
Ricardo Matsui 2021-04-15 22:38:43 -07:00 committed by GitHub
commit a7fc7816d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
474 changed files with 15372 additions and 8022 deletions

View file

@ -1,8 +1,11 @@
import moment from 'moment';
import _ from 'lodash-es';
angular.module('portainer.docker').controller('LogViewerController', [
'clipboard',
function (clipboard) {
'Blob',
'FileSaver',
function (clipboard, Blob, FileSaver) {
this.state = {
availableSinceDatetime: [
{ desc: 'Last day', value: moment().subtract(1, 'days').format() },
@ -43,5 +46,10 @@ angular.module('portainer.docker').controller('LogViewerController', [
this.state.selectedLines.splice(idx, 1);
}
};
this.downloadLogs = function () {
const data = new Blob([_.reduce(this.state.filteredLogs, (acc, log) => acc + '\n' + log, '')]);
FileSaver.saveAs(data, this.resourceName + '_logs.txt');
};
},
]);