
From: samhenri <samuel.guimaraes@eldorado.org.br> Signed-off-by: samhenri <samuel.guimaraes@eldorado.org.br> --- src/wok/plugins/kimchi/ui/config/tab-ext.xml | 2 +- .../plugins/kimchi/ui/css/theme-default/host.css | 1 + .../kimchi/ui/css/theme-default/report-add.css | 1 + .../kimchi/ui/css/theme-default/report-rename.css | 1 + .../kimchi/ui/css/theme-default/repository-add.css | 1 + .../ui/css/theme-default/repository-edit.css | 2 +- src/wok/plugins/kimchi/ui/js/src/kimchi.host.js | 62 ++++++++++++---------- src/wok/plugins/kimchi/ui/pages/host.html.tmpl | 2 +- .../plugins/kimchi/ui/pages/report-add.html.tmpl | 2 +- .../kimchi/ui/pages/report-rename.html.tmpl | 1 + .../kimchi/ui/pages/repository-add.html.tmpl | 1 + .../kimchi/ui/pages/repository-edit.html.tmpl | 1 + 12 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/wok/plugins/kimchi/ui/config/tab-ext.xml b/src/wok/plugins/kimchi/ui/config/tab-ext.xml index 7ae8d39..7b9c8ec 100644 --- a/src/wok/plugins/kimchi/ui/config/tab-ext.xml +++ b/src/wok/plugins/kimchi/ui/config/tab-ext.xml @@ -35,4 +35,4 @@ <class>network</class> <path>plugins/kimchi/network.html</path> </tab> - </tabs-ext> \ No newline at end of file + </tabs-ext> diff --git a/src/wok/plugins/kimchi/ui/css/theme-default/host.css b/src/wok/plugins/kimchi/ui/css/theme-default/host.css index bb693cc..e24ba8a 100644 --- a/src/wok/plugins/kimchi/ui/css/theme-default/host.css +++ b/src/wok/plugins/kimchi/ui/css/theme-default/host.css @@ -15,3 +15,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + \ No newline at end of file diff --git a/src/wok/plugins/kimchi/ui/css/theme-default/report-add.css b/src/wok/plugins/kimchi/ui/css/theme-default/report-add.css index 3769daa..377e094 100644 --- a/src/wok/plugins/kimchi/ui/css/theme-default/report-add.css +++ b/src/wok/plugins/kimchi/ui/css/theme-default/report-add.css @@ -15,3 +15,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + \ No newline at end of file diff --git a/src/wok/plugins/kimchi/ui/css/theme-default/report-rename.css b/src/wok/plugins/kimchi/ui/css/theme-default/report-rename.css index 48abeb9..881768a 100644 --- a/src/wok/plugins/kimchi/ui/css/theme-default/report-rename.css +++ b/src/wok/plugins/kimchi/ui/css/theme-default/report-rename.css @@ -16,3 +16,4 @@ * limitations under the License. */ + \ No newline at end of file diff --git a/src/wok/plugins/kimchi/ui/css/theme-default/repository-add.css b/src/wok/plugins/kimchi/ui/css/theme-default/repository-add.css index 2d9e4a2..cabbbdb 100644 --- a/src/wok/plugins/kimchi/ui/css/theme-default/repository-add.css +++ b/src/wok/plugins/kimchi/ui/css/theme-default/repository-add.css @@ -15,3 +15,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + \ No newline at end of file diff --git a/src/wok/plugins/kimchi/ui/css/theme-default/repository-edit.css b/src/wok/plugins/kimchi/ui/css/theme-default/repository-edit.css index d50bbc1..9e707b2 100644 --- a/src/wok/plugins/kimchi/ui/css/theme-default/repository-edit.css +++ b/src/wok/plugins/kimchi/ui/css/theme-default/repository-edit.css @@ -23,4 +23,4 @@ .yum .deb{ display: none; -} +} diff --git a/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js b/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js index 31a4a6a..6679503 100644 --- a/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js +++ b/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js @@ -22,7 +22,7 @@ kimchi.host_main = function() { var controlledNode = $(header).attr('aria-controls'); $('#' + controlledNode)[toExpand ? 'removeClass' : 'addClass']('hidden'); $(header).attr('aria-expanded', toExpand ? 'true' : 'false'); - }; + }; var repositoriesGrid = null; var initRepositoriesGrid = function(repo_type) { @@ -338,23 +338,25 @@ kimchi.host_main = function() { }); }; var initReportGrid = function(reports) { - reportGrid = new wok.widget.Grid({ + reportGrid = new wok.widget.List({ container: 'available-reports-grid-container', id: reportGridID, title: i18n['KCHDR6002M'], toolbarButtons: [{ id: reportGridID + '-generate-button', + class: 'fa fa-plus-circle', label: i18n['KCHDR6006M'], onClick: function(event) { wok.window.open('plugins/kimchi/report-add.html'); } }, { id: reportGridID + '-rename-button', + class: 'fa fa-pencil', label: i18n['KCHDR6008M'], disabled: true, onClick: function(event) { var report = reportGrid.getSelected(); - if(!report) { + if (!report) { return; } @@ -362,20 +364,37 @@ kimchi.host_main = function() { wok.window.open('plugins/kimchi/report-rename.html'); } }, { + id: reportGridID + '-download-button', + label: i18n['KCHDR6010M'], + class: 'fa fa-download', + disabled: true, + onClick: function(event) { + var report = reportGrid.getSelected(); + if (!report) { + return; + } + + kimchi.downloadReport({ + file: report['uri'] + }); + } + }, { id: reportGridID + '-remove-button', + class: 'fa fa-minus-circle', label: i18n['KCHDR6009M'], + critical: true, disabled: true, onClick: function(event) { var report = reportGrid.getSelected(); - if(!report) { + if (!report) { return; } var settings = { - title : i18n['KCHAPI6004M'], - content : i18n['KCHDR6001M'], - confirm : i18n['KCHAPI6002M'], - cancel : i18n['KCHAPI6003M'] + title: i18n['KCHAPI6004M'], + content: i18n['KCHDR6001M'], + confirm: i18n['KCHAPI6002M'], + cancel: i18n['KCHAPI6003M'] }; wok.confirm(settings, function() { @@ -384,36 +403,21 @@ kimchi.host_main = function() { }, function(result) { listDebugReports(); }, function(error) { - wok.message.error(error.responseJSON.reason); + wok.message.error(error.responseJSON.reason); }); }); } - }, { - id: reportGridID + '-download-button', - label: i18n['KCHDR6010M'], - disabled: true, - onClick: function(event) { - var report = reportGrid.getSelected(); - if(!report) { - return; - } - - kimchi.downloadReport({ - file: report['uri'] - }); - } }], onRowSelected: function(row) { var report = reportGrid.getSelected(); // Only enable report buttons if the selected line is not a // pending report if (report['time'] == i18n['KCHDR6007M']) { - var gridElement = $('#'+ reportGridID); + var gridElement = $('#' + reportGridID); var row = $('tr:contains(' + report['name'] + ')', gridElement); enableReportButtons(false); row.attr('class', ''); - } - else { + } else { enableReportButtons(true); } }, @@ -421,11 +425,13 @@ kimchi.host_main = function() { fields: [{ name: 'name', label: i18n['KCHDR6003M'], - 'class': 'debug-report-name' + 'class': 'debug-report-name', + type: 'name' }, { name: 'time', label: i18n['KCHDR6005M'], - 'class': 'debug-report-time' + 'class': 'debug-report-time', + type: 'description' }], data: reports }); diff --git a/src/wok/plugins/kimchi/ui/pages/host.html.tmpl b/src/wok/plugins/kimchi/ui/pages/host.html.tmpl index 3c02a34..f21ee6d 100644 --- a/src/wok/plugins/kimchi/ui/pages/host.html.tmpl +++ b/src/wok/plugins/kimchi/ui/pages/host.html.tmpl @@ -23,7 +23,7 @@ #silent _ = t.gettext #silent _t = t.gettext <!DOCTYPE html> -<html> +<html> <head> <link rel="stylesheet" href="plugins/kimchi/css/theme-default.min.css"> <script src="plugins/kimchi/js/kimchi.min.js"></script> diff --git a/src/wok/plugins/kimchi/ui/pages/report-add.html.tmpl b/src/wok/plugins/kimchi/ui/pages/report-add.html.tmpl index 6882f34..8d6fb38 100644 --- a/src/wok/plugins/kimchi/ui/pages/report-add.html.tmpl +++ b/src/wok/plugins/kimchi/ui/pages/report-add.html.tmpl @@ -43,4 +43,4 @@ </div> <script> kimchi.report_add_main(); -</script> \ No newline at end of file +</script> \ No newline at end of file diff --git a/src/wok/plugins/kimchi/ui/pages/report-rename.html.tmpl b/src/wok/plugins/kimchi/ui/pages/report-rename.html.tmpl index ef14d8b..f89da19 100644 --- a/src/wok/plugins/kimchi/ui/pages/report-rename.html.tmpl +++ b/src/wok/plugins/kimchi/ui/pages/report-rename.html.tmpl @@ -45,3 +45,4 @@ <script> kimchi.report_rename_main(); </script> + \ No newline at end of file diff --git a/src/wok/plugins/kimchi/ui/pages/repository-add.html.tmpl b/src/wok/plugins/kimchi/ui/pages/repository-add.html.tmpl index 0ab2cc0..2ef0953 100644 --- a/src/wok/plugins/kimchi/ui/pages/repository-add.html.tmpl +++ b/src/wok/plugins/kimchi/ui/pages/repository-add.html.tmpl @@ -68,3 +68,4 @@ <script> kimchi.repository_add_main(); </script> + \ No newline at end of file diff --git a/src/wok/plugins/kimchi/ui/pages/repository-edit.html.tmpl b/src/wok/plugins/kimchi/ui/pages/repository-edit.html.tmpl index d74d816..33e5eee 100644 --- a/src/wok/plugins/kimchi/ui/pages/repository-edit.html.tmpl +++ b/src/wok/plugins/kimchi/ui/pages/repository-edit.html.tmpl @@ -74,3 +74,4 @@ <script type="text/javascript"> kimchi.repository_edit_main(); </script> + \ No newline at end of file -- 1.9.3