diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 156e84c0..034f9e94 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -278,6 +278,7 @@ import { DataSourceFilter } from './filters/dataSourceFilter'; import { ChangeHostnameActionComponent } from './components/project-map/context-menu/actions/change-hostname/change-hostname-action.component'; import { ChangeHostnameDialogComponent } from './components/project-map/change-hostname-dialog/change-hostname-dialog.component'; import { ApplianceInfoDialogComponent } from './components/project-map/new-template-dialog/appliance-info-dialog/appliance-info-dialog.component'; +import { ResetLinkActionComponent } from './components/project-map/context-menu/actions/reset-link/reset-link-action.component'; @NgModule({ declarations: [ @@ -309,6 +310,7 @@ import { ApplianceInfoDialogComponent } from './components/project-map/new-templ StopCaptureActionComponent, ResumeLinkActionComponent, SuspendLinkActionComponent, + ResetLinkActionComponent, ProjectMapShortcutsComponent, SettingsComponent, PreferencesComponent, diff --git a/src/app/common/error-handlers/toaster-error-handler.ts b/src/app/common/error-handlers/toaster-error-handler.ts index 2e1f09f1..3888850a 100644 --- a/src/app/common/error-handlers/toaster-error-handler.ts +++ b/src/app/common/error-handlers/toaster-error-handler.ts @@ -5,7 +5,7 @@ import { SentryErrorHandler } from './sentry-error-handler'; @Injectable() export class ToasterErrorHandler extends SentryErrorHandler { handleError(err: any): void { - if (err.error && err.error.status && !(err.error.status === 403 || err.error.status === 404)) { + if (err.error && err.error.status && !(err.error.status === 403 || err.error.status === 404 || err.error.status === 405)) { super.handleError(err); } diff --git a/src/app/components/project-map/context-menu/actions/reset-link/reset-link-action.component.html b/src/app/components/project-map/context-menu/actions/reset-link/reset-link-action.component.html new file mode 100644 index 00000000..f216e4db --- /dev/null +++ b/src/app/components/project-map/context-menu/actions/reset-link/reset-link-action.component.html @@ -0,0 +1,4 @@ + diff --git a/src/app/components/project-map/context-menu/actions/reset-link/reset-link-action.component.ts b/src/app/components/project-map/context-menu/actions/reset-link/reset-link-action.component.ts new file mode 100644 index 00000000..085e8896 --- /dev/null +++ b/src/app/components/project-map/context-menu/actions/reset-link/reset-link-action.component.ts @@ -0,0 +1,21 @@ +import { Component, Input } from '@angular/core'; +import { Server } from '../../../../../models/server'; +import { Link } from '../../../../../models/link'; +import { LinkService } from '../../../../../services/link.service'; + +@Component({ + selector: 'app-reset-link-action', + templateUrl: './reset-link-action.component.html' +}) +export class ResetLinkActionComponent { + @Input() server: Server; + @Input() link: Link; + + constructor( + private linkService: LinkService + ) {} + + resetLink() { + this.linkService.resetLink(this.server, this.link).subscribe(() => {}); + } +} diff --git a/src/app/components/project-map/context-menu/context-menu.component.html b/src/app/components/project-map/context-menu/context-menu.component.html index fbfcb3c5..b38e9ef8 100644 --- a/src/app/components/project-map/context-menu/context-menu.component.html +++ b/src/app/components/project-map/context-menu/context-menu.component.html @@ -141,6 +141,11 @@ [server]="server" [link]="links[0]" > +