diff --git a/frontend/public/assets/mtp/boot-stomp.svg b/frontend/public/assets/mtp/boot-stomp.svg
new file mode 100644
index 0000000..289c0b1
--- /dev/null
+++ b/frontend/public/assets/mtp/boot-stomp.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/public/assets/mtp/websocket.svg b/frontend/public/assets/mtp/websocket.svg
new file mode 100644
index 0000000..522ad53
--- /dev/null
+++ b/frontend/public/assets/mtp/websocket.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/pages/index.js b/frontend/src/pages/index.js
index b98018e..1ba7351 100644
--- a/frontend/src/pages/index.js
+++ b/frontend/src/pages/index.js
@@ -143,12 +143,6 @@ const Page = () => {
container
spacing={3}
>
-
-
{
>
+
+
+
@@ -176,6 +184,12 @@ const Page = () => {
sm={6}
lg={3}
>
+
{
- var { value, sx } = props;
+ var { value, mtp, sx, type } = props;
var valueRaw;
if( value !== undefined) {
valueRaw = value.substring(1);
+ console.log("rtt:", valueRaw)
}
+ const formatMilliseconds = (timeString) => {
+
+ if (timeString === "") {
+ return "";
+ }
+ // Regular expression to extract value and unit
+ const regex = /^(\d+(\.\d+)?)\s*([mµ]?s|s)?$/;
+
+ // Extract value and unit
+ const matches = timeString.match(regex);
+ if (!matches) {
+ return "Invalid time format";
+ }
+
+ let value = parseFloat(matches[1]);
+ const unit = matches[3] || "ms";
+
+ // Convert units to milliseconds
+ switch (unit) {
+ case "s":
+ value *= 1000;
+ break;
+ case "µs":
+ value /= 1000;
+ break;
+ default:
+ // For "ms", do nothing
+ break;
+ }
+
+ // Round the number to two decimal places
+ const roundedValue = value.toFixed(2);
+
+ return `${roundedValue}ms`;
+}
+
+const showIcon = (mtpType) => {
+ if (valueRaw === "") {
+ return
+ }
+ switch (mtpType) {
+ case "mqtt":
+ return
+ case "stomp":
+ return ;
+ case "websocket":
+ return ;
+ default:
+ return ;
+ }
+}
+
return (
@@ -34,10 +89,10 @@ export const OverviewTasksProgress = (props) => {
gutterBottom
variant="overline"
>
- Conexão MQTT
+ {mtp}
- {valueRaw}
+ {formatMilliseconds(valueRaw)}
{
width: 56
}}
>
-
-
-
+ {showIcon(type)}