diff --git a/backend-server/src/index.ts b/backend-server/src/index.ts index 4818c65..bc19c75 100644 --- a/backend-server/src/index.ts +++ b/backend-server/src/index.ts @@ -80,15 +80,16 @@ app.get("/", (req,res)=>{ res.send("Server Ran Properly") }) +app.get("/api/backup", async (req,res)=>{ + const allBackup = await BackupModel.find({ deleted: { $ne: true} }).sort({ projectName: 'asc' }) + res.send(allBackup) +}) + app.get("/api/update", async (req,res)=>{ const allUpdate = await UpdateModel.find({}).sort({ Date: 'asc' }) res.status(200).send(allUpdate); }) -app.get("/api/backup", async (req,res)=>{ - const allBackup = await BackupModel.find({ deleted: { $ne: true} }).sort({ projectName: 'asc' }) - res.send(allBackup) -}) app.post("/api/update/add", async (req,res)=>{ const {Date, Details, Reference, Remarks, Sales, Handler, Status, deleted} = req.body; @@ -110,6 +111,16 @@ app.post("/api/update/add", async (req,res)=>{ }) }) +app.post("/api/update/complete", async(req,res)=>{ + const id = req.body.id; + const status = req.body.Status; + const update = await BackupModel.findOneAndUpdate({_id: id},{ Status: status }) + console.log(update) + if (update) { + res.send(update) + } +}) + const PORT = 3000; app.listen(PORT,()=>{ 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 018f92c..c1e2fd2 100644 --- a/src/app/components/pages/shift-update/shift-update.component.html +++ b/src/app/components/pages/shift-update/shift-update.component.html @@ -1,4 +1,31 @@ - +
+ - \ No newline at end of file +
+
+ + + + + + + + + + + + + + + + + + +
{{tableHeader}}
{{updateData.Date}}{{updateData.Details | shorten:getRowNumber(i)}}{{updateData.Remarks | shorten:getRowNumber(i)}}{{updateData.Sales_Concern}}{{updateData.Reference | shorten:getRowNumber(i)}}{{updateData.Handler}}{{updateData.Status}}
+
+
+
+ + + \ No newline at end of file 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 e69de29..ff5becc 100644 --- a/src/app/components/pages/shift-update/shift-update.component.scss +++ b/src/app/components/pages/shift-update/shift-update.component.scss @@ -0,0 +1,96 @@ +@import './../../../shared/scss/colors.scss'; + +.table-container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + +} + +.table{ + padding: 0rem 2rem; +} + +table { + margin-left: 1rem; +} + +table, tr, td { + border-collapse: collapse; + border: none; +} + +th{ + color: $txt-heading-color; + font-size: 1.5rem; + padding-bottom: 3rem; + position:sticky; +} + +tbody tr { + transition: all 0.3s +} + +tbody tr:hover { + transform: scale(1.01); + background-color: rgba($hover-color,0.5); + border-collapse: collapse; + border: none; +} + +td:first-child{ + border-radius: 1rem 0rem 0rem 1rem; + padding-left: 2rem; +} + +td:nth-child(3){ + transition: color 0.09s ease-in-out; +} +td:last-child{ + border-radius: 0rem 1rem 1rem 0rem; + padding-right: 2rem; +} + +td:nth-child(3):active { + color: rgb(168, 168, 168); +} + +tr:nth-child(even) { + background-color: rgba(0,0,0,0.03); +} + +td { + padding: 0.7rem 1.5rem; + -webkit-user-select: none; /* Safari */ + -ms-user-select: none; /* IE 10 and IE 11 */ + user-select: none; /* Standard syntax */ + max-width: 300px; +} + +.actions { + display: grid; +} + +.complete{ + background-color: $txt-heading-color; + border: none; + height: 2rem; + width: 2.5rem; + border-radius: 10px; + &:hover { + background-color: darken($txt-heading-color, 20); + } +} + +.delete { + background-color: $danger; + border: none; + height: 2rem; + width: 2.5rem; + border-radius: 10px; + margin-top: 5px; + &:hover { + background-color: darken($danger, 20); + } +} 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 97dbe48..42c1c6e 100644 --- a/src/app/components/pages/shift-update/shift-update.component.ts +++ b/src/app/components/pages/shift-update/shift-update.component.ts @@ -1,16 +1,17 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; -import { TableComponent } from '../../../shared/components/table/table.component'; import { UpdateService } from './update.service'; import { TitleComponent } from '../../../shared/components/title/title.component'; import { InputFormComponent } from "../../../shared/components/input-form/input-form.component"; import { Update } from '../../../shared/model/update.model'; +import { CommonModule } from '@angular/common'; +import { ShortenPipe } from '../../../shared/pipe/shorten.pipe'; @Component({ selector: 'app-shift-update', standalone: true, - imports: [TableComponent, TitleComponent, InputFormComponent], + imports: [TitleComponent, InputFormComponent, CommonModule, ShortenPipe], templateUrl: './shift-update.component.html', styleUrl: './shift-update.component.scss', providers: [UpdateService] @@ -28,21 +29,12 @@ export class ShiftUpdateComponent implements OnInit, OnDestroy { this.updateDataList = update; console.log(this.updateDataList.keys) }); - console.log(this.completeTask) } ngOnDestroy(): void { this.updateListSubscription.unsubscribe(); } - completeTask(event: string) { - // - } - - deleteTask(event: boolean) { - // - } - addUpdate(newUpdate:any){ this.updateService.addUpdate(newUpdate); } @@ -51,4 +43,22 @@ export class ShiftUpdateComponent implements OnInit, OnDestroy { this.updateDataList = update; }) } + + expandRowIndex: number | null = null; + +toggleRow(index: number){ + this.expandRowIndex = this.expandRowIndex === index ? null : index; +} +getRowNumber(index: number): number { + return this.expandRowIndex === index ? 15000 : 75; +} + +onComplete(update: Update){ + update.Status = "completed"; + this.updateService.updateStatus(update) +} + +onDelete() { + // +} } diff --git a/src/app/components/pages/shift-update/update.service.ts b/src/app/components/pages/shift-update/update.service.ts index 4efae4f..6f8391e 100644 --- a/src/app/components/pages/shift-update/update.service.ts +++ b/src/app/components/pages/shift-update/update.service.ts @@ -3,7 +3,7 @@ import { sample_update } from "./sample_update"; import { Observable } from "rxjs"; import { Update } from "../../../shared/model/update.model"; import { HttpClient } from "@angular/common/http"; -import { UPDATE_ADD_URL, UPDATE_GET_URL } from "../../../shared/constants/backend"; +import { UPDATE_ADD_URL, UPDATE_COMPLETE_URL, UPDATE_GET_URL } from "../../../shared/constants/backend"; @Injectable({ providedIn: 'root' @@ -23,5 +23,11 @@ export class UpdateService{ console.log(log) }) } + + updateStatus(newUpdate: Update) { + this.httpClient.post(UPDATE_COMPLETE_URL,newUpdate).subscribe((res)=>{ + console.log(res) + }) + } } diff --git a/src/app/shared/constants/backend.ts b/src/app/shared/constants/backend.ts index bee476c..033bf7b 100644 --- a/src/app/shared/constants/backend.ts +++ b/src/app/shared/constants/backend.ts @@ -2,4 +2,5 @@ const MAIN_URL = "http://localhost: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` \ No newline at end of file +export const UPDATE_ADD_URL = `${UPDATE_GET_URL}/add`; +export const UPDATE_COMPLETE_URL = `${UPDATE_GET_URL}/complete` \ No newline at end of file diff --git a/src/app/urls.ts b/src/app/urls.ts index 76ede63..13b191e 100644 --- a/src/app/urls.ts +++ b/src/app/urls.ts @@ -91,4 +91,22 @@ export const all_tools: Tool[] = [ 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