diff options
author | Young Gyu Park <younggyu@google.com> | 2018-02-27 12:32:50 +0900 |
---|---|---|
committer | Young Gyu Park <younggyu@google.com> | 2018-03-12 17:49:54 +0900 |
commit | 0af022a827becb32bb6132bd505efffd350de242 (patch) | |
tree | 92664185a61da856c180c36855ed970bdf115afc /src/main/webapp | |
parent | 6a63048585642a823cc7d0a339146e6cdd670277 (diff) | |
download | dashboard-0af022a827becb32bb6132bd505efffd350de242.tar.gz |
GCS zip log file viewer by unarchiving the file.
Test: Tested with browser on GAE(go/vts-web-staging/show_gcs_log)
Bug: 73900965
Change-Id: I65d2ea816a8327e333f2e818e2af19a0989e6b63
Diffstat (limited to 'src/main/webapp')
-rw-r--r-- | src/main/webapp/WEB-INF/appengine-web.xml | 1 | ||||
-rw-r--r-- | src/main/webapp/WEB-INF/jsp/error_msg.jsp | 38 | ||||
-rw-r--r-- | src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp | 73 |
3 files changed, 109 insertions, 3 deletions
diff --git a/src/main/webapp/WEB-INF/appengine-web.xml b/src/main/webapp/WEB-INF/appengine-web.xml index 4023fb1..fed561d 100644 --- a/src/main/webapp/WEB-INF/appengine-web.xml +++ b/src/main/webapp/WEB-INF/appengine-web.xml @@ -16,6 +16,7 @@ <threadsafe>true</threadsafe> <sessions-enabled>true</sessions-enabled> <runtime>java8</runtime> + <instance-class>F4_1G</instance-class> <system-properties> <property name="EMAIL_DOMAIN" value="${appengine.emailDomain}" /> diff --git a/src/main/webapp/WEB-INF/jsp/error_msg.jsp b/src/main/webapp/WEB-INF/jsp/error_msg.jsp new file mode 100644 index 0000000..13e6657 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/error_msg.jsp @@ -0,0 +1,38 @@ +<%-- + ~ Copyright (c) 2018 Google Inc. All Rights Reserved. + ~ + ~ 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. + --%> +<%@ page contentType='text/html;charset=UTF-8' language='java' %> +<%@ taglib prefix='fn' uri='http://java.sun.com/jsp/jstl/functions' %> +<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%> + +<html> +<link rel='stylesheet' href='/css/dashboard_main.css'> +<%@ include file='header.jsp' %> +<body> + +<div class='container wide'> + + <div class="card-panel"> + <span class="red-text text-darken-2"> + <h3> <c:out value="${error_title}"></c:out> </h3> + <br/> + <c:out value="${error_message}"></c:out> + </span> + </div> + +</div> +<%@ include file='footer.jsp' %> +</body> +</html> 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 5c175ea..8bdf416 100644 --- a/src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp +++ b/src/main/webapp/WEB-INF/jsp/show_gcs_log.jsp @@ -27,9 +27,42 @@ <script src='js/plan_runs.js'></script> <script src='js/search_header.js'></script> <script type='text/javascript'> - var search; $(document).ready(function() { - + var paraMap = {'path': '', 'entry': ''}; + $('.modal').modal({ + dismissible: true, // Modal can be dismissed by clicking outside of the modal + opacity: .99, // Opacity of modal background + inDuration: 300, // Transition in duration + outDuration: 200, // Transition out duration + 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(); + 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']; + $(modal).find('#downloadLink').prop('href', url + "&action=download"); + $.get( url, function(data) { + var entryList = $(modal).find('#modal-entry-list'); + $(data.entryList).each(function( index, element ) { + entryList.append("<li><a href='#logEntryViewModal'>" + element + "</a></li>"); + }); + }); + } else { + paraMap['entry'] = trigger.text().trim(); + $(modal).find('#entry-view-modal-title').text(paraMap['entry']); + 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); + }); + } + }, + complete: function() { + console.log("modal closed!"); + } // Callback for Modal close + }); }); </script> @@ -55,7 +88,7 @@ <h3>File List</h3> <c:forEach varStatus="fileLoop" var="fileName" items="${fileList}"> <p> - <a href="${requestScope['javax.servlet.forward.servlet_path']}?path=${fileName}"> + <a href="#logEntryListModal"> <c:out value="${fileName}"></c:out> </a> </p> @@ -64,6 +97,40 @@ </c:forEach> </div> </div> + <%@ include file="footer.jsp" %> + + <!-- Modal For Zip file entries --> + <div id="logEntryListModal" class="modal"> + <div class="modal-content"> + <h4 id="entry-list-modal-title" class="truncate"></h4> + <div id="entry-list-modal-content"> + <ul id="modal-entry-list"></ul> + </div> + </div> + <div class="modal-footer"> + <div class="row"> + <div class="col s3 offset-s6"> + <a href="#!" id="downloadLink" class="modal-action modal-close waves-effect waves-green btn">Download</a> + </div> + <div class="col s3"> + <a href="#!" class="modal-action modal-close waves-effect waves-green btn">Close</a> + </div> + </div> + </div> + </div> + + <!-- Modal For Zip file entry's content --> + <div id="logEntryViewModal" class="modal modal-fixed-footer"> + <div class="modal-content"> + <h4 id="entry-view-modal-title" class="truncate"></h4> + <div id="entry-view-modal-content"> + + </div> + </div> + <div class="modal-footer"> + <a href="#!" class="modal-action modal-close waves-effect waves-green btn">Close</a> + </div> + </div> </body> </html> |