mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-01-04 03:49:28 +02:00
Fixing sharing link url on the admin page fixes #631
This commit is contained in:
parent
64dd94fe6a
commit
080455cdc1
@ -129,7 +129,7 @@ export class Utils {
|
|||||||
|
|
||||||
url += part + '/';
|
url += part + '/';
|
||||||
}
|
}
|
||||||
url = url.replace(new RegExp('/+', 'g'), '/');
|
url = url.replace(/(https?:\/\/)|(\/){2,}/g, "$1$2")
|
||||||
|
|
||||||
if (url.trim() === '') {
|
if (url.trim() === '') {
|
||||||
url = './';
|
url = './';
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let share of shares">
|
<tr *ngFor="let share of shares">
|
||||||
<td><a [href]="sharingUrl + share.sharingKey">{{share.sharingKey}}</a></td>
|
<td><a [href]="sharingUrl + share.sharingKey">{{share.sharingKey}}</a>,{{sharingUrl}}</td>
|
||||||
<td>{{share.path}}</td>
|
<td>{{share.path}}</td>
|
||||||
<td>{{share.creator.name}}</td>
|
<td>{{share.creator.name}}</td>
|
||||||
<td>{{share.expires | date}}</td>
|
<td>{{share.expires | date}}</td>
|
||||||
|
@ -13,12 +13,12 @@ import {Utils} from '../../../../../common/Utils';
|
|||||||
export class SharingsListComponent implements OnInit {
|
export class SharingsListComponent implements OnInit {
|
||||||
|
|
||||||
public shares: SharingDTO[] = [];
|
public shares: SharingDTO[] = [];
|
||||||
|
public sharingUrl = Utils.concatUrls(Config.Server.publicUrl, '/share') + '/';
|
||||||
|
|
||||||
constructor(public sharingList: SharingListService,
|
constructor(public sharingList: SharingListService,
|
||||||
private settingsService: SettingsService) {
|
private settingsService: SettingsService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sharingUrl = Utils.concatUrls(Config.Server.publicUrl, '/share/');
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.getSharingList();
|
this.getSharingList();
|
||||||
|
@ -16,6 +16,9 @@ describe('Utils', () => {
|
|||||||
expect(Utils.concatUrls('abc/', '/cde/')).to.be.equal('abc/cde');
|
expect(Utils.concatUrls('abc/', '/cde/')).to.be.equal('abc/cde');
|
||||||
expect(Utils.concatUrls('abc\\/', '/cde/')).to.be.equal('abc/cde');
|
expect(Utils.concatUrls('abc\\/', '/cde/')).to.be.equal('abc/cde');
|
||||||
expect(Utils.concatUrls('abc\\/', '/cde/', 'fgh')).to.be.equal('abc/cde/fgh');
|
expect(Utils.concatUrls('abc\\/', '/cde/', 'fgh')).to.be.equal('abc/cde/fgh');
|
||||||
|
expect(Utils.concatUrls('abc\\/', '////cde/', 'fgh')).to.be.equal('abc/cde/fgh');
|
||||||
|
expect(Utils.concatUrls('http://abc\\/', '/cde/', 'fgh')).to.be.equal('http://abc/cde/fgh');
|
||||||
|
expect(Utils.concatUrls('https://abc\\/', '/cde/', 'fgh')).to.be.equal('https://abc/cde/fgh');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should find closest number', () => {
|
it('should find closest number', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user