mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[CST-5535] WIP
This commit is contained in:
12
src/app/health-page/health.module.ts
Normal file
12
src/app/health-page/health.module.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { HealthComponent } from './health/health.component';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
HealthComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class HealthModule {
|
||||||
|
|
||||||
|
}
|
25
src/app/health-page/health.routing.module.ts
Normal file
25
src/app/health-page/health.routing.module.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
||||||
|
import { HealthComponent } from './health/health.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
canActivate: [AuthenticatedGuard],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: HealthComponent,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class HealthPageRoutingModule {
|
||||||
|
|
||||||
|
}
|
1
src/app/health-page/health/health.component.html
Normal file
1
src/app/health-page/health/health.component.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<p>health works!</p>
|
0
src/app/health-page/health/health.component.scss
Normal file
0
src/app/health-page/health/health.component.scss
Normal file
25
src/app/health-page/health/health.component.spec.ts
Normal file
25
src/app/health-page/health/health.component.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { HealthComponent } from './health.component';
|
||||||
|
|
||||||
|
describe('HealthComponent', () => {
|
||||||
|
let component: HealthComponent;
|
||||||
|
let fixture: ComponentFixture<HealthComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ HealthComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(HealthComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
26
src/app/health-page/health/health.component.ts
Normal file
26
src/app/health-page/health/health.component.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { DspaceRestService } from '../../core/dspace-rest/dspace-rest.service';
|
||||||
|
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-health',
|
||||||
|
templateUrl: './health.component.html',
|
||||||
|
styleUrls: ['./health.component.scss']
|
||||||
|
})
|
||||||
|
export class HealthComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(protected halService: HALEndpointService,
|
||||||
|
protected restService: DspaceRestService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.halService.getRootHref();
|
||||||
|
console.log('this.halService.getRootHref()',);
|
||||||
|
this.restService.get(this.halService.getRootHref() + '/actuator' + '/health').subscribe((data)=>{
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user