Skip to content

Commit

Permalink
show version in (usually hidden) options panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwin Dondorp committed Nov 11, 2023
1 parent c5c41b7 commit 10ac96d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion saltgui/static/scripts/panels/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {Utils} from "../Utils.js";
export class LoginPanel extends Panel {

constructor () {
LoginPanel.version = "SaltGUI v1.30.0-snapshot";

super("login");

this.addTitle("SaltGUI");
Expand Down Expand Up @@ -66,7 +68,7 @@ export class LoginPanel extends Panel {
img.src = "static/images/github.png";
aa.append(img);

const txt = document.createTextNode("SaltGUI v1.30.0-snapshot");
const txt = document.createTextNode(LoginPanel.version);
aa.append(txt);

form.append(aa);
Expand Down
6 changes: 5 additions & 1 deletion saltgui/static/scripts/panels/Options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global */

import {Character} from "../Character.js";
import {LoginPanel} from "../panels/Login.js";
import {Output} from "../output/Output.js";
import {OutputYaml} from "../output/OutputYaml.js";
import {Panel} from "./Panel.js";
Expand All @@ -27,6 +28,7 @@ export class OptionsPanel extends Panel {
this.addTable(["Name", "Value"]);

this.options = [
["saltgui", "version"],
["eauth", "session"],
["user", "session"],
["token", "session"],
Expand Down Expand Up @@ -285,7 +287,9 @@ export class OptionsPanel extends Panel {
const valuesArr = option[3];

let value;
if (category === "session") {
if (category === "version") {
value = LoginPanel.version;
} else if (category === "session") {
value = loginResponse[name];
} else if (category === null) {
value = Utils.getStorageItem("session", name.replace(/-/g, "_"));
Expand Down

0 comments on commit 10ac96d

Please sign in to comment.