VedirectView becomes component

* move Vedirect in the component folder
* VedirectView is now component of BasePage
* /vedirectlivedata connectable through vue proxy
This commit is contained in:
helgeerbe 2023-02-15 15:01:59 +01:00
parent a529c91254
commit 0ac529146e
4 changed files with 11 additions and 6 deletions

View File

@ -203,6 +203,7 @@ export default defineComponent({
}, },
methods: { methods: {
getInitialData() { getInitialData() {
console.log("Get initalData for VeDirect");
this.dataLoading = true; this.dataLoading = true;
fetch("/api/vedirectlivedata/status", { headers: authHeader() }) fetch("/api/vedirectlivedata/status", { headers: authHeader() })
.then((response) => handleResponse(response, this.$emitter, this.$router)) .then((response) => handleResponse(response, this.$emitter, this.$router))
@ -212,7 +213,7 @@ export default defineComponent({
}); });
}, },
initSocket() { initSocket() {
console.log("Starting connection to WebSocket Server"); console.log("Starting connection to VeDirect WebSocket Server");
const { protocol, host } = location; const { protocol, host } = location;
const authString = authUrl(); const authString = authUrl();
@ -230,7 +231,7 @@ export default defineComponent({
this.socket.onopen = function (event) { this.socket.onopen = function (event) {
console.log(event); console.log(event);
console.log("Successfully connected to the echo websocket server..."); console.log("Successfully connected to the VeDirect websocket server...");
}; };
// Listen to window events , When the window closes , Take the initiative to disconnect websocket Connect // Listen to window events , When the window closes , Take the initiative to disconnect websocket Connect

View File

@ -106,10 +106,9 @@
</div> </div>
</div> </div>
</div> </div>
<VedirectView />
</BasePage> </BasePage>
<VedirectView />
<div class="modal" id="eventView" tabindex="-1"> <div class="modal" id="eventView" tabindex="-1">
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
@ -318,7 +317,7 @@ import EventLog from '@/components/EventLog.vue';
import HintView from '@/components/HintView.vue'; import HintView from '@/components/HintView.vue';
import InverterChannelInfo from "@/components/InverterChannelInfo.vue"; import InverterChannelInfo from "@/components/InverterChannelInfo.vue";
import InverterTotalInfo from '@/components/InverterTotalInfo.vue'; import InverterTotalInfo from '@/components/InverterTotalInfo.vue';
import VedirectView from '@/views/VedirectView.vue'; import VedirectView from '@/components/VedirectView.vue';
import type { DevInfoStatus } from '@/types/DevInfoStatus'; import type { DevInfoStatus } from '@/types/DevInfoStatus';
import type { EventlogItems } from '@/types/EventlogStatus'; import type { EventlogItems } from '@/types/EventlogStatus';
import type { LimitConfig } from '@/types/LimitConfig'; import type { LimitConfig } from '@/types/LimitConfig';

View File

@ -49,6 +49,11 @@ export default defineConfig({
ws: true, ws: true,
changeOrigin: true changeOrigin: true
}, },
'^/vedirectlivedata': {
target: 'ws://192.168.178.78/',
ws: true,
changeOrigin: true
},
'^/console': { '^/console': {
target: 'ws://192.168.20.110/', target: 'ws://192.168.20.110/',
ws: true, ws: true,

Binary file not shown.