Skip to content

Commit

Permalink
fix(Linting):blacked code
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and github-actions[bot] committed Oct 21, 2024
1 parent 1ecd996 commit 561b0f1
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 57 deletions.
78 changes: 39 additions & 39 deletions src/app/facility_manager/resources/resource-machine.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
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))
}
}
}
}

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))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/virtualmachines/virtualmachinemodels/imageTypes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Image Types enum.
*/
// eslint-disable-next-line no-shadow

export enum ImageTypes {
IMAGE = 'IMAGE',
CLUSTER_IMAGE = 'CLUSTER_IMAGE',
Expand Down
23 changes: 10 additions & 13 deletions src/app/virtualmachines/workshop/workshop-urlinfo.model.ts
Original file line number Diff line number Diff line change
@@ -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<UrlData>) {
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<WorkshopUrlInfoModel>) {
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))
}
}
}
}

}
4 changes: 0 additions & 4 deletions src/app/vo_manager/vo-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> | Promise<boolean> | 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)
}
})
Expand Down

0 comments on commit 561b0f1

Please sign in to comment.