Changed hard coded urls to config

feature/appm-store/pbac
Jayasanka 5 years ago
parent 42727786ce
commit feb68e9a70

@ -3,10 +3,11 @@
"type": "default",
"value": "lightBaseTheme"
},
"config": {
"serverConfig": {
"hostname": "localhost",
"httpsPort": "9443",
"apiPort": "8243"
"invokerUri": "/api/application-mgt-handler/v1.0/invoke",
"loginUri": "/api/application-mgt-handler/v1.0/login"
},
"serverUrl" : "https://localhost:9443",
"defaultPlatformIcons": {

@ -20,9 +20,13 @@ class AppCard extends React.Component {
if(defaultPlatformIcons.hasOwnProperty(this.props.platform)){
icon = defaultPlatformIcons[this.props.platform];
}
let descriptionText = this.props.description;
if(descriptionText.length>50){
descriptionText = descriptionText.substring(0,50)+"...";
}
const description = (
<div>
<p>{this.props.description}</p>
<p>{descriptionText}</p>
<Text code>{this.props.type}</Text>
<Text> {this.props.subType}</Text>
</div>

@ -1,12 +1,13 @@
import axios from "axios";
import {GET_APPS} from "../constants/action-types";
import config from "../../../public/conf/config.json";
export function getApps() {
return (dispatch) => {
const request = "method=post&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications";
return axios.post('https://localhost:9443/api/application-mgt-handler/v1.0/invoke', request
return axios.post('https://'+config.serverConfig.hostname+':'+config.serverConfig.httpsPort+config.serverConfig.invokerUri, request
).then(res => {
if (res.status === 200) {
let apps = [];

@ -2,6 +2,7 @@ import React from "react";
import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox} from 'antd';
import styles from './Login.less';
import axios from 'axios';
import config from "../../public/conf/config.json";
const {Title} = Typography;
const {Text} = Typography;
@ -58,7 +59,7 @@ class NormalLoginForm extends React.Component {
});
console.log('Received values of form: ', values);
let data = "username=" + values.username + "&password=" + values.password + "&platform=publisher";
axios.post('https://localhost:9443/api/application-mgt-handler/v1.0/login', data
axios.post('https://'+config.serverConfig.hostname+':'+config.serverConfig.httpsPort+config.serverConfig.loginUri, data
).then(res => {
if (res.status === 200) {
window.location = res.data.url;

Loading…
Cancel
Save