summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/api-docs/api-docs.component.ts
blob: 7d9ea86ebe81ccaeecdae19ff218fecbaf06f9b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Component, OnInit } from '@angular/core';

import SwaggerUI from 'swagger-ui';

@Component({
  selector: 'cd-api-docs',
  templateUrl: './api-docs.component.html',
  styleUrls: ['./api-docs.component.scss']
})
export class ApiDocsComponent implements OnInit {
  ngOnInit(): void {
    SwaggerUI({
      url: window.location.origin + '/docs/openapi.json',
      dom_id: '#swagger-ui',
      layout: 'BaseLayout'
    });
  }
}