Skip to content

Commit

Permalink
Show LLM cost info only if any LLM feature is enabled in course.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasnertobias committed Dec 17, 2024
1 parent 4bc3d38 commit a89db19
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ <h5 class="text-center">{{ 'artemisApp.course.detail.' + doughnutChartTitle + 'T
}
<div class="doughnut-chart-container" [ngClass]="titleLink ? 'clickable' : ''" (click)="openCorrespondingPage()">
<div class="doughnut-chart-text">
@if (receivedStats && currentPercentage != undefined) {
<div class="h4">{{ currentPercentage }}%</div>
} @else if (receivedStats && showText) {
<div class="h4">{{ showText }}</div>
}
@if (receivedStats && !showText) {
<div class="h6">{{ currentAbsolute }} / {{ currentMax }}</div>
} @else if (receivedStats && currentPercentage != undefined) {
<div class="h6">{{ showText }}</div>
}
@if (!receivedStats) {
@if (receivedStats) {
@if (currentPercentage != undefined) {
<div class="h4">{{ currentPercentage }}%</div>
} @else if (showText) {
<div class="h4">{{ showText }}</div>
}
@if (!showText) {
<div class="h6">{{ currentAbsolute }} / {{ currentMax }}</div>
} @else if (currentPercentage != undefined) {
<div class="h6">{{ showText }}</div>
}
} @else {
<div class="h3">
<fa-icon [icon]="faSpinner" animation="spin" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const PIE_CHART_NA_FALLBACK_VALUE = [0, 0, 1];
})
export class CourseDetailDoughnutChartComponent implements OnChanges, OnInit {
@Input() contentType: DoughnutChartType;
@Input() currentPercentage: number | undefined;
@Input() currentAbsolute: number | undefined;
@Input() currentMax: number | undefined;
@Input() currentPercentage?: number;
@Input() currentAbsolute?: number;
@Input() currentMax?: number;
@Input() course: Course;
@Input() showText: string | undefined;
@Input() showText?: string;

receivedStats = false;
doughnutChartTitle: string;
stats: number[];
titleLink: string | undefined;
titleLink?: string;

// Icons
faSpinner = faSpinner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@
[currentAbsolute]="courseDTO?.currentAbsoluteAverageScore"
[currentMax]="courseDTO?.currentMaxAverageScore"
/>
<jhi-course-detail-doughnut-chart
class="doughnut-container col-sm-6 my-3"
[course]="course"
[contentType]="DoughnutChartType.CURRENT_LLM_COST"
[showText]="courseDTO?.currentTotalLlmCostInEur + ' €'"
[currentMax]="0"
/>
@if (this.irisChatEnabled || this.isAthenaEnabled) {
<jhi-course-detail-doughnut-chart
class="doughnut-container col-sm-6 my-3"
[course]="course"
[contentType]="DoughnutChartType.CURRENT_LLM_COST"
[showText]="courseDTO?.currentTotalLlmCostInEur + ' €'"
[currentMax]="0"
/>
}
</div>
</div>
<jhi-course-detail-line-chart class="col-xxl-8" [course]="course" [numberOfStudentsInCourse]="course.numberOfStudents!" [initialStats]="activeStudents" />
Expand Down

0 comments on commit a89db19

Please sign in to comment.