Skip to content

Commit

Permalink
fix some syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ValT78 committed Mar 28, 2024
1 parent 124d5f7 commit 35b8bd4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion backend/proxmox_api/db/db_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def is_ip_available(ip): #permet de définir si l'ip est disponible... ou non
if Vm.query.filter_by(ip=ip).first():
return False
else:
return True;
return True

def getNextVmID(min = 110): # get the next vmid available. The minimum whould not be less than 110
if min <110 :
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h3 class="alert-heading">
<div class="spinner-border spinner-border-sm text-secondary" role="status" *ngIf="this.user.usedCPU == -1 || nb_cpu_max == -1">
</div>
<div class="progress" role="progressbar" aria-label="Basic example" aria-valuenow="1000" aria-valuemin="0" aria-valuemax="100" *ngIf="this.user.usedCPU != -1 && nb_cpu_max != -1">
<div class="progress-bar bg-success" style="width: {{(nb_cpu_max - (this.user.usedCPU +nb_cpu_selected))*100/nb_cpu_max}}%"></div>
<div class="progress-bar bg-success" [style.width.%]="(nb_cpu_max - (this.user.usedCPU +nb_cpu_selected))*100/nb_cpu_max"></div>
</div>
</div>
<div>
Expand All @@ -68,7 +68,7 @@ <h3 class="alert-heading">
</div>
<div class="progress" role="progressbar" aria-label="Basic example" aria-valuenow="1000" aria-valuemin="0" aria-valuemax="100" *ngIf="this.user.usedRAM != -1 && nb_ram_max != -1">

<div class="progress-bar bg-success" style="width: {{(nb_ram_max - (this.user.usedRAM +nb_ram_selected))*100/nb_ram_max}}%"></div>
<div class="progress-bar bg-success" [style.width.%]="(nb_ram_max - (this.user.usedRAM +nb_ram_selected))*100/nb_ram_max"></div>
</div>
</div>
<div>
Expand All @@ -77,7 +77,7 @@ <h3 class="alert-heading">
</div>
<div class="progress" role="progressbar" aria-label="Basic example" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" *ngIf="this.user.usedStorage != -1 && nb_storage_max != -1">

<div class="progress-bar bg-success" style="width: {{(nb_storage_max - (this.user.usedStorage +nb_storage_selected))*100/nb_storage_max}}%" ></div>
<div class="progress-bar bg-success" [style.width.%]="(nb_storage_max - (this.user.usedStorage +nb_storage_selected))*100/nb_storage_max" ></div>
</div>
</div>
</div>
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, OnInit, Input, SimpleChange, OnChanges, SimpleChanges} from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {UserService} from '../common/services/user.service';
import {Utils} from '../common/utils';
Expand All @@ -7,9 +7,6 @@ import {User} from '../models/user';
import {SlugifyPipe} from '../pipes/slugify.pipe';
import {Vm} from '../models/vm';
import {ActivatedRoute, Router} from '@angular/router';
import {timer} from 'rxjs';
import {mergeMap} from 'rxjs/operators';
import {Dns} from "../models/dns";
import {TranslateService} from "@ngx-translate/core";
import {CookieService} from "ngx-cookie-service";

Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/manual/manual.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
-moz-osx-font-smoothing: grayscale;
word-break: normal;
-moz-tab-size: 4;
tab-size: 4;
}

h2 {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/navbar/navbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { NavbarComponent } from './navbar.component';


describe('NavbarComponent', () => {
let component: NavbarComponent;
let fixture: ComponentFixture<NavbarComponent>;
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/app/vm/vm.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,17 @@ <h4>{{'vm.systemInformation' | translate}}</h4>
<div class="progress flex-fill">
<div *ngIf="user.vms[0].cpuUsage <= 50" class="progress-bar progress-bar-animated"
role="progressbar"
aria-valuemin="0" aria-valuemax="100" style="width: {{user.vms[0].cpuUsage}}%">
aria-valuemin="0" aria-valuemax="100" [style.width.%]="user.vms[0].cpuUsage">
</div>

<div *ngIf=" 50 < user.vms[0].cpuUsage && user.vms[0].cpuUsage <= 75"
class="progress-bar progress-bar-animated bg-warning" role="progressbar"
aria-valuemin="0" aria-valuemax="100" style="width: {{user.vms[0].cpuUsage}}%">
aria-valuemin="0" aria-valuemax="100" [style.width.%]="user.vms[0].cpuUsage">
</div>

<div *ngIf=" 75 < user.vms[0].cpuUsage" class="progress-bar progress-bar-animated bg-danger"
role="progressbar"
aria-valuemin="0" aria-valuemax="100" style="width: {{user.vms[0].cpuUsage}}%">
aria-valuemin="0" aria-valuemax="100" [style.width.%]="user.vms[0].cpuUsage">
</div>

</div>
Expand All @@ -200,17 +200,17 @@ <h4>{{'vm.systemInformation' | translate}}</h4>
<div class="progress flex-fill">
<div *ngIf="user.vms[0].ramUsage <= 50" class="progress-bar progress-bar-animated"
role="progressbar"
aria-valuemin="0" aria-valuemax="100" style="width: {{user.vms[0].ramUsage}}%">
aria-valuemin="0" aria-valuemax="100" [style.width.%]="user.vms[0].ramUsage">
</div>

<div *ngIf=" 50 < user.vms[0].ramUsage && user.vms[0].ramUsage <= 75"
class="progress-bar progress-bar-animated bg-warning" role="progressbar"
aria-valuemin="0" aria-valuemax="100" style="width: {{user.vms[0].ramUsage}}%">
aria-valuemin="0" aria-valuemax="100" [style.width.%]="user.vms[0].ramUsage">
</div>

<div *ngIf=" 75 < user.vms[0].ramUsage" class="progress-bar progress-bar-animated bg-danger"
role="progressbar"
aria-valuemin="0" aria-valuemax="100" style="width: {{user.vms[0].ramUsage}}%">
aria-valuemin="0" aria-valuemax="100" [style.width.%]="user.vms[0].ramUsage">
</div>
</div>
<span *ngIf="user.vms[0].ramUsage" style="float: right"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/vm/vm.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class VmComponent implements OnInit, OnDestroy {
this.editing = true;
}

secondsToDhms(seconds): string {
secondsToDhms(seconds: number): string {
seconds = Number(seconds);
const d = Math.floor(seconds / (3600 * 24));
const h = Math.floor(seconds % (3600 * 24) / 3600);
Expand All @@ -107,7 +107,7 @@ export class VmComponent implements OnInit, OnDestroy {
return dDisplay + hDisplay + mDisplay + sDisplay;
}

formatTimestamp(timestamp): string {
formatTimestamp(timestamp: number): string {
const date = new Date(timestamp*1000);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
Expand Down

0 comments on commit 35b8bd4

Please sign in to comment.