Skip to content

Commit ff44528

Browse files
committed
fix UE data with sorting
1 parent fdd03da commit ff44528

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/bs/bs.jsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ const BsIcon = ({ bsId, backendData, backendEvents }) => {
9898
className="bs-showinfo"
9999
style={{
100100
position: 'fixed', // Position fixed to follow mouse across the viewport
101-
top: mousePos.y + 0, // Offset by 10px for better visibility
102-
left: mousePos.x + 0
101+
top: mousePos.y + 30, // Offset by 10px for better visibility
102+
left: mousePos.x + 30
103103
}}
104104
>
105105
<p><strong>BS ID</strong>: {bsId}</p>
@@ -110,7 +110,6 @@ const BsIcon = ({ bsId, backendData, backendEvents }) => {
110110
<p><strong>Time Created</strong>: {parseTimestamp(parseInt(backendData.timestamp)) ? parseTimestamp(parseInt(backendData.timestamp)).toLocaleString() : ""}</p>
111111
{Object.keys(backendEvents).map((ueId) => {
112112
const ueData = backendEvents[ueId];
113-
console.log(backendData.timestamp);
114113
let eventsArray = [];
115114
if (!ueData.event || !Object.keys(ueData.event).length) {
116115
eventsArray = [{

src/server.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,19 @@ def fetch_sdl_data():
133133
# Create a batch of keys
134134
batch_keys = [str(j) for j in range(i, min(i + max_batch_get_value, key_len_by_namespace[bs_mobiflow_key]))]
135135

136-
137136
# Create the command for the batch
138137
command = get_val_command(bs_mobiflow_key, " ".join(batch_keys))
139138
value = execute_command(command)
140139

141-
142140
# Process each value in the batch
143-
print(value)
144-
values = [val.strip() for val in value.split("\n") if val.strip()]
145-
for val in values:
146-
val = val.split(":")[1][2:] # remove prefix
141+
values = {}
142+
for line in [val.strip() for val in value.split("\n") if val.strip()]:
143+
k = int(line.split(":")[0])
144+
v = line.split(":")[1][2:] # remove prefix
145+
values[k] = v
146+
values = dict(sorted(values.items())) # sort values based on Index
147+
148+
for val in values.values():
147149
bs_mf_item = val.split(";")
148150
nr_cell_id = bs_mf_item[bs_meta.index("nr_cell_id")]
149151
timestamp = bs_mf_item[bs_meta.index("Timestamp")]
@@ -168,16 +170,19 @@ def fetch_sdl_data():
168170
# Create a batch of keys
169171
batch_keys = [str(j) for j in range(i, min(i + max_batch_get_value, key_len_by_namespace[ue_mobiflow_key]))]
170172

171-
172173
# Create the command for the batch
173174
command = get_val_command(ue_mobiflow_key, " ".join(batch_keys))
174175
value = execute_command(command)
175176

176-
177177
# Process each value in the batch
178-
values = [val.strip() for val in value.split("\n") if val.strip()]
179-
for val in values:
180-
val = val.split(":")[1][2:] # remove prefix
178+
values = {}
179+
for line in [val.strip() for val in value.split("\n") if val.strip()]:
180+
k = int(line.split(":")[0])
181+
v = line.split(":")[1][2:] # remove prefix
182+
values[k] = v
183+
values = dict(sorted(values.items())) # sort values based on Index
184+
185+
for val in values.values():
181186
ue_mf_item = val.split(";")
182187
ue_id = ue_mf_item[ue_meta.index("gnb_du_ue_f1ap_id")]
183188
nr_cell_id = ue_mf_item[ue_meta.index("nr_cell_id")]
@@ -238,16 +243,13 @@ def fetch_sdl_data():
238243
# Create a batch of keys
239244
batch_keys = [str(j) for j in range(i, min(i + max_batch_get_value, key_len_by_namespace[event_key] + 1))]
240245

241-
242246
# Create the command for the batch
243247
command = get_val_command(event_key, " ".join(batch_keys))
244248
value = execute_command(command)
245249

246-
247250
# Process each value in the batch
248251
values = [val.strip() for val in value.split("\n") if val.strip()]
249252

250-
251253
for val in values:
252254
val = ''.join([c for c in val if 32 <= ord(c) <= 126])[2:] # Remove non-ASCII characters
253255
event_item = val.split(";")

src/ue/ue.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ const UeIcon = ({ backendEvent, ueId, isHovered, click, setHoveredUeId, setIsBsH
271271
backgroundColor: '#fff',
272272
color: '#000',
273273
padding: '16px',
274-
borderRadius: '8px',
275274
border: '1px solid #000', // Added black border
276275
width: '900px', // Increased width
277276
height: '400px', // Added height

0 commit comments

Comments
 (0)