diff --git a/src/components/EventLogs.vue b/src/components/EventLogs.vue index e0fc940..084b63e 100644 --- a/src/components/EventLogs.vue +++ b/src/components/EventLogs.vue @@ -1,24 +1,53 @@ @@ -26,8 +55,8 @@ watch( @import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap'); .log-container { - bottom:320px; - height: 300px; + bottom: 320px; + max-height: 300px; display: flex; max-width: 40%; overflow-y: scroll; @@ -36,6 +65,6 @@ watch( .log { font-family: 'Share Tech Mono', monospace; padding-right: 20px; - font-size: .82rem; + font-size: 0.82rem; } diff --git a/src/core/network.ts b/src/core/network.ts index 34dd2c6..5fc1259 100644 --- a/src/core/network.ts +++ b/src/core/network.ts @@ -22,6 +22,7 @@ export class NetworkHub { Flows = ref([]) Packets = ref([]) PacketsCurrent = ref([]) + Logs = ref([]) ASN = ref(0) // absolute slot number Rand: SeededRandom kdTree: KDTree // to find nearest neighbors @@ -81,6 +82,8 @@ export class NetworkHub { w: undefined } this.Nodes.value.push(n) + + this.Logs.value.unshift(`New ${NODE_TYPE[type]} node: ID ${n.id}, position: [${n.pos}]`) } ConstructTopology() { @@ -104,6 +107,8 @@ export class NetworkHub { this.AddLink(n.id, nn) }) } + + this.Logs.value.unshift(`Established ${Object.keys(this.Links.value).length} links`) } StartWebWorkers() { @@ -147,6 +152,7 @@ export class NetworkHub { } } } + this.Logs.value.unshift('WebWorkers started') } // handle control plane msg from each node diff --git a/src/hooks/useDrawTopology.ts b/src/hooks/useDrawTopology.ts index bfedb14..3b754f7 100644 --- a/src/hooks/useDrawTopology.ts +++ b/src/hooks/useDrawTopology.ts @@ -1,6 +1,5 @@ -import { nextTick, watch } from 'vue' +import { watch } from 'vue' import { - Logs, Network, SelectedNode, SignalEditTopology, @@ -122,12 +121,14 @@ export function useDrawTopology(dom: HTMLElement) { // console.log( // 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' // ) - Logs.value.unshift('Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.') + Network.Logs.value.unshift( + 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' + ) } loadingManager.onLoad = function () { // console.log('Loading complete!') - Logs.value.unshift('Loading complete!') + Network.Logs.value.unshift('Loading complete!') } loadingManager.onProgress = function (url, itemsLoaded, itemsTotal) {