From 092e1c37b1ad47b72645aace493dc88ae665fbc8 Mon Sep 17 00:00:00 2001 From: Young Gyu Park Date: Tue, 13 Mar 2018 17:59:30 +0900 Subject: Showing loading indicator while handling the zip log file. Test: Tested with browser on GAE(go/vts-web-staging/show_gcs_log) Bug: 74508542 Change-Id: Iff0932678623de31d2228ebf96708ee9d8892bd9 --- src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp | 118 +++++++++++++++++++-------- src/main/webapp/css/show_gcs_log.css | 25 ++++++ 2 files changed, 110 insertions(+), 33 deletions(-) create mode 100644 src/main/webapp/css/show_gcs_log.css (limited to 'src/main/webapp') diff --git a/src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp b/src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp index 8bdf416..f9f285e 100644 --- a/src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp +++ b/src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp @@ -19,8 +19,7 @@ <%@ include file="header.jsp" %> - - + @@ -37,9 +36,11 @@ startingTop: '4%', // Starting top style attribute endingTop: '10%', // Ending top style attribute ready: function(modal, trigger) { // Callback for Modal open. Modal and trigger parameters available. - if ($(trigger).attr("href") == "#logEntryListModal") { - $(modal).find('#modal-entry-list').find("li").remove(); - paraMap['path'] = trigger.text().trim(); + $('.loading-overlay').show(); + if ($(modal).attr("id") == "logEntryListModal") { + console.log($(trigger)); + $(trigger).addClass("active"); + paraMap['path'] = "${path}" + trigger.text().trim(); var fileName = paraMap['path'].substring(paraMap['path'].lastIndexOf('/')+1); // Getting filename $(modal).find('#entry-list-modal-title').text(fileName); // Set file name for modal window var url = "${requestScope['javax.servlet.forward.servlet_path']}?path=" + paraMap['path']; @@ -47,8 +48,10 @@ $.get( url, function(data) { var entryList = $(modal).find('#modal-entry-list'); $(data.entryList).each(function( index, element ) { - entryList.append("
  • " + element + "
  • "); + entryList.append("
  • " + element + "
  • "); }); + }).done(function() { + $('.loading-overlay').hide(); }); } else { paraMap['entry'] = trigger.text().trim(); @@ -56,11 +59,18 @@ var entryUrl = "${requestScope['javax.servlet.forward.servlet_path']}?path=" + paraMap['path'] + "&entry=" + paraMap['entry']; $.get( entryUrl, function(data) { $(modal).find('#entry-view-modal-content').text(data.entryContent); + }).done(function() { + $('.loading-overlay').hide(); }); } }, - complete: function() { - console.log("modal closed!"); + complete: function(modal) { + if ($(modal).attr("id") == "logEntryListModal") { + $(modal).find('#modal-entry-list').find("li").remove(); + $("div.collection > a.collection-item.active").removeClass('active') + } else { + $(modal).find('#entry-view-modal-content').text(''); + } } // Callback for Modal close }); }); @@ -69,32 +79,40 @@
    -

    Directory List

    - -

    - - - - (Move to Parent) - - -

    - - -
    -
    Current Directory Path : ${path}

    -

    File List

    - -

    - - - -

    - - -
    +
    +
    +

    Directory List

    + +
    +
    +

    File List

    +
    + + + + + + + +
    +
    +
    +
    @@ -105,7 +123,7 @@ + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + @@ -131,6 +166,23 @@ + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + diff --git a/src/main/webapp/css/show_gcs_log.css b/src/main/webapp/css/show_gcs_log.css new file mode 100644 index 0000000..1960485 --- /dev/null +++ b/src/main/webapp/css/show_gcs_log.css @@ -0,0 +1,25 @@ +/* Copyright (C) 2018 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +.loading-overlay { + display: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #A8A8A8; + opacity: 0.4; +} -- cgit v1.2.3