client-app/app/controllers/index.js in logster-2.14.0 vs client-app/app/controllers/index.js in logster-2.15.0
- old
+ new
@@ -6,13 +6,16 @@
ajax,
getLocalStorage,
setLocalStorage,
} from "client-app/lib/utilities";
import Preload from "client-app/lib/preload";
+import { tracked } from "@glimmer/tracking";
@classic
export default class IndexController extends Controller {
+ @tracked loading = false;
+
showDebug = getLocalStorage("showDebug", false);
showInfo = getLocalStorage("showInfo", false);
showWarn = getLocalStorage("showWarn", true);
showErr = getLocalStorage("showErr", true);
showFatal = getLocalStorage("showFatal", true);
@@ -39,11 +42,13 @@
return null;
}
async doSearch(term) {
this.model.set("search", term);
+ this.loading = true;
await this.model.reload();
+ this.loading = false;
this.model.updateSelectedRow();
}
resizePanels(amount) {
const bottomPanel = document.getElementById("bottom-panel");
@@ -80,11 +85,13 @@
@action
async clear() {
// eslint-disable-next-line no-alert
if (confirm("Clear the logs?\n\nCancel = No, OK = Clear")) {
await ajax("/clear", { type: "POST" });
+ this.loading = true;
this.model.reload();
+ this.loading = false;
}
}
@action
removeMessage(msg) {
@@ -142,10 +149,12 @@
@action
async updateFilter(name) {
this.toggleProperty(name);
this.model.set(name, this[name]);
setLocalStorage(name, this[name]);
+ this.loading = true;
await this.model.reload();
+ this.loading = false;
this.model.updateSelectedRow();
}
@action
updateSearch(event) {