[Kimchi-devel] [PATCHv2 3/3] Display all disk types in storage edit view

Aline Manera alinefm at linux.vnet.ibm.com
Tue Apr 22 17:51:52 UTC 2014


Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>

On 04/22/2014 06:05 AM, lvroyce at linux.vnet.ibm.com wrote:
> From: Royce Lv <lvroyce at linux.vnet.ibm.com>
>
> Instead of just displaying cdrom type in storage edit view,
> Add disk type to storage display view to make sure
> we get the right view after attach and detach new disk.
>
> Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
> ---
>   ui/js/src/kimchi.guest_edit_main.js |  5 ++---
>   ui/pages/guest-edit.html.tmpl       | 17 ++++++++++++++++-
>   2 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
> index 9375c51..eec1214 100644
> --- a/ui/js/src/kimchi.guest_edit_main.js
> +++ b/ui/js/src/kimchi.guest_edit_main.js
> @@ -34,15 +34,14 @@ kimchi.guest_edit_main = function() {
>
>       var refreshCDROMs = function() {
>           kimchi.listVMStorages({
> -            vm: kimchi.selectedGuest,
> -            storageType: 'cdrom'
> +            vm: kimchi.selectedGuest
>           }, function(storages) {
> -            var rowHTML = $('#cdrom-row-tmpl').html();
>               var container = $('#guest-edit-cdrom-row-container');
>               $(container).empty();
>
>               $.each(storages, function(index, storage) {
>                   storage['vm'] = kimchi.selectedGuest;
> +                rowHTML = $('#' + storage['type'] + '-row-tmpl').html();
>                   var templated = kimchi.template(rowHTML, storage);
>                   container.append(templated);
>               });
> diff --git a/ui/pages/guest-edit.html.tmpl b/ui/pages/guest-edit.html.tmpl
> index 804fc39..0405d6f 100644
> --- a/ui/pages/guest-edit.html.tmpl
> +++ b/ui/pages/guest-edit.html.tmpl
> @@ -133,7 +133,22 @@
>           </div>
>       </div>
>   </script>
> -
> +<script id="disk-row-tmpl" type="text/html">
> +    <div>
> +        <div class="guest-edit-wrapper-label">
> +            <label for="disk-{dev}">{dev}</label>
> +        </div>
> +        <div class="guest-edit-wrapper-controls">
> +            <input id="disk-{dev}" name="disk" type="text"
> +                data-vm="{vm}" data-dev="{dev}"
> +                value="{path}" readonly="readonly" />
> +            <button class="guest-edit-cdrom-button detach"
> +                data-vm="{vm}" data-dev="{dev}"
> +                title="$_("Detach")">
> +            </button>
> +        </div>
> +    </div>
> +</script>
>   <script type="text/javascript">
>       kimchi.guest_edit_main();
>   </script>




More information about the Kimchi-devel mailing list