From 0c80d41e0221b704ca93207a0d9d24eaff0bcf47 Mon Sep 17 00:00:00 2001 From: Mosiur Date: Wed, 18 Dec 2024 19:25:12 +0000 Subject: [PATCH 01/10] New Branch --- Dockerfile | 21 ++++++++++++ backend-server/.dockerignore | 7 ++++ backend-server/Dockerfile | 19 +++++++++++ backend-server/Dockerfile.bkp2 | 44 ++++++++++++++++++++++++++ backend-server/docker-compose.yml | 11 +++++++ backend-server/docker-compose.yml.bkp2 | 17 ++++++++++ backend-server/package.json | 3 +- backend-server/package.json.bkp | 29 +++++++++++++++++ backend-server/src/index.ts | 13 ++++---- backend-server/test/Dockerfile | 7 ++++ backend-server/test/package.json | 29 +++++++++++++++++ default.conf | 14 ++++++++ docker-compose.yml | 6 ++++ nginx.conf | 20 ++++++++++++ src/app/shared/constants/backend.ts | 4 +-- 15 files changed, 234 insertions(+), 10 deletions(-) create mode 100644 Dockerfile create mode 100644 backend-server/.dockerignore create mode 100644 backend-server/Dockerfile create mode 100644 backend-server/Dockerfile.bkp2 create mode 100644 backend-server/docker-compose.yml create mode 100644 backend-server/docker-compose.yml.bkp2 create mode 100644 backend-server/package.json.bkp create mode 100644 backend-server/test/Dockerfile create mode 100644 backend-server/test/package.json create mode 100644 default.conf create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8c6380e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:plucky + +RUN apt update && apt upgrade -y + +RUN apt install git -y + +RUN mkdir library && cd library + +WORKDIR ~/library/ + +RUN git init + +RUN git remote add origin https://github.com/dumsilor/library.git + +RUN git pull origin master + +RUN apt install npm + +RUN npm i + +CMD ["ng","serve"] diff --git a/backend-server/.dockerignore b/backend-server/.dockerignore new file mode 100644 index 0000000..c7e9903 --- /dev/null +++ b/backend-server/.dockerignore @@ -0,0 +1,7 @@ +node_modules +logs +*.log +*.md +Dockerfile +docker-compose.yml + diff --git a/backend-server/Dockerfile b/backend-server/Dockerfile new file mode 100644 index 0000000..caf52f8 --- /dev/null +++ b/backend-server/Dockerfile @@ -0,0 +1,19 @@ +FROM node:22-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN chown -R node:node /app + +USER node + +RUN npm i --production + +RUN npm install --save-dev @types/cors + +COPY . . + +EXPOSE 3000 + +CMD ["npm","start"] diff --git a/backend-server/Dockerfile.bkp2 b/backend-server/Dockerfile.bkp2 new file mode 100644 index 0000000..18dee78 --- /dev/null +++ b/backend-server/Dockerfile.bkp2 @@ -0,0 +1,44 @@ +# Use the official Ubuntu base image +FROM ubuntu:22.04 + +# Set environment variables to avoid prompts during package installations +ENV DEBIAN_FRONTEND=noninteractive + +# Update the package list and install necessary dependencies +RUN apt-get update && apt-get install -y \ + curl \ + gnupg2 \ + build-essential \ + unzip + +RUN curl -fsSL https://fnm.vercel.app/install | bash \ + && export PATH="/root/.fnm:$PATH" \ + && eval "$(fnm env)" \ + && fnm install 22 \ + && fnm use 22 \ + && fnm alias default 22 + +# Install nodemon globally +RUN export PATH="/root/.fnm:$PATH" \ + && eval "$(fnm env)" \ + && npm install -g nodemon + +# Set the working directory inside the container +WORKDIR /home/node/app + +# Copy the package.json and package-lock.json files to the container +COPY package*.json ./ + +# Install the application dependencies +RUN export PATH="/root/.fnm:$PATH" \ + && eval "$(fnm env)" \ + && npm install --legacy-peer-deps + +# Copy the rest of the application code to the container +COPY . . + +# Expose the application port +EXPOSE 3000 + +# Default command (can be overridden by docker-compose) +CMD ["npm", "start"] diff --git a/backend-server/docker-compose.yml b/backend-server/docker-compose.yml new file mode 100644 index 0000000..c144f1b --- /dev/null +++ b/backend-server/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3.8' + +services: + link-manage-backend: + build: . + ports: + - "3000:3000" + environment: + - NODE_ENV=production + deploy: + replicas: 3 diff --git a/backend-server/docker-compose.yml.bkp2 b/backend-server/docker-compose.yml.bkp2 new file mode 100644 index 0000000..046e5e4 --- /dev/null +++ b/backend-server/docker-compose.yml.bkp2 @@ -0,0 +1,17 @@ + +services: + link-manage-backend: + image: "node:23" + user: "node" + working_dir: /home/node/app + environment: + - NODE_ENV=production + volumes: + - ./:/home/node/app + expose: + - "3000" + ports: + - "3000:3000" + command: + - "npm i" + - "npm start" diff --git a/backend-server/package.json b/backend-server/package.json index 9328b53..4c18e2f 100644 --- a/backend-server/package.json +++ b/backend-server/package.json @@ -4,7 +4,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start": "cd src && nodemon index.ts", + "start": "cd src && ts-node index.ts", "build": "tsc", "serve": "node dist/index.js" }, @@ -13,7 +13,6 @@ "license": "ISC", "description": "", "dependencies": { - "bcrypt": "^5.1.1", "cors": "^2.8.5", "crypto": "^1.0.1", "express": "^4.21.1", diff --git a/backend-server/package.json.bkp b/backend-server/package.json.bkp new file mode 100644 index 0000000..9328b53 --- /dev/null +++ b/backend-server/package.json.bkp @@ -0,0 +1,29 @@ +{ + "name": "backend-server", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "cd src && nodemon index.ts", + "build": "tsc", + "serve": "node dist/index.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "bcrypt": "^5.1.1", + "cors": "^2.8.5", + "crypto": "^1.0.1", + "express": "^4.21.1", + "mongoose": "^8.8.2" + }, + "devDependencies": { + "@types/bcrypt": "^5.0.2", + "@types/express": "^5.0.0", + "@types/node": "^22.9.3", + "ts-node": "^10.9.2", + "typescript": "^5.7.2" + } +} diff --git a/backend-server/src/index.ts b/backend-server/src/index.ts index 11b6ebf..10810c9 100644 --- a/backend-server/src/index.ts +++ b/backend-server/src/index.ts @@ -1,8 +1,8 @@ import express from "express"; import cors from 'cors'; import mongoose from 'mongoose'; -import {vols} from "../../src/app/backup" -import {all_tools} from "../../src/app/urls" +//import {vols} from "../../src/app/backup" +//import {all_tools} from "../../src/app/urls" import crypto from "crypto"; import bcrypt from "bcrypt" @@ -98,7 +98,7 @@ app.get("/seed-backup", async (req,res)=>{ // if (backupCount > 0) { // res.send("Seed already done") // } - BackupModel.create(vols) +// BackupModel.create(vols) }) app.get("/", (req,res)=>{ @@ -183,8 +183,9 @@ function decryptPassword(encryptedPassword: string, iv: string) { } app.get("/api/seed-creds",async(req,res)=>{ - const all_creds: ICreds[] = all_tools; - for (const cred of all_creds) { +// const all_creds: ICreds[] = all_tools; + const all_creds: ICreds[] = []; + for (const cred of all_creds) { const { iv, encryptedPassword} = encryptPassword(cred.password) const newCred =new CredsModel({ @@ -217,4 +218,4 @@ app.get("/api/secrets",async(req,res)=>{ const PORT = 3000; app.listen(PORT,()=>{ console.log(`Server started on port ${PORT}`) -}) \ No newline at end of file +}) diff --git a/backend-server/test/Dockerfile b/backend-server/test/Dockerfile new file mode 100644 index 0000000..83f887b --- /dev/null +++ b/backend-server/test/Dockerfile @@ -0,0 +1,7 @@ +FROM node + +WORKDIR /app + +COPY ./package.json . + + diff --git a/backend-server/test/package.json b/backend-server/test/package.json new file mode 100644 index 0000000..9328b53 --- /dev/null +++ b/backend-server/test/package.json @@ -0,0 +1,29 @@ +{ + "name": "backend-server", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "cd src && nodemon index.ts", + "build": "tsc", + "serve": "node dist/index.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "bcrypt": "^5.1.1", + "cors": "^2.8.5", + "crypto": "^1.0.1", + "express": "^4.21.1", + "mongoose": "^8.8.2" + }, + "devDependencies": { + "@types/bcrypt": "^5.0.2", + "@types/express": "^5.0.0", + "@types/node": "^22.9.3", + "ts-node": "^10.9.2", + "typescript": "^5.7.2" + } +} diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..cad35cd --- /dev/null +++ b/default.conf @@ -0,0 +1,14 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9f032c1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3.9' +services: + navigator: + build: . + ports: + - "12180:80" diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..8ed59da --- /dev/null +++ b/nginx.conf @@ -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/shared/constants/backend.ts b/src/app/shared/constants/backend.ts index fac0041..21b5491 100644 --- a/src/app/shared/constants/backend.ts +++ b/src/app/shared/constants/backend.ts @@ -1,8 +1,8 @@ -const MAIN_URL = "http://localhost:3000/api" +const MAIN_URL = "http://118.67.213.117:3000/api" export const BACKUP_GET_URL = `${MAIN_URL}/backup`; export const UPDATE_GET_URL = `${MAIN_URL}/update`; export const UPDATE_ADD_URL = `${UPDATE_GET_URL}/add`; export const UPDATE_COMPLETE_URL = `${UPDATE_GET_URL}/complete`; export const UPDATE_DELETE_URL = `${UPDATE_GET_URL}/delete`; -export const SECRET_URL = `${MAIN_URL}/secrets`; \ No newline at end of file +export const SECRET_URL = `${MAIN_URL}/secrets`; From 89aa9fc0f47979a4151b39996bc4f5a9b09172b5 Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Thu, 19 Dec 2024 02:05:49 +0600 Subject: [PATCH 02/10] Added jenkinsFile --- jenkinsFile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 jenkinsFile diff --git a/jenkinsFile b/jenkinsFile new file mode 100644 index 0000000..c185525 --- /dev/null +++ b/jenkinsFile @@ -0,0 +1,22 @@ +pipeline { + agent any + + + stages{ + stage('Build') { + steps { + echo 'Building...' + } + } + stage('Test') { + steps { + echo 'Testing...' + } + } + stage('Deploy') { + steps { + echo 'Deploying...' + } + } + } +} \ No newline at end of file From 510394fdc74971037823bd06b22e09b17a2b4a31 Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Sun, 22 Dec 2024 10:52:31 +0600 Subject: [PATCH 03/10] Added the edit button --- .../shift-update/shift-update.component.html | 54 +++++++++++++------ .../shift-update/shift-update.component.scss | 20 +++++++ .../shift-update/shift-update.component.ts | 18 ++++++- .../input-form/input-form.component.scss | 3 +- 4 files changed, 75 insertions(+), 20 deletions(-) diff --git a/src/app/components/pages/shift-update/shift-update.component.html b/src/app/components/pages/shift-update/shift-update.component.html index 6671335..d05db5f 100644 --- a/src/app/components/pages/shift-update/shift-update.component.html +++ b/src/app/components/pages/shift-update/shift-update.component.html @@ -12,23 +12,43 @@ - - {{updateData.Date}} - {{updateData.Details | shorten:getRowNumber(i)}} - {{updateData.Remarks | shorten:getRowNumber(i)}} - {{updateData.Sales_Concern}} - {{updateData.Reference | shorten:getRowNumber(i)}} - {{updateData.Handler}} - {{updateData.Status}} - - - - - + + + + {{updateData.Date}} + {{updateData.Details | shorten:getRowNumber(i)}} + {{updateData.Remarks | shorten:getRowNumber(i)}} + {{updateData.Sales_Concern}} + {{updateData.Reference | shorten:getRowNumber(i)}} + {{updateData.Handler}} + {{updateData.Status}} + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/components/pages/shift-update/shift-update.component.scss b/src/app/components/pages/shift-update/shift-update.component.scss index ff5becc..d18c9aa 100644 --- a/src/app/components/pages/shift-update/shift-update.component.scss +++ b/src/app/components/pages/shift-update/shift-update.component.scss @@ -94,3 +94,23 @@ td { background-color: darken($danger, 20); } } + +.edit{ + background-color: yellowgreen; + border: none; + height: 2rem; + width: 2.5rem; + border-radius: 10px; + margin-top: 5px; + &:hover { + background-color: darken(yellowgreen, 20); + } +} + + +.edit-input { + input{ + max-width: 100px; + + } +} \ No newline at end of file diff --git a/src/app/components/pages/shift-update/shift-update.component.ts b/src/app/components/pages/shift-update/shift-update.component.ts index c983d63..df63b27 100644 --- a/src/app/components/pages/shift-update/shift-update.component.ts +++ b/src/app/components/pages/shift-update/shift-update.component.ts @@ -7,11 +7,12 @@ import { InputFormComponent } from "../../../shared/components/input-form/input- import { Update } from '../../../shared/model/update.model'; import { CommonModule } from '@angular/common'; import { ShortenPipe } from '../../../shared/pipe/shorten.pipe'; +import { FormsModule } from '@angular/forms'; @Component({ selector: 'app-shift-update', standalone: true, - imports: [TitleComponent, InputFormComponent, CommonModule, ShortenPipe], + imports: [TitleComponent, InputFormComponent, CommonModule, ShortenPipe, FormsModule], templateUrl: './shift-update.component.html', styleUrl: './shift-update.component.scss', providers: [UpdateService] @@ -21,7 +22,8 @@ export class ShiftUpdateComponent implements OnInit, OnDestroy { updateDataList!: Update[]; updateListSubscription!: Subscription; todayDate!: String; - + editMode = false; + editIndex: number | null = null; constructor(private updateService: UpdateService) {} @@ -78,6 +80,9 @@ onDelete(data: any) { }) } +onEdit(index: number) { + this.editIndex = index; +} // clickToAdd(){ // const test_update: Update = { // id: "", @@ -96,6 +101,15 @@ onDelete(data: any) { // }) // } +onEditSave() { + // +} + +onCancel() +{ + this.editIndex = null; +} + private fetchUpdates(): void { this.updateService.allUpdate().subscribe((update) => { this.updateDataList = update; diff --git a/src/app/shared/components/input-form/input-form.component.scss b/src/app/shared/components/input-form/input-form.component.scss index 6ee7132..4680762 100644 --- a/src/app/shared/components/input-form/input-form.component.scss +++ b/src/app/shared/components/input-form/input-form.component.scss @@ -51,8 +51,9 @@ .toggle{ position: fixed; - right: 2.5rem; + right: 2rem; bottom: 0; + z-index: 100; } i { From 4c080f44d14c6ac2ff94392e78ff87dc70394bbb Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Fri, 3 Jan 2025 01:37:01 +0600 Subject: [PATCH 04/10] Updated the backend and select enabled --- backend-server/src/index.ts | 6 ++++-- jenkinsFile | 12 +++++++----- .../pages/backup-list/backup-list.component.scss | 6 +++--- src/app/shared/model/backup.model.ts | 1 + 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/backend-server/src/index.ts b/backend-server/src/index.ts index 10810c9..e3dc980 100644 --- a/backend-server/src/index.ts +++ b/backend-server/src/index.ts @@ -23,7 +23,8 @@ interface IBackup { projectName: string, projectURL: string, volumeName: string, - volumeURL: string + volumeURL: string, + day: string } interface IUpdate { @@ -49,7 +50,8 @@ const backupSchema = new mongoose.Schema({ projectName: String, projectURL: String, volumeName: String, - volumeURL: String + volumeURL: String, + day: }, { toJSON: { virtuals: true }, diff --git a/jenkinsFile b/jenkinsFile index c185525..9315e2d 100644 --- a/jenkinsFile +++ b/jenkinsFile @@ -1,16 +1,18 @@ pipeline { agent any - + tools { + nodejs 'nodejs' + } stages{ - stage('Build') { + stage('Checkout') { steps { - echo 'Building...' + git branch: 'jenkins-build' url: 'https://github.com/dumsilor/link-manage.git' } } - stage('Test') { + stage('Install Dependencies') { steps { - echo 'Testing...' + sh 'npm install' } } stage('Deploy') { diff --git a/src/app/components/pages/backup-list/backup-list.component.scss b/src/app/components/pages/backup-list/backup-list.component.scss index 7308aa2..0a18e34 100644 --- a/src/app/components/pages/backup-list/backup-list.component.scss +++ b/src/app/components/pages/backup-list/backup-list.component.scss @@ -66,9 +66,9 @@ td:nth-child(3):active { td { padding: 0.7rem 0.5rem; - -webkit-user-select: none; /* Safari */ - -ms-user-select: none; /* IE 10 and IE 11 */ - user-select: none; /* Standard syntax */ + // -webkit-user-select: none; /* Safari */ + // -ms-user-select: none; /* IE 10 and IE 11 */ + // user-select: none; /* Standard syntax */ } a{ diff --git a/src/app/shared/model/backup.model.ts b/src/app/shared/model/backup.model.ts index 776b063..2ada993 100644 --- a/src/app/shared/model/backup.model.ts +++ b/src/app/shared/model/backup.model.ts @@ -3,4 +3,5 @@ export class Backup{ projectURL!: string; volumeName!: string; volumeURL!: string; + day!: string; } \ No newline at end of file From 33016e36af7f4cfadd6830cf1a25aef493a3be51 Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Fri, 3 Jan 2025 02:43:29 +0600 Subject: [PATCH 05/10] fixed bug for backend --- backend-server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-server/src/index.ts b/backend-server/src/index.ts index e3dc980..af3b8a6 100644 --- a/backend-server/src/index.ts +++ b/backend-server/src/index.ts @@ -51,7 +51,7 @@ const backupSchema = new mongoose.Schema({ projectURL: String, volumeName: String, volumeURL: String, - day: + day: String }, { toJSON: { virtuals: true }, From b0bd22a2ba1e0786ada977544f1831af998eb29f Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Fri, 3 Jan 2025 02:46:48 +0600 Subject: [PATCH 06/10] fixed bug for backend --- backend-server/docker-compose.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend-server/docker-compose.yml b/backend-server/docker-compose.yml index c144f1b..59e30e0 100644 --- a/backend-server/docker-compose.yml +++ b/backend-server/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: link-manage-backend: build: . @@ -8,4 +6,4 @@ services: environment: - NODE_ENV=production deploy: - replicas: 3 + replicas: 1 From 2d5991dbf7c408f790b8095d3557bd8914e951ac Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Sun, 5 Jan 2025 00:21:30 +0600 Subject: [PATCH 07/10] Login Component added --- docker-compose.yml | 1 - src/app/app.routes.ts | 2 + .../backup-list/backup-list.component.html | 2 - .../pages/login/login.component.html | 7 ++ .../pages/login/login.component.scss | 0 .../pages/login/login.component.spec.ts | 23 ++++ .../components/pages/login/login.component.ts | 14 +++ src/app/urls.ts.bkp | 112 ++++++++++++++++++ 8 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 src/app/components/pages/login/login.component.html create mode 100644 src/app/components/pages/login/login.component.scss create mode 100644 src/app/components/pages/login/login.component.spec.ts create mode 100644 src/app/components/pages/login/login.component.ts create mode 100644 src/app/urls.ts.bkp diff --git a/docker-compose.yml b/docker-compose.yml index 9f032c1..634cf5b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3.9' services: navigator: build: . diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 3d4b175..bce33ed 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -3,11 +3,13 @@ import { BackupListComponent } from './components/pages/backup-list/backup-list. import { ShiftUpdateComponent } from './components/pages/shift-update/shift-update.component'; 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'; export const routes: Routes = [ {path: "", component: NoMansLandComponent}, {path: "backup", component: BackupListComponent}, {path: "update", component: ShiftUpdateComponent}, {path: "creds", component: ToolListComponent }, + {path: "login", component: LoginComponent }, {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 e6029dd..7a11521 100644 --- a/src/app/components/pages/backup-list/backup-list.component.html +++ b/src/app/components/pages/backup-list/backup-list.component.html @@ -16,7 +16,6 @@ backup volume Copy Name - @@ -24,7 +23,6 @@ {{backup.projectName}} {{backup.volumeName}} {{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud - diff --git a/src/app/components/pages/login/login.component.html b/src/app/components/pages/login/login.component.html new file mode 100644 index 0000000..dc1bd8f --- /dev/null +++ b/src/app/components/pages/login/login.component.html @@ -0,0 +1,7 @@ +
+
+
+ login works! +
+
+
\ No newline at end of file diff --git a/src/app/components/pages/login/login.component.scss b/src/app/components/pages/login/login.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/pages/login/login.component.spec.ts b/src/app/components/pages/login/login.component.spec.ts new file mode 100644 index 0000000..18f3685 --- /dev/null +++ b/src/app/components/pages/login/login.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginComponent } from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [LoginComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/pages/login/login.component.ts b/src/app/components/pages/login/login.component.ts new file mode 100644 index 0000000..20c1110 --- /dev/null +++ b/src/app/components/pages/login/login.component.ts @@ -0,0 +1,14 @@ +import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; + +@Component({ + selector: 'app-login', + standalone: true, + imports: [ReactiveFormsModule, CommonModule], + templateUrl: './login.component.html', + styleUrl: './login.component.scss' +}) +export class LoginComponent { + +} diff --git a/src/app/urls.ts.bkp b/src/app/urls.ts.bkp new file mode 100644 index 0000000..3aec58b --- /dev/null +++ b/src/app/urls.ts.bkp @@ -0,0 +1,112 @@ +import { Tool } from "./shared/model/tool.model"; + +export const all_tools: any[] = [ +{ + name: 'Nagios', + url: "http://nagios.brilliant.com.bd/nagios", + userName: "nagiosadmin", + password: "Icloud-#@!!@#" +}, +{ + name: "Graphana", + url: "https://grafana.brilliant.com.bd/login", + userName: "cloud-operation", + password: "Br!ll!ant-#@!!@#", +}, +{ + name: "Cacti", + url: "http://cacti.brilliant.com.bd/cacti", + userName: "admin", + password: "Icl0ud#@!", +}, +{ + name: "Fortigate", + url: "https://118.67.210.46/", + userName: "cloud-operation", + password: "ic-FW-Cl0ud-ops132267" +}, +{ + name: "Forti Analyzer", + url: "https://118.67.209.115/", + userName: "cloud-operation", + password: "ic-FW-Cl0ud-ops132267" + }, + { + name: "Observium", + url: "http://observium.brilliant.com.bd/", + userName: "admin", + password: "Icloud-#@!!@#" + }, + { + name: "VM 1", + url: "http://118.67.215.11/dashboard/", + userName: "mosiur.rahman", + password: " brilliant-mosiur.rahman" + }, + { + name: "VM 2", + url: "http://118.67.215.12/dashboard/", + userName: "mosiur.rahman", + password: " brilliant-mosiur.rahman" + }, + { + name: "VM 3", + url: "http://118.67.215.13/dashboard/", + userName: "mosiur.rahman", + password: " brilliant-mosiur.rahman" + }, + { + name: "VM 4", + url: "https://cloud.brilliant.com.bd/", + userName: "mosiur.rahman", + password: " brilliant-mosiur.rahman" + }, + { + name: "BCP Portal", + url: "https://bcp.brilliant.com.bd/", + userName: "mosiur.rahman@brilliant.com.bd", + password: "brilliant-mosiur.rahman" + }, + { + name: "Cloud File Serve", + url: "http://118.67.215.251", + userName: "cloud-support", + password: "Icl0ud-Supp0rt!@#" + }, + { + name: "CA Admin", + url: " https://ca.brilliant.com.bd", + userName: "admin@brilliant.com.bd", + password: "@Dm!NBr!ll!@nt" + }, + { + name: "BCP Portal", + url: "http://118.67.215.13/dashboard/", + userName: "core-system", + password: "F91@cPR20L!kRe0651096hjQ#2072" +}, +{ + name: "CommVault Support Portal", + url: "https://support.commvault.com/", + userName: "core.system@intercloud.com.bd", + password: "mBSrdN&I/d90" +}, +{ + name: "Backup Portal RDP", + url: "baas.brilliant.com.bd", + userName: "administrator", + password: "kjferi_lfbDSNQK@#346" +}, +{ + name: "Backup Portal main RDP", + url: "backup.brilliant.com.bd", + userName: "administrator", + password: "kjferi_lfbDSNQK@#346" +}, +{ + name: "Remote VPN Password", + url: "103.248.13.66:10443", + userName: "mosiur.rahman", + password: "Hgd%4st#4d" +}, +] \ No newline at end of file From f5a86a0b5d74b31e518e00307237c01e882512bc Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Sun, 5 Jan 2025 00:36:37 +0600 Subject: [PATCH 08/10] Login Page partially Completed --- .../pages/login/login.component.html | 14 ++++++-- .../components/pages/login/login.component.ts | 35 +++++++++++++++++-- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/app/components/pages/login/login.component.html b/src/app/components/pages/login/login.component.html index dc1bd8f..f7fb61a 100644 --- a/src/app/components/pages/login/login.component.html +++ b/src/app/components/pages/login/login.component.html @@ -1,7 +1,17 @@
-
- login works! + +
+ + +
+
+ + +
+
+ +
\ No newline at end of file diff --git a/src/app/components/pages/login/login.component.ts b/src/app/components/pages/login/login.component.ts index 20c1110..5ebdf5e 100644 --- a/src/app/components/pages/login/login.component.ts +++ b/src/app/components/pages/login/login.component.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; +import { Component, OnInit } from '@angular/core'; +import { FormControl, ReactiveFormsModule, FormGroup } from '@angular/forms'; @Component({ selector: 'app-login', @@ -9,6 +9,35 @@ import { ReactiveFormsModule } from '@angular/forms'; templateUrl: './login.component.html', styleUrl: './login.component.scss' }) -export class LoginComponent { +export class LoginComponent implements OnInit { + constructor() {} + + loginForm = new FormGroup({ + userName: new FormControl(''), + password: new FormControl('') + }) + + sample_user = [{ + userName: 'admin', + password: 'admin' + }, +{ + userName: 'rashik', + password: '123' +}] + + ngOnInit() { + // do something + } + + login() { + let username = this.loginForm.value.userName; + let password = this.loginForm.value.password; + if (this.sample_user.find(user=> user.userName === username && user.password === password)) { + console.log('Login Successful'); + } else { + console.log('Login Failed'); + } + } } From ca9696bf031e04dff9db6e24904a039565c766f4 Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Tue, 7 Jan 2025 11:20:10 +0600 Subject: [PATCH 09/10] added the day with the backups and also added additional backups --- backend-server/src/index.ts | 8 +- src/app/backup copy.ts | 146 +++++++++++++++++++ src/app/backup.ts | 277 ++++++++++++++++++++++++++++++++---- 3 files changed, 404 insertions(+), 27 deletions(-) create mode 100644 src/app/backup copy.ts diff --git a/backend-server/src/index.ts b/backend-server/src/index.ts index af3b8a6..f67270a 100644 --- a/backend-server/src/index.ts +++ b/backend-server/src/index.ts @@ -19,12 +19,16 @@ const headerSchema = new mongoose.Schema({ headerName: String }) +interface IDay { + day: string +} + interface IBackup { projectName: string, projectURL: string, volumeName: string, volumeURL: string, - day: string + backupDay: Array } interface IUpdate { @@ -51,7 +55,7 @@ const backupSchema = new mongoose.Schema({ projectURL: String, volumeName: String, volumeURL: String, - day: String + backupDay: Array }, { toJSON: { virtuals: true }, diff --git a/src/app/backup copy.ts b/src/app/backup copy.ts new file mode 100644 index 0000000..dbdcd53 --- /dev/null +++ b/src/app/backup copy.ts @@ -0,0 +1,146 @@ +export const vols = [ + { + projectName: "Novotel", + projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", + volumeName: "NovoTel-Primary-Database-Volume", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/585ccae9-d7f3-4370-b2f3-5b43c2881b64/" + }, + { + projectName: "Novotel", + projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", + volumeName: "Brilliant-Shop-VM", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/ad491ab9-0777-4270-847f-21a7f00c5f45/" + }, + { + projectName: "Novotel", + projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", + volumeName: "Live Web Server Vol 1 1200GB", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/c8a8a689-b431-4529-97b2-97dd2fc8928b/" + }, + { + projectName: "Novotel", + projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", + volumeName: "Live-Web-Server-Vol-02", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/730a9a15-b5d9-4af8-944b-39ac1045279d/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Mailbox5-Vol-1", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/42251910-80e5-485d-864f-3c7c0ba09cc0/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "mailbox-5-backup-data", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/943b0329-7785-494b-806a-38b45d4eef9d/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra mailbox", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/174eef51-bb78-4cea-8790-00760c1d2b04/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra-MailBox-Backup", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/b85b8ee2-873b-4034-9efb-4ba39fe3e81a/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra-mail", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/3672d9e4-396e-49c0-b9e0-8ea45268633d/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra-mta", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/4c1cdefe-3e32-42da-8a7d-00e42623df70/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra mzmta", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/879779bd-1344-41f5-8265-f92c4d6726d1/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra slave ldap", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/a92a4722-ec40-4ca1-8392-8b31c4fb4901/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra Master ldap", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/c198c929-fdff-45a1-9f77-f6866b645a60/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Mailborder v5 Mail filter", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/c2ccaee8-f9e7-402f-8a81-0dbbf9ce9cff/" + }, + { + projectName: "Zimbra mail (MAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", + volumeName: "Zimbra DNS", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/12c5a3d2-85a9-4a03-b80b-4f356e586d4c/" + }, + { + projectName: "CommVault (BAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", + volumeName: "Commvault Proxy-vol-1", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/ab563c0e-ef20-4c24-80ab-b54d04282b86/" + }, + { + projectName: "CommVault (BAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", + volumeName: "Commvault Backup new", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/7f757d5e-a7d8-47fb-9ea5-116328b1ca19/" + }, + { + projectName: "CommVault (BAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", + volumeName: "commserve-additional-300gb-new", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/2916a834-d6d9-491e-ab94-a46736b7ce54/" + }, + { + projectName: "CommVault (BAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", + volumeName: "Commserve-DR-Backup-200GB-from-old-server-new", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/732ce2d7-88fd-4e3d-aa48-2eb20dd68152/" + }, + { + projectName: "CommVault (BAAS)", + projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", + volumeName: "Commserve-DR-Backup-200GB-from-old-server-new", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/732ce2d7-88fd-4e3d-aa48-2eb20dd68152/" + }, + { + projectName: "Cloud-Monioring", + projectURL: "http://118.67.215.11/dashboard/auth/switch/e21290ae6e9845ddacb7158ba1d35867/?next=/dashboard/project/", + volumeName: "Owncloud-Intercloud-VM-01-Vol-01-SAS", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/b23b318f-2ad3-43d7-850b-83340b68ac0f/" + }, + { + projectName: "Cloud-Monioring", + projectURL: "http://118.67.215.11/dashboard/auth/switch/e21290ae6e9845ddacb7158ba1d35867/?next=/dashboard/project/", + volumeName: "Owncloud-Intercloud-VM-01-Vol-02-SAS", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/7dde4fc3-7a0e-4a5d-bca8-12fe6832d8d5/" + }, + { + projectName: "Revenue-Assurance", + projectURL: "http://118.67.215.11/dashboard/auth/switch/344358e7b22049a0bff2ac785417ab4e/?next=/dashboard/project/i", + volumeName: "revenue-assurence-VM-01-Vol-1", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/76905062-4af5-405e-b485-3bd66d031a57/" + }, + { + projectName: "Revenue-Assurance", + projectURL: "http://118.67.215.11/dashboard/auth/switch/344358e7b22049a0bff2ac785417ab4e/?next=/dashboard/project/i", + volumeName: "revenue-assurence-VM-01-Vol-2", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/f59c48b8-23c2-4f60-bc75-047d6363edc2/" + }, +] \ No newline at end of file diff --git a/src/app/backup.ts b/src/app/backup.ts index dbdcd53..def020a 100644 --- a/src/app/backup.ts +++ b/src/app/backup.ts @@ -3,73 +3,87 @@ export const vols = [ projectName: "Novotel", projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", volumeName: "NovoTel-Primary-Database-Volume", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/585ccae9-d7f3-4370-b2f3-5b43c2881b64/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/585ccae9-d7f3-4370-b2f3-5b43c2881b64/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Novotel", projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", volumeName: "Brilliant-Shop-VM", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/ad491ab9-0777-4270-847f-21a7f00c5f45/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/49871458-7705-40d2-aec3-69c694fcb27b/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, { projectName: "Novotel", projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", volumeName: "Live Web Server Vol 1 1200GB", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/c8a8a689-b431-4529-97b2-97dd2fc8928b/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/c8a8a689-b431-4529-97b2-97dd2fc8928b/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Novotel", projectURL: "http://118.67.215.11/dashboard/auth/switch/b4600c142d024e068972a9bf574ab662/?next=/dashboard/project/", volumeName: "Live-Web-Server-Vol-02", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/730a9a15-b5d9-4af8-944b-39ac1045279d/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/730a9a15-b5d9-4af8-944b-39ac1045279d/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Mailbox5-Vol-1", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/42251910-80e5-485d-864f-3c7c0ba09cc0/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/42251910-80e5-485d-864f-3c7c0ba09cc0/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "mailbox-5-backup-data", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/943b0329-7785-494b-806a-38b45d4eef9d/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/943b0329-7785-494b-806a-38b45d4eef9d/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Zimbra mailbox", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/174eef51-bb78-4cea-8790-00760c1d2b04/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/174eef51-bb78-4cea-8790-00760c1d2b04/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Zimbra-MailBox-Backup", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/b85b8ee2-873b-4034-9efb-4ba39fe3e81a/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/b85b8ee2-873b-4034-9efb-4ba39fe3e81a/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Zimbra-mail", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/3672d9e4-396e-49c0-b9e0-8ea45268633d/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/3672d9e4-396e-49c0-b9e0-8ea45268633d/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Zimbra-mta", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/4c1cdefe-3e32-42da-8a7d-00e42623df70/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/4c1cdefe-3e32-42da-8a7d-00e42623df70/", + backupDay: ['sun', 'tue', 'thu'] + }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Zimbra mzmta", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/879779bd-1344-41f5-8265-f92c4d6726d1/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/879779bd-1344-41f5-8265-f92c4d6726d1/", + backupDay: ['sun', 'tue', 'thu'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Zimbra slave ldap", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/a92a4722-ec40-4ca1-8392-8b31c4fb4901/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/a92a4722-ec40-4ca1-8392-8b31c4fb4901/", + backupDay: ['sun', 'tue', 'thu'] }, { projectName: "Zimbra mail (MAAS)", @@ -81,31 +95,36 @@ export const vols = [ projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Mailborder v5 Mail filter", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/c2ccaee8-f9e7-402f-8a81-0dbbf9ce9cff/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/c2ccaee8-f9e7-402f-8a81-0dbbf9ce9cff/", + backupDay: ['sun', 'tue', 'thu'] }, { projectName: "Zimbra mail (MAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/77659323516246abbd198ec924cadfe2/?next=/dashboard/project/", volumeName: "Zimbra DNS", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/12c5a3d2-85a9-4a03-b80b-4f356e586d4c/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/12c5a3d2-85a9-4a03-b80b-4f356e586d4c/", + backupDay: ['sun', 'tue', 'thu'] }, { projectName: "CommVault (BAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", volumeName: "Commvault Proxy-vol-1", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/ab563c0e-ef20-4c24-80ab-b54d04282b86/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/ab563c0e-ef20-4c24-80ab-b54d04282b86/", + backupDay: ['sun', 'thu'] }, { projectName: "CommVault (BAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", volumeName: "Commvault Backup new", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/7f757d5e-a7d8-47fb-9ea5-116328b1ca19/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/7f757d5e-a7d8-47fb-9ea5-116328b1ca19/", + backupDay: ['sun', 'thu'] }, { projectName: "CommVault (BAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", volumeName: "commserve-additional-300gb-new", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/2916a834-d6d9-491e-ab94-a46736b7ce54/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/2916a834-d6d9-491e-ab94-a46736b7ce54/", + backupDay: ['sun', 'thu'] }, { projectName: "CommVault (BAAS)", @@ -117,30 +136,238 @@ export const vols = [ projectName: "CommVault (BAAS)", projectURL: "http://118.67.215.11/dashboard/auth/switch/cad590b54ab9483badee1a347f313c06/?next=/dashboard/project/", volumeName: "Commserve-DR-Backup-200GB-from-old-server-new", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/732ce2d7-88fd-4e3d-aa48-2eb20dd68152/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/732ce2d7-88fd-4e3d-aa48-2eb20dd68152/", + backupDay: ['sun', 'thu'] }, { projectName: "Cloud-Monioring", projectURL: "http://118.67.215.11/dashboard/auth/switch/e21290ae6e9845ddacb7158ba1d35867/?next=/dashboard/project/", volumeName: "Owncloud-Intercloud-VM-01-Vol-01-SAS", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/b23b318f-2ad3-43d7-850b-83340b68ac0f/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/b23b318f-2ad3-43d7-850b-83340b68ac0f/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Cloud-Monioring", projectURL: "http://118.67.215.11/dashboard/auth/switch/e21290ae6e9845ddacb7158ba1d35867/?next=/dashboard/project/", volumeName: "Owncloud-Intercloud-VM-01-Vol-02-SAS", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/7dde4fc3-7a0e-4a5d-bca8-12fe6832d8d5/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/7dde4fc3-7a0e-4a5d-bca8-12fe6832d8d5/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Revenue-Assurance", - projectURL: "http://118.67.215.11/dashboard/auth/switch/344358e7b22049a0bff2ac785417ab4e/?next=/dashboard/project/i", + projectURL: "http://118.67.215.11/dashboard/auth/switch/344358e7b22049a0bff2ac785417ab4e/?next=/dashboard/project/", volumeName: "revenue-assurence-VM-01-Vol-1", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/76905062-4af5-405e-b485-3bd66d031a57/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/76905062-4af5-405e-b485-3bd66d031a57/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, { projectName: "Revenue-Assurance", - projectURL: "http://118.67.215.11/dashboard/auth/switch/344358e7b22049a0bff2ac785417ab4e/?next=/dashboard/project/i", + projectURL: "http://118.67.215.11/dashboard/auth/switch/344358e7b22049a0bff2ac785417ab4e/?next=/dashboard/project/", volumeName: "revenue-assurence-VM-01-Vol-2", - volumeURL: "http://118.67.215.11/dashboard/project/volumes/f59c48b8-23c2-4f60-bc75-047d6363edc2/" + volumeURL: "http://118.67.215.11/dashboard/project/volumes/f59c48b8-23c2-4f60-bc75-047d6363edc2/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] }, -] \ No newline at end of file + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-06-Vol-1-22.12.24", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/f68a8ba6-fc39-45b8-887d-37dcfd237d71/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "BD-BLT-Quark-PROD-02-new", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/dd1a89b4-4bb5-45a6-bbf9-6ddaf3d2cb6b/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "BD-BLT-Cataleya-Bastion", + volumeURL: "http://118.67.215.11/dashboard/project/instances/98edad56-fdf6-44f6-bed7-2407fe8e5ee4/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-VM-05-nreplace", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/3df9d1b5-681a-4ffb-b3be-19d4a06be9ae/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-05-Vol-1", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/bec0db09-09f2-491e-a454-524b27582c9b/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "34ca8764-5f94-49e2-99ca-1323c3b22aaf", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/34ca8764-5f94-49e2-99ca-1323c3b22aaf/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-02-Vol-01", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/ca1a7cd1-6409-471e-910d-c3853f47d982/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-02-Vol-02", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/18372ec5-daa1-4106-8ad1-86ad3c5dd696/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-02-Vol-03", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/8029e194-cf82-461a-82e1-e51a779ab07e/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-02-Vol-04", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/f211ea3c-1697-4b62-aba6-ab936143d832/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-Backup", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/0c453ce1-fce6-404b-a998-8e3c153b7cce/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-01-Vol-03", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/fdcafc68-4b46-4298-ab2a-fcb12134d26d/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-01-Vol-02", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/eb0c9371-3889-4c20-8567-69fd824310b4/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-DB-VM-01-Vol-01", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/47295d5e-fabb-495e-a171-6a0881876a6e/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-VM-05-new-Vol-1-SSD", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/326ec6c1-d7bb-4999-b5ad-74cb8405f9c3/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-VM-04-new-Vol-1-SSD", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/454cb5f7-2990-4cbb-b386-71a2b185472c/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Toku", + projectURL: "http://118.67.215.11/dashboard/auth/switch/42c90e3b5a0349958165f1da77234d18/?next=/dashboard/project/", + volumeName: "Toku-Vol3", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/34b01fb8-d2da-4551-8736-663e12ea6f83/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "3s-Software", + projectURL: "http://118.67.215.11/dashboard/auth/switch/08c2a6767adf4aae922b4a484d67d5f2/?next=/dashboard/project/", + volumeName: "3s-software-VM-1-Vol-1-nvme", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/3fddd240-5ac1-4fed-a630-629fdfce0a38/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "3s-Software", + projectURL: "http://118.67.215.11/dashboard/auth/switch/08c2a6767adf4aae922b4a484d67d5f2/?next=/dashboard/project/", + volumeName: "3s-software-VM-01-Vol-2-nvme", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/340a3e71-8c06-4205-a3ec-d484086cbe26/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "3s-Software", + projectURL: "http://118.67.215.11/dashboard/auth/switch/08c2a6767adf4aae922b4a484d67d5f2/?next=/dashboard/project/", + volumeName: "3s-software-VM-2-Vol-1-nvme", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/4f9c1184-b2e2-4467-954c-32906c461df9/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "3s-Software", + projectURL: "http://118.67.215.11/dashboard/auth/switch/08c2a6767adf4aae922b4a484d67d5f2/?next=/dashboard/project/", + volumeName: "3s-software-VM-3Vol-1-nvme", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/7644b6be-5a09-44e6-9693-1a914edd7c44/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "3s-Software", + projectURL: "http://118.67.215.11/dashboard/auth/switch/08c2a6767adf4aae922b4a484d67d5f2/?next=/dashboard/project/", + volumeName: "3s-software-VM-03-Vol-2-nvme", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/540f7bf9-ca96-43fa-b2bd-ccb8c2c57229/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Shanta-Holdings", + projectURL: "http://118.67.215.11/dashboard/auth/switch/686cbf9da603421782c7275846e03c18/?next=/dashboard/project/", + volumeName: "Shanta-Holdings-VM-01-Vol-1-SSD", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/7ca89636-60dc-49d2-92dc-baebc9c1cc24/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Shanta-Holdings", + projectURL: "http://118.67.215.11/dashboard/auth/switch/686cbf9da603421782c7275846e03c18/?next=/dashboard/project/", + volumeName: "Shanta-Holdings-VM-01-Vol-4-SSD", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/bdddd67c-a051-4d7e-adbc-7e28e0714d20/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Shanta-Holdings", + projectURL: "http://118.67.215.11/dashboard/auth/switch/686cbf9da603421782c7275846e03c18/?next=/dashboard/project/", + volumeName: "Shanta-Holdings-VM-01-Vol-5-SSD", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/d21bb398-1da3-48a0-83f4-495eaa512b28/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Shanta-Holdings", + projectURL: "http://118.67.215.11/dashboard/auth/switch/686cbf9da603421782c7275846e03c18/?next=/dashboard/project/", + volumeName: "Shanta-Holdings-VM-02-Vol-1-SSD-new", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/eaf67655-b3b3-43de-8472-98a4d703c6d7/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Shanta-Holdings", + projectURL: "http://118.67.215.11/dashboard/auth/switch/686cbf9da603421782c7275846e03c18/?next=/dashboard/project/", + volumeName: "Shanta-Holdings-VM-02-Vol-1-SSD-new", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/eaf67655-b3b3-43de-8472-98a4d703c6d7/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Shanta-Holdings", + projectURL: "http://118.67.215.11/dashboard/auth/switch/686cbf9da603421782c7275846e03c18/?next=/dashboard/project/", + volumeName: "Shanta-Holdings-VM-02-Vol-4-SSD", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/036495e5-8c32-41e7-b34c-a0257c336464/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, + { + projectName: "Shanta-Holdings", + projectURL: "http://118.67.215.11/dashboard/auth/switch/686cbf9da603421782c7275846e03c18/?next=/dashboard/project/", + volumeName: "Shanta-Holdings-VM-02-Vol-5-SSD", + volumeURL: "http://118.67.215.11/dashboard/project/volumes/0c8d0a7b-6b6a-463f-95ba-d0ece70d3fb7/", + backupDay: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + }, +] From 01af0bf3951d914c030f1d261a3f1a53c28f6d10 Mon Sep 17 00:00:00 2001 From: Mosiur Rahman Date: Tue, 7 Jan 2025 13:15:39 +0600 Subject: [PATCH 10/10] added the date filter --- backend-server/src/index.ts | 4 ++-- .../pages/backup-list/backup-list.component.html | 12 +++++++----- .../pages/backup-list/backup-list.component.ts | 5 +++-- src/app/shared/model/backup.model.ts | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/backend-server/src/index.ts b/backend-server/src/index.ts index f67270a..f0af701 100644 --- a/backend-server/src/index.ts +++ b/backend-server/src/index.ts @@ -1,7 +1,7 @@ import express from "express"; import cors from 'cors'; import mongoose from 'mongoose'; -//import {vols} from "../../src/app/backup" +import {vols} from "../../src/app/backup" //import {all_tools} from "../../src/app/urls" import crypto from "crypto"; import bcrypt from "bcrypt" @@ -104,7 +104,7 @@ app.get("/seed-backup", async (req,res)=>{ // if (backupCount > 0) { // res.send("Seed already done") // } -// BackupModel.create(vols) + BackupModel.create(vols) }) app.get("/", (req,res)=>{ 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 7a11521..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,11 +19,13 @@ - - {{backup.projectName}} - {{backup.volumeName}} - {{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud - + + + {{backup.projectName}} + {{backup.volumeName}} + {{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud + + diff --git a/src/app/components/pages/backup-list/backup-list.component.ts b/src/app/components/pages/backup-list/backup-list.component.ts index f5fed31..10f027f 100644 --- a/src/app/components/pages/backup-list/backup-list.component.ts +++ b/src/app/components/pages/backup-list/backup-list.component.ts @@ -23,8 +23,8 @@ export class BackupListComponent implements OnInit, OnDestroy{ innerHTML!: string; backupVolumesSubscription!: Subscription; searchTerm: FormControl = new FormControl(); - - + days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; + today!: string; constructor(private backupService: BackupService, private searchService: searchService) {} @@ -32,6 +32,7 @@ export class BackupListComponent implements OnInit, OnDestroy{ this.backupVolumesSubscription = this.backupService.allBackups().subscribe((volumes)=>{ this.backupVolumes = volumes; }); + this.today = this.days[this.currentDate.getDay()]; } ngOnDestroy(): void { diff --git a/src/app/shared/model/backup.model.ts b/src/app/shared/model/backup.model.ts index 2ada993..e6a78cd 100644 --- a/src/app/shared/model/backup.model.ts +++ b/src/app/shared/model/backup.model.ts @@ -3,5 +3,5 @@ export class Backup{ projectURL!: string; volumeName!: string; volumeURL!: string; - day!: string; + backupDay!: string[]; } \ No newline at end of file