Skip to content

Commit 4f0cfab

Browse files
committed
Display RAPI error messages
Changes to display any error messages returned when sending RAPI commands and also added colour to help see the different states
1 parent 17b059e commit 4f0cfab

File tree

5 files changed

+30
-18
lines changed

5 files changed

+30
-18
lines changed

src/components/blocks/configuration/Dev.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
if (res=="error") {
5151
button_send_state = "error"
5252
return false
53-
}
53+
}
5454
else {
5555
button_send_state = "ok"
5656
rapi_cmd_result.push(res)
@@ -69,7 +69,7 @@
6969
button_export_state = "loading"
7070
// get usefull data
7171
let data = {}
72-
72+
7373
// copy stores
7474
data.target = {...$claims_target_store}
7575
// get claims store not cached here
@@ -85,7 +85,7 @@
8585
data.config = {...$config_store}
8686
data.limits = {...$limit_store}
8787
data.tesla = {...$tesla_store}
88-
88+
8989
data.uistates = {...$uistates_store}
9090
9191
@@ -119,9 +119,10 @@
119119
<div class="mb-2">
120120
<div>
121121
<div class="is-size-7 has-text-left my-2 mx-2">
122-
{#each rapi_cmd_result as { cmd, ret } }
123-
&gt; {cmd} <br>
124-
&lt; {ret} <br>
122+
{#each rapi_cmd_result as { cmd, ret, error } }
123+
&gt; <span class="rapi-cmd">{cmd}</span><br>
124+
&lt; {#if ret !== undefined}<span class="rapi-res">{ret}</span>{/if}
125+
{#if error !== undefined}<span class="rapi-error">{error}</span>{/if} <br>
125126
{/each}
126127
</div>
127128
<form on:submit|preventDefault={send_rapi_cmd}>
@@ -153,4 +154,4 @@
153154
{#if opened}
154155
<Terminal mode={mode} bind:opened={opened}/>
155156
{/if}
156-
<!-- </Modal> -->
157+
<!-- </Modal> -->

src/lib/i18n/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@
484484
"missing-ohm": "Ohm Key is missing"
485485
},
486486
"dev": {
487-
"rapi-cmd": "Rapi Commands",
487+
"rapi-cmd": "RAPI Commands",
488488
"send": "Send",
489489
"clear": "Clear",
490490
"consoles": "Consoles",
@@ -510,4 +510,4 @@
510510
"missing-ocpp_idtag": "missing Id Tag"
511511
}
512512
}
513-
}
513+
}

src/lib/i18n/es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@
484484
"missing-ohm": "Falta Clave Ohm"
485485
},
486486
"dev": {
487-
"rapi-cmd": "Comando Rapi",
487+
"rapi-cmd": "Comando RAPI",
488488
"send": "enviar",
489489
"clear": "Limpiar",
490490
"consoles": "Consolas",

src/lib/i18n/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@
485485
"missing-ohm": "Clef Ohm manquante"
486486
},
487487
"dev": {
488-
"rapi-cmd": "Commandes Rapi",
488+
"rapi-cmd": "Commandes RAPI",
489489
"send": "Envoyer",
490490
"clear": "Effacer",
491491
"consoles": "Consoles",

src/mystyles.scss

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $body-color: $dark;
3737
@import "../node_modules/bulma/sass/grid/_all";
3838
@import "../node_modules/bulma/sass/helpers/_all";
3939
@import "../node_modules/bulma/sass/utilities/_all";
40-
@import "../node_modules/bulma/sass/components/level";
40+
@import "../node_modules/bulma/sass/components/level";
4141
@import "../node_modules/bulma/sass/components/modal";
4242
@import "../node_modules/bulma/sass/components/tabs";
4343
@import "../node_modules/bulma/sass/components/message";
@@ -64,7 +64,7 @@ $breadcrumb-item-color: $text;
6464
box-sizing: border-box;
6565
}
6666

67-
67+
6868
// body::-webkit-scrollbar { display: none; }
6969

7070

@@ -89,7 +89,7 @@ html {
8989
::-webkit-scrollbar {
9090
width: 8px;
9191
}
92-
92+
9393
/* Track */
9494
::-webkit-scrollbar-track {
9595
background: none;
@@ -98,16 +98,16 @@ html {
9898

9999
::-webkit-scrollbar-track:hover {
100100
background: #fbf9ed;
101-
101+
102102
}
103-
104-
103+
104+
105105
/* Handle */
106106
::-webkit-scrollbar-thumb {
107107
// background: hsl(189, 53%, 47%);
108108
background: #32b3d4;;
109109
border-radius: 8px;
110-
110+
111111
}
112112

113113
@media screen and (max-width: 768px){
@@ -123,3 +123,14 @@ scrollbar-color: hsl(189, 53%, 47%) white;
123123
scrollbar-width: thin;
124124
}
125125

126+
.rapi-cmd {
127+
color: $cyan;
128+
}
129+
130+
.rapi-res {
131+
color: $green;
132+
}
133+
134+
.rapi-error {
135+
color: #cc0f35;
136+
}

0 commit comments

Comments
 (0)