Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
connectbo committed Feb 4, 2022
1 parent ef04dc6 commit 4081076
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docker-test-framework/etc/irods-ext/metalnx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,7 @@ pluggablepublishing.info.timeout=0
pluggablepublishing.publishing.timeout=0

# server rule engine instance that will provide the galleryview listing
gallery_view.rule_engine_plugin.instance_name=irods_rule_engine_plugin-irods_rule_language-instance
gallery_view.rule_engine_plugin.instance_name=irods_rule_engine_plugin-irods_rule_language-instance

# popup text that will be displayed on login page
login.popup.text=
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
Expand Down Expand Up @@ -44,6 +45,9 @@ public class LoginController {
@Autowired
private LoggedUserUtils loggedUserUtils;

@Value("${login.popup.text}")
private String popupText;

@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView loginView(final Model inModel, final HttpServletRequest request,
final HttpServletResponse response) {
Expand Down Expand Up @@ -101,6 +105,8 @@ public ModelAndView loginView(final Model inModel, final HttpServletRequest requ
addAuthTypesAndDefaultAuthToModel(model);
}

model.addObject("popupText", popupText);

return model;
}

Expand Down
27 changes: 26 additions & 1 deletion src/metalnx-web/src/main/resources/static/css/styles-login.css
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ img {
left: 50%;
display: block;
margin-top: -185px;
margin-left: -235px;
margin-left: -260px;
padding: 25px;
width: 520px;
height: 500px;
Expand Down Expand Up @@ -291,3 +291,28 @@ input, textarea, .uneditable-input {
input[type="button"], input[type="radio"], input[type="checkbox"] {
width: auto;
}


.login-popup {
position: absolute;
top: 5%;
left: 50%;
padding: 10px;
background-color: #e6a153;
width: 500px;
margin-left: -250px;
border-radius: 10px;
}

.login-popup-btn {
position: absolute;
right: 1px;
width: 20px;
height: 20px;
opacity: 0.3;
cursor: pointer;
}

.login-popup-btn:hover {
opacity: 1;
}
17 changes: 16 additions & 1 deletion src/metalnx-web/src/main/resources/views/login/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@
<span th:text="#{login.copyright}"></span>
</div> -->
</div>
<div class="login-popup" th:if="${popupText != null and #strings.length(popupText)>0}">
<span class="login-popup-msg" th:text="${popupText}"></span>
<a class="login-popup-btn"><i class="fa fa-times"></i></a>
</div>
</body>

<script>
Expand All @@ -144,7 +148,13 @@
}

for (var i = 0; i < mlxKeys.length; i++) {
localStorage.removeItem(mlxKeys[i]);
if(mlxKeys[i] !== 'metalnx-popup-read') localStorage.removeItem(mlxKeys[i]);
}

var renderRestrictedMsgPopup = localStorage.getItem('metalnx-popup-read')

if(renderRestrictedMsgPopup === 'true') {
$(".login-popup").hide();
}

$(".login form input").keyup(function() {
Expand Down Expand Up @@ -178,6 +188,11 @@
$(this).submit();
});

$(".login-popup-btn").click(function () {
$(".login-popup").hide();
localStorage.setItem('metalnx-popup-read', 'true')
});

function isValidPath(path) {
return path != '' && path.indexOf("/") >= 0 && path.indexOf("/") != path.length - 1;
}
Expand Down

0 comments on commit 4081076

Please sign in to comment.