109
109
</openwb-base-alert >
110
110
</div >
111
111
</div >
112
+ <div v-if =" !installAssistantActive" >
113
+ <openwb-base-button-group-input
114
+ title =" HTTP-API"
115
+ :buttons =" [
116
+ {
117
+ buttonValue: false,
118
+ text: 'Aus',
119
+ class: 'btn-outline-danger',
120
+ },
121
+ {
122
+ buttonValue: true,
123
+ text: 'An',
124
+ class: 'btn-outline-success',
125
+ },
126
+ ]"
127
+ :model-value ="
128
+ $store.state.mqtt['openWB/general/http_api']
129
+ "
130
+ @update:model-value ="
131
+ updateState('openWB/general/http_api', $event)
132
+ "
133
+ >
134
+ <template #help >
135
+ Mit der HTTP-API kann man den Wert eines MQTT-Topics
136
+ per HTTP GET oder POST abfragen. Ein Zugriff ist nur
137
+ lesend möglich, nicht schreibend.<br />
138
+ GET-Request:
139
+ <a
140
+ :href =" `http://${getIpAddress()}:8080/?topic=openWB/system/time`"
141
+ target =" _blank"
142
+ rel =" noopener noreferrer"
143
+ >
144
+ http://{{
145
+ getIpAddress()
146
+ }}:8080/?topic=openWB/system/time </a
147
+ ><br />
148
+ Verschlüsselter GET-Request:
149
+ <a
150
+ :href =" `https://${getIpAddress()}:8443/?topic=openWB/system/time`"
151
+ target =" _blank"
152
+ rel =" noopener noreferrer"
153
+ >
154
+ https://{{
155
+ getIpAddress()
156
+ }}:8443/?topic=openWB/system/time
157
+ </a >
158
+ <br />
159
+ POST-Request mit curl:
160
+ <openwb-base-copy-to-clipboard
161
+ class =" text-info"
162
+ tooltip =" Topic kopieren"
163
+ >curl -X POST --data "topic=openWB/system/time"
164
+ http://{{
165
+ getIpAddress()
166
+ }}:8080/</openwb-base-copy-to-clipboard
167
+ >
168
+ Verschlüsselter POST-Request über curl mit privatem
169
+ SSL-Zertifikat:
170
+ <openwb-base-copy-to-clipboard
171
+ class =" text-info"
172
+ tooltip =" Topic kopieren"
173
+ >curl -k -X POST --data
174
+ "topic=openWB/system/time" https://{{
175
+ getIpAddress()
176
+ }}:8080/</openwb-base-copy-to-clipboard
177
+ ><br />
178
+ </template >
179
+ </openwb-base-button-group-input >
180
+ </div >
112
181
</openwb-base-card >
113
182
<openwb-base-card title =" Hardware" >
114
183
<div v-if =" $store.state.mqtt['openWB/general/extern'] === true" >
@@ -594,6 +663,7 @@ export default {
594
663
" openWB/general/extern" ,
595
664
" openWB/general/control_interval" ,
596
665
" openWB/general/grid_protection_configured" ,
666
+ " openWB/general/http_api" ,
597
667
" openWB/general/external_buttons_hw" ,
598
668
" openWB/general/modbus_control" ,
599
669
" openWB/general/notifications/selected" ,
@@ -608,6 +678,7 @@ export default {
608
678
" openWB/general/web_theme" ,
609
679
" openWB/system/configurable/ripple_control_receivers" ,
610
680
" openWB/system/configurable/web_themes" ,
681
+ " openWB/system/ip_address" ,
611
682
],
612
683
};
613
684
},
@@ -642,6 +713,9 @@ export default {
642
713
},
643
714
},
644
715
methods: {
716
+ getIpAddress () {
717
+ return this .$store .state .mqtt [" openWB/system/ip_address" ];
718
+ },
645
719
getWebThemeDefaults (webThemeType ) {
646
720
const webThemeDefaults = this .webThemeList .find (
647
721
(element ) => element .value == webThemeType,
0 commit comments