This commit is contained in:
Mosiur Rahman
2025-02-06 20:15:01 +06:00
10 changed files with 151 additions and 28 deletions

View File

@@ -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;"]

View File

@@ -10,11 +10,9 @@ events {
http { http {
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; 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; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
# Include the default server configuration
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
} }

20
nginx.conf.bkp Normal file
View 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;
}

View File

@@ -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 { NoMansLandComponent } from './components/pages/no-mans-land/no-mans-land.component';
import { ToolListComponent } from './components/pages/tool-list/tool-list.component'; import { ToolListComponent } from './components/pages/tool-list/tool-list.component';
import { LoginComponent } from './components/pages/login/login.component'; import { LoginComponent } from './components/pages/login/login.component';
import { BitComponent } from './components/pages/bit/bit.component';
export const routes: Routes = [ export const routes: Routes = [
{path: "", component: NoMansLandComponent}, {path: "", component: NoMansLandComponent},
@@ -11,5 +12,6 @@ export const routes: Routes = [
{path: "update", component: ShiftUpdateComponent}, {path: "update", component: ShiftUpdateComponent},
{path: "creds", component: ToolListComponent }, {path: "creds", component: ToolListComponent },
{path: "login", component: LoginComponent }, {path: "login", component: LoginComponent },
{path: 'bits', component: BitComponent},
{path: "**", component: NoMansLandComponent}, {path: "**", component: NoMansLandComponent},
]; ];

View File

@@ -19,13 +19,6 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<<<<<<< HEAD
<tr *ngFor="let backup of backupVolumes">
<td><a target="_blank" [href]=backup.projectURL>{{backup.projectName}}</a></td>
<td><a target="_blank" [href]=backup.volumeURL>{{backup.volumeName}}</a></td>
<td class="copyName" #copy (click)="copyName(copy)">{{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud</td>
</tr>
=======
<ng-container *ngFor="let backup of backupVolumes"> <ng-container *ngFor="let backup of backupVolumes">
<tr *ngIf="backup.backupDay.includes(today)"> <tr *ngIf="backup.backupDay.includes(today)">
<td><a target="_blank" [href]=backup.projectURL>{{backup.projectName}}</a></td> <td><a target="_blank" [href]=backup.projectURL>{{backup.projectName}}</a></td>
@@ -33,7 +26,6 @@
<td class="copyName" #copy (click)="copyName(copy)">{{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud</td> <td class="copyName" #copy (click)="copyName(copy)">{{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud</td>
</tr> </tr>
</ng-container> </ng-container>
>>>>>>> 01af0bf3951d914c030f1d261a3f1a53c28f6d10
</tbody> </tbody>
</table> </table>
</div> </div>

View 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>

View 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%;
}

View 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();
});
});

View 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;
}
}
}

View File

@@ -3,9 +3,5 @@ export class Backup{
projectURL!: string; projectURL!: string;
volumeName!: string; volumeName!: string;
volumeURL!: string; volumeURL!: string;
<<<<<<< HEAD
day!: string;
=======
backupDay!: string[]; backupDay!: string[];
>>>>>>> 01af0bf3951d914c030f1d261a3f1a53c28f6d10
} }