Skip to content

Commit

Permalink
VedirectView becomes component
Browse files Browse the repository at this point in the history
* move Vedirect in the component folder
* VedirectView is now component of BasePage
* /vedirectlivedata connectable through vue proxy
  • Loading branch information
helgeerbe committed Feb 15, 2023
1 parent a529c91 commit 0ac5291
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export default defineComponent({
},
methods: {
getInitialData() {
console.log("Get initalData for VeDirect");
this.dataLoading = true;
fetch("/api/vedirectlivedata/status", { headers: authHeader() })
.then((response) => handleResponse(response, this.$emitter, this.$router))
Expand All @@ -212,7 +213,7 @@ export default defineComponent({
});
},
initSocket() {
console.log("Starting connection to WebSocket Server");
console.log("Starting connection to VeDirect WebSocket Server");
const { protocol, host } = location;
const authString = authUrl();
Expand All @@ -230,7 +231,7 @@ export default defineComponent({
this.socket.onopen = function (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
Expand Down
7 changes: 3 additions & 4 deletions webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@
</div>
</div>
</div>
<VedirectView />
</BasePage>

<VedirectView />


<div class="modal" id="eventView" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
Expand Down Expand Up @@ -318,7 +317,7 @@ import EventLog from '@/components/EventLog.vue';
import HintView from '@/components/HintView.vue';
import InverterChannelInfo from "@/components/InverterChannelInfo.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 { EventlogItems } from '@/types/EventlogStatus';
import type { LimitConfig } from '@/types/LimitConfig';
Expand Down
5 changes: 5 additions & 0 deletions webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export default defineConfig({
ws: true,
changeOrigin: true
},
'^/vedirectlivedata': {
target: 'ws://192.168.178.78/',
ws: true,
changeOrigin: true
},
'^/console': {
target: 'ws://192.168.20.110/',
ws: true,
Expand Down
Binary file modified webapp_dist/js/app.js.gz
Binary file not shown.

0 comments on commit 0ac5291

Please sign in to comment.