Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B671018D27 for ; Thu, 12 Nov 2015 05:59:44 +0000 (UTC) Received: (qmail 92369 invoked by uid 500); 12 Nov 2015 05:59:44 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 92315 invoked by uid 500); 12 Nov 2015 05:59:44 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 92303 invoked by uid 99); 12 Nov 2015 05:59:43 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Nov 2015 05:59:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3F9EFC451D for ; Thu, 12 Nov 2015 05:59:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id GCWb-N5bfdq1 for ; Thu, 12 Nov 2015 05:59:34 +0000 (UTC) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 3CFC824E6A for ; Thu, 12 Nov 2015 05:59:33 +0000 (UTC) Received: by padhx2 with SMTP id hx2so54544179pad.1 for ; Wed, 11 Nov 2015 21:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=8ZZcYLjHltcs7pbHgUCaO4LKkcBJxguUAq8pL1Nv0OI=; b=zURXKSZV6vUEKOo5bzB0NPG8zrw7tYtNk5YBPsBmKRlV1fRW3ZHGq43XQoYIi8h17e Gv7EtX5VThGYjx3xcfzQ31u2cwwa1t6m50W9myOsPpmTP96GfcyVYtJr/MNO++0FKcuO PZCepAGT47TCjKVR1TL7HzqZEfgmlQc4Ktm0P1yZTVOJcDxzU3Ila+GFvszhCQjQjM5A 4PO5iv+RQZb2de/aj2i00vLx2J8H377JHL7atNA3tIfffNjALKRA137rkQP3syTP7pdI javDP24DGzlsECTlQmCfT22Z8yO47J2i+LPbz7x3SSPoeZWKlYJdN67Jyqu6eO8mjxcd QVAA== X-Received: by 10.67.24.97 with SMTP id ih1mr20525739pad.65.1447307971834; Wed, 11 Nov 2015 21:59:31 -0800 (PST) Received: from [0.0.0.0] (dev1.cloudsand.com. [162.243.147.22]) by smtp.gmail.com with ESMTPSA id kw16sm12651635pab.34.2015.11.11.21.59.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2015 21:59:31 -0800 (PST) Message-ID: <56442AC3.5000202@gmail.com> Date: Wed, 11 Nov 2015 21:59:31 -0800 From: ilya User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: dev@cloudstack.apache.org Subject: Re: UI customization References: <75c4635ea51b360b375b5b4f8a5d8a3d@ant.ee> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit As per Vadim, plugins is the way to go. Regards -ilya On 11/11/15 6:45 AM, Илья Толстихин wrote: > Many thanks. > > 2015-11-09 18:29 GMT+06:00 Vadim Kimlaychuk : > >> From my opinion better way is to write a plugin: >> http://docs.cloudstack.apache.org/en/latest/plugins.html#how-to-write-a-plugin-overview >> and follow UI customization guide: >> http://support.citrix.com/servlet/KbServlet/download/38315-102-714564/CloudPlatform_4.5_User_Interface_Customization.pdf >> >> Doing direct changes to cloudStack.js that are not contributed back to >> community is guaranteed way to have problems after updates. You will have >> to merge your code with mainstream all the time. >> >> Another way is to implement your own interface based on CS REST API. Doing >> that for just 1 button is overkill for sure, but such changes will never >> end as soon as you start to customize. Think about it. The easiest way is >> not always the best one. >> >> Vadim. >> >> On 2015-11-09 13:58, Kshitij Kansal wrote: >> >> Hi, >>> >>> You can find the scripts at the location >>> "client/target/generated-webapp/scripts/". Make changes to cloudstack.js >>> here. >>> >>> *Note: *First remove the corresponding gz file(in your case >>> cloudstack.js.gz) otherwise the changes won't reflect. >>> >>> *The changes in generated-webapps are not saved and tracked in git. So >>> make >>> sure to copy your changes to actual scripts (in ui/scripts) before finally >>> rebuilding the project. *The changes made this way are directly reflected >>> >>> by refreshing the page. >>> >>> PS: Not sure if its the correct way to develop but it works :). Once >>> again, >>> make sure to copy your changes back to correct scripts before building the >>> project. >>> >>> Regards, >>> Kshitij >>> >>> On Mon, Nov 9, 2015 at 12:34 PM, Wei ZHOU wrote: >>> >>> I guess you worked on old version before. >>> in 4.6, something changed. you might compress cloudStack.js to get >>> cloudStack.js.gz as well. >>> >>> 2015-11-08 15:05 GMT+01:00 Илья Толстихин : >>> >>> Hi all, >>> >>> Could please help with the process of UI customization: >>> >>> I have CloudStack 4.6.0 built from the source. >>> I want to add a custom button to the WebUI menu. >>> In file ui/scripts/cloudStack.js I added my button into sections array >>> >>> *sections: {* >>> * /*** >>> * * Dashboard* >>> * */* >>> * dashboard: {},* >>> * instances: {},* >>> * affinityGroups: {},* >>> * storage: {},* >>> * network: {},* >>> * templates: {},* >>> * events: {},* >>> * projects: {},* >>> * accounts: {},* >>> >>> * domains: {}, //domain-admin and root-admin only* >>> >>> * regions: {}, //root-admin only* >>> * system: {}, //root-admin only* >>> * 'global-settings': {}, //root-admin only* >>> * configuration: {}, //root-admin only* >>> * plugins: {},* >>> * test: {* >>> * title: 'TestSection',* >>> * id: 'TestSection',* >>> * show: function(args){* >>> * var div = document.createElement('div');* >>> * div.innerHTML = "

Test section

";* >>> * return div;* >>> * }* >>> * }* >>> * }* >>> >>> and in sectionPreFilter array >>> >>> *sectionPreFilter: function(args) {* >>> * var sections = [];* >>> >>> * if (isAdmin()) {* >>> * sections = ["dashboard", "instances", "storage", >>> "network", "templates", "accounts", "domains", "events", "system", >>> "global-settings", "configuration", "projects", "regions", >>> "affinityGroups", "test"];* >>> >>> After building the project, the button was added to the menu, but when I >>> edit cloudStack.js and restart jetty UI doesn't change, any changes are >>> applied only after the full project rebuild with command mvn >>> -Pdeveloper,systemvm -DskipTests clean install. >>> Jetty version 6.1.26 >>> >>> How to apply changes without rebuilding project? >>> And is it possible to apply it without restart Jetty? >>> >> >