chg: [app:the-scores] Sort players by email
This commit is contained in:
parent
cffb761c4d
commit
2a601849dc
4 changed files with 15 additions and 5 deletions
|
@ -9,14 +9,14 @@ misp_skipssl = True
|
|||
|
||||
live_logs_accepted_scope = {
|
||||
'events': ['add', 'edit', 'delete', 'restSearch',],
|
||||
'attributes': ['add', 'edit', 'delete', 'restSearch',],
|
||||
'attributes': ['add', 'add_attachment', 'edit', 'delete', 'restSearch',],
|
||||
'eventReports': ['add', 'edit', 'delete',],
|
||||
'tags': '*',
|
||||
}
|
||||
|
||||
user_activity_accepted_scope = {
|
||||
'events': ['view', 'add', 'edit', 'delete', 'restSearch',],
|
||||
'attributes': ['add', 'edit', 'delete', 'restSearch',],
|
||||
'attributes': ['add', 'add_attachment', 'edit', 'delete', 'restSearch',],
|
||||
'objects': ['add', 'edit', 'delete',],
|
||||
'eventReports': ['view', 'add', 'edit', 'delete',],
|
||||
'tags': '*',
|
||||
|
|
|
@ -331,6 +331,7 @@ def get_progress():
|
|||
continue
|
||||
progress[user_id] = {
|
||||
'email': db.USER_ID_TO_EMAIL_MAPPING[user_id],
|
||||
'user_id': user_id,
|
||||
'exercises': {},
|
||||
}
|
||||
for exec_uuid, tasks_completion in completion_for_users[user_id].items():
|
||||
|
|
|
@ -246,12 +246,12 @@ async def forward_zmq_to_socketio():
|
|||
while True:
|
||||
message = await zsocket.recv_string()
|
||||
topic, s, m = message.partition(" ")
|
||||
await handleMessage(topic, s, m)
|
||||
try:
|
||||
ZMQ_MESSAGE_COUNT += 1
|
||||
ZMQ_LAST_TIME = time.time()
|
||||
# await handleMessage(topic, s, m)
|
||||
await handleMessage(topic, s, m)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
logger.error('Error handling message %s', e)
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,15 @@
|
|||
|
||||
const hasExercises = computed(() => exercises.value.length > 0)
|
||||
const hasProgress = computed(() => Object.keys(progresses.value).length > 0)
|
||||
const sortedProgress = computed(() => Object.values(progresses.value).sort((a, b) => {
|
||||
if (a.email < b.email) {
|
||||
return -1;
|
||||
}
|
||||
if (a.email > b.email) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}))
|
||||
|
||||
</script>
|
||||
|
||||
|
@ -85,7 +94,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
<template v-else>
|
||||
<tr v-for="(progress, user_id) in progresses" :key="user_id" class="bg-slate-100 dark:bg-slate-900">
|
||||
<tr v-for="(progress) in sortedProgress" :key="progress.user_id" class="bg-slate-100 dark:bg-slate-900">
|
||||
<td class="border-b border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-400 p-0 pl-2 relative">
|
||||
<span class="flex flex-col max-w-60">
|
||||
<span :title="user_id" class="text-nowrap inline-block leading-5 truncate">
|
||||
|
|
Loading…
Reference in a new issue