Skip to content

Commit

Permalink
show new options in Options panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwin Dondorp committed Dec 21, 2023
1 parent c608bb4 commit 3c6a324
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
6 changes: 6 additions & 0 deletions saltgui/static/scripts/panels/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ export class LoginPanel extends Panel {
const hideJobs = wheelConfigValuesData.saltgui_hide_jobs;
Utils.setStorageItem("session", "hide_jobs", JSON.stringify(hideJobs));

const useCacheForGrains = wheelConfigValuesData.saltgui_use_cache_for_grains;
Utils.setStorageItem("session", "use_cache_for_grains", JSON.stringify(useCacheForGrains));

const useCacheForPillars = wheelConfigValuesData.saltgui_use_cache_for_pillars;
Utils.setStorageItem("session", "use_cache_for_pillars", JSON.stringify(useCacheForPillars));

const syndicMaster = wheelConfigValuesData.syndic_master;
Utils.setStorageItem("session", "syndic_master", syndicMaster);

Expand Down
40 changes: 40 additions & 0 deletions saltgui/static/scripts/panels/Options.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ export class OptionsPanel extends Panel {
],
["preview-grains", "saltgui", "(none)"],
["public-pillars", "saltgui", "(none)"],
[
"use-cache-for-grains", "saltgui", "false",
[["grains", "true", "false"]]
],
[
"use-cache-for-pillar", "saltgui", "false",
[["pillar", "true", "false"]]
],
["templates", "saltgui", "(none)"],
[
"tooltip-mode", "saltgui", "full",
Expand Down Expand Up @@ -179,6 +187,14 @@ export class OptionsPanel extends Panel {
radio.addEventListener("change", () => {
this._newFullReturn();
});
} else if (pName === "use-cache-for-grains") {
radio.addEventListener("change", () => {
this._newUseCacheForGrains();
});
} else if (pName === "use-cache-for-pillar") {
radio.addEventListener("change", () => {
this._newUseCacheForPillar();
});
}

if (pName === "state-output" && itemValue === "full_id") {
Expand Down Expand Up @@ -460,6 +476,30 @@ export class OptionsPanel extends Panel {
Router.currentPage.stats.onShow();
}

_newUseCacheForGrains () {
let value = "";
/* eslint-disable curly */
if (this._isSelected("use-cache-for-grains", "grains", "false")) value = "false";
if (this._isSelected("use-cache-for-grains", "grains", "true")) value = "true";
value = value.replace(/^,/, "");
/* eslint-enable curly */
const useCacheForGrainsTd = this.div.querySelector("#option-use-cache-for-grains-value");
useCacheForGrainsTd.innerText = value || "(none)";
Utils.setStorageItem("session", "use_cache_for_grains", value);
}

_newUseCacheForPillar () {
let value = "";
/* eslint-disable curly */
if (this._isSelected("use-cache-for-pillar", "pillar", "false")) value = "false";
if (this._isSelected("use-cache-for-pillar", "pillar", "true")) value = "true";
value = value.replace(/^,/, "");
/* eslint-enable curly */
const useCacheForPillarTd = this.div.querySelector("#option-use-cache-for-pillar-value");
useCacheForPillarTd.innerText = value || "(none)";
Utils.setStorageItem("session", "use_cache_for_pillar", value);
}

_newDatetimeFractionDigits () {
let value = "";
/* eslint-disable curly */
Expand Down

0 comments on commit 3c6a324

Please sign in to comment.