diff --git a/css/style.css b/css/style.css index 1df0a78..d0fa8ac 100644 --- a/css/style.css +++ b/css/style.css @@ -1,6 +1,7 @@ :root { --negative-color: #f00; --positive-color: #0f0; + --highlight-color: yellow; --lightbg-text-color: black; --main-bg-color: #404040; --main-text-color: white; diff --git a/images/actions/network/add.svg b/images/actions/network/add.svg new file mode 100644 index 0000000..ec398dd --- /dev/null +++ b/images/actions/network/add.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/index.html b/index.html index 9a030a5..e6d1c37 100644 --- a/index.html +++ b/index.html @@ -61,9 +61,9 @@
- diff --git a/scripts/index.js b/scripts/index.js index c5a5604..9218c38 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -38,9 +38,9 @@ async function getInstances () { } async function populateInstances () { - const searchQuery = document.querySelector("#search").value; + const searchQuery = document.querySelector("#search").value || null; let criteria; - if (searchQuery === "") { + if (!searchQuery) { criteria = (a, b) => { return (a.vmid > b.vmid) ? 1 : -1; }; @@ -64,11 +64,11 @@ async function populateInstances () { }; } instances.sort(criteria); - // console.log(instances) const instanceContainer = document.querySelector("#instance-container"); instanceContainer.innerHTML = ""; for (let i = 0; i < instances.length; i++) { const newInstance = document.createElement("instance-card"); + instances[i].searchQuery = searchQuery; newInstance.data = instances[i]; instanceContainer.append(newInstance); } diff --git a/scripts/instance.js b/scripts/instance.js index b7b1127..03fbb7d 100644 --- a/scripts/instance.js +++ b/scripts/instance.js @@ -53,7 +53,8 @@ class InstanceCard extends HTMLElement { status: this.status, vmid: this.status, name: this.name, - node: this.node + node: this.node, + searchQuery: this.searchQuery }; } @@ -66,6 +67,7 @@ class InstanceCard extends HTMLElement { this.vmid = data.vmid; this.name = data.name; this.node = data.node; + this.searchQuery = data.searchQuery; this.update(); } @@ -74,7 +76,16 @@ class InstanceCard extends HTMLElement { vmidParagraph.innerText = this.vmid; const nameParagraph = this.shadowRoot.querySelector("#instance-name"); - nameParagraph.innerText = this.name ? this.name : ""; + if (this.searchQuery) { + const nameParts = this.name.split(this.searchQuery); + nameParagraph.innerHTML += `${nameParts[0]}`; + for (let i = 1; i < nameParts.length; i++) { + nameParagraph.innerHTML += `${this.searchQuery}${nameParts[i]}`; + } + } + else { + nameParagraph.innerText = this.name ? this.name : ""; + } const typeParagraph = this.shadowRoot.querySelector("#instance-type"); typeParagraph.innerText = this.type; diff --git a/settings.html b/settings.html index 40d7459..0e155f8 100644 --- a/settings.html +++ b/settings.html @@ -61,7 +61,7 @@
App Sync Frequency
-

Sync every

Second(s)

+

Sync every

Second(s)