feat(dashboard): add dashboard table with links display

This commit is contained in:
Jan K9f 2025-01-19 21:23:26 +01:00
commit 8bbbdd2dfa
Signed by: jank
GPG key ID: 50620ADD22CD330B
6 changed files with 76 additions and 4 deletions

View file

@ -1 +1,24 @@
<p>dashboard works!</p>
<div class="overflow-x-auto">
<table class="table">
<!-- head -->
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Url</th>
<th>Short Url</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
@for (link of links; track link) {
<tr class="bg-base-200">
<th>{{link.id}}</th>
<td>{{link.name}}</td>
<td>{{link.url}}</td>
<td>Not done yet</td>
</tr>
}
</tbody>
</table>
</div>

View file

@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { LinkService } from '../service/link.service';
import { RecordModel } from 'pocketbase';
@Component({
selector: 'app-dashboard',
@ -8,11 +9,13 @@ import { LinkService } from '../service/link.service';
styleUrl: './dashboard.component.css'
})
export class DashboardComponent {
public links: any[] = [];
constructor(private linkService: LinkService) { };
ngOnInit(): void {
this.linkService.getLinks().then(links => {
console.log(links);
this.links = links;
});
}
}

View file

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body class="h-full">
<body class="h-full" data-theme="light">
<app-root></app-root>
</body>
</html>