BASEPATH
This commit is contained in:
@@ -2,6 +2,7 @@ import { NgModule, enableProdMode } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ExtraOptions, PreloadAllModules, RouterModule } from '@angular/router';
|
||||
import { APP_BASE_HREF } from '@angular/common';
|
||||
import { MarkdownModule } from 'ngx-markdown';
|
||||
import { TreoModule } from '@treo';
|
||||
import { TreoConfigModule } from '@treo/services/config';
|
||||
@@ -11,7 +12,7 @@ import { appConfig } from 'app/core/config/app.config';
|
||||
import { mockDataServices } from 'app/data/mock';
|
||||
import { LayoutModule } from 'app/layout/layout.module';
|
||||
import { AppComponent } from 'app/app.component';
|
||||
import { appRoutes } from 'app/app.routing';
|
||||
import { appRoutes, getAppBaseHref } from 'app/app.routing';
|
||||
|
||||
const routerConfig: ExtraOptions = {
|
||||
scrollPositionRestoration: 'enabled',
|
||||
@@ -54,7 +55,13 @@ if (process.env.NODE_ENV === 'production') {
|
||||
],
|
||||
bootstrap : [
|
||||
AppComponent
|
||||
]
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: APP_BASE_HREF,
|
||||
useValue: getAppBaseHref()
|
||||
}
|
||||
],
|
||||
})
|
||||
export class AppModule
|
||||
{
|
||||
|
||||
@@ -2,6 +2,17 @@ import { Route } from '@angular/router';
|
||||
import { LayoutComponent } from 'app/layout/layout.component';
|
||||
import { EmptyLayoutComponent } from 'app/layout/layouts/empty/empty.component';
|
||||
|
||||
// @formatter:off
|
||||
export function getAppBaseHref(): string {
|
||||
return getBasePath() + '/web';
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
// tslint:disable:max-line-length
|
||||
export function getBasePath(): string {
|
||||
return window.location.pathname.split('/web').slice(0, 1)[0];
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
// tslint:disable:max-line-length
|
||||
export const appRoutes: Route[] = [
|
||||
|
||||
@@ -5,6 +5,7 @@ import { MatFormField } from '@angular/material/form-field';
|
||||
import { Subject } from 'rxjs';
|
||||
import { debounceTime, filter, map, takeUntil } from 'rxjs/operators';
|
||||
import { TreoAnimations } from '@treo/animations/public-api';
|
||||
import { getBasePath } from 'app/app.routing';
|
||||
|
||||
@Component({
|
||||
selector : 'search',
|
||||
@@ -199,7 +200,7 @@ export class SearchComponent implements OnInit, OnDestroy
|
||||
})
|
||||
)
|
||||
.subscribe((value) => {
|
||||
this._httpClient.post('api/common/search', {query: value})
|
||||
this._httpClient.post(getBasePath() + '/api/common/search', {query: value})
|
||||
.subscribe((response: any) => {
|
||||
this.results = response.results;
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { getBasePath } from 'app/app.routing';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -45,7 +46,7 @@ export class DashboardService
|
||||
*/
|
||||
getData(): Observable<any>
|
||||
{
|
||||
return this._httpClient.get('/api/summary').pipe(
|
||||
return this._httpClient.get(getBasePath() + '/api/summary').pipe(
|
||||
tap((response: any) => {
|
||||
this._data.next(response);
|
||||
})
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { getBasePath } from 'app/app.routing';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -45,7 +46,7 @@ export class DetailService
|
||||
*/
|
||||
getData(wwn): Observable<any>
|
||||
{
|
||||
return this._httpClient.get(`/api/device/${wwn}/details`).pipe(
|
||||
return this._httpClient.get(getBasePath() + `/api/device/${wwn}/details`).pipe(
|
||||
tap((response: any) => {
|
||||
this._data.next(response);
|
||||
})
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
||||
<browserconfig><msapplication><tile><square70x70logo src="./ms-icon-70x70.png"/><square150x150logo src="./ms-icon-150x150.png"/><square310x310logo src="./ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>scrutiny</title>
|
||||
<base href="/">
|
||||
|
||||
<meta name="viewport"
|
||||
content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0">
|
||||
@@ -22,7 +21,7 @@
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<link rel="manifest" href="./manifest.json" crossorigin="use-credentials">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
@@ -2,40 +2,40 @@
|
||||
"name": "App",
|
||||
"icons": [
|
||||
{
|
||||
"src": "\/android-icon-36x36.png",
|
||||
"src": ".\/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-48x48.png",
|
||||
"src": ".\/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-72x72.png",
|
||||
"src": ".\/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-96x96.png",
|
||||
"src": ".\/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-144x144.png",
|
||||
"src": ".\/android-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-192x192.png",
|
||||
"src": ".\/android-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user