mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-24 19:14:14 +00:00
Update adbutler.component.ts
This commit is contained in:
parent
5697274dd4
commit
bec15d4d37
@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http';
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { AdButlerResponse } from '../../models/adbutler';
|
import { AdButlerResponse } from '../../models/adbutler';
|
||||||
import { ThemeService } from '../../services/theme.service';
|
import { ThemeService } from '../../services/theme.service';
|
||||||
|
import { Location } from '@angular/common';
|
||||||
|
|
||||||
const adButlerResponseBodyRegex: RegExp = /<a href="(.*)">(.*)<\/a><br\/>(.*)<br\/>\s*<button><a .*>(.*)<\/a>\s*<\/button>/i;
|
const adButlerResponseBodyRegex: RegExp = /<a href="(.*)">(.*)<\/a><br\/>(.*)<br\/>\s*<button><a .*>(.*)<\/a>\s*<\/button>/i;
|
||||||
|
|
||||||
@ -21,13 +22,14 @@ export class AdbutlerComponent implements OnInit {
|
|||||||
'Network Config Generator makes it easy configure network devices, including VLANs without opening the CLI';
|
'Network Config Generator makes it easy configure network devices, including VLANs without opening the CLI';
|
||||||
buttonLabel: string = 'Check it out!';
|
buttonLabel: string = 'Check it out!';
|
||||||
|
|
||||||
constructor(private httpClient: HttpClient, private themeService: ThemeService) {}
|
constructor(private httpClient: HttpClient, private themeService: ThemeService, private location: Location) {}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this.isVisible = false;
|
this.isVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
if (this.location.path().includes('nodes')) return;
|
||||||
this.httpClient
|
this.httpClient
|
||||||
.get<AdButlerResponse>('https://servedbyadbutler.com/adserve/;ID=165803;size=0x0;setID=371476;type=json;')
|
.get<AdButlerResponse>('https://servedbyadbutler.com/adserve/;ID=165803;size=0x0;setID=371476;type=json;')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user