From nobody Wed Jan 15 16:11:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) client-ip=66.187.230.42; envelope-from=kimchi-devel-bounces@ovirt.org; helo=lists.ovirt.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) smtp.mailfrom=kimchi-devel-bounces@ovirt.org; Return-Path: Received: from lists.ovirt.org (lists.phx.ovirt.org [66.187.230.42]) by mx.zohomail.com with SMTPS id 1486994294387639.8506636578044; Mon, 13 Feb 2017 05:58:14 -0800 (PST) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id 7CE57820711; Mon, 13 Feb 2017 13:58:13 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lists.ovirt.org (Postfix) with ESMTPS id 85C468206E1 for ; Mon, 13 Feb 2017 13:57:24 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1DDmeYw055346 for ; Mon, 13 Feb 2017 08:57:24 -0500 Received: from e24smtp01.br.ibm.com (e24smtp01.br.ibm.com [32.104.18.85]) by mx0a-001b2d01.pphosted.com with ESMTP id 28j0180f5d-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 13 Feb 2017 08:57:23 -0500 Received: from localhost by e24smtp01.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Feb 2017 11:57:21 -0200 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp01.br.ibm.com (10.172.0.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 13 Feb 2017 11:57:19 -0200 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 1DE711DC007F for ; Mon, 13 Feb 2017 08:57:20 -0500 (EST) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.8.31.93]) by d24relay01.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1DDvIWE4571144 for ; Mon, 13 Feb 2017 11:57:18 -0200 Received: from d24av02.br.ibm.com (localhost [127.0.0.1]) by d24av02.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1DDvI3R005732 for ; Mon, 13 Feb 2017 11:57:18 -0200 Received: from alinefm-TP440.ibmmodules.com ([9.85.175.177]) by d24av02.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1DDv63g005628 for ; Mon, 13 Feb 2017 11:57:17 -0200 X-Original-To: kimchi-devel@ovirt.org From: Aline Manera To: Kimchi Devel Date: Mon, 13 Feb 2017 11:57:01 -0200 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170213135704.7556-1-alinefm@linux.vnet.ibm.com> References: <20170213135704.7556-1-alinefm@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021313-1523-0000-0000-0000027F03BE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021313-1524-0000-0000-00002A1403A2 Message-Id: <20170213135704.7556-5-alinefm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-13_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702130136 Subject: [Kimchi-devel] [PATCH] [Wok 4/7] Fix indentation on wok.user-log.js file X-BeenThere: kimchi-devel@ovirt.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: kimchi-devel-bounces@ovirt.org Errors-To: kimchi-devel-bounces@ovirt.org X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Always use 4 spaces indentation on JS files Signed-off-by: Aline Manera --- ui/js/wok.user-log.js | 371 +++++++++++++++++++++++++---------------------= ---- 1 file changed, 184 insertions(+), 187 deletions(-) diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js index 160f9a0..560fbfa 100644 --- a/ui/js/wok.user-log.js +++ b/ui/js/wok.user-log.js @@ -17,228 +17,225 @@ */ =20 wok.initSettings =3D function() { - wok.opts_user_log =3D {}; - wok.opts_user_log['id'] =3D 'user-log-content'; - wok.opts_user_log['gridId'] =3D "user-log-grid"; - wok.opts_user_log['loadingMessage'] =3D i18n['WOKSETT0007M']; - wok.initUserLog(); + wok.opts_user_log =3D {}; + wok.opts_user_log['id'] =3D 'user-log-content'; + wok.opts_user_log['gridId'] =3D "user-log-grid"; + wok.opts_user_log['loadingMessage'] =3D i18n['WOKSETT0007M']; + wok.initUserLog(); }; =20 wok.initUserLogConfig =3D function() { - wok.listUserLogConfig(); + wok.listUserLogConfig(); } =20 wok.listUserLogConfig =3D function() { =20 - var ulGrid =3D []; - var gridFields =3D []; + var ulGrid =3D []; + var gridFields =3D []; =20 - gridFields =3D [{ - "column-id": 'app', - "converter": 'string', - "formatter": "settings-user-log-app", - "title": i18n['WOKSETT0001M'] + gridFields =3D [{ + "column-id": 'app', + "converter": 'string', + "formatter": "settings-user-log-app", + "title": i18n['WOKSETT0001M'] }, { - "column-id": 'user', - "converter": 'string', - "title": i18n['WOKSETT0002M'] + "column-id": 'user', + "converter": 'string', + "title": i18n['WOKSETT0002M'] }, { - "column-id": 'ip', - "converter": 'string', - "title": i18n['WOKSETT0014M'] + "column-id": 'ip', + "converter": 'string', + "title": i18n['WOKSETT0014M'] }, { - "column-id": 'req', - "converter": 'string', - "title": i18n['WOKSETT0003M'] + "column-id": 'req', + "converter": 'string', + "title": i18n['WOKSETT0003M'] }, { - "column-id": 'date', - "converter": 'date-locale-converter', - "order": 'desc', - "title": i18n['WOKSETT0004M'] + "column-id": 'date', + "converter": 'date-locale-converter', + "order": 'desc', + "title": i18n['WOKSETT0004M'] }, { - "column-id": 'time', - "converter": 'time-locale-converter', - "order": 'desc', - "title": i18n['WOKSETT0005M'] + "column-id": 'time', + "converter": 'time-locale-converter', + "order": 'desc', + "title": i18n['WOKSETT0005M'] }, { - "column-id": 'zone', - "converter": 'string', - "width": "6%", - "title": i18n['WOKSETT0013M'] + "column-id": 'zone', + "converter": 'string', + "width": "6%", + "title": i18n['WOKSETT0013M'] }, { - "column-id": 'status', - "converter": 'string', - "width": "7%", - "title": i18n['WOKSETT0015M'] + "column-id": 'status', + "converter": 'string', + "width": "7%", + "title": i18n['WOKSETT0015M'] }, { - "column-id": 'message', - "converter": 'string', - "formatter": "settings-user-log-message", - "sortable": false, - "width": "30%", - "title": i18n['WOKSETT0006M'] - } - ]; - - wok.opts_user_log['gridFields'] =3D JSON.stringify(gridFields); - wok.opts_user_log['converters'] =3D wok.localeConverters; - - ulGrid =3D wok.createBootgrid(wok.opts_user_log); - wok.hideBootgridLoading(wok.opts_user_log); - wok.initUserLogConfigGridData(); + "column-id": 'message', + "converter": 'string', + "formatter": "settings-user-log-message", + "sortable": false, + "width": "30%", + "title": i18n['WOKSETT0006M'] + }]; + + wok.opts_user_log['gridFields'] =3D JSON.stringify(gridFields); + wok.opts_user_log['converters'] =3D wok.localeConverters; + + ulGrid =3D wok.createBootgrid(wok.opts_user_log); + wok.hideBootgridLoading(wok.opts_user_log); + wok.initUserLogConfigGridData(); }; =20 wok.initUserLogConfigGridData =3D function() { - wok.clearBootgridData(wok.opts_user_log['gridId']); - wok.hideBootgridData(wok.opts_user_log); - wok.showBootgridLoading(wok.opts_user_log); - - var labelStyle =3D function(status) { - var result =3D null; - if (status !=3D undefined) { - var firstNumberOfStatus =3D status.toString().charAt(0); - result =3D { - labelColor: "", - labelIcon: "" - }; - switch(firstNumberOfStatus) { - case "1": - case "2": result.labelColor =3D 'label label-info'; result.labelIc= on =3D 'fa fa-check fa-2'; break; - case "3": result.labelColor =3D 'label label-warning'; result.labe= lIcon =3D 'fa fa-times fa-2'; break; - case "4": - case "5": result.labelColor =3D 'label label-danger'; result.label= Icon =3D 'fa fa-times fa-2'; break; - } + wok.clearBootgridData(wok.opts_user_log['gridId']); + wok.hideBootgridData(wok.opts_user_log); + wok.showBootgridLoading(wok.opts_user_log); + + var labelStyle =3D function(status) { + var result =3D null; + if (status !=3D undefined) { + var firstNumberOfStatus =3D status.toString().charAt(0); + result =3D { + labelColor: "", + labelIcon: "" + }; + switch(firstNumberOfStatus) { + case "1": + case "2": result.labelColor =3D 'label label-info'; result= .labelIcon =3D 'fa fa-check fa-2'; break; + case "3": result.labelColor =3D 'label label-warning'; res= ult.labelIcon =3D 'fa fa-times fa-2'; break; + case "4": + case "5": result.labelColor =3D 'label label-danger'; resu= lt.labelIcon =3D 'fa fa-times fa-2'; break; + } + } + return result; } - return result; - } - - wok.getUserLogs(function(result) { - $.each(result, function(index, log){ - var statusLabel =3D labelStyle(log.status); - var userLabel =3D labelStyle(log.user); - if (statusLabel !=3D null) { - log.status =3D " " + log.s= tatus + " "; - } else { - log.status =3D ""; - } - if (userLabel =3D=3D null) { - log.user =3D "N/A"; - } - }) - wok.loadBootgridData(wok.opts_user_log['gridId'], result); - wok.showBootgridData(wok.opts_user_log); - wok.hideBootgridLoading(wok.opts_user_log); - }, function(error) { - wok.message.error(error.responseJSON.reason, '#message-container-area'= ); - wok.hideBootgridLoading(wok.opts_user_log); - }); -}; =20 -wok.initUserLog =3D function() { - $(".content-area", "#wokSettings").css("height", "100%"); - wok.initUserLogConfig(); - $('#advanced-search-button').on('click',function(){ - wok.window.open('tabs/settings-search.html'); - }); - - $("#download-button").on('click',function(){ - var search =3D $('#download-button').data('search'); - if(search){ - search +=3D'&'; - }; - wok.downloadLogs(function(result) { - window.open(result.uri, '_blank'); - }, function(error) { + wok.getUserLogs(function(result) { + $.each(result, function(index, log){ + var statusLabel =3D labelStyle(log.status); + var userLabel =3D labelStyle(log.user); + if (statusLabel !=3D null) { + log.status =3D " "= + log.status + " "; + } else { + log.status =3D ""; + } + if (userLabel =3D=3D null) { + log.user =3D "N/A"; + } + }) + wok.loadBootgridData(wok.opts_user_log['gridId'], result); + wok.showBootgridData(wok.opts_user_log); + wok.hideBootgridLoading(wok.opts_user_log); + }, function(error) { wok.message.error(error.responseJSON.reason, '#message-container-a= rea'); - },search); - }); - - $("#refresh-button").on('click', function(){ - $("#download-button").data('search', ''); - $("#user-log-grid").bootgrid("search"); - wok.initUserLogConfigGridData(); - }); + wok.hideBootgridLoading(wok.opts_user_log); + }); +}; =20 +wok.initUserLog =3D function() { + $(".content-area", "#wokSettings").css("height", "100%"); + wok.initUserLogConfig(); + $('#advanced-search-button').on('click',function(){ + wok.window.open('tabs/settings-search.html'); + }); + + $("#download-button").on('click',function(){ + var search =3D $('#download-button').data('search'); + if(search){ + search +=3D'&'; + }; + wok.downloadLogs(function(result) { + window.open(result.uri, '_blank'); + }, function(error) { + wok.message.error(error.responseJSON.reason, '#message-contain= er-area'); + },search); + }); + + $("#refresh-button").on('click', function(){ + $("#download-button").data('search', ''); + $("#user-log-grid").bootgrid("search"); + wok.initUserLogConfigGridData(); + }); }; =20 wok.initUserLogWindow =3D function() { - var currentLocale =3D wok.lang.get_locale(); - currentLocale =3D currentLocale.substring(0, currentLocale.indexOf('-')); - $("#request-type").selectpicker(); - $.datepicker.setDefaults($.datepicker.regional[currentLocale]); - $("#date").datepicker({ dateFormat: 'yy-mm-dd', - onSelect: function(dateText) { - $('#button-search').prop('disabled',false); - }, - beforeShow: function(input, inst) { - $('#ui-datepicker-div').removeClass(function() { - return $('input').get(0).id; - }); - $('#ui-datepicker-div').addClass(this.id); - } - }); - var pluginsData =3D []; - wok.listPlugins(function(pluginReturn) { + var currentLocale =3D wok.lang.get_locale(); + currentLocale =3D currentLocale.substring(0, currentLocale.indexOf('-'= )); + $("#request-type").selectpicker(); + $.datepicker.setDefaults($.datepicker.regional[currentLocale]); + $("#date").datepicker({ dateFormat: 'yy-mm-dd', + onSelect: function(dateText) { + $('#button-search').prop('disabled',false); + }, + beforeShow: function(input, inst) { + $('#ui-datepicker-div').removeClass(function() { + return $('input').get(0).id; + }); + $('#ui-datepicker-div').addClass(this.id); + } + }); + var pluginsData =3D []; + wok.listPlugins(function(pluginReturn) { $.each(pluginReturn, function(i, obj) { - pluginsData.push({"app": obj}); + pluginsData.push({"app": obj}); }); pluginsData.unshift({"app": "wok"}); var pluginsTt =3D new Bloodhound({ - datumTokenizer: Bloodhound.tokenizers.obj.whitespace('ap= p'), - queryTokenizer: Bloodhound.tokenizers.whitespace, - local: pluginsData - }); + datumTokenizer: Bloodhound.tokenizers.obj.whitespace('app'), + queryTokenizer: Bloodhound.tokenizers.whitespace, + local: pluginsData + }); pluginsTt.initialize(); =20 $('.typeahead').typeahead( - { - autoselect: false - }, { + { + autoselect: false + }, { name: 'application-name', displayKey: 'app', source: pluginsTt.ttAdapter() }); - - }); - - $('#form-advanced-search').submit(function(event) { - event.preventDefault(); - var $inputs =3D $('#form-advanced-search :input').not('button'); - var values =3D {}; - $inputs.each(function() { - if($(this).val()) { - values[this.name] =3D $(this).val(); - } - }); - if(Object.keys(values).length){ - var form =3D $('#form-advanced-search').serialize(); - wok.getFilteredUserLogs(function(result) { - $("#"+wok.opts_user_log['gridId']).bootgrid("clear"); - $("#"+wok.opts_user_log['gridId']).bootgrid("append", result.rec= ords); - $("#download-button").data('search',form); - wok.window.close(); - }, function(err) { - wok.message.error(err.responseJSON.reason, '#alert-modal-contain= er'); - wok.hideBootgridLoading(wok.opts_user_log); - }, form); - }else { - wok.getUserLogs(function(result) { - $("#"+wok.opts_user_log['gridId']).bootgrid("clear"); - $("#"+wok.opts_user_log['gridId']).bootgrid("append", result); - }, function(error) { - wok.message.error(error.responseJSON.reason, '#message-container-a= rea'); - wok.hideBootgridLoading(wok.opts_user_log); - }); - wok.window.close(); - } - }); - - $('#button-search').on('click',function(){ - $('#form-advanced-search :input').each(function(){ - if( $(this).val() =3D=3D=3D '' ){ - $(this).prop('disabled',true); - } - }); - $('#form-advanced-search').submit(); - }); + }); + + $('#form-advanced-search').submit(function(event) { + event.preventDefault(); + var $inputs =3D $('#form-advanced-search :input').not('button'); + var values =3D {}; + $inputs.each(function() { + if($(this).val()) { + values[this.name] =3D $(this).val(); + } + }); + if(Object.keys(values).length){ + var form =3D $('#form-advanced-search').serialize(); + wok.getFilteredUserLogs(function(result) { + $("#"+wok.opts_user_log['gridId']).bootgrid("clear"); + $("#"+wok.opts_user_log['gridId']).bootgrid("append", resu= lt.records); + $("#download-button").data('search',form); + wok.window.close(); + }, function(err) { + wok.message.error(err.responseJSON.reason, '#alert-modal-c= ontainer'); + wok.hideBootgridLoading(wok.opts_user_log); + }, form); + }else { + wok.getUserLogs(function(result) { + $("#"+wok.opts_user_log['gridId']).bootgrid("clear"); + $("#"+wok.opts_user_log['gridId']).bootgrid("append", resu= lt); + }, function(error) { + wok.message.error(error.responseJSON.reason, '#message-con= tainer-area'); + wok.hideBootgridLoading(wok.opts_user_log); + }); + wok.window.close(); + } + }); + + $('#button-search').on('click',function(){ + $('#form-advanced-search :input').each(function(){ + if( $(this).val() =3D=3D=3D '' ){ + $(this).prop('disabled',true); + } + }); + $('#form-advanced-search').submit(); + }); }; --=20 2.9.3 _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel