mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Changed hard coded urls to config
This commit is contained in:
parent
42727786ce
commit
feb68e9a70
@ -3,10 +3,11 @@
|
|||||||
"type": "default",
|
"type": "default",
|
||||||
"value": "lightBaseTheme"
|
"value": "lightBaseTheme"
|
||||||
},
|
},
|
||||||
"config": {
|
"serverConfig": {
|
||||||
"hostname": "localhost",
|
"hostname": "localhost",
|
||||||
"httpsPort": "9443",
|
"httpsPort": "9443",
|
||||||
"apiPort": "8243"
|
"invokerUri": "/api/application-mgt-handler/v1.0/invoke",
|
||||||
|
"loginUri": "/api/application-mgt-handler/v1.0/login"
|
||||||
},
|
},
|
||||||
"serverUrl" : "https://localhost:9443",
|
"serverUrl" : "https://localhost:9443",
|
||||||
"defaultPlatformIcons": {
|
"defaultPlatformIcons": {
|
||||||
|
|||||||
@ -20,9 +20,13 @@ class AppCard extends React.Component {
|
|||||||
if(defaultPlatformIcons.hasOwnProperty(this.props.platform)){
|
if(defaultPlatformIcons.hasOwnProperty(this.props.platform)){
|
||||||
icon = defaultPlatformIcons[this.props.platform];
|
icon = defaultPlatformIcons[this.props.platform];
|
||||||
}
|
}
|
||||||
|
let descriptionText = this.props.description;
|
||||||
|
if(descriptionText.length>50){
|
||||||
|
descriptionText = descriptionText.substring(0,50)+"...";
|
||||||
|
}
|
||||||
const description = (
|
const description = (
|
||||||
<div>
|
<div>
|
||||||
<p>{this.props.description}</p>
|
<p>{descriptionText}</p>
|
||||||
<Text code>{this.props.type}</Text>
|
<Text code>{this.props.type}</Text>
|
||||||
<Text> {this.props.subType}</Text>
|
<Text> {this.props.subType}</Text>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {GET_APPS} from "../constants/action-types";
|
import {GET_APPS} from "../constants/action-types";
|
||||||
|
import config from "../../../public/conf/config.json";
|
||||||
|
|
||||||
export function getApps() {
|
export function getApps() {
|
||||||
|
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
const request = "method=post&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications";
|
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 => {
|
).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
let apps = [];
|
let apps = [];
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import React from "react";
|
|||||||
import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox} from 'antd';
|
import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox} from 'antd';
|
||||||
import styles from './Login.less';
|
import styles from './Login.less';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import config from "../../public/conf/config.json";
|
||||||
|
|
||||||
const {Title} = Typography;
|
const {Title} = Typography;
|
||||||
const {Text} = Typography;
|
const {Text} = Typography;
|
||||||
@ -58,7 +59,7 @@ class NormalLoginForm extends React.Component {
|
|||||||
});
|
});
|
||||||
console.log('Received values of form: ', values);
|
console.log('Received values of form: ', values);
|
||||||
let data = "username=" + values.username + "&password=" + values.password + "&platform=publisher";
|
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 => {
|
).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
window.location = res.data.url;
|
window.location = res.data.url;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user