Skip to content

Commit

Permalink
Added possibilty to add a custom command to a course
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 7322ddefd741b1fee2f56b2e44d7db05f9ecf41e
  • Loading branch information
mohamedalibarkailluin authored and Gitlab-CI committed Dec 4, 2024
1 parent a0c0890 commit fc4d86b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions front/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added
- Redirect to containers through reverse proxy
- Can add a custom command to a course

## 2.24.6
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
import { IComputeType } from '../../../compute-type/interfaces/compute-type';
import { ISessionsById } from "../../../sessions-form/interfaces/admin-session";

const DEFAULT_COMMAND = "${MYDOCKER_USERNAME} ${MYDOCKER_PASSWORD}"

@Component({
selector: 'app-course-form',
templateUrl: './course-form.component.html',
Expand Down Expand Up @@ -98,6 +100,7 @@ export class CourseFormComponent implements OnInit, ControlValueAccessor, Valida
nanoCpusLimit: obj?.nanoCpusLimit || null,
memoryBytesLimit: obj?.memoryBytesLimit || null,
computeTypeId: obj?.computeTypeId || this.defaultComputeTypeId,
command: obj?.command || DEFAULT_COMMAND,

saveStudentWork: obj?.saveStudentWork || false,
workdirSize: obj?.workdirSize || null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ <h2>Ports:</h2>
<app-ports-form
formControlName="ports"
></app-ports-form>

<mat-form-field>
<mat-label>Commande</mat-label>
<input matInput formControlName="command" type="text">
</mat-form-field>
<br>
<mat-divider></mat-divider>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class CourseTechnicalInformationFormComponent implements OnInit, OnDestro
nanoCpusLimit: null,
memoryBytesLimit: null,
computeTypeId: null,
command: null,

saveStudentWork: false,
workdirSize: null,
Expand Down Expand Up @@ -107,6 +108,7 @@ export class CourseTechnicalInformationFormComponent implements OnInit, OnDestro
nanoCpusLimit: obj?.nanoCpusLimit * 1e-9 || null,
memoryBytesLimit: obj?.memoryBytesLimit * 1e-9 || null,
computeTypeId: obj?.computeTypeId || this.defaultComputeTypeId,
command: obj?.command || null,

saveStudentWork: obj?.saveStudentWork || false,
workdirSize: obj?.workdirSize || null,
Expand Down
1 change: 1 addition & 0 deletions front/src/app/modules/admin-course/interfaces/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface IAdminCourseBase {
nanoCpusLimit: number;
memoryBytesLimit: number;
computeTypeId: number;
command: string;

saveStudentWork: boolean;
workdirSize: number;
Expand Down

0 comments on commit fc4d86b

Please sign in to comment.