diff --git a/src/app/Controllers/JsonController/consul/consul.component.html b/src/app/Controllers/JsonController/consul/consul.component.html deleted file mode 100644 index f2c6648..0000000 --- a/src/app/Controllers/JsonController/consul/consul.component.html +++ /dev/null @@ -1 +0,0 @@ -

consul works!

diff --git a/src/app/Controllers/JsonController/consul/consul.component.ts b/src/app/Controllers/JsonController/consul/consul.component.ts deleted file mode 100644 index f7a1ad3..0000000 --- a/src/app/Controllers/JsonController/consul/consul.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-consul', - templateUrl: './consul.component.html', - styleUrls: ['./consul.component.scss'] -}) -export class ConsulComponent { - -} diff --git a/src/app/Models/DummyResponse.ts b/src/app/Models/DummyResponse.ts deleted file mode 100644 index 49c8d19..0000000 --- a/src/app/Models/DummyResponse.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IConsulObject } from "./JsonObject" - -export var SampleResponse = '{"consul-server":{"ID":"Wfrning!","Service":"Dummy-Response ","Tags":["infra","vdk2ch","consul-server","ssl"],"Meta":{},"Port":8500,"Address":"consul.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"drone-server":{"ID":"drone-server","Service":"drone-server","Tags":["infra","vdk2ch","drone-server","ssl"],"Meta":{},"Port":38080,"Address":"drone.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"dvach-back-api":{"ID":"dvach-back-api","Service":"dvach-back-api","Tags":["board","vdk2ch","back-api","api","ssl"],"Meta":{},"Port":5000,"Address":"api.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"dvach-front-angular":{"ID":"dvach-front-angular","Service":"dvach-front-angular","Tags":["board","vdk2ch","angular","front","ssl"],"Meta":{},"Port":4200,"Address":"board.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"gitea":{"ID":"gitea","Service":"gitea","Tags":["infra","vdk2ch","git","ssl"],"Meta":{},"Port":3000,"Address":"git.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"graylog":{"ID":"graylog","Service":"graylog","Tags":["infra","vdk2ch","graylog","ssl"],"Meta":{},"Port":9000,"Address":"graylog.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"minio-api":{"ID":"minio-api","Service":"minio-api","Tags":["infra","vdk2ch","minio-api","static","ssl"],"Meta":{},"Port":15555,"Address":"static.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"minio-consule":{"ID":"minio-consule","Service":"minio-console","Tags":["infra","vdk2ch","minio-consol","ssl"],"Meta":{},"Port":15556,"Address":"minio.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"}}' \ No newline at end of file diff --git a/src/app/Pages/main-page/main-page.component.spec.ts b/src/app/Pages/main-page/main-page.component.spec.ts deleted file mode 100644 index ad990af..0000000 --- a/src/app/Pages/main-page/main-page.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MainPageComponent } from './main-page.component'; - -describe('MainPageComponent', () => { - let component: MainPageComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ MainPageComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(MainPageComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/Pages/single-object/single-objcet.component.spec.ts b/src/app/Pages/single-object/single-objcet.component.spec.ts deleted file mode 100644 index d8c06fe..0000000 --- a/src/app/Pages/single-object/single-objcet.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SingleObjcetComponent } from './single-objcet.component'; - -describe('SingleObjcetComponent', () => { - let component: SingleObjcetComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ SingleObjcetComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(SingleObjcetComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 973cce9..9a30cc9 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,9 +1,11 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { MainPageComponent } from './Pages/main-page/main-page.component'; +import { AboutComponent } from './pages/about/about.component'; +import { MainPageComponent } from './pages/main-page/main-page.component'; const routes: Routes = [ { path: 'benis', component: MainPageComponent }, + { path: 'about', component: AboutComponent} ]; @NgModule({ diff --git a/src/app/app.component.html b/src/app/app.component.html index f9d55cd..2bdb1ce 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,6 +1,7 @@ \ No newline at end of file diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e0502d1..8f62ff4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,14 +4,16 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import { MainPageComponent } from './Pages/main-page/main-page.component'; -import { SingleObjcetComponent } from './Pages/single-object/single-objcet.component'; +import { MainPageComponent } from './pages/main-page/main-page.component'; +import { SingleObjcetComponent } from './pages/main-page/single-object/single-objcet.component'; +import { AboutComponent } from './pages/about/about.component'; @NgModule({ declarations: [ AppComponent, MainPageComponent, - SingleObjcetComponent + SingleObjcetComponent, + AboutComponent ], imports: [ BrowserModule, diff --git a/src/app/models/DummyResponse.ts b/src/app/models/DummyResponse.ts new file mode 100644 index 0000000..828b420 --- /dev/null +++ b/src/app/models/DummyResponse.ts @@ -0,0 +1,3 @@ +import { IConsulObject } from "./JsonObject" + +export const SampleResponse = '{"consul-server":{"ID":"Wfrning!","Service":"Dummy-Response ","Tags":["infra","vdk2ch","consul-server","ssl"],"Meta":{},"Port":8500,"Address":"consul.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"drone-server":{"ID":"drone-server","Service":"drone-server","Tags":["infra","vdk2ch","drone-server","ssl"],"Meta":{},"Port":38080,"Address":"drone.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"dvach-back-api":{"ID":"dvach-back-api","Service":"dvach-back-api","Tags":["board","vdk2ch","back-api","api","ssl"],"Meta":{},"Port":5000,"Address":"api.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"dvach-front-angular":{"ID":"dvach-front-angular","Service":"dvach-front-angular","Tags":["board","vdk2ch","angular","front","ssl"],"Meta":{},"Port":4200,"Address":"board.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"gitea":{"ID":"gitea","Service":"gitea","Tags":["infra","vdk2ch","git","ssl"],"Meta":{},"Port":3000,"Address":"git.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"graylog":{"ID":"graylog","Service":"graylog","Tags":["infra","vdk2ch","graylog","ssl"],"Meta":{},"Port":9000,"Address":"graylog.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"minio-api":{"ID":"minio-api","Service":"minio-api","Tags":["infra","vdk2ch","minio-api","static","ssl"],"Meta":{},"Port":15555,"Address":"static.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"},"minio-consule":{"ID":"minio-consule","Service":"minio-console","Tags":["infra","vdk2ch","minio-consol","ssl"],"Meta":{},"Port":15556,"Address":"minio.vdk2ch.ru","Weights":{"Passing":1,"Warning":1},"EnableTagOverride":false,"Datacenter":"vdk2ch"}}' \ No newline at end of file diff --git a/src/app/Models/JsonObject.ts b/src/app/models/JsonObject.ts similarity index 100% rename from src/app/Models/JsonObject.ts rename to src/app/models/JsonObject.ts diff --git a/src/app/pages/about/about.component.html b/src/app/pages/about/about.component.html new file mode 100644 index 0000000..ff2b7cc --- /dev/null +++ b/src/app/pages/about/about.component.html @@ -0,0 +1,2 @@ +

Написано на больную, температурящую голову, отшкребая сопли от клавиатуры и задаваясь вопросом "когда же выздоровление?"

+

Рак, 29 декабря 2022

diff --git a/src/app/Controllers/JsonController/consul/consul.component.scss b/src/app/pages/about/about.component.scss similarity index 100% rename from src/app/Controllers/JsonController/consul/consul.component.scss rename to src/app/pages/about/about.component.scss diff --git a/src/app/Controllers/JsonController/consul/consul.component.spec.ts b/src/app/pages/about/about.component.spec.ts similarity index 54% rename from src/app/Controllers/JsonController/consul/consul.component.spec.ts rename to src/app/pages/about/about.component.spec.ts index 29bcb6e..7e3a2ca 100644 --- a/src/app/Controllers/JsonController/consul/consul.component.spec.ts +++ b/src/app/pages/about/about.component.spec.ts @@ -1,18 +1,18 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ConsulComponent } from './consul.component'; +import { AboutComponent } from './about.component'; -describe('ConsulComponent', () => { - let component: ConsulComponent; - let fixture: ComponentFixture; +describe('AboutComponent', () => { + let component: AboutComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ConsulComponent ] + declarations: [ AboutComponent ] }) .compileComponents(); - fixture = TestBed.createComponent(ConsulComponent); + fixture = TestBed.createComponent(AboutComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/pages/about/about.component.ts b/src/app/pages/about/about.component.ts new file mode 100644 index 0000000..e036785 --- /dev/null +++ b/src/app/pages/about/about.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-about', + templateUrl: './about.component.html', + styleUrls: ['./about.component.scss'] +}) +export class AboutComponent { + +} diff --git a/src/app/Pages/main-page/main-page.component.html b/src/app/pages/main-page/main-page.component.html similarity index 100% rename from src/app/Pages/main-page/main-page.component.html rename to src/app/pages/main-page/main-page.component.html diff --git a/src/app/Pages/main-page/main-page.component.scss b/src/app/pages/main-page/main-page.component.scss similarity index 100% rename from src/app/Pages/main-page/main-page.component.scss rename to src/app/pages/main-page/main-page.component.scss diff --git a/src/app/Pages/main-page/main-page.component.ts b/src/app/pages/main-page/main-page.component.ts similarity index 60% rename from src/app/Pages/main-page/main-page.component.ts rename to src/app/pages/main-page/main-page.component.ts index 3d59ea6..39658da 100644 --- a/src/app/Pages/main-page/main-page.component.ts +++ b/src/app/pages/main-page/main-page.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; -import { IConsulObject } from 'src/app/Models/JsonObject'; -import { HttpClient } from '@angular/common/http' -import * as DummyResponse from '../../Models/DummyResponse'; +import { IConsulObject } from 'src/app/models/JsonObject'; +import * as DummyResponse from '../../models/DummyResponse'; +import { JsonService } from 'src/app/services/json.service'; @Component({ selector: 'app-main-page', @@ -9,7 +9,10 @@ import * as DummyResponse from '../../Models/DummyResponse'; styleUrls: ['./main-page.component.scss'] }) export class MainPageComponent { - constructor(private http: HttpClient) {} + + constructor(public jsonService: JsonService) { +} + response: any = JSON.parse(DummyResponse.SampleResponse); @@ -18,7 +21,7 @@ responseArray: IConsulObject[] = []; list(){ this.responseArray = [] -this.getList().subscribe(response => { + this.jsonService.getList().subscribe(response => { this.response = response this.keys= Object.keys(this.response); this.keys.forEach(element => { @@ -30,11 +33,7 @@ this.getList().subscribe(response => { -getList(){ - var response = this.http.get("https://consul.vdk2ch.ru/v1/agent/services") - console.log(response) - return response; -} + ngOnInit(): void { diff --git a/src/app/Pages/single-object/single-objcet.component.html b/src/app/pages/main-page/single-object/single-objcet.component.html similarity index 100% rename from src/app/Pages/single-object/single-objcet.component.html rename to src/app/pages/main-page/single-object/single-objcet.component.html diff --git a/src/app/Pages/single-object/single-objcet.component.scss b/src/app/pages/main-page/single-object/single-objcet.component.scss similarity index 100% rename from src/app/Pages/single-object/single-objcet.component.scss rename to src/app/pages/main-page/single-object/single-objcet.component.scss diff --git a/src/app/Pages/single-object/single-objcet.component.ts b/src/app/pages/main-page/single-object/single-objcet.component.ts similarity index 84% rename from src/app/Pages/single-object/single-objcet.component.ts rename to src/app/pages/main-page/single-object/single-objcet.component.ts index f80299c..a6c60be 100644 --- a/src/app/Pages/single-object/single-objcet.component.ts +++ b/src/app/pages/main-page/single-object/single-objcet.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { IConsulObject } from 'src/app/Models/JsonObject'; +import { IConsulObject } from 'src/app/models/JsonObject'; @Component({ selector: 'app-single-objcet', diff --git a/src/app/services/json.service.ts b/src/app/services/json.service.ts new file mode 100644 index 0000000..2c0cd7b --- /dev/null +++ b/src/app/services/json.service.ts @@ -0,0 +1,18 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class JsonService { + + +constructor(private http: HttpClient) { + } + + getList(): Observable { + var response = this.http.get("https://consul.vdk2ch.ru/v1/agent/services") + return response; +} +}