20 lines
549 B
JavaScript
20 lines
549 B
JavaScript
var app_state = {
|
|
api_endpoint: "http://198.46.176.136:44444",
|
|
api_token: "thisisthetoken",
|
|
should_poll: false,
|
|
show_config_form: false,
|
|
init: function () {
|
|
this.load_state();
|
|
},
|
|
load_state: function () {
|
|
console.log("Loading state");
|
|
this.api_endpoint = localStorage.getItem("endpoint");
|
|
this.api_token = localStorage.getItem("token");
|
|
},
|
|
save_state: function () {
|
|
console.log("Saving state");
|
|
localStorage.setItem("endpoint", this.api_endpoint);
|
|
localStorage.setItem("token", this.api_token);
|
|
},
|
|
};
|