diff --git a/Dockerfile b/Dockerfile index 8c6380e..c220e01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,23 @@ -FROM ubuntu:plucky +FROM node AS build -RUN apt update && apt upgrade -y +WORKDIR /app -RUN apt install git -y +COPY package*.json ./ -RUN mkdir library && cd library +RUN npm install -WORKDIR ~/library/ +COPY . . -RUN git init +RUN npm run build --configuration=production -RUN git remote add origin https://github.com/dumsilor/library.git +FROM nginx -RUN git pull origin master +COPY --from=build /app/dist/navigator/browser /usr/share/nginx/html -RUN apt install npm +COPY nginx.conf /etc/nginx/nginx.conf -RUN npm i +COPY default.conf /etc/nginx/conf.d/default.conf -CMD ["ng","serve"] +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index 8ed59da..0c87e5f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -10,11 +10,9 @@ events { http { include /etc/nginx/mime.types; default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; + + # Include the default server configuration include /etc/nginx/conf.d/*.conf; } diff --git a/nginx.conf.bkp b/nginx.conf.bkp new file mode 100644 index 0000000..8ed59da --- /dev/null +++ b/nginx.conf.bkp @@ -0,0 +1,20 @@ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log /var/log/nginx/access.log main; + sendfile on; + keepalive_timeout 65; + include /etc/nginx/conf.d/*.conf; +} diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index bce33ed..a77a089 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -4,6 +4,7 @@ import { ShiftUpdateComponent } from './components/pages/shift-update/shift-upda import { NoMansLandComponent } from './components/pages/no-mans-land/no-mans-land.component'; import { ToolListComponent } from './components/pages/tool-list/tool-list.component'; import { LoginComponent } from './components/pages/login/login.component'; +import { BitComponent } from './components/pages/bit/bit.component'; export const routes: Routes = [ {path: "", component: NoMansLandComponent}, @@ -11,5 +12,6 @@ export const routes: Routes = [ {path: "update", component: ShiftUpdateComponent}, {path: "creds", component: ToolListComponent }, {path: "login", component: LoginComponent }, + {path: 'bits', component: BitComponent}, {path: "**", component: NoMansLandComponent}, ]; diff --git a/src/app/components/pages/backup-list/backup-list.component.html b/src/app/components/pages/backup-list/backup-list.component.html index 0f26cea..736db8c 100644 --- a/src/app/components/pages/backup-list/backup-list.component.html +++ b/src/app/components/pages/backup-list/backup-list.component.html @@ -19,13 +19,6 @@ -<<<<<<< HEAD - - {{backup.projectName}} - {{backup.volumeName}} - {{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud - -======= {{backup.projectName}} @@ -33,7 +26,6 @@ {{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud ->>>>>>> 01af0bf3951d914c030f1d261a3f1a53c28f6d10 diff --git a/src/app/components/pages/bit/bit.component.html b/src/app/components/pages/bit/bit.component.html new file mode 100644 index 0000000..18f1d55 --- /dev/null +++ b/src/app/components/pages/bit/bit.component.html @@ -0,0 +1,16 @@ +
+
+
Bits
+
Bytes
+
MegaBytes
+
GigaBytes
+
PetaBytes
+
+
+ + GB +
+
+

{{ value * factor }} {{selectedUnit}}

+
+
\ No newline at end of file diff --git a/src/app/components/pages/bit/bit.component.scss b/src/app/components/pages/bit/bit.component.scss new file mode 100644 index 0000000..00271a4 --- /dev/null +++ b/src/app/components/pages/bit/bit.component.scss @@ -0,0 +1,29 @@ +.container { + margin: 2rem; + + .units{ + display: flex; + padding-bottom: 2rem; + .unit{ + padding: 1rem; + cursor: pointer; + &:hover{ + background-color: lightcoral; + border-radius: 10px; + } + } + } +} + +label { + padding-right: 1rem; +} + +input{ + border: none; + border-bottom: 2px solid black; + border-radius: 5px; + padding-left: 1rem; + width: 20%; +} + diff --git a/src/app/components/pages/bit/bit.component.spec.ts b/src/app/components/pages/bit/bit.component.spec.ts new file mode 100644 index 0000000..eb71bc9 --- /dev/null +++ b/src/app/components/pages/bit/bit.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BitComponent } from './bit.component'; + +describe('BitComponent', () => { + let component: BitComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [BitComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(BitComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/pages/bit/bit.component.ts b/src/app/components/pages/bit/bit.component.ts new file mode 100644 index 0000000..39043d5 --- /dev/null +++ b/src/app/components/pages/bit/bit.component.ts @@ -0,0 +1,45 @@ +import { CommonModule } from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { FormsModule } from '@angular/forms'; + +@Component({ + selector: 'app-bit', + standalone: true, + imports: [CommonModule,FormsModule], + templateUrl: './bit.component.html', + styleUrl: './bit.component.scss' +}) +export class BitComponent implements OnInit { + value: number = 0; + selectedUnit: string = ""; + factor: number = 0; + + + ngOnInit(): void { + } + +onUnitClick(unit: string){ + this.selectedUnit = unit; + switch (unit) { + case 'bit': + this.factor = 1024 ** 2 * 8 ; + break; + case 'bytes': + this.factor = 1024 ** 2 ; + break; + case 'mb': + this.factor = 1024 ** 1 ; + break; + case 'gb': + this.factor = 1 ; + break; + case 'pb': + this.factor = 1/1024 ; + break; + default: + break; + } +} + + +} diff --git a/src/app/shared/model/backup.model.ts b/src/app/shared/model/backup.model.ts index 9240674..8ac948b 100644 --- a/src/app/shared/model/backup.model.ts +++ b/src/app/shared/model/backup.model.ts @@ -3,9 +3,5 @@ export class Backup{ projectURL!: string; volumeName!: string; volumeURL!: string; -<<<<<<< HEAD - day!: string; -======= backupDay!: string[]; ->>>>>>> 01af0bf3951d914c030f1d261a3f1a53c28f6d10 -} \ No newline at end of file +}