Skip to content

Commit

Permalink
show path on flow panel
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyangXYZ committed Jan 29, 2024
1 parent 0d33510 commit be0c268
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
33 changes: 20 additions & 13 deletions src/components/FlowsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,50 @@ const columns: any = [
key: 'flow_id',
title: 'ID',
dataKey: 'flow_id',
width: 60,
width: 40,
align: 'center',
cellRenderer: ({ rowIndex }: any) => rowIndex + 1
},
{
key: 'src',
title: 'Source',
title: 'SRC',
dataKey: 'e2e_src',
width: 40,
align: 'center'
},
{
key: 'dst',
title: 'Dest',
title: 'DST',
dataKey: 'e2e_dst',
width: 40,
align: 'center'
},
// {
// key: 'deadline',
// title: 'Deadline',
// dataKey: 'deadline',
// width: 50,
// align: 'center'
// },
{
key: 'deadline',
title: 'Deadline',
dataKey: 'deadline',
width: 50,
key: 'period',
title: 'PERIOD',
dataKey: 'period',
width: 40,
align: 'center'
},
{
key: 'period',
title: 'Period',
dataKey: 'period',
width: 60,
key: 'path',
title: 'PATH',
dataKey: 'path',
width: 120,
align: 'center'
},
{
key: 'workload',
title: 'Workload',
title: 'WORKLOAD',
dataKey: 'workload',
width: 100,
width: 50,
align: 'center',
// cellRenderer: ({ cellData: payload_size }: any) => payload_size.toString()
}
Expand Down
8 changes: 3 additions & 5 deletions src/core/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export class NetworkHub {
constructRoutingGraph() {
const graph: RoutingGraph = {}

for (const link of this.Links.value) {
for (const link of Object.values(this.Links.value)) {

if (link === undefined) continue

Expand Down Expand Up @@ -428,8 +428,8 @@ export class NetworkHub {

AddFlows(num_flows: number) {
for (let i = 0; i < num_flows; i++) {
let src = Math.floor(this.Rand.next() * 7) + 11
let dst = Math.floor(this.Rand.next() * 7) + 11
const src = Math.floor(this.Rand.next() * 7) + 11
const dst = Math.floor(this.Rand.next() * 7) + 11

const f = <Flow>{
id: this.Flows.value.length,
Expand All @@ -440,12 +440,10 @@ export class NetworkHub {
workload: Math.floor(this.Rand.next() * 10), // from 0 to 9 - change this later
path: this.findPath(src, dst)
}

this.Flows.value.push(f)

this.Logs.value.unshift(`New flow: ID:${f.id}, source:${f.e2e_src}, dest:${f.e2e_dst}.`)
}
console.log(this.Flows.value)
}

Run = () => {
Expand Down

0 comments on commit be0c268

Please sign in to comment.