fixed conflicts
This commit is contained in:
24
Dockerfile
24
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;"]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
20
nginx.conf.bkp
Normal file
20
nginx.conf.bkp
Normal file
@@ -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;
|
||||
}
|
||||
@@ -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},
|
||||
];
|
||||
|
||||
16
src/app/components/pages/bit/bit.component.html
Normal file
16
src/app/components/pages/bit/bit.component.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="container">
|
||||
<div class="units">
|
||||
<div class="unit" (click)="onUnitClick('bit')">Bits</div>
|
||||
<div class="unit" (click)="onUnitClick('bytes')">Bytes</div>
|
||||
<div class="unit" (click)="onUnitClick('mb')">MegaBytes</div>
|
||||
<div class="unit" (click)="onUnitClick('gb')">GigaBytes</div>
|
||||
<div class="unit" (click)="onUnitClick('pb')">PetaBytes</div>
|
||||
</div>
|
||||
<div class="input">
|
||||
<label for="cal-value">Enter Value: </label>
|
||||
<input type="text" id="cal-value" class=form-control name="calc-value" [(ngModel)]="value"><span> GB</span>
|
||||
</div>
|
||||
<div class="output">
|
||||
<p>{{ value * factor }} {{selectedUnit}}</p>
|
||||
</div>
|
||||
</div>
|
||||
29
src/app/components/pages/bit/bit.component.scss
Normal file
29
src/app/components/pages/bit/bit.component.scss
Normal file
@@ -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%;
|
||||
}
|
||||
|
||||
23
src/app/components/pages/bit/bit.component.spec.ts
Normal file
23
src/app/components/pages/bit/bit.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BitComponent } from './bit.component';
|
||||
|
||||
describe('BitComponent', () => {
|
||||
let component: BitComponent;
|
||||
let fixture: ComponentFixture<BitComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [BitComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(BitComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
45
src/app/components/pages/bit/bit.component.ts
Normal file
45
src/app/components/pages/bit/bit.component.ts
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user