From nobody Wed Jan 15 15:40:19 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 1486145578154985.4792805296371; Fri, 3 Feb 2017 10:12:58 -0800 (PST) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id 9F3C98205B1; Fri, 3 Feb 2017 18:12:56 +0000 (UTC) Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.178]) by lists.ovirt.org (Postfix) with ESMTPS id 78848820581 for ; Fri, 3 Feb 2017 18:12:23 +0000 (UTC) Received: by mail-qk0-f178.google.com with SMTP id s186so6393720qkb.1 for ; Fri, 03 Feb 2017 10:12:23 -0800 (PST) Received: from arthas.ltc.br.ibm.com ([177.99.121.66]) by smtp.gmail.com with ESMTPSA id s2sm25036036qts.25.2017.02.03.10.12.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 10:12:21 -0800 (PST) X-Original-To: kimchi-devel@ovirt.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YEvoHGNDN9Rdar5QWtpKWQelJ/wJv3UaqvT3vwveYt0=; b=PA05EFT0xYZKZ4DdZmuqjuKNYZSXpH7VKMlMLDmyDb4lE51q//kKY/QT0UMx6K+0Pp rjoq90MuGAhvVneDDwmWPTWgA4MiAEWodMUasZVZ0CJgRJZDNuVoGxyYdqo9QCNaxZCQ 7slVAbTuAesRiP67QdkptY2fBdnNIW6rl/g20kx7O1afpF+1oDH8+6IF1IKXFJ6m3vw/ VHpe56k8tIarkDh9lzuVC3rlEzTrh4fbQUH/WTOgIdFUGmfJdkQdqgmGF3CK9gowtxfU CctEeC64F9i/fZgyW4tuZG2OZAeOD6nIl6osTSg8H631m4YI5OoaNnbRj0c3W2ql/nDd lJQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YEvoHGNDN9Rdar5QWtpKWQelJ/wJv3UaqvT3vwveYt0=; b=OnPMW35LPY0dyIZEHaoCgPNkiAGEd9jJIwramrwZO/stpQzSk7/6x+Znqg//ZkPAg5 Ncoh5ZO0kUdPZcWlIU9QiYVKGbFu6lx15FEJwI3Y49iecPRPm2RGM7EualZYEMO2NPnb ivSZ9gFjXTLKK9q/2YshMpMWD1ng6LjaY1qkvg8YR4uecnAE+qSAiobVwcsUTCN0A0zZ 75gZVc0A2iz40OxEa+PPdz45cjyI3CTr0FaITGsFKJUza4Kvlq3/GB9a70M/Xu0OAW8e zRdUMDz/xXBM2vb/jh+WaiOOlOfpcgYtJVBw0A8KFZ0/6XGKtUlu8rrMHPc+Y0Z+qcbd bnTQ== X-Gm-Message-State: AMke39lT9GXSoxJZFWsBVSrt4knCX/zw5cSOdUHmLSX8sQ9h89csP6RHdDj3tPYgOYlnEw== X-Received: by 10.55.19.142 with SMTP id 14mr14687802qkt.206.1486145542408; Fri, 03 Feb 2017 10:12:22 -0800 (PST) From: To: Kimchi Devel Date: Fri, 3 Feb 2017 16:12:02 -0200 Message-Id: <20170203181202.10386-3-dhbarboza82@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203181202.10386-1-dhbarboza82@gmail.com> References: <20170203181202.10386-1-dhbarboza82@gmail.com> Subject: [Kimchi-devel] [PATCH] [WoK 2/2] /config/plugins: changing existing UI calls 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" From: Daniel Henrique Barboza This patch changes ui/js/src/wok.api.js 'listPlugins' method to use the URL /config/plugins instead of /plugins. With this change, ui/js/src/wok.logos.js and ui/js/src/wok.main.js were also changed to handle the different return value from the /config/plugins API. Signed-off-by: Daniel Henrique Barboza --- ui/js/src/wok.api.js | 4 ++-- ui/js/src/wok.logos.js | 11 +++++++---- ui/js/src/wok.main.js | 10 +++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ui/js/src/wok.api.js b/ui/js/src/wok.api.js index e2829ab..c465dfb 100644 --- a/ui/js/src/wok.api.js +++ b/ui/js/src/wok.api.js @@ -1,7 +1,7 @@ /* * Project Wok * - * Copyright IBM Corp, 2015-2016 + * Copyright IBM Corp, 2015-2017 * * Code derived from Project Kimchi * @@ -111,7 +111,7 @@ var wok =3D { =20 listPlugins : function(suc, err, sync) { wok.requestJSON({ - url : 'plugins', + url : '/config/plugins', type : 'GET', contentType : 'application/json', dataType : 'json', diff --git a/ui/js/src/wok.logos.js b/ui/js/src/wok.logos.js index a825108..b4e2d75 100644 --- a/ui/js/src/wok.logos.js +++ b/ui/js/src/wok.logos.js @@ -1,7 +1,7 @@ /* * Project Wok * - * Copyright IBM Corp, 2016 + * Copyright IBM Corp, 2016-2017 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,18 +78,21 @@ wok.logos =3D function(element, powered) { wok.listPlugins(function(plugins) { if(plugins && plugins.length > 0) { $(plugins).each(function(i, p) { + if (p.enabled =3D=3D=3D false) { + return true; + } var url =3D wok.substitute(pluginUrl, { - plugin: p + plugin: p.name }); obj[i] =3D { - name : p + name : p.name } var pluginVersions; pluginVersions =3D retrieveVersion(url); if(pluginVersions && pluginVersions.length > 0){ obj[i].version =3D pluginVersions; } - var imagepath =3D url+'/images/'+p; + var imagepath =3D url+'/images/'+p.name; if(checkImage(imagepath+'.svg') =3D=3D 200) { obj[i].image =3D imagepath+'.svg'; } diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js index c67e97c..6de8ea0 100644 --- a/ui/js/src/wok.main.js +++ b/ui/js/src/wok.main.js @@ -142,16 +142,20 @@ wok.main =3D function() { var tabs =3D retrieveTabs('wok', wokConfigUrl); wok.listPlugins(function(plugins) { $(plugins).each(function(i, p) { + if (p.enabled =3D=3D=3D false) { + return true; + } + var url =3D wok.substitute(pluginConfigUrl, { - plugin: p + plugin: p.name }); var i18nUrl =3D wok.substitute(pluginI18nUrl, { - plugin: p + plugin: p.name }); wok.getI18n(function(i18nObj){ $.extend(i18n, i18nObj)}, function(i18nObj){ //i18n is not define by plu= gin }, i18nUrl, true); - var pluginTabs =3D retrieveTabs(p, url); + var pluginTabs =3D retrieveTabs(p.name, url); if(pluginTabs.length > 0){ tabs.push.apply(tabs, pluginTabs); } --=20 2.9.3 _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel