[menu] call services api to fetch user menu

This commit is contained in:
nymkappa 2023-08-17 18:59:27 +02:00
parent 23b871631a
commit 91e3943a74
No known key found for this signature in database
GPG key ID: E155910B16E8BD04
4 changed files with 28 additions and 38 deletions

View file

@ -112,6 +112,14 @@ PROXY_CONFIG.push(...[
"^/testnet": ""
},
},
{
context: ['/api/v1/services/**'],
target: `http://localhost:9000`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/v1/**'],
target: `http://127.0.0.1:8999`,

View file

@ -112,6 +112,14 @@ PROXY_CONFIG.push(...[
"^/testnet": ""
},
},
{
context: ['/api/v1/services/**'],
target: `http://localhost:9000`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/v1/**'],
target: `http://localhost:8999`,

View file

@ -95,6 +95,14 @@ if (configContent && configContent.BASE_MODULE === 'bisq') {
}
PROXY_CONFIG.push(...[
{
context: ['/api/v1/services/**'],
target: `http://localhost:9000`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/v1/**'],
target: `http://localhost:8999`,

View file

@ -9,6 +9,7 @@ import { Outspend, Transaction } from '../interfaces/electrs.interface';
import { Conversion } from './price.service';
import { MenuGroup } from '../interfaces/services.interface';
// Todo - move to config.json
const SERVICES_API_PREFIX = `/api/v1/services`;
@Injectable({
@ -348,43 +349,8 @@ export class ApiService {
return of(null);
}
return of([
{
title: 'Lightning',
i18n: '',
items: [
{
title: 'Nodes',
i18n: '',
faIcon: 'network-wired',
link: '/services/lightning/nodes'
}
]
},
{
title: 'Enterprise',
i18n: '',
items: [
{
title: 'Settings',
i18n: '',
faIcon: 'id-card-alt',
link: '/services/enterprise/settings'
},
{
title: 'IP Whitelist',
i18n: '',
faIcon: 'check-circle',
link: '/services/enterprise/ip-whitelist'
}
]
}
]);
// return this.httpClient.get<MenuGroup[]>(`${SERVICES_API_PREFIX}/account`, {
// headers: {
// 'Authorization': auth.token
// }
// });
return this.httpClient.get<MenuGroup[]>(`${SERVICES_API_PREFIX}/account/menu`, {
headers: { 'Authorization': auth.token }
});
}
}