From nobody Wed Mar 12 04:42:38 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 1486994282386603.0727916371076; Mon, 13 Feb 2017 05:58:02 -0800 (PST) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id 3A41E8206F9; Mon, 13 Feb 2017 13:58:01 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lists.ovirt.org (Postfix) with ESMTPS id 14A638206E1 for ; Mon, 13 Feb 2017 13:57:22 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1DDr9p5046439 for ; Mon, 13 Feb 2017 08:57:21 -0500 Received: from e24smtp01.br.ibm.com (e24smtp01.br.ibm.com [32.104.18.85]) by mx0a-001b2d01.pphosted.com with ESMTP id 28kaqqrq7q-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 13 Feb 2017 08:57:21 -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:18 -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:17 -0200 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 022F61DC006F for ; Mon, 13 Feb 2017 08:57:18 -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 v1DDvGSr4726832 for ; Mon, 13 Feb 2017 11:57:16 -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 v1DDvGmL005709 for ; Mon, 13 Feb 2017 11:57:16 -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 v1DDv63f005628 for ; Mon, 13 Feb 2017 11:57:14 -0200 X-Original-To: kimchi-devel@ovirt.org From: Aline Manera To: Kimchi Devel Date: Mon, 13 Feb 2017 11:57:00 -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-0000027F03B8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021313-1524-0000-0000-00002A14039C Message-Id: <20170213135704.7556-4-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 3/7] Move AJAX API calls to wok.api.js 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" All the AJAX calls should be placed on wok.api.js Signed-off-by: Aline Manera --- ui/js/src/wok.api.js | 40 ++++++++++++++++++++++++++++++++++++++++ ui/js/wok.user-log.js | 40 ---------------------------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/ui/js/src/wok.api.js b/ui/js/src/wok.api.js index c465dfb..4af3f88 100644 --- a/ui/js/src/wok.api.js +++ b/ui/js/src/wok.api.js @@ -144,5 +144,45 @@ var wok =3D { success : suc, error : err }); + }, + + getUserLogs : function(suc, err) { + wok.requestJSON({ + url : 'logs', + type : 'GET', + contentType : 'application/json', + dataType : 'json', + resend : true, + success : suc, + error : err || function(data) { + wok.message.error(data.responseJSON.reason); + } + }); + }, + + getFilteredUserLogs : function(suc, err, search) { + wok.requestJSON({ + url : 'logs?' + search, + type : 'GET', + contentType : 'application/json', + dataType : 'json', + success : suc, + error : err || function(data) { + wok.message.error(data.responseJSON.reason); + } + }); + }, + + downloadLogs : function(suc, err, search) { + wok.requestJSON({ + url : 'logs?'+search+'download=3DTrue', + type : 'GET', + contentType : 'application/json', + dataType : 'json', + success : suc, + error : err || function(data) { + wok.message.error(data.responseJSON.reason); + } + }); } }; diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js index fa4945f..160f9a0 100644 --- a/ui/js/wok.user-log.js +++ b/ui/js/wok.user-log.js @@ -28,46 +28,6 @@ wok.initUserLogConfig =3D function() { wok.listUserLogConfig(); } =20 -wok.getUserLogs =3D function(suc, err) { - wok.requestJSON({ - url : 'logs', - type : 'GET', - contentType : 'application/json', - dataType : 'json', - resend : true, - success : suc, - error : err || function(data) { - wok.message.error(data.responseJSON.reason); - } - }); -}; - -wok.getFilteredUserLogs =3D function(suc, err, search) { - wok.requestJSON({ - url : 'logs?' + search, - type : 'GET', - contentType : 'application/json', - dataType : 'json', - success : suc, - error : err || function(data) { - wok.message.error(data.responseJSON.reason); - } - }); -}; - -wok.downloadLogs =3D function(suc, err, search) { - wok.requestJSON({ - url : 'logs?'+search+'download=3DTrue', - type : 'GET', - contentType : 'application/json', - dataType : 'json', - success : suc, - error : err || function(data) { - wok.message.error(data.responseJSON.reason); - } - }); -}; - wok.listUserLogConfig =3D function() { =20 var ulGrid =3D []; --=20 2.9.3 _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel