feat(dashboard): add dashboard table with links display
This commit is contained in:
parent
23d1109604
commit
8bbbdd2dfa
6 changed files with 76 additions and 4 deletions
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue