Skip to content

Commit

Permalink
Revert "Merged Staging & Custom look (#155)"
Browse files Browse the repository at this point in the history
This reverts commit 9845774.
  • Loading branch information
GuilhemSempere committed Oct 9, 2024
1 parent 9845774 commit d3e7f99
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 193 deletions.
292 changes: 146 additions & 146 deletions src/main/webapp/ProgressWatch.jsp
Original file line number Diff line number Diff line change
@@ -1,147 +1,147 @@
<%--
* GIGWA - Genotype Investigator for Genome Wide Analyses
* Copyright (C) 2016 - 2019, <CIRAD> <IRD>
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License, version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* See <http://www.gnu.org/licenses/agpl.html> for details about GNU General
* Public License V3.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="UTF-8" import="fr.cirad.web.controller.gigwa.GigwaRestController"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<jsp:useBean id="appConfig" class="fr.cirad.tools.AppConfig" />

<html>

<head>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
<script type="text/javascript">
var progressUrl = "<c:url value='<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.PROGRESS_PATH%>' />";
var abortUrl = "<c:url value='<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.ABORT_PROCESS_PATH%>' />";
var downloadURL = "${param.successURL}";
var fileName = downloadURL.substring(downloadURL.lastIndexOf("/") + 1);
if (fileName.startsWith("?"))
fileName = location.origin + '<c:url value='/' />' + fileName;
var processAborted = false;
<c:if test="${param.exportFormat != null}">
var galaxyPushURL = '<c:url value="<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.GALAXY_HISTORY_PUSH%>" />';
var onlineOutputTools = null;
var igvDataLoadPort, igvGenomeListUrl;
<c:set var="igvDataLoadPort" value="<%= appConfig.get(\"igvDataLoadPort\") %>"></c:set>
<c:set var="igvGenomeListUrl" value="<%= appConfig.get(\"igvGenomeListUrl\") %>"></c:set>
<c:if test='${!fn:startsWith(igvDataLoadPort, "??") && !empty igvDataLoadPort && !fn:startsWith(igvGenomeListUrl, "??") && !empty igvGenomeListUrl}'>
igvDataLoadPort = ${igvDataLoadPort};
igvGenomeListUrl = '<c:url value="<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.IGV_GENOME_LIST_URL %>" />';
</c:if>
$.ajax({
url: '<c:url value="<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.ONLINE_OUTPUT_TOOLS_URL%>" />',
async: true,
type: "GET",
contentType: "application/json;charset=utf-8",
success: function(labelsAndURLs) {
onlineOutputTools = labelsAndURLs;
onlineOutputTools["Custom tool"] = {"url" : "", "formats" : ""};
},
error: function(xhr, thrownError) {
handleError(xhr, thrownError);
}
});
</c:if>
function watchProgress()
{
$.ajax({
url: progressUrl<c:if test="${param.process != null}">+'?progressToken=${param.process}'</c:if>,
type: "GET",
async: false,
<c:if test="${param.token != null}">headers: { "Authorization": "Bearer ${param.token}" },</c:if>
success: function (jsonResult) {
if (jsonResult == null) {
$('body').append('<center id="defaultMsg"><p style="margin-top:60px;" class="bold">No such process is running at the moment.</p><p>Refresh to try again or use the link below to access resulting data in case the process has already finished:<br/><br/><a style="cursor:pointer;" href="' + downloadURL + '">' + (fileName == '?' ? downloadURL : fileName) + '</a></p></center>');
<c:if test="${param.exportFormat != null}">
$.ajax({
type: 'HEAD',
url: downloadURL,
success: function(data, textStatus, jqXHR) {
if (jqXHR.status >= 200 && jqXHR.status < 300) {
successFunction();
$("#defaultMsg").remove();
}
}
});
</c:if>
}
else
{
$('#progress').modal({backdrop: 'static', keyboard: false, show: true});
$('.modal-backdrop.in').css('opacity', '0.1');
displayProcessProgress(5, <c:choose><c:when test="${param.token != null}">'${param.token}'</c:when><c:otherwise>null</c:otherwise></c:choose>, '${param.process}'<c:if test="${param.exportFormat != null}">, successFunction</c:if>);
$('#progress').on('hidden.bs.modal', function () {
if (processAborted)
$('body').append('<center><p style="margin-top:60px;" class="bold">Process aborted</p></center>');
<c:if test="${param.exportFormat == null}">
else if (!$('#progress').data('error'))
$('body').append('<center><p style="margin-top:60px;" class="bold">Process has completed. Data is now <a style="cursor:pointer;" href="' + downloadURL + '">available here</a></center>');
</c:if>
$('#progress').off('hidden.bs.modal');
});
}
},
error: function (xhr, ajaxOptions, thrownError) {
handleError(xhr, thrownError);
}
});
$("div.modal-backdrop").remove();
}
<c:if test="${param.exportFormat != null}">
function successFunction() {
let fileExtensions = "${param.exportFormatExtensions}".split(";");
<c:if test="${param.exportedTsvMetadata eq true}">
fileExtensions.push("tsv");
</c:if>
showServerExportBox(${param.keepExportOnServ}, fileExtensions);
}
</c:if>
</script>
<title>Gigwa process watcher</title>
</head>
<body style='background-color:#f0f0f0;' onload="$('button#abort').css('display', ${param.abortable eq 'true'} ? 'inline' : 'none'); watchProgress();">
<c:if test="${param.exportFormat != null}">
<input type="hidden" id="exportFormat" value="${param.exportFormat}" />
<input type="hidden" id="module" value="${param.module}" />
<input type="hidden" id="galaxyInstanceURL" value="${param.galaxyInstanceUrl}" />
<input type="hidden" id="exportedIndividualCount" value="${param.exportedIndividualCount}" />
<input type="hidden" id="count" value="${param.exportedVariantCount}" />
</c:if>
<div style='background-color:white; width:100%; padding:5px;'><img src="<c:url value='/images/logo.png' />" height="25"></div>
<div id='progress' style='margin-top:50px; margin-left:20%; width:60%; display:block; text-align:center; display:none;'>
<p>This process is running as a background task.</p>
<p>You may leave the main Gigwa page and either keep this one open or copy its URL to check again later.</p>
<h2 id="progressText" class="loading-message" style='margin-top:100px'>Please wait...</h2>
<button class="btn btn-danger btn-sm" id="abort" style="display:none;" type="button" name="abort" onclick="if (confirm('Are you sure?')) abort('${param.process}');">Abort</button>
</div>
<div id="serverExportBox" class="panel" style="position:absolute; margin:0; top:50px; left:calc(50% - 250px); width:400px;"></div>
</body>
<%--
* GIGWA - Genotype Investigator for Genome Wide Analyses
* Copyright (C) 2016 - 2019, <CIRAD> <IRD>
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License, version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* See <http://www.gnu.org/licenses/agpl.html> for details about GNU General
* Public License V3.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="UTF-8" import="fr.cirad.web.controller.gigwa.GigwaRestController"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<jsp:useBean id="appConfig" class="fr.cirad.tools.AppConfig" />

<html>

<head>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
<script type="text/javascript">
var progressUrl = "<c:url value='<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.PROGRESS_PATH%>' />";
var abortUrl = "<c:url value='<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.ABORT_PROCESS_PATH%>' />";
var downloadURL = "${param.successURL}";
var fileName = downloadURL.substring(downloadURL.lastIndexOf("/") + 1);
if (fileName.startsWith("?"))
fileName = location.origin + '<c:url value='/' />' + fileName;
var processAborted = false;
<c:if test="${param.exportFormat != null}">
var galaxyPushURL = '<c:url value="<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.GALAXY_HISTORY_PUSH%>" />';
var onlineOutputTools = null;
var igvDataLoadPort, igvGenomeListUrl;
<c:set var="igvDataLoadPort" value="<%= appConfig.get(\"igvDataLoadPort\") %>"></c:set>
<c:set var="igvGenomeListUrl" value="<%= appConfig.get(\"igvGenomeListUrl\") %>"></c:set>
<c:if test='${!fn:startsWith(igvDataLoadPort, "??") && !empty igvDataLoadPort && !fn:startsWith(igvGenomeListUrl, "??") && !empty igvGenomeListUrl}'>
igvDataLoadPort = ${igvDataLoadPort};
igvGenomeListUrl = '<c:url value="<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.IGV_GENOME_LIST_URL %>" />';
</c:if>
$.ajax({
url: '<c:url value="<%=GigwaRestController.REST_PATH + GigwaRestController.BASE_URL + GigwaRestController.ONLINE_OUTPUT_TOOLS_URL%>" />',
async: true,
type: "GET",
contentType: "application/json;charset=utf-8",
success: function(labelsAndURLs) {
onlineOutputTools = labelsAndURLs;
onlineOutputTools["Custom tool"] = {"url" : "", "formats" : ""};
},
error: function(xhr, thrownError) {
handleError(xhr, thrownError);
}
});
</c:if>
function watchProgress()
{
$.ajax({
url: progressUrl<c:if test="${param.process != null}">+'?progressToken=${param.process}'</c:if>,
type: "GET",
async: false,
<c:if test="${param.token != null}">headers: { "Authorization": "Bearer ${param.token}" },</c:if>
success: function (jsonResult) {
if (jsonResult == null) {
$('body').append('<center id="defaultMsg"><p style="margin-top:60px;" class="bold">No such process is running at the moment.</p><p>Refresh to try again or use the link below to access resulting data in case the process has already finished:<br/><br/><a style="cursor:pointer;" href="' + downloadURL + '">' + (fileName == '?' ? downloadURL : fileName) + '</a></p></center>');
<c:if test="${param.exportFormat != null}">
$.ajax({
type: 'HEAD',
url: downloadURL,
success: function(data, textStatus, jqXHR) {
if (jqXHR.status >= 200 && jqXHR.status < 300) {
successFunction();
$("#defaultMsg").remove();
}
}
});
</c:if>
}
else
{
$('#progress').modal({backdrop: 'static', keyboard: false, show: true});
$('.modal-backdrop.in').css('opacity', '0.1');
displayProcessProgress(5, <c:choose><c:when test="${param.token != null}">'${param.token}'</c:when><c:otherwise>null</c:otherwise></c:choose>, '${param.process}'<c:if test="${param.exportFormat != null}">, successFunction</c:if>);
$('#progress').on('hidden.bs.modal', function () {
if (processAborted)
$('body').append('<center><p style="margin-top:60px;" class="bold">Process aborted</p></center>');
<c:if test="${param.exportFormat == null}">
else if (!$('#progress').data('error'))
$('body').append('<center><p style="margin-top:60px;" class="bold">Process has completed. Data is now <a style="cursor:pointer;" href="' + downloadURL + '">available here</a></center>');
</c:if>
$('#progress').off('hidden.bs.modal');
});
}
},
error: function (xhr, ajaxOptions, thrownError) {
handleError(xhr, thrownError);
}
});
$("div.modal-backdrop").remove();
}
<c:if test="${param.exportFormat != null}">
function successFunction() {
let fileExtensions = "${param.exportFormatExtensions}".split(";");
<c:if test="${param.exportedTsvMetadata eq true}">
fileExtensions.push("tsv");
</c:if>
showServerExportBox(${param.keepExportOnServ}, fileExtensions);
}
</c:if>
</script>
<title>Gigwa process watcher</title>
</head>
<body style='background-color:#f0f0f0;' onload="$('button#abort').css('display', ${param.abortable eq 'true'} ? 'inline' : 'none'); watchProgress();">
<c:if test="${param.exportFormat != null}">
<input type="hidden" id="exportFormat" value="${param.exportFormat}" />
<input type="hidden" id="module" value="${param.module}" />
<input type="hidden" id="galaxyInstanceURL" value="${param.galaxyInstanceUrl}" />
<input type="hidden" id="exportedIndividualCount" value="${param.exportedIndividualCount}" />
<input type="hidden" id="count" value="${param.exportedVariantCount}" />
</c:if>
<div style='background-color:white; width:100%; padding:5px;'><img src="<c:url value='/images/logo.png' />" height="25"></div>
<div id='progress' style='margin-top:50px; margin-left:20%; width:60%; display:block; text-align:center; display:none;'>
<p>This process is running as a background task.</p>
<p>You may leave the main Gigwa page and either keep this one open or copy its URL to check again later.</p>
<h2 id="progressText" class="loading-message" style='margin-top:100px'>Please wait...</h2>
<button class="btn btn-danger btn-sm" id="abort" style="display:none;" type="button" name="abort" onclick="if (confirm('Are you sure?')) abort('${param.process}');">Abort</button>
</div>
<div id="serverExportBox" class="panel" style="position:absolute; margin:0; top:50px; left:calc(50% - 250px); width:400px;"></div>
</body>
</html>
9 changes: 4 additions & 5 deletions src/main/webapp/WEB-INF/jsp/import.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@
<c:set var="supervisorRoleSuffix" value='<%= "$" + IRoleDefinition.ROLE_DB_SUPERVISOR %>' />
<sec:authorize access="hasRole('ROLE_ADMIN')" var="isAdmin"/>
<sec:authorize access="hasRole('ROLE_ANONYMOUS')" var="isAnonymous"/>
<c:set var="customCssFolder" value='<%= new java.io.File(application.getRealPath("/custom/css")).isDirectory() ? "custom/" : "" %>' />

<html>
<head>
<meta charset="utf-8">
<title>Gigwa <%= appVersion == null ? "" : ("v" + appVersion)%></title>
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/bootstrap-select.min.css ">
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/dropzone.css">
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/main.css">
<link type="text/css" rel="stylesheet" href="css/bootstrap-select.min.css ">
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="css/dropzone.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
Expand Down
7 changes: 3 additions & 4 deletions src/main/webapp/WEB-INF/jsp/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<jsp:useBean id="appConfig" class="fr.cirad.tools.AppConfig" />
<c:set var="customCssFolder" value='<%= new java.io.File(application.getRealPath("/custom/css")).isDirectory() ? "custom/" : "" %>' />

<html>
<head>
<meta charset="utf-8">
<title>Gigwa - Login</title>
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/main.css">
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/login.css">
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
<link type="text/css" rel="stylesheet" href="css/login.css">
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
var currentWindow = this;
Expand Down
5 changes: 2 additions & 3 deletions src/main/webapp/cas-logout.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@
String[] splittedAppVersion = appVersion == null ? new String[] {""} : appVersion.split("-");
%>

<c:set var="customCssFolder" value='<%= new java.io.File(application.getRealPath("/custom/css")).isDirectory() ? "custom/" : "" %>' />

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Gigwa <%= appVersion == null ? "" : ("v" + appVersion)%></title>
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="${customCssFolder}css/main.css">
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript">
Expand Down
Loading

0 comments on commit d3e7f99

Please sign in to comment.