From nobody Wed Jan 15 16:25:42 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 1485950687654888.0964068450749; Wed, 1 Feb 2017 04:04:47 -0800 (PST) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id F37EB8205EF; Wed, 1 Feb 2017 12:04:43 +0000 (UTC) Received: from mail-qt0-f177.google.com (mail-qt0-f177.google.com [209.85.216.177]) by lists.ovirt.org (Postfix) with ESMTPS id 4012E8205C6 for ; Wed, 1 Feb 2017 12:03:54 +0000 (UTC) Received: by mail-qt0-f177.google.com with SMTP id k15so262333976qtg.3 for ; Wed, 01 Feb 2017 04:03:54 -0800 (PST) Received: from arthas.ltc.br.ibm.com.com ([177.99.122.130]) by smtp.gmail.com with ESMTPSA id m30sm18461059qtg.10.2017.02.01.04.03.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 04:03:53 -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=qFytjANxwhuv5dw8ihTPVPmvUFGEkRKWAxkoSw5PuU7iATE5oS/FkzRv302LjHaw7n mvMR+7HI+yYXLv4I47TkjG41cWfdvuaad98DSAPy0OHuwrsG1jvXuFpzQEuTGAqH2CKU lu7XnH/vnDSxS3eHLaSTO04x0X9okAiOQHzb7eYkWmXaZwmTbphxZt2/rP9vW1Ng2YI7 IhG2mn8GsSVzcI/2zdV0iNch2udwrrTHrvb+owFxPv1Tld8AhZmRhmQ6Q/fZqtd3ax6H GrOQKHZhk1bUuFnmv3o5LBIHnky+C6lCeqGQpHMTljBT3bAfv7Uu/XaZWGMreFQpFCwE 7XfQ== 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=iOjQwUZ0isZ4voLHVtQGZIZVYOJM8PPFiCwQpefO9kYfWVLKxmLnNrgxoILWaHtsEX 1UnuO9jb6mL7rr4fhh9KRwsLhHxOd7oVeJfAgoJSkul53UThMKmHy2l54Wekscm1r0Sw Z9CcNnkhv26n/1/WdlXkjmuWoEdrvykC0QR0I+I+Nbg0lJdi1eO7/9x0t0+VI/pWomge gPugSnkdYOhqyZnhOlIqgO/D/7Zg2FuA/tczpIFu6X5OJrD0h5IZHMKrC+8NZV0BCEIw xA6TkjPOPdhXi9EuKZdrLESkzKlKSTAYuPeM5zO1c3NagDQ3Xvvczge12lIAxk+1YtYZ GByg== X-Gm-Message-State: AIkVDXK17kDtoVtJS+p3CM666Z20IHq9bEnjNuwPor9griSGstCm1iWqpbEzmSv2PP074g== X-Received: by 10.200.48.110 with SMTP id g43mr2153370qte.277.1485950633371; Wed, 01 Feb 2017 04:03:53 -0800 (PST) From: To: Kimchi Devel Date: Wed, 1 Feb 2017 10:03:27 -0200 Message-Id: <20170201120327.477-3-dhbarboza82@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170201120327.477-1-dhbarboza82@gmail.com> References: <20170201120327.477-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