[Kimchi-devel] [PATCH v3] Remove debug report's file path from UI

Shu Ming shuming at linux.vnet.ibm.com
Mon Mar 17 03:26:37 UTC 2014


Reviewed-by: Shu Ming<shuming at linux.vnet.ibm.com>

2014-03-14Fr的 10:43 +0800,Mark Wu:
> Now the file path displayed on UI is "/data/debugreports/<reportname>/",
> It's misleading because people could assume it's path on file system,
> but it's the uri path in fact. We don't need expose the URI path because
> the download button can help user to get the file. So this patch removes
> it from UI.  And this patch also renames debug report's 'file' attribute
> to 'uri', because we use it to represent the download uri path.
> 
> Signed-off-by: Mark Wu <wudxw at linux.vnet.ibm.com>
> ---
>  docs/API.md                        | 2 +-
>  src/kimchi/control/debugreports.py | 2 +-
>  src/kimchi/model/debugreports.py   | 2 +-
>  ui/css/theme-default/host.css      | 4 ----
>  ui/js/src/kimchi.host.js           | 4 ----
>  ui/pages/i18n.html.tmpl            | 1 -
>  6 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/docs/API.md b/docs/API.md
> index 672ef14..105498a 100644
> --- a/docs/API.md
> +++ b/docs/API.md
> @@ -672,7 +672,7 @@ specific to the low level collection tool being used.
> 
>  * **GET**: Retrieve the full description  of Debug Report
>      * name: The debug report  name used to identify the report
> -    * file: The debug report  file name used to identify the report
> +    * uri: The URI path to download a debug report
>      * time: The time when the debug report is created
> 
>  * **DELETE**: Remove the Debug Report
> diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py
> index 9922cfa..6efae23 100644
> --- a/src/kimchi/control/debugreports.py
> +++ b/src/kimchi/control/debugreports.py
> @@ -37,7 +37,7 @@ class DebugReport(Resource):
>      @property
>      def data(self):
>          return {'name': self.ident,
> -                'file': self.info['file'],
> +                'uri': self.info['uri'],
>                  'time': self.info['ctime']}
> 
> 
> diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py
> index c6e698b..6ae282a 100644
> --- a/src/kimchi/model/debugreports.py
> +++ b/src/kimchi/model/debugreports.py
> @@ -162,7 +162,7 @@ class DebugReportModel(object):
>          ctime = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime(ctime))
>          file_target = os.path.split(file_target)[-1]
>          file_target = os.path.join("/data/debugreports", file_target)
> -        return {'file': file_target,
> +        return {'uri': file_target,
>                  'ctime': ctime}
> 
>      def delete(self, name):
> diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css
> index 0f8b941..8af34f5 100644
> --- a/ui/css/theme-default/host.css
> +++ b/ui/css/theme-default/host.css
> @@ -215,14 +215,10 @@
>  }
> 
>  .debug-report-name,
> -.debug-report-file,
>  .debug-report-time {
>      width: 200px;
>  }
> 
> -.debug-report-file {
> -    width: 300px;
> -}
>  /* End of Debug Report */
> 
>  /* Software Updates */
> diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
> index 6300f37..fa7b4c8 100644
> --- a/ui/js/src/kimchi.host.js
> +++ b/ui/js/src/kimchi.host.js
> @@ -186,10 +186,6 @@ kimchi.host_main = function() {
>                  label: i18n['KCHDR6003M'],
>                  'class': 'debug-report-name'
>              }, {
> -                name: 'file',
> -                label: i18n['KCHDR6004M'],
> -                'class': 'debug-report-file'
> -            }, {
>                  name: 'time',
>                  label: i18n['KCHDR6005M'],
>                  'class': 'debug-report-time'
> diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
> index 2f47e50..a626759 100644
> --- a/ui/pages/i18n.html.tmpl
> +++ b/ui/pages/i18n.html.tmpl
> @@ -92,7 +92,6 @@ var i18n = {
>      'KCHDR6001M': "$_("Debug report will be removed permanently and can't be recovered. Do you want to continue?")",
>      'KCHDR6002M': "$_("Debug Reports")",
>      'KCHDR6003M': "$_("Name")",
> -    'KCHDR6004M': "$_("File Path")",
>      'KCHDR6005M': "$_("Generated Time")",
>      'KCHDR6006M': "$_("Generate")",
>      'KCHDR6007M': "$_("Generating...")",







More information about the Kimchi-devel mailing list