diff --git a/web/src/components/CustomResourceDefinition.vue b/web/src/components/CustomResourceDefinition.vue index 2e1794b..c2701bf 100644 --- a/web/src/components/CustomResourceDefinition.vue +++ b/web/src/components/CustomResourceDefinition.vue @@ -73,7 +73,7 @@ - {{ condition.severity }}: {{ condition.reason }} + {{ condition.severity }}: {{ condition.reason }} + {{ condition.severity }} + {{ condition.reason }} + Unknown @@ -201,11 +203,9 @@ export default { }, methods: { getType(condition) { - return condition.status - ? "success" - : condition.isError - ? "error" - : "warning"; + if (condition.status === "True") return "success"; + else if (condition.isError || !condition.severity || condition.status === "Unknown") return "error"; // if severity is undefined, we assume it's an error + else return "warning"; }, onScroll(e) { this.scrollY = window.scrollY; @@ -230,7 +230,7 @@ export default { conditions.forEach((e, i) => { this.conditions.push({ type: e.type, - status: e.status === "True", + status: e.status, isError: e.severity === "Error", severity: e.severity, reason: e.reason, @@ -258,6 +258,7 @@ export default { watch: { jsonItems: { handler(val, old) { + console.log("Val is", val); this.setConditions(val?.status?.conditions); }, }, diff --git a/web/src/components/StatusIcon.vue b/web/src/components/StatusIcon.vue index 9172af4..3f9b816 100644 --- a/web/src/components/StatusIcon.vue +++ b/web/src/components/StatusIcon.vue @@ -40,6 +40,12 @@ :color="$vuetify.theme.dark ? 'black' : 'white'" :size="size-2" > mdi-information-variant + mdi-help mdi-information + mdi-help-circle @@ -100,7 +112,9 @@ export default { default: 1.5, type: Number, }, - circle: Boolean, + circle: Boolean, + // If circle is true, the icon will be displayed in a circle with the color in the background. This is meant for the top right corner of a CRD. + // If circle is false, the icon will be displayed in a square with the color as the border. This is meant for the condition chips in the CRD views. spinner: Boolean, left: Boolean, }, @@ -113,6 +127,8 @@ export default { getColor(type) { if (!this.circle) return ""; + if (type === "unknown") return "error"; + if (this.spinner && (type === "warning" || type === "info")) return "warning";