Skip to content

Commit

Permalink
MetaStore: If the user is already logged in, this is now displayed di…
Browse files Browse the repository at this point in the history
…rectly in the 'Search' tab.
  • Loading branch information
VolkerHartmann committed Feb 26, 2024
1 parent 535d7c8 commit c49fdb1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions elastic-search-metastore.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<script src="js/semantic-ui/dropdown.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/keycloak.min.js"></script>
<script src="./js/download.js"></script>
<script src="js/apply-config.js"></script>

<link rel="stylesheet" href="./css/styles.css"/>

Expand Down Expand Up @@ -311,6 +312,16 @@ <h1 class="ui block header">
let from = 0;
let size = page_size;

applyConfig(keycloak, showServiceUrl,appDescription, config, addMessage, (login, username) => {
if(login){
$("#logged_in_as").text("Logged in as " + username);
$("#editor-create-button").removeAttr("disabled");
}else{
$("#logged_in_as").text("Not logged in.");
$("#editor-create-button").attr("disabled", "disabled");
}
});

Handlebars.registerHelper('isOpen', function (list) {
if (list != null && list.indexOf("anonymousUser") > -1) {
return true;
Expand Down Expand Up @@ -438,6 +449,15 @@ <h1 class="ui block header">
from = from + size;
doSearch(true);
});

if (localStorage.getItem("userLoggedIn")) {
localStorage.removeItem("userLoggedIn")
$("#login_button").click();
}

if (typeof keycloak != typeof undefined && config.token == null) {
$("#editor-create-button").attr("disabled", "disabled");
}
addMessage(0, "Search successfully initialized.");


Expand Down

0 comments on commit c49fdb1

Please sign in to comment.