diff --git a/src/app/facility_manager/resources/resource-machine.ts b/src/app/facility_manager/resources/resource-machine.ts index 7156a59a5f..d28d397331 100644 --- a/src/app/facility_manager/resources/resource-machine.ts +++ b/src/app/facility_manager/resources/resource-machine.ts @@ -1,51 +1,51 @@ -import { ComputecenterComponent } from '../../projectmanagement/computecenter.component'; -import { GPUSpecification } from './gpu-specification'; +import { ComputecenterComponent } from '../../projectmanagement/computecenter.component' +import { GPUSpecification } from './gpu-specification' /** * ResourceMachine class. */ export class ResourceMachine { - id: string; - compute_center: ComputecenterComponent; - name: string; - ram_public_factor: number = 1; - ram_private_factor: number = 1; - cores: number = 0; - cores_private_factor: number = 1; - cores_public_factor: number = 1; - gpu_slots: number = 0; - gpu_used: GPUSpecification[] = []; - public_count: number = 0; - private_count: number = 0; - ram: number = 0; - type: string = 'GENERAL_PURPOSE'; - local_disk_storage: number = 0; - local_disk_encrypted: boolean = false; + id: string + compute_center: ComputecenterComponent + name: string + ram_public_factor: number = 1 + ram_private_factor: number = 1 + cores: number = 0 + cores_private_factor: number = 1 + cores_public_factor: number = 1 + gpu_slots: number = 0 + gpu_used: GPUSpecification[] = [] + public_count: number = 0 + private_count: number = 0 + ram: number = 0 + type: string = 'GENERAL_PURPOSE' + local_disk_storage: number = 0 + local_disk_encrypted: boolean = false constructor(resourceMachine: ResourceMachine | null) { if (resourceMachine) { - this.id = resourceMachine.id; - this.compute_center = resourceMachine.compute_center; - this.name = resourceMachine.name; - // eslint-disable-next-line no-multi-assign,no-param-reassign - this.ram_public_factor = resourceMachine.ram_public_factor = 1; - // eslint-disable-next-line no-multi-assign,no-param-reassign - this.ram_private_factor = resourceMachine.ram_private_factor = 1; - this.cores = resourceMachine.cores; - this.local_disk_storage = resourceMachine.local_disk_storage; - this.local_disk_encrypted = resourceMachine.local_disk_encrypted; - this.cores_private_factor = resourceMachine.cores_private_factor; - this.cores_public_factor = resourceMachine.cores_public_factor; - this.gpu_slots = resourceMachine.gpu_slots; - this.gpu_used = resourceMachine.gpu_used; - this.public_count = resourceMachine.public_count; - this.private_count = resourceMachine.private_count; - this.ram = resourceMachine.ram; - this.type = resourceMachine.type; + this.id = resourceMachine.id + this.compute_center = resourceMachine.compute_center + this.name = resourceMachine.name + + this.ram_public_factor = resourceMachine.ram_public_factor = 1 + + this.ram_private_factor = resourceMachine.ram_private_factor = 1 + this.cores = resourceMachine.cores + this.local_disk_storage = resourceMachine.local_disk_storage + this.local_disk_encrypted = resourceMachine.local_disk_encrypted + this.cores_private_factor = resourceMachine.cores_private_factor + this.cores_public_factor = resourceMachine.cores_public_factor + this.gpu_slots = resourceMachine.gpu_slots + this.gpu_used = resourceMachine.gpu_used + this.public_count = resourceMachine.public_count + this.private_count = resourceMachine.private_count + this.ram = resourceMachine.ram + this.type = resourceMachine.type if (this.gpu_used.length < this.gpu_slots) { while (this.gpu_used.length < this.gpu_slots) { - this.gpu_used.push(new GPUSpecification(null)); + this.gpu_used.push(new GPUSpecification(null)) } } } @@ -53,10 +53,10 @@ export class ResourceMachine { changeGpuUsed(): void { if (this.gpu_slots < this.gpu_used.length) { - this.gpu_used = this.gpu_used.slice(0, this.gpu_slots); + this.gpu_used = this.gpu_used.slice(0, this.gpu_slots) } else { while (this.gpu_slots > this.gpu_used.length) { - this.gpu_used.push(new GPUSpecification(null)); + this.gpu_used.push(new GPUSpecification(null)) } } } diff --git a/src/app/virtualmachines/virtualmachinemodels/imageTypes.ts b/src/app/virtualmachines/virtualmachinemodels/imageTypes.ts index 8cfe6d4624..b2662b57e5 100644 --- a/src/app/virtualmachines/virtualmachinemodels/imageTypes.ts +++ b/src/app/virtualmachines/virtualmachinemodels/imageTypes.ts @@ -1,7 +1,7 @@ /** * Image Types enum. */ -// eslint-disable-next-line no-shadow + export enum ImageTypes { IMAGE = 'IMAGE', CLUSTER_IMAGE = 'CLUSTER_IMAGE', diff --git a/src/app/virtualmachines/workshop/workshop-urlinfo.model.ts b/src/app/virtualmachines/workshop/workshop-urlinfo.model.ts index ab256c226b..bb9914b212 100644 --- a/src/app/virtualmachines/workshop/workshop-urlinfo.model.ts +++ b/src/app/virtualmachines/workshop/workshop-urlinfo.model.ts @@ -1,30 +1,27 @@ -// eslint-disable-next-line max-classes-per-file export class UrlData { - user_email: string; - user_name: string; - resenv_url: string; + user_email: string + user_name: string + resenv_url: string constructor(url_data?: Partial) { - Object.assign(this, url_data); + Object.assign(this, url_data) } } export class WorkshopUrlInfoModel { - - longname: string; - shortname: string; - url_data: UrlData[]; + longname: string + shortname: string + url_data: UrlData[] constructor(workshop_info?: Partial) { - Object.assign(this, workshop_info); + Object.assign(this, workshop_info) if (workshop_info) { if (workshop_info.url_data) { - this.url_data = []; + this.url_data = [] for (const url_data of workshop_info.url_data) { - this.url_data.push(new UrlData(url_data)); + this.url_data.push(new UrlData(url_data)) } } } } - } diff --git a/src/app/vo_manager/vo-guard.service.ts b/src/app/vo_manager/vo-guard.service.ts index cad5b4abc9..291e3b377d 100644 --- a/src/app/vo_manager/vo-guard.service.ts +++ b/src/app/vo_manager/vo-guard.service.ts @@ -13,18 +13,14 @@ import { is_vo } from '../shared/globalvar' export class VoGuardService { constructor(private router: Router) {} - // eslint-disable-next-line @typescript-eslint/no-unused-vars canActivate( route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): Observable | Promise | boolean { - // eslint-disable-next-line @typescript-eslint/no-unused-vars return new Promise((resolve: any, reject: any): any => { if (is_vo) { - // eslint-disable-next-line no-promise-executor-return return resolve(true) } else { - // eslint-disable-next-line no-promise-executor-return return resolve(false) } })