diff --git a/static/terraboard-vuejs/src/views/State.vue b/static/terraboard-vuejs/src/views/State.vue
index 0791561c..a851db56 100644
--- a/static/terraboard-vuejs/src/views/State.vue
+++ b/static/terraboard-vuejs/src/views/State.vue
@@ -83,7 +83,7 @@
id="resFilterInput"
class="form-control"
type="search"
- v-model="resFilter"
+ v-model="resFilter.value"
placeholder="Filter resources..."
/>
@@ -97,13 +97,13 @@
class="node-name"
v-bind:class="{ selected: mod == selectedMod }"
>
-
{{mod.path ? mod.path : "root"}}{{(this.resFilter == "" ? "" : this.filteredResLength+"/")+mod.resources.length}}{{mod.path ? mod.path : "root"}}
- {
- if (mod.name.lastIndexOf(filter, 0) === 0) {
- res.push(mod);
+ module.resources.forEach((resource: any) => {
+ if ((resource.type+"."+resource.name).includes(this.resFilter.value)) {
+ res.push(resource);
}
});
- this.filteredRes = res;
- this.filteredResLength = res.length;
+ this.resFilter.module.set(module.path, {
+ resources: res,
+ length: res.length,
+ });
return res;
}
- return modules;
+ return module.resources;
},
fetchLocks(): void {
const url = `/api/locks`;
@@ -454,6 +457,14 @@ import StatesCompare from "../components/StatesCompare.vue";
},
updated() {
hljs.highlightAll();
+ if(this.state.details.modules != undefined) {
+ this.state.details.modules.forEach((mod: any) => {
+ const span = document.getElementById("modSpan-"+mod.path) as HTMLSpanElement;
+ span.innerHTML = (this.resFilter.value == "" || this.resFilter.module.get(mod.path) === undefined)
+ ? mod.resources.length
+ : this.resFilter.module.get(mod.path).length+"/"+mod.resources.length;
+ });
+ }
}
})
export default class State extends Vue {}