[Kimchi-devel] [PATCH] [Wok] Refresh functionality to user activity log

Socorro Stoppler socorro at linux.vnet.ibm.com
Thu Jun 9 22:27:55 UTC 2016


Reviewed-by: Socorro Stoppler <socorro at linux.vnet.ibm.com>
Tested-by: Socorro Stoppler <socorro at linux.vnet.ibm.com>

On 06/09/2016 01:51 PM, peterpnns at gmail.com wrote:
> From: peterpennings <peterpnns at gmail.com>
>
> Signed-off-by: peterpennings <peterpnns at gmail.com>
> ---
>   ui/js/wok.user-log.js            | 23 ++++++++---------------
>   ui/pages/tabs/settings.html.tmpl |  2 +-
>   2 files changed, 9 insertions(+), 16 deletions(-)
>
> diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js
> index e787ee6..501bb87 100644
> --- a/ui/js/wok.user-log.js
> +++ b/ui/js/wok.user-log.js
> @@ -16,7 +16,7 @@
>    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
>    */
>
> - wok.initSettings = function() {
> +wok.initSettings = function() {
>     wok.opts_user_log = {};
>     wok.opts_user_log['id'] = 'user-log-content';
>     wok.opts_user_log['gridId'] = "user-log-grid";
> @@ -127,7 +127,7 @@ wok.initUserLogConfigGridData = function() {
>     }, function(error) {
>       wok.message.error(error.responseJSON.reason, '#message-container-area');
>       wok.hideBootgridLoading(wok.opts_user_log);
> -    });
> +  });
>   };
>
>   wok.initUserLog = function() {
> @@ -149,6 +149,12 @@ wok.initUserLog = function() {
>         },search);
>     });
>
> +  $("#refresh-button").on('click', function(){
> +    $("#download-button").data('search', '');
> +    $("#user-log-grid").bootgrid("search");
> +    wok.initUserLogConfigGridData();
> +  });
> +
>   };
>
>   wok.initUserLogWindow = function() {
> @@ -205,7 +211,6 @@ wok.initUserLogWindow = function() {
>           wok.getFilteredUserLogs(function(result) {
>             $("#"+wok.opts_user_log['gridId']).bootgrid("clear");
>             $("#"+wok.opts_user_log['gridId']).bootgrid("append", result.records);
> -          $("#reset-button").removeClass('hidden');
>             $("#download-button").data('search',form);
>             wok.window.close();
>           }, function(err) {
> @@ -224,18 +229,6 @@ wok.initUserLogWindow = function() {
>         }
>     });
>
> -  $("#reset-button").on('click',function(){
> -    wok.getUserLogs(function(result) {
> -        $("#"+wok.opts_user_log['gridId']).bootgrid("clear");
> -        $("#"+wok.opts_user_log['gridId']).bootgrid("append", result);
> -        $("#reset-button").addClass('hidden');
> -        $("#download-button").data('search', '');
> -      }, function(error) {
> -        wok.message.error(error.responseJSON.reason, '#message-container-area');
> -        wok.hideBootgridLoading(wok.opts_user_log);
> -      });
> -  });
> -
>     $('#button-search').on('click',function(){
>          $('#form-advanced-search :input').each(function(){
>            if( $(this).val() === '' ){
> diff --git a/ui/pages/tabs/settings.html.tmpl b/ui/pages/tabs/settings.html.tmpl
> index 8493403..8701885 100644
> --- a/ui/pages/tabs/settings.html.tmpl
> +++ b/ui/pages/tabs/settings.html.tmpl
> @@ -54,7 +54,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
>                     <div id="user-log-actions" class="pull-left">
>                       <button id="advanced-search-button" class="btn btn-primary">$_('Advanced Search')</button>
>                       <button id="download-button" class="btn btn-primary" data-search="">$_('Download')</button>
> -                    <button id="reset-button" class="btn btn-primary hidden">$_('Reset To Default')</button>
> +                    <button id="refresh-button" class="btn btn-primary">$_('Refresh')</button>
>                     </div>
>                   </div>
>                   <div id="user-log-content" class="row col-md-12">




More information about the Kimchi-devel mailing list