in helper/src/components/portalnav.js [144:179]
function initTabValues (selected, baseTabValues, resetDynamic = false) {
// Apply selected presets to tab values
var tabApplySections = Object.keys(selected.values).reduce((acc, curr) =>
updateTabValues(acc, selected.sections, curr, selected.values[curr])
, baseTabValues)
if (resetDynamic) {
const clusterName = `az-k8s-${(Math.floor(Math.random() * 900000) + 100000).toString(36)}`
// Apply dynamic presets to tab values
tabApplySections = {
...tabApplySections,
deploy: {
...tabApplySections.deploy,
clusterName,
rg: `${clusterName}-rg`
}
}
}
// Apply url params to tab values
tabApplySections = Object.keys(tabApplySections).reduce((acct, currt) => {
return {
...acct,
[currt]: Object.keys(tabApplySections[currt]).reduce((accv, currv) => {
const urlname = `${currt}.${currv}`
let valres = tabApplySections[currt][currv]
if (urlParams.has(urlname)) {
let val = urlParams.get(urlname)
valres = val === "true" ? true : val === "false" ? false : isNaN(val) ? val : parseInt(val)
}
return { ...accv, [currv]: valres }
}, {})
}
}, {})
return tabApplySections
}