Skip to content
Snippets Groups Projects
Commit 3cf25ff5 authored by Tim Kreuzer's avatar Tim Kreuzer
Browse files

wip

parent 39038a2d
No related branches found
No related tags found
No related merge requests found
......@@ -182,6 +182,7 @@ authStateKeys:
- incidentCheck
- binderRepos
- share
- mapSystems
selfapihandler:
allowedAuthStateKeys:
- access_token
......@@ -366,11 +367,15 @@ services:
show: true
type: dropdown
options:
values:
- A
- B
- C
values_func: get_hpc_system
invalidFeedback: "Please choose a System."
label:
type: text
value: "System--:"
value: "System"
onChangeUpdate:
- account
- key: account
......@@ -392,7 +397,7 @@ services:
invalidFeedback: "Please choose a Project."
label:
type: text
value: "Project"
value: "ProjectABC"
onChangeUpdate:
- partition
- key: partition
......
......@@ -9,6 +9,22 @@ define(["jquery"], function (
function get_hpc_system(software_key, tab_key, input_key, values) {
const systems = ["JUWELS", "JURECA", "JEDI", "JUSUF", "DEEP", "JSC-Cloud"];
const entitlements = getEntitlements();
const mapSystems = getMapSystems();
console.log(mapSystems);
const resPattern = /^urn:(.+?(?=:res:)):res:(?<systempartition>[^:]+):[^:]+:act:[^:]+:[^:]+$/;
const systemPartitions = [];
entitlements.forEach(entitlement => {
const match = entitlement.match(resPattern);
if (match) {
const lowersystempartition = match.groups.systempartition.toLowerCase();
const system = mapSystems?.[lowersystempartition];
if ( system && !systemPartitions.includes(system) ) {
systemPartitions.push(system);
}
}
});
console.log(systemPartitions);
return systems;
}
return functions;
......
......@@ -143,6 +143,14 @@ function getHostname() {
return {{hostname | tojson}} || {};
}
function getEntitlements() {
return {{auth_state.get("entitlements", []) | tojson}} || [];
}
function getMapSystems() {
return {{custom_config.get("mapSystems", {}) | tojson }};
}
function getDropdownOptions() {
return {{auth_state.get("options_form", {}).get("dropdown_list", {}) | tojson}};
}
......@@ -340,7 +348,9 @@ require(["jquery", "jhapi", "home/utils", "home/dropdown-options", "home/lab-con
select.append(`<option value="{{versionName}}">{{versionOptions.get("name", versionName)}}</option>`);
{%- endfor %}
select.val(defaultOptionValue);
setTimeout(() => {
select.trigger("change");
}, 50);
{# dropdowns.updateServices("{{ software_key }}", "{{ software }}-{{ new }}"); #}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment