mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-01 11:17:59 +00:00
Merge branch 'master' of https://github.com/Telecominfraproject/wlan-cloud-ui into feature/network-page-reload-function
This commit is contained in:
@@ -24,7 +24,11 @@ RUN npm run build
|
|||||||
|
|
||||||
# production environment
|
# production environment
|
||||||
FROM nginx:stable-alpine
|
FROM nginx:stable-alpine
|
||||||
|
RUN apk add --no-cache jq
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
COPY docker_entrypoint.sh generate_config_js.sh /
|
||||||
|
RUN chmod +x docker_entrypoint.sh generate_config_js.sh
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
ENTRYPOINT ["/docker_entrypoint.sh"]
|
||||||
1
app/config.js
Normal file
1
app/config.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
window.REACT_APP_API = undefined;
|
||||||
@@ -31,6 +31,7 @@ const Alarms = () => {
|
|||||||
const { customerId } = useContext(UserContext);
|
const { customerId } = useContext(UserContext);
|
||||||
const { loading, error, data, refetch, fetchMore } = useQuery(GET_ALL_ALARMS, {
|
const { loading, error, data, refetch, fetchMore } = useQuery(GET_ALL_ALARMS, {
|
||||||
variables: { customerId },
|
variables: { customerId },
|
||||||
|
errorPolicy: 'all',
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleOnReload = () => {
|
const handleOnReload = () => {
|
||||||
@@ -73,9 +74,10 @@ const Alarms = () => {
|
|||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error && !data?.getAllAlarms?.items) {
|
||||||
return <Alert message="Error" description="Failed to load alarms." type="error" showIcon />;
|
return <Alert message="Error" description="Failed to load alarms." type="error" showIcon />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AlarmsPage
|
<AlarmsPage
|
||||||
data={data.getAllAlarms.items}
|
data={data.getAllAlarms.items}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import UserContext from 'contexts/UserContext';
|
|||||||
import { GET_CLIENT_SESSION, FILTER_SERVICE_METRICS } from 'graphql/queries';
|
import { GET_CLIENT_SESSION, FILTER_SERVICE_METRICS } from 'graphql/queries';
|
||||||
|
|
||||||
const toTime = moment();
|
const toTime = moment();
|
||||||
const fromTime = moment().subtract(1, 'hour');
|
const fromTime = moment().subtract(4, 'hours');
|
||||||
|
|
||||||
const ClientDeviceDetails = () => {
|
const ClientDeviceDetails = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
@@ -33,7 +33,7 @@ const ClientDeviceDetails = () => {
|
|||||||
toTime: toTime.valueOf().toString(),
|
toTime: toTime.valueOf().toString(),
|
||||||
clientMacs: [id],
|
clientMacs: [id],
|
||||||
dataTypes: ['Client'],
|
dataTypes: ['Client'],
|
||||||
limit: 100,
|
limit: 1000,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ const ClientDeviceDetails = () => {
|
|||||||
metricsData={
|
metricsData={
|
||||||
metricsData && metricsData.filterServiceMetrics && metricsData.filterServiceMetrics.items
|
metricsData && metricsData.filterServiceMetrics && metricsData.filterServiceMetrics.items
|
||||||
}
|
}
|
||||||
historyDate={toTime}
|
historyDate={{ toTime, fromTime }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ export const FILTER_SERVICE_METRICS = gql`
|
|||||||
rssi
|
rssi
|
||||||
rxBytes
|
rxBytes
|
||||||
txBytes
|
txBytes
|
||||||
|
detailsJSON
|
||||||
}
|
}
|
||||||
context {
|
context {
|
||||||
lastPage
|
lastPage
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
<!-- Allow installing the app to the homescreen -->
|
<!-- Allow installing the app to the homescreen -->
|
||||||
<meta name="mobile-web-app-capable" content="yes" />
|
<meta name="mobile-web-app-capable" content="yes" />
|
||||||
|
<script type="text/javascript" src="/config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ import { getItem, setItem, removeItem } from 'utils/localStorage';
|
|||||||
import history from 'utils/history';
|
import history from 'utils/history';
|
||||||
|
|
||||||
const API_URI =
|
const API_URI =
|
||||||
process.env.NODE_ENV === 'development'
|
process.env.NODE_ENV === 'development' ? 'http://localhost:4000/' : window.REACT_APP_API;
|
||||||
? 'http://localhost:4000/'
|
|
||||||
: 'https://wlan-graphql.zone3.lab.connectus.ai/';
|
|
||||||
const MOUNT_NODE = document.getElementById('root');
|
const MOUNT_NODE = document.getElementById('root');
|
||||||
|
|
||||||
const cache = new InMemoryCache();
|
const cache = new InMemoryCache();
|
||||||
|
|||||||
3
docker_entrypoint.sh
Normal file
3
docker_entrypoint.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh -eu
|
||||||
|
./generate_config_js.sh >/usr/share/nginx/html/config.js
|
||||||
|
nginx -g "daemon off;"
|
||||||
10
generate_config_js.sh
Normal file
10
generate_config_js.sh
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh -eu
|
||||||
|
if [ -z "${API:-}" ]; then
|
||||||
|
API_URL_JSON=undefined
|
||||||
|
else
|
||||||
|
API_URL_JSON=$(jq -n --arg api "$API" '$api')
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
window.REACT_APP_API = $API_URL_JSON;
|
||||||
|
EOF
|
||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wlan-cloud-ui",
|
"name": "wlan-cloud-ui",
|
||||||
"version": "0.2.4",
|
"version": "0.2.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1874,9 +1874,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@tip-wlan/wlan-cloud-ui-library": {
|
"@tip-wlan/wlan-cloud-ui-library": {
|
||||||
"version": "0.2.4",
|
"version": "0.2.7",
|
||||||
"resolved": "https://tip.jfrog.io/artifactory/api/npm/tip-wlan-cloud-npm-repo/@tip-wlan/wlan-cloud-ui-library/-/@tip-wlan/wlan-cloud-ui-library-0.2.4.tgz",
|
"resolved": "https://tip.jfrog.io/artifactory/api/npm/tip-wlan-cloud-npm-repo/@tip-wlan/wlan-cloud-ui-library/-/@tip-wlan/wlan-cloud-ui-library-0.2.7.tgz",
|
||||||
"integrity": "sha1-TjgY8Jog3I95kD1OKmOXljGzXg8="
|
"integrity": "sha1-GGCapOJxcgD36ml6ZU2j1AlzXio="
|
||||||
},
|
},
|
||||||
"@types/anymatch": {
|
"@types/anymatch": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wlan-cloud-ui",
|
"name": "wlan-cloud-ui",
|
||||||
"version": "0.2.4",
|
"version": "0.2.7",
|
||||||
"author": "ConnectUs",
|
"author": "ConnectUs",
|
||||||
"description": "React Portal",
|
"description": "React Portal",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"@ant-design/icons": "^4.2.1",
|
"@ant-design/icons": "^4.2.1",
|
||||||
"@apollo/react-hoc": "^3.1.4",
|
"@apollo/react-hoc": "^3.1.4",
|
||||||
"@apollo/react-hooks": "^3.1.3",
|
"@apollo/react-hooks": "^3.1.3",
|
||||||
"@tip-wlan/wlan-cloud-ui-library": "^0.2.4",
|
"@tip-wlan/wlan-cloud-ui-library": "^0.2.7",
|
||||||
"antd": "^4.3.1",
|
"antd": "^4.3.1",
|
||||||
"apollo-cache-inmemory": "^1.6.6",
|
"apollo-cache-inmemory": "^1.6.6",
|
||||||
"apollo-client": "^2.6.10",
|
"apollo-client": "^2.6.10",
|
||||||
|
|||||||
Reference in New Issue
Block a user