vm-rename: Update API.md for vm rename

Add a PUT method to VM resource and allow 'name' attributes to be updated.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
vm-rename: Update controller

Update controller and json schema to support vm rename.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
vm-rename: Update model for vm edit

Classify vm attributes edit for 2 kinds:
1. live update attr: Attributes updated with libvirt api.
2. static update attr: Attributes updated with re-define xml, for running vm,
   only take effect on next boot.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
vm-rename: Update mockmodel for vm edit

Add mockmodel support for vm rename.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
vm-rename: Update testcases for vm-rename

Updated testcases for model and mockmodel for rename.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
Update storage pool list after activate/deactivate

After activating or deactivating a storage pool, the page may update the
pool list even if the operation has not been finished. That results in
inconsistent information in the UI, like duplicate or missing entries.

Make sure the storage pool list is updated only after the
activate/deactivate operation finishes successfully.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
Sort the storage pool list

The storage pool list is displayed in the order returned by libvirt.

Sort the output alphabetically.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
vm-rename fix: return domain after static config change

domain instance remains the same after static change,
return it to update the domain.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
VM Edit UI

Support VM name editing.

  Depends on:
  * [PATCH] vm-rename fix: return domain after static config change

v2 -> v3:
  3a) Display default icon when returning undefined
  3b) Move "Cores" to "CPUs"

Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Fix low version libvirt bug when get cpuinfo

The low-version libvirt cannot get the correct info of processor.

1) directly reading file '/proc/cpuinfo' to get cpuinfo
2) use function `xreadline` to let it more effective

Signed-off-by: Malcolm Yu <minghaoyusombie@gmail.com>
Expose if the host has at least one system report tool

This is needed to enable/disable system reports on UI.
When the host does not have at least one system report tool the user
will not be able to generate debug reports.
For it, the current debug reports implementation was splitted into small
functions to avoid duplicating code but the functionality remains as it was.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Add sos/sosreport package as Kimchi dependency

Fedora and RHEL distributions provide 'sosreport' command by sos package
and Ubuntu do it by sosreport package.
Adding this package as Kimchi dependency allow the user always has the
debug report feature enabled while working on these systems.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
deep scan: Probe iso information

libvirt only recognizes a storage volume as an iso type if its name
ends with ".iso", otherwise it will be set as raw type.
So adjust the iso link name properly to allow Kimchi probes iso information
(os_distro and os_version) during deep scan

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Format template and storage pool details

The details of templates and storage pools are displayed unformatted
(e.g. "Memory:1024M" instead of "Memory: 1024M").

Change the details layout so that the text formatting looks better.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
Use "dropdown" CSS class on the Edit Template page

The storage pool combo box on the Edit Template page uses a different
CSS class than the rest of the application.

Make the Edit Template page appearance more consistent by applying the
class "dropdown" to the Storage Pool picker.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
UI: deep scan

V3 > V4 Fix issue that not able to close the create template window when not start a deep scan.
        Disable the button when it is "Please, wait...", if select it again the scan will stop.
        Move the position of search button when deep scan finds results.
V2 > V3 Modified according aline's suggestion
        - Always display a button "Search more ISOs" (when shallow scan has results) or "Search ISOs" (when shallow scan does not have results)
        - When this button is selected we warning user it will take long time "It will take long time. Do you want to continue?"
            - If so, we start deep scan and display a loading circle and message in the button ("Please, wait...")
            - When it is done: display the results or a message "No ISOs found"
            - if user gives up of deep scanning (close the window or manually entried a ISO) we need to stop getting the deep scan result (and maybe stop deep scan on backend too)
V1 > V2 Change "More" link to button.
        Omit "No iso found" message.

Add UI for deep scan.

Signed-off-by: Xin Ding <xinding@linux.vnet.ibm.com>
Template update UI return 'cpus' and 'memory' as numbers

This patch corrects the data returned by UI when updating a
template. Cpus and memory values have been returned and written
in database as string.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com>
Add the back-end support of tabs

Make backend support xml and tabs/

There are two kinds of files in tabs.
1 The tab htmls which needs to be puted as tabs in navigation bar.
2 tabs.xml which define the detail way shown the tabs.such as the
  order and the title and path.
  1) order defines the tabs order in the navigation bar.
  2) title defines the name needs be shown in navigation bar.
  3) path defines the tabs path in UI.

This patch provide allow user to visit html in tabs
and will return the static xml in tabs.

Signed-off-by: zhoumeina <zhoumein@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Add the front-end support of tabs

1) Add the tab titles in 18n.html.tmpl

2) Edit the bookmark and reload the html

3)An exmaple of tabs config tabs.xml

4) The patch series have change the tabs files from pages to pages/
tabs so need to make tabs's makefile work, this patch is working
for this purpose.

Make po work for change tabs from pages to pages/tabs

Move the tabs from pages to pages/tabs

To ensure that the tabs files are not together with other kinds
of files, we decide to move tab files to a single folder which
only contain tabs.

This is the configuration of guests, templates, storage.
And if we want to add a new tab, we can put it into pages/tabs.
and add a item in tabs.xml.
Also, we need to add the title in i18n.html.tmpl to make it have
the right translation.

5)Add a sample for plugin.
Signed-off-by: zhoumeina <zhoumein@linux.vnet.ibm.com>
Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Authentication is required to access debugreports

As the other collections, authentication is required.

Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com>