refactor: better toast messages + minor ui improvements

This commit is contained in:
liyasthomas
2021-08-11 16:57:40 +05:30
parent 829e116e04
commit 0738ad1c15
52 changed files with 300 additions and 275 deletions

View File

@@ -227,7 +227,7 @@ export default defineComponent({
this.connectingState = false
this.connectionState = false
this.log.push({
payload: this.$t("error_occurred"),
payload: this.$t("error.something_went_wrong"),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),
@@ -279,7 +279,7 @@ export default defineComponent({
icon: "sync_disabled",
})
} else {
this.$toast.error(this.$t("something_went_wrong"), {
this.$toast.error(this.$t("error.something_went_wrong"), {
icon: "error",
})
}
@@ -298,7 +298,7 @@ export default defineComponent({
} catch (e) {
this.log.push({
payload:
this.$t("error_occurred") +
this.$t("error.something_went_wrong") +
`while publishing msg: ${this.msg} to topic: ${this.pub_topic}`,
source: "info",
color: "#ff5555",
@@ -322,7 +322,7 @@ export default defineComponent({
} catch (e) {
this.log.push({
payload:
this.$t("error_occurred") +
this.$t("error.something_went_wrong") +
`while subscribing to topic: ${this.sub_topic}`,
source: "info",
color: "#ff5555",

View File

@@ -283,9 +283,9 @@ export default defineComponent({
icon: "sync_disabled",
})
})
} catch (ex) {
this.handleError(ex)
this.$toast.error(this.$t("something_went_wrong"), {
} catch (e) {
this.handleError(e)
this.$toast.error(this.$t("error.something_went_wrong"), {
icon: "error",
})
}
@@ -302,7 +302,7 @@ export default defineComponent({
this.connectingState = false
this.connectionState = false
this.communication.log.push({
payload: this.$t("error_occurred"),
payload: this.$t("error.something_went_wrong"),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),
@@ -321,7 +321,7 @@ export default defineComponent({
.map((input) => {
try {
return JSON.parse(input)
} catch (err) {
} catch (e) {
return input
}
})

View File

@@ -182,9 +182,9 @@ export default {
ts: new Date().toLocaleTimeString(),
})
})
} catch (ex) {
this.handleSSEError(ex)
this.$toast.error(this.$t("something_went_wrong"), {
} catch (e) {
this.handleSSEError(e)
this.$toast.error(this.$t("error.something_went_wrong"), {
icon: "error",
})
}
@@ -207,7 +207,7 @@ export default {
this.stop()
this.connectionSSEState = false
this.events.log.push({
payload: this.$t("error_occurred"),
payload: this.$t("error.something_went_wrong"),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),

View File

@@ -91,6 +91,7 @@
flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.protocol', { count: index + 1 })"
@@ -322,9 +323,9 @@ export default defineComponent({
ts: new Date().toLocaleTimeString(),
})
}
} catch (ex) {
this.handleError(ex)
this.$toast.error(this.$t("something_went_wrong"), {
} catch (e) {
this.handleError(e)
this.$toast.error(this.$t("error.something_went_wrong"), {
icon: "error",
})
}
@@ -344,7 +345,7 @@ export default defineComponent({
this.disconnect()
this.connectionState = false
this.communication.log.push({
payload: this.$t("error_occurred"),
payload: this.$t("error.something_went_wrong"),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),