Fixed live score part

This commit is contained in:
nise.moe 2024-03-05 13:24:47 +01:00
parent 9a0508b389
commit da240716d1
3 changed files with 49 additions and 5 deletions

View File

@ -44,8 +44,8 @@
</ng-template> </ng-template>
</label> </label>
<div class="term"> <div class="term" style="width: 100%; padding: 0">
<div class="text-center" style="font-weight: bold; font-size: 14px; padding-bottom: 10px"> <div class="text-center" style="font-weight: bold; font-size: 14px; padding-bottom: 10px; padding-top: 16px">
<img src="/assets/new.png" width="48" style=" filter: grayscale(30%) sepia(20%) brightness(90%);"> <img src="/assets/new.png" width="48" style=" filter: grayscale(30%) sepia(20%) brightness(90%);">
<br> <br>
<ng-container *ngIf="this.wantsConnection">new <span style="margin-right: 4px" class="text-has-info " title="this feed includes any score - this does not mean they're cheating.">scores</span> <span style="color: rgba(36,255,114,0.65); filter: grayscale(40%)">[live]</span></ng-container> <ng-container *ngIf="this.wantsConnection">new <span style="margin-right: 4px" class="text-has-info " title="this feed includes any score - this does not mean they're cheating.">scores</span> <span style="color: rgba(36,255,114,0.65); filter: grayscale(40%)">[live]</span></ng-container>
@ -62,11 +62,11 @@
new scores will appear here. new scores will appear here.
</p> </p>
</ng-container> </ng-container>
<div style="overflow-y: scroll; max-height: 565px"> <div style="overflow-y: scroll; max-height: 495px; padding: 16px">
<ng-container *ngFor="let replay of this.liveScores"> <ng-container *ngFor="let replay of this.liveScores">
<div style="margin-bottom: 6px"> <div style="margin-bottom: 6px">
<a [routerLink]="['/s/' + replay.replay_id]"> <a [routerLink]="['/s/' + replay.replay_id]">
<div style="border: 1px dotted rgba(204,204,204,0.4); padding: 4px; margin-right: 16px; font-size: 13px"> <div style="border: 1px dotted rgba(204,204,204,0.4); padding: 4px; font-size: 13px">
<ul style="list-style: none; padding-left: 10px;"> <ul style="list-style: none; padding-left: 10px;">
<li>User: {{ replay.username }}</li> <li>User: {{ replay.username }}</li>
<li>Date: {{ replay.date }}</li> <li>Date: {{ replay.date }}</li>

View File

@ -4,7 +4,7 @@ import {environment} from "../../environments/environment";
import {LocalCacheService} from "../../corelib/service/local-cache.service"; import {LocalCacheService} from "../../corelib/service/local-cache.service";
import {RxStompService} from "../../corelib/stomp/stomp.service"; import {RxStompService} from "../../corelib/stomp/stomp.service";
import {Message} from "@stomp/stompjs/esm6"; import {Message} from "@stomp/stompjs/esm6";
import {ReplayData} from "../replays"; import {ErrorDistribution, ReplayData, ReplayDataChart, ReplayDataSimilarScore} from "../replays";
import {DecimalPipe, NgForOf, NgIf} from "@angular/common"; import {DecimalPipe, NgForOf, NgIf} from "@angular/common";
import {Router, RouterLink} from "@angular/router"; import {Router, RouterLink} from "@angular/router";
import {HttpClient} from "@angular/common/http"; import {HttpClient} from "@angular/common/http";

View File

@ -66,6 +66,50 @@ export interface UserReplayData {
charts: ReplayDataChart[]; charts: ReplayDataChart[];
} }
export function getMockReplayData(): ReplayData {
return {
'replay_id': 123,
'user_id': 123,
'username': 'username',
'date': 'date',
'beatmap_id': 123,
'beatmap_beatmapset_id': 123,
'beatmap_artist': 'beatmap_artist',
'beatmap_title': 'beatmap_title',
'beatmap_star_rating': 123,
'beatmap_creator': 'beatmap_creator',
'beatmap_version': 'beatmap_version',
'score': 123,
'mods': ['mods'],
'rank': 'rank',
'ur': 123,
'average_ur': 123,
'adjusted_ur': 123,
'frametime': 123,
'snaps': 123,
'hits': 123,
'pp': 123,
'perfect': true,
'max_combo': 123,
'mean_error': 123,
'error_variance': 123,
'error_standard_deviation': 123,
'minimum_error': 123,
'maximum_error': 123,
'error_range': 123,
'error_coefficient_of_variation': 123,
'error_kurtosis': 123,
'error_skewness': 123,
'count_300': 123,
'count_100': 123,
'count_50': 123,
'count_miss': 123,
'similar_scores': [],
'error_distribution': {},
'charts': []
};
}
export interface ReplayData { export interface ReplayData {
replay_id: number | null; replay_id: number | null;
user_id: number; user_id: number;