12 Commits

Author SHA1 Message Date
Sean Macfarlane
196a8607cc v1.0.7 2021-04-08 16:01:14 -04:00
Sean Macfarlane
e38c672f91 Merge branch 'master' into release/v1.0.0 2021-03-23 11:05:30 -04:00
Sean Macfarlane
cf7ed39120 Merge branch 'master' into release/v1.0.0 2021-03-18 18:02:59 -04:00
Sean Macfarlane
eba4850ae1 fixed typo 2021-03-04 13:29:11 -05:00
Sean Macfarlane
3cfdcf15c6 Merge branch 'master' into release/v1.0.0 2021-03-04 13:18:41 -05:00
Max Brenner
1f018cbd04 strip v character from tags 2021-03-03 19:00:56 +01:00
Max Brenner
bc57402aa9 enable docker push commands 2021-03-02 16:44:59 +01:00
Max Brenner
2692e6527f fix matching of optional v character 2021-03-02 16:35:49 +01:00
Max Brenner
f6d03b7a1b fix matching of optional v character 2021-03-02 16:20:55 +01:00
Max Brenner
3f1a85a9c0 adjust build for release branch 2021-03-02 16:04:53 +01:00
AkshayJagadish-ne
f1b0c54fc3 Merge pull request #89 from Telecominfraproject/WIFI-1669
WIFI:1669 TIP 1.0 Update SDK components  in release 1.0 branch
2021-02-27 22:02:31 -05:00
Akshay Jagadish
7659407562 WIFI:1669 TIP 1.0 Update SDK components and default container image tags in release 1.0 branch 2021-02-26 19:13:49 -05:00
8 changed files with 3773 additions and 2063 deletions

View File

@@ -20,11 +20,8 @@ function formatBytes(bytes, decimals = 2) {
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i] || ''}`; return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i] || ''}`;
} }
function trafficLabelFormatter(bytes) { function trafficLabelFormatter() {
if (this?.value) { return formatBytes(this.value);
return formatBytes(this.value);
}
return formatBytes(bytes);
} }
function trafficTooltipFormatter() { function trafficTooltipFormatter() {
@@ -34,7 +31,7 @@ function trafficTooltipFormatter() {
} }
const lineChartConfig = [ const lineChartConfig = [
{ key: 'service', title: 'Inservice APs (24 hours)' }, { key: 'inservicesAPs', title: 'Inservice APs (24 hours)' },
{ key: 'clientDevices', title: 'Client Devices (24 hours)' }, { key: 'clientDevices', title: 'Client Devices (24 hours)' },
{ {
key: 'traffic', key: 'traffic',
@@ -59,11 +56,9 @@ const Dashboard = () => {
}); });
const [lineChartData, setLineChartData] = useState({ const [lineChartData, setLineChartData] = useState({
service: { inservicesAPs: {
inservicesAPs: { key: 'Inservice APs',
key: 'Inservice APs', value: [],
value: [],
},
}, },
clientDevices: { clientDevices: {
is2dot4GHz: { is2dot4GHz: {
@@ -126,23 +121,22 @@ const Dashboard = () => {
}, },
}, },
}) => { }) => {
const timestamp = parseInt(eventTimestamp, 10); inservicesAPs.push([eventTimestamp, equipmentInServiceCount]);
inservicesAPs.push({ timestamp, value: equipmentInServiceCount });
let total5GHz = 0; let total5GHz = 0;
total5GHz += (radios?.is5GHz || 0) + (radios?.is5GHzL || 0) + (radios?.is5GHzU || 0); // combine all 5GHz radios total5GHz += (radios?.is5GHz || 0) + (radios?.is5GHzL || 0) + (radios?.is5GHzU || 0); // combine all 5GHz radios
clientDevices2dot4GHz.push({ timestamp, value: radios.is2dot4GHz || 0 }); clientDevices2dot4GHz.push([eventTimestamp, radios.is2dot4GHz || 0]);
clientDevices5GHz.push({ timestamp, value: total5GHz || 0 }); clientDevices5GHz.push([eventTimestamp, total5GHz || 0]);
trafficBytesDownstreamData.push({ trafficBytesDownstreamData.push([
timestamp, eventTimestamp,
value: (trafficBytesDownstream > 0 && trafficBytesDownstream) || 0, (trafficBytesDownstream > 0 && trafficBytesDownstream) || 0,
}); ]);
trafficBytesUpstreamData.push({ trafficBytesUpstreamData.push([
timestamp, eventTimestamp,
value: (trafficBytesUpstream > 0 && trafficBytesUpstream) || 0, (trafficBytesUpstream > 0 && trafficBytesUpstream) || 0,
}); ]);
totalDown += (trafficBytesDownstream > 0 && trafficBytesDownstream) || 0; totalDown += (trafficBytesDownstream > 0 && trafficBytesDownstream) || 0;
totalUp += (trafficBytesUpstream > 0 && trafficBytesUpstream) || 0; totalUp += (trafficBytesUpstream > 0 && trafficBytesUpstream) || 0;
@@ -150,11 +144,9 @@ const Dashboard = () => {
); );
return { return {
service: { inservicesAPs: {
inservicesAPs: { ...prev.inservicesAPs,
...prev.service.inservicesAPs, value: [...prev.inservicesAPs.value, ...inservicesAPs],
value: [...prev.service.inservicesAPs.value, ...inservicesAPs],
},
}, },
clientDevices: { clientDevices: {
is2dot4GHz: { is2dot4GHz: {

View File

@@ -70,7 +70,7 @@ const AccessPointDetails = ({ locations }) => {
loading: metricsLoading, loading: metricsLoading,
error: metricsError, error: metricsError,
data: metricsData, data: metricsData,
fetchMore: fetchMoreServiceMetrics, refetch: metricsRefetch,
} = useQuery(FILTER_SERVICE_METRICS, { } = useQuery(FILTER_SERVICE_METRICS, {
variables: { variables: {
customerId, customerId,
@@ -90,29 +90,7 @@ const AccessPointDetails = ({ locations }) => {
const refetchData = () => { const refetchData = () => {
refetch(); refetch();
fetchMoreServiceMetrics({ metricsRefetch();
variables: {
fromTime: moment()
.subtract(2, 'minutes')
.valueOf()
.toString(),
toTime: moment()
.valueOf()
.toString(),
},
updateQuery: (previousResult, { fetchMoreResult }) => {
const previousEntry = previousResult.filterServiceMetrics;
const newItems = fetchMoreResult.filterServiceMetrics.items;
return {
filterServiceMetrics: {
context: fetchMoreResult.filterServiceMetrics.context,
items: [...previousEntry.items, ...newItems],
__typename: previousEntry.__typename,
},
};
},
});
}; };
const handleUpdateEquipment = ({ const handleUpdateEquipment = ({

5618
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "wlan-cloud-ui", "name": "wlan-cloud-ui",
"version": "1.1.1", "version": "1.0.7",
"author": "ConnectUs", "author": "ConnectUs",
"description": "React Portal", "description": "React Portal",
"engines": { "engines": {
@@ -9,9 +9,9 @@
}, },
"scripts": { "scripts": {
"test": "jest --passWithNoTests --coverage", "test": "jest --passWithNoTests --coverage",
"start": "cross-env NODE_ENV=development webpack serve", "start": "cross-env NODE_ENV=development webpack-dev-server",
"start:bare": "cross-env API=ttps://portal.rtl.lab.netexperience.com NODE_ENV=bare webpack serve", "start:bare": "cross-env API=ttps://portal.rtl.lab.netexperience.com NODE_ENV=bare webpack-dev-server",
"start:dev": "cross-env API=https://portal.rtl.lab.netexperience.com NODE_ENV=development webpack serve", "start:dev": "cross-env API=https://portal.rtl.lab.netexperience.com NODE_ENV=development webpack-dev-server",
"build": "webpack --mode=production", "build": "webpack --mode=production",
"format": "prettier --write 'app/**/*{.js,.scss}'", "format": "prettier --write 'app/**/*{.js,.scss}'",
"eslint-fix": "eslint --fix 'app/**/*.js'", "eslint-fix": "eslint --fix 'app/**/*.js'",
@@ -21,29 +21,33 @@
"dependencies": { "dependencies": {
"@ant-design/icons": "^4.2.1", "@ant-design/icons": "^4.2.1",
"@apollo/client": "^3.1.3", "@apollo/client": "^3.1.3",
"@tip-wlan/wlan-cloud-ui-library": "^1.1.3", "@tip-wlan/wlan-cloud-ui-library": "^1.0.10",
"antd": "^4.5.2", "antd": "^4.5.2",
"apollo-upload-client": "^13.0.0", "apollo-upload-client": "^13.0.0",
"graphql": "^15.5.0", "clean-webpack-plugin": "^3.0.0",
"graphql": "^14.6.0",
"highcharts": "^8.1.0", "highcharts": "^8.1.0",
"highcharts-react-official": "^3.0.0", "highcharts-react-official": "^3.0.0",
"history": "^4.10.1", "history": "^4.10.1",
"html-webpack-plugin": "^3.2.0",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"mini-css-extract-plugin": "^0.9.0",
"moment": "^2.26.0", "moment": "^2.26.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^16.13.0", "react": "^16.13.0",
"react-dom": "^16.13.0", "react-dom": "^16.13.0",
"react-helmet": "^5.2.1", "react-helmet": "^5.2.1",
"react-jsx-highcharts": "^4.1.0", "react-jsx-highcharts": "^4.1.0",
"react-jsx-highstock": "^4.1.0", "react-jsx-highstock": "^4.1.0",
"react-router-dom": "^5.1.2" "react-router-dom": "^5.1.2",
"terser-webpack-plugin": "^2.3.5"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.8.7", "@babel/core": "^7.8.7",
"@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.8.7", "@babel/preset-env": "^7.8.7",
"@babel/preset-react": "^7.8.3", "@babel/preset-react": "^7.8.3",
"@babel/runtime": "^7.13.10",
"@testing-library/react": "^10.0.3", "@testing-library/react": "^10.0.3",
"babel-core": "^6.26.3", "babel-core": "^6.26.3",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
@@ -51,10 +55,8 @@
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"babel-plugin-root-import": "^6.4.1", "babel-plugin-root-import": "^6.4.1",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"clean-webpack-plugin": "^3.0.0",
"cross-env": "^7.0.2", "cross-env": "^7.0.2",
"css-loader": "^3.4.2", "css-loader": "^3.4.2",
"css-minimizer-webpack-plugin": "^1.3.0",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-config-airbnb": "^18.0.1", "eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.10.0", "eslint-config-prettier": "^6.10.0",
@@ -66,23 +68,20 @@
"eslint-plugin-react": "^7.19.0", "eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.0", "eslint-plugin-react-hooks": "^2.5.0",
"file-loader": "^5.1.0", "file-loader": "^5.1.0",
"html-webpack-plugin": "^5.3.1",
"husky": "^4.2.3", "husky": "^4.2.3",
"jest": "^25.4.0", "jest": "^25.4.0",
"less": "^3.11.1", "less": "^3.11.1",
"less-loader": "^6.2.0", "less-loader": "^5.0.0",
"lint-staged": "^10.0.8", "lint-staged": "^10.0.8",
"mini-css-extract-plugin": "^1.3.9",
"node-sass": "^4.13.1", "node-sass": "^4.13.1",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"react-test-renderer": "^16.13.1", "react-test-renderer": "^16.13.1",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"style-loader": "^1.1.3", "style-loader": "^1.1.3",
"terser-webpack-plugin": "^5.1.1", "webpack": "^4.42.0",
"webpack": "^5.28.0", "webpack-cli": "^3.3.11",
"webpack-cli": "^4.5.0", "webpack-dev-server": "^3.11.0",
"webpack-dev-server": "^3.11.2", "webpack-merge": "^4.2.2"
"webpack-merge": "^5.7.3"
}, },
"browserslist": [ "browserslist": [
"last 2 versions", "last 2 versions",

View File

@@ -1,5 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */ const webpackMerge = require('webpack-merge');
const { merge } = require('webpack-merge');
const common = require('./webpack/webpack.common'); const common = require('./webpack/webpack.common');
const envs = { const envs = {
@@ -10,4 +9,4 @@ const envs = {
/* eslint-disable global-require,import/no-dynamic-require */ /* eslint-disable global-require,import/no-dynamic-require */
const env = envs[process.env.NODE_ENV || 'production']; const env = envs[process.env.NODE_ENV || 'production'];
const envConfig = require(`./webpack/webpack.${env}.js`); const envConfig = require(`./webpack/webpack.${env}.js`);
module.exports = merge(common, envConfig); module.exports = webpackMerge(common, envConfig);

View File

@@ -1,3 +1,4 @@
const HtmlWebPackPlugin = require('html-webpack-plugin');
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
const webpack = require('webpack'); const webpack = require('webpack');
@@ -24,6 +25,10 @@ module.exports = {
], ],
}, },
plugins: [ plugins: [
new HtmlWebPackPlugin({
template: commonPaths.templatePath,
favicon: './app/images/favicon.ico',
}),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env.API': JSON.stringify(process.env.API || 'http://localhost:4000'), 'process.env.API': JSON.stringify(process.env.API || 'http://localhost:4000'),
}), }),

View File

@@ -1,6 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const path = require('path'); const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const commonPaths = require('./paths'); const commonPaths = require('./paths');
@@ -54,9 +52,7 @@ module.exports = {
{ {
loader: 'less-loader', // compiles Less to CSS loader: 'less-loader', // compiles Less to CSS
options: { options: {
lessOptions: { javascriptEnabled: true,
javascriptEnabled: true,
},
}, },
}, },
], ],
@@ -83,11 +79,4 @@ module.exports = {
), ),
}, },
}, },
plugins: [
new HtmlWebpackPlugin({
template: commonPaths.templatePath,
favicon: './app/images/favicon.ico',
}),
],
}; };

View File

@@ -1,8 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const path = require('path'); const path = require('path');
@@ -10,50 +8,45 @@ const commonPaths = require('./paths');
module.exports = { module.exports = {
output: { output: {
filename: `${commonPaths.jsFolder}/[name].[hash].js`,
path: commonPaths.outputPath, path: commonPaths.outputPath,
publicPath: '/', publicPath: '/',
filename: `${commonPaths.jsFolder}/[name].[chunkhash].js`, chunkFilename: `${commonPaths.jsFolder}/[name].[chunkhash].js`,
chunkFilename: `${commonPaths.jsFolder}/[id].[chunkhash].js`,
}, },
optimization: { optimization: {
minimize: true, minimize: true,
minimizer: [ minimizer: [
new TerserPlugin({ new TerserPlugin({
terserOptions: { // Use multi-process parallel running to improve the build speed
warnings: false, // Default number of concurrent runs: os.cpus().length - 1
compress: {
comparisons: false,
},
parse: {},
mangle: true,
output: {
comments: false,
ascii_only: true,
},
},
parallel: true, parallel: true,
// Enable file caching
cache: true,
sourceMap: true,
}), }),
new CssMinimizerPlugin(), new OptimizeCSSAssetsPlugin(),
], ],
nodeEnv: 'production', // Automatically split vendor and commons
sideEffects: true, // https://twitter.com/wSokra/status/969633336732905474
concatenateModules: true, // https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
runtimeChunk: 'single',
splitChunks: { splitChunks: {
chunks: 'all',
maxInitialRequests: 10,
minSize: 0,
cacheGroups: { cacheGroups: {
vendor: { vendors: {
test: /[\\/]node_modules[\\/]/, test: /[\\/]node_modules[\\/]/,
name(module) { name: 'vendors',
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; chunks: 'initial',
return `npm.${packageName.replace('@', '')}`; },
}, async: {
test: /[\\/]node_modules[\\/]/,
name: 'async',
chunks: 'async',
minChunks: 4,
}, },
}, },
}, },
// Keep the runtime chunk seperated to enable long term caching
// https://twitter.com/wSokra/status/969679223278505985
runtimeChunk: true,
}, },
module: { module: {
@@ -85,48 +78,25 @@ module.exports = {
{ {
loader: 'less-loader', // compiles Less to CSS loader: 'less-loader', // compiles Less to CSS
options: { options: {
lessOptions: { javascriptEnabled: true,
javascriptEnabled: true,
},
}, },
}, },
], ],
}, },
], ],
}, },
resolve: { resolve: {
modules: ['node_modules', 'app'], modules: ['node_modules', 'app'],
alias: { alias: {
app: path.resolve(__dirname, '../', 'app'), app: path.resolve(__dirname, '../', 'app'),
}, },
}, },
plugins: [ plugins: [
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
// Minify and optimize the index.html
new HtmlWebpackPlugin({
template: commonPaths.templatePath,
favicon: './app/images/favicon.ico',
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
inject: true,
}),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: `${commonPaths.cssFolder}/[name].css`, filename: `${commonPaths.cssFolder}/[name].css`,
chunkFilename: `${commonPaths.cssFolder}/[id].css`, chunkFilename: `${commonPaths.cssFolder}/[name].css`,
}), }),
], ],
devtool: 'source-map',
}; };