added the date filter
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
import mongoose from 'mongoose';
|
import mongoose from 'mongoose';
|
||||||
//import {vols} from "../../src/app/backup"
|
import {vols} from "../../src/app/backup"
|
||||||
//import {all_tools} from "../../src/app/urls"
|
//import {all_tools} from "../../src/app/urls"
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import bcrypt from "bcrypt"
|
import bcrypt from "bcrypt"
|
||||||
@@ -104,7 +104,7 @@ app.get("/seed-backup", async (req,res)=>{
|
|||||||
// if (backupCount > 0) {
|
// if (backupCount > 0) {
|
||||||
// res.send("Seed already done")
|
// res.send("Seed already done")
|
||||||
// }
|
// }
|
||||||
// BackupModel.create(vols)
|
BackupModel.create(vols)
|
||||||
})
|
})
|
||||||
|
|
||||||
app.get("/", (req,res)=>{
|
app.get("/", (req,res)=>{
|
||||||
|
|||||||
@@ -19,11 +19,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let backup of backupVolumes">
|
<ng-container *ngFor="let backup of backupVolumes">
|
||||||
|
<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>
|
||||||
<td><a target="_blank" [href]=backup.volumeURL>{{backup.volumeName}}</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>
|
<td class="copyName" #copy (click)="copyName(copy)">{{backup.volumeName}}-{{currentDate | date: 'dd-MM-YYYY'}}-Cloud</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</ng-container>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ export class BackupListComponent implements OnInit, OnDestroy{
|
|||||||
innerHTML!: string;
|
innerHTML!: string;
|
||||||
backupVolumesSubscription!: Subscription;
|
backupVolumesSubscription!: Subscription;
|
||||||
searchTerm: FormControl = new FormControl();
|
searchTerm: FormControl = new FormControl();
|
||||||
|
days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
||||||
|
today!: string;
|
||||||
|
|
||||||
constructor(private backupService: BackupService, private searchService: searchService) {}
|
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.backupVolumesSubscription = this.backupService.allBackups().subscribe((volumes)=>{
|
||||||
this.backupVolumes = volumes;
|
this.backupVolumes = volumes;
|
||||||
});
|
});
|
||||||
|
this.today = this.days[this.currentDate.getDay()];
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ export class Backup{
|
|||||||
projectURL!: string;
|
projectURL!: string;
|
||||||
volumeName!: string;
|
volumeName!: string;
|
||||||
volumeURL!: string;
|
volumeURL!: string;
|
||||||
day!: string;
|
backupDay!: string[];
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user