Skip to content

Commit

Permalink
Changed websocket endpoint to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonfelipesp committed Oct 14, 2024
1 parent 0a59d25 commit aba695c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions netbox_proxbox/templates/netbox_proxbox/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ <h1>Log Messages</h1>

<div>
<div style='overflow-y: auto; width: 100%; height: 400px;' id="scrollable-div">
<div class="card" style="padding: 8px; flex-direction: cloumn; overflow-y: auto">
<ul id='messages' style='overflow: auto; flex-direction: cloumn-reverse'>
<div class="card" style="flex-direction: cloumn; overflow-y: auto">
<ul id='messages' style='overflow: auto; flex-direction: cloumn-reverse; list-style-type: none;'>
</ul>
</div>
</div>
<script>
var ws = new WebSocket("ws://10.0.30.250:8800/ws");
uvicorn_host = "{{ configuration.netbox_proxbox.fastapi.uvicorn_host }}"
uvicorn_port = "{{ configuration.netbox_proxbox.fastapi.uvicorn_port }}"

websocket_endpoint = `ws://${uvicorn_host}:${uvicorn_port}/ws`
console.log(websocket_endpoint)

var ws = new WebSocket(websocket_endpoint);
ws.onmessage = function(event) {

var messages = document.getElementById('messages')
Expand Down

0 comments on commit aba695c

Please sign in to comment.