Migrated depreciated imports

This commit is contained in:
itzMiney committed 2025-12-24 00:52:47 +01:00
1 parent 47428ee891
commit 381b76de9c
26 files changed
+2132 -1621

No files matched your search

+58 -55
View File
@@ -15,65 +15,68 @@
class="form-control"
placeholder="Original URL"
required
/>
/>
</div>
<div class="form-group">
<input
type="text"
id="short_name"
name="short_name"
ngModel
class="form-control"
placeholder="Short URL Name (Optional)"
/>
</div>
<button type="submit" class="btn btn-primary">Shorten URL</button>
</form>
</div>
<div class="form-group">
<input
type="text"
id="short_name"
name="short_name"
ngModel
class="form-control"
placeholder="Short URL Name (Optional)"
/>
<!-- Delete URL Section -->
<div class="form-section">
<h3>Delete Short URL</h3>
<form (ngSubmit)="deleteShortURL(deleteURLForm)" #deleteURLForm="ngForm">
<div class="form-group">
<input
type="number"
id="deleteId"
name="deleteId"
ngModel
class="form-control"
placeholder="ID"
required
/>
<button type="submit" class="btn btn-danger">Delete</button>
</div>
</form>
</div>
<h3>Existing Short URLs</h3>
</div>
<button type="submit" class="btn btn-primary">Shorten URL</button>
</form>
</div>
<!-- Scrollable URL list -->
<div class="url-list-wrapper">
@if (noURLs) {
<div>
<p>No short URLs available.</p>
</div>
} @else {
<ul class="url-list-items">
@for (url of urls; track url) {
<li>
<strong>ID {{url.id}}</strong> // <strong>URL: </strong>
<a [href]="'https://itz.sh/' + url.short_url" target="_blank">{{ 'https://itz.sh/' + url.short_url }}</a><br>
<strong>Original: </strong>
<a [href]="url.og_url" target="_blank">
{{ (url.og_url | slice:0:45) + (url.og_url.length > 40 ? '...' : '')}}
</a><br>
</li>
}
</ul>
}
<!-- Delete URL Section -->
<div class="form-section">
<h3>Delete Short URL</h3>
<form (ngSubmit)="deleteShortURL(deleteURLForm)" #deleteURLForm="ngForm">
<div class="form-group">
<input
type="number"
id="deleteId"
name="deleteId"
ngModel
class="form-control"
placeholder="ID"
required
/>
<button type="submit" class="btn btn-danger">Delete</button>
</div>
</form>
</div>
</div>
<h3>Existing Short URLs</h3>
</div>
<!-- Scrollable URL list -->
<div class="url-list-wrapper">
<div *ngIf="noURLs; else urlList">
<p>No short URLs available.</p>
</div>
<ng-template #urlList>
<ul class="url-list-items">
<li *ngFor="let url of urls">
<strong>ID {{url.id}}</strong> // <strong>URL: </strong>
<a [href]="'https://itz.sh/' + url.short_url" target="_blank">{{ 'https://itz.sh/' + url.short_url }}</a><br>
<strong>Original: </strong>
<a [href]="url.og_url" target="_blank">
{{ (url.og_url | slice:0:45) + (url.og_url.length > 40 ? '...' : '')}}
</a><br>
</li>
</ul>
</ng-template>
</div>
</div>
</div>
+2 -4
View File
@@ -3,7 +3,7 @@ import {Title} from '@angular/platform-browser';
import {ShortenerService} from '../shared/services/shortener.service';
import {interval, Subscription, switchMap} from 'rxjs';
import {FormsModule} from '@angular/forms';
import {NgFor, NgIf, SlicePipe} from '@angular/common';
import { SlicePipe } from '@angular/common';
import {AuthService} from '../shared/services/auth.service';
import {filter} from 'rxjs/operators';
@@ -11,10 +11,8 @@ import {filter} from 'rxjs/operators';
selector: 'app-shortener',
imports: [
FormsModule,
NgFor,
NgIf,
SlicePipe
],
],
templateUrl: './shortener.component.html',
styleUrl: './shortener.component.css'
})