Skip to content

Commit

Permalink
fix the bug of not loaded icons in the alert component (#1419)
Browse files Browse the repository at this point in the history
* fix the Some Icons are not loading in the Alert component in the node page

* fix the missing icons in the control page alert

* fix the ams comp.

* fix dialog
  • Loading branch information
mabasian authored Aug 24, 2023
1 parent cff96da commit ed32826
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}"
@mouseenter="
(cursorLocation = `the current epoch: ${currentResult.currentEpoch} and the slot number is ${
n.slotNumber === 0 ? 'null' : n.slotNumber
n.slotNumber === 0 ? 'N/A' : n.slotNumber
}`),
dialogOpen(currentResult.currentEpoch, n.slotNumber, n.slotStatus),
(epochType = 'proposed ')
Expand Down
20 changes: 18 additions & 2 deletions launcher/src/components/UI/the-control/ControlAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@
@mouseleave="cursorLocation = ''"
>
<div class="icon-box">
<img :src="item.sIcon" alt="warn_storage" />
<img :src="iconFilter(item)" alt="warn_storage" />
</div>
<div class="message">
<div class="main-message" @click="showUpdate">
<span>{{ item.name }} UPDATE</span>
<span>{{ nameFilter(item) }} UPDATE</span>
</div>
<div class="val-message">
<span>{{ item.version }}</span>
Expand Down Expand Up @@ -265,6 +265,22 @@ export default {
this.cpuMeth();
},
methods: {
nameFilter(arg) {
if (arg.name === "PrometheusNodeExporter") {
return "Node Exporter";
} else {
return arg.name;
}
},
iconFilter(arg) {
if (arg.name === "PrometheusNodeExporter") {
return "/img/icon/plugin-icons/Other/PrometheusNodeExporter-s.png";
} else if (arg.name === "Notification") {
return "/img/icon/plugin-icons/Other/NotifierService-s.png";
} else {
return arg.sIcon;
}
},
expertHandler(el) {
let selectedObject = this.installedServices.find((obj) => obj.config.serviceID === el);
selectedObject.expertOptionsModal = true;
Expand Down
2 changes: 1 addition & 1 deletion launcher/src/components/UI/the-control/TooltipDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
green: status == 'proposed',
red: status == 'missed',
}"
>{{ slot == 0 ? "null" : formatValues(slot) }}</span
>{{ slot == 0 ? "N/A" : formatValues(slot) }}</span
>
</div>
</div>
Expand Down
30 changes: 26 additions & 4 deletions launcher/src/components/UI/the-node/NodeAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@
@click="showUpdate"
>
<div class="message-icon">
<img :src="item.sIcon" alt="warn_storage" />
<img :src="iconFilter(item)" alt="warn_storage" />
</div>
<div class="message-text_container">
<div class="message-text_container update-items">
<div class="main-message">
<span>{{ item.name }} UPDATE</span>
<span>{{ nameFilter(item) }} UPDATE</span>
</div>
<div class="val-message">
<span>{{ item.version }}</span>
Expand All @@ -154,7 +154,7 @@

<script>
import ControlService from "@/store/ControlService";
import { useControlStore } from "../../../store/theControl";
import { useControlStore } from "@/store/theControl";
import { mapWritableState } from "pinia";
import { useNodeHeader } from "@/store/nodeHeader";
import { useServices } from "@/store/services";
Expand Down Expand Up @@ -203,6 +203,7 @@ export default {
...mapWritableState(useFooter, {
cursorLocation: "cursorLocation",
}),
usedPercInt() {
return parseInt(this.usedPerc);
},
Expand Down Expand Up @@ -233,6 +234,7 @@ export default {
}
return update;
});
console.log("updatedUpdates", updatedUpdates);
return updatedUpdates;
},
},
Expand Down Expand Up @@ -278,6 +280,22 @@ export default {
this.cpuMeth();
},
methods: {
nameFilter(arg) {
if (arg.name === "PrometheusNodeExporter") {
return "Node Exporter";
} else {
return arg.name;
}
},
iconFilter(arg) {
if (arg.name === "PrometheusNodeExporter") {
return "/img/icon/plugin-icons/Other/PrometheusNodeExporter-s.png";
} else if (arg.name === "Notification") {
return "/img/icon/plugin-icons/Other/NotifierService-s.png";
} else {
return arg.sIcon;
}
},
expertHandler(el) {
let selectedObject = this.installedServices.find((obj) => obj.config.serviceID === el);
selectedObject.expertOptionsModal = true;
Expand Down Expand Up @@ -375,6 +393,10 @@ export default {
</script>

<style scoped>
.update-items {
height: 90% !important;
justify-content: center !important;
}
.pointer {
cursor: pointer;
}
Expand Down

0 comments on commit ed32826

Please sign in to comment.