You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mg...@apache.org on 2017/02/01 09:49:55 UTC
ambari git commit: AMBARI-19791 Log Search "Preview" should have a
"Select for Copy" button (mgergely)
Repository: ambari
Updated Branches:
refs/heads/trunk 8ece8aa6c -> c4f59ef71
AMBARI-19791 Log Search "Preview" should have a "Select for Copy" button (mgergely)
Change-Id: I99b2b10d83d2f2f4cb88637721bfd32a23668b44
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c4f59ef7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c4f59ef7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c4f59ef7
Branch: refs/heads/trunk
Commit: c4f59ef71dad456538818f0392c229fd381e62b4
Parents: 8ece8aa
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Wed Feb 1 10:49:43 2017 +0100
Committer: Miklos Gergely <mg...@hortonworks.com>
Committed: Wed Feb 1 10:49:43 2017 +0100
----------------------------------------------------------------------
.../webapp/scripts/views/tabs/LogFileView.js | 47 +++++++++++++++-----
1 file changed, 37 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c4f59ef7/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/LogFileView.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/LogFileView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/LogFileView.js
index 57d4acd..c7e1cba 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/LogFileView.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/LogFileView.js
@@ -352,16 +352,16 @@ define(['require',
});
},
getIdRowForTableLayout : function(){
- var IdRow = Backgrid.Row.extend({
- render: function() {
- IdRow.__super__.render.apply(this, arguments);
- if (this.model.has("id")) {
- this.$el.attr("data-id", this.model.get('id'));
- }
- return this;
- }
- });
- return IdRow;
+ var IdRow = Backgrid.Row.extend({
+ render: function() {
+ IdRow.__super__.render.apply(this, arguments);
+ if (this.model.has("id")) {
+ this.$el.attr("data-id", this.model.get('id'));
+ }
+ return this;
+ }
+ });
+ return IdRow;
},
renderTableLikeLogFile: function() {
var that = this;
@@ -821,6 +821,33 @@ define(['require',
click: function() {
that.onDialogClosed();
}
+ },
+ {
+ id: "copyBtn",
+ text: "Select for Copy",
+ "class": "btn btn-default",
+ click: function() {
+ if ($('.logsContainer-clipboard').length != 0)
+ return;
+
+ var logElement = $(".logsContainer");
+ var logElementRect = logElement[0].getBoundingClientRect();
+ logElement.css("display", "none");
+
+ var text = '';
+ logElement.find('div').each(function(){
+ text += this.innerText + '\n';
+ });
+
+ var textarea = $('<textarea class="logsContainer-clipboard"></textarea>');
+ $(".logsDetail").append(textarea);
+ textarea
+ .text(text)
+ .css('display', 'block')
+ .width(logElementRect.width)
+ .height(logElementRect.height)
+ .select();
+ }
}]
};
var dialog = that.dialog = new JBDialog(opts).render();