[Kimchi-devel] [PATCH 2/3] change the stop to power off for VM in UI
Daniel H Barboza
danielhb at linux.vnet.ibm.com
Thu Apr 10 14:16:00 UTC 2014
Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>
On 04/10/2014 06:57 AM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> "Stop" is obscure for user.
> "power off" is more exact than "stop" in literal meaning.
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> ---
> ui/js/src/kimchi.api.js | 6 +++---
> ui/js/src/kimchi.guest_main.js | 6 +++---
> ui/pages/guest.html.tmpl | 4 ++--
> ui/pages/help/guests.dita | 2 +-
> 4 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
> index 0c5c790..84405b3 100644
> --- a/ui/js/src/kimchi.api.js
> +++ b/ui/js/src/kimchi.api.js
> @@ -208,9 +208,9 @@ var kimchi = {
> });
> },
>
> - stopVM : function(vm, suc, err) {
> + poweroffVM : function(vm, suc, err) {
> kimchi.requestJSON({
> - url : kimchi.url + 'vms/' + encodeURIComponent(vm) + '/stop',
> + url : kimchi.url + 'vms/' + encodeURIComponent(vm) + '/poweroff',
> type : 'POST',
> contentType : 'application/json',
> dataType : 'json',
> @@ -221,7 +221,7 @@ var kimchi = {
>
> resetVM : function(vm, suc, err) {
> kimchi.requestJSON({
> - url : kimchi.url + 'vms/' + encodeURIComponent(vm) + '/stop',
> + url : kimchi.url + 'vms/' + encodeURIComponent(vm) + '/poweroff',
> type : 'POST',
> contentType : 'application/json',
> dataType : 'json',
> diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
> index 8a20d07..58e348b 100644
> --- a/ui/js/src/kimchi.guest_main.js
> +++ b/ui/js/src/kimchi.guest_main.js
> @@ -37,13 +37,13 @@ kimchi.vmstart = function(event) {
> }
> };
>
> -kimchi.vmstop = function(event) {
> +kimchi.vmpoweroff = function(event) {
> var button=$(this);
> if (!button.hasClass('loading')) {
> button.addClass('loading');
> var vm=button.closest('li[name=guest]');
> var vm_id=vm.attr("id");
> - kimchi.stopVM(vm_id, function(result) {
> + kimchi.poweroffVM(vm_id, function(result) {
> button.removeClass('loading');
> kimchi.listVmsAuto();
> }, function(err) {
> @@ -248,7 +248,7 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
>
> //Setup action event handlers
> guestActions.find("[name=vm-start]").on({click : kimchi.vmstart});
> - guestActions.find("[name=vm-stop]").on({click : kimchi.vmstop});
> + guestActions.find("[name=vm-poweroff]").on({click : kimchi.vmpoweroff});
> if (vmRunningBool) { //If the guest is not running, do not enable reset
> guestActions.find("[name=vm-reset]").on({click : kimchi.vmreset});
> }
> diff --git a/ui/pages/guest.html.tmpl b/ui/pages/guest.html.tmpl
> index f8edf11..588b7b0 100644
> --- a/ui/pages/guest.html.tmpl
> +++ b/ui/pages/guest.html.tmpl
> @@ -49,7 +49,7 @@
> <div class="top">
> <a class="btn shutoff-disabled" name="vm-reset" href="javascript:void(0);" title="$_("Reset")"><span class="icon reset"></span></a>
> <a class="btn running-hidden" name="vm-start" href="javascript:void(0);" title="$_("Start")"><span class="icon power-down"></span></a>
> - <a class="btn shutoff-hidden" name="vm-stop" href="javascript:void(0);" title="$_("Stop")"><span class="icon power-up"></span></a>
> + <a class="btn shutoff-hidden" name="vm-poweroff" href="javascript:void(0);" title="$_("Power Off")"><span class="icon power-up"></span></a>
> </div>
> <div class="bottom">
> <div name="actionmenu" class="btn dropdown popable vm-action" style="width: 70px">
> @@ -60,7 +60,7 @@
> <button class="button-big running-disabled" name="vm-edit"><span class="text">$_("Edit")</span></button>
> <button class="button-big shutoff-hidden" name="vm-reset"><span class="text">$_("Reset")</span></button>
> <button class="button-big running-hidden" name="vm-start"><span class="text">$_("Start")</span></button>
> - <button class="button-big shutoff-hidden" name="vm-stop"><span class="text">$_("Stop")</span></button>
> + <button class="button-big shutoff-hidden" name="vm-poweroff"><span class="text">$_("Power Off")</span></button>
> <a class="button-big red " name="vm-delete">$_("Delete")</a>
> </div>
> </div>
> diff --git a/ui/pages/help/guests.dita b/ui/pages/help/guests.dita
> index f6e2c6c..61f3dcc 100644
> --- a/ui/pages/help/guests.dita
> +++ b/ui/pages/help/guests.dita
> @@ -35,7 +35,7 @@ guest is not active.</dd>
> <dt>Reset</dt>
> <dd>Click to reset the guest. </dd>
> </dlentry><dlentry>
> -<dt>Power (Start or Stop)</dt>
> +<dt>Power (Start or Power off)</dt>
> <dd>Click to power on or power off the guest. If the icon is red,
> the power is off; if the icon is green, the power is on.</dd>
> </dlentry></dl> </p>
More information about the Kimchi-devel
mailing list