Skip to content

Commit

Permalink
merge from baidu master
Browse files Browse the repository at this point in the history
  • Loading branch information
minorcong committed Mar 23, 2018
2 parents f3fd154 + 03ad63b commit 56edfb3
Show file tree
Hide file tree
Showing 7 changed files with 325 additions and 350 deletions.
2 changes: 1 addition & 1 deletion control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ check_uwsgi() {
tar -zcf uwsgi-2.0.15.tar.gz uwsgi-2.0.15
rm -rf uwsgi-2.0.15
pip install uwsgi-2.0.15.tar.gz
echo "uwsgi installed."
rm uwsgi-2.0.15.tar.gz
echo "uwsgi installed."
mv ${G_VENV_DIR}/bin/uwsgi ${G_VENV_DIR}/bin/curve_uwsgi
echo "uwsgi renamed."
cutoff
Expand Down
7 changes: 4 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "1.1.3",
"css-loader": "0.28.4",
"d3": "^4.12.2",
"d3": "^4.13.0",
"dotenv": "4.0.0",
"eslint": "3.19.0",
"eslint-config-react-app": "^1.0.5",
Expand All @@ -27,7 +27,8 @@
"extract-text-webpack-plugin": "2.1.2",
"file-loader": "0.11.2",
"fs-extra": "3.0.1",
"highcharts": "^6.0.4",
"highcharts": "6.0.7",
"highcharts-boost": "^0.1.7",
"highcharts-no-data-to-display": "^0.1.7",
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
Expand Down Expand Up @@ -104,7 +105,7 @@
"extends": "react-app"
},
"devDependencies": {
"babel-plugin-import": "^1.6.3",
"babel-plugin-import": "^1.6.5",
"less": "^2.7.2",
"less-loader": "^4.0.4"
},
Expand Down
41 changes: 26 additions & 15 deletions web/src/common/baseComponent/band.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ export default class Band extends Component {
const self = this;
self.initBand();
eventProxy.on('loadBand', obj => {
let legend = !self.isEmpty(self.state.legend[obj.name]) ? self.state.legend[obj.name] : {0: 'show'};
let trendsBands = obj.trendsBands;
let initLegend = {};
trendsBands.forEach((item, index) => {
if (!index) {
initLegend[item.name] = 'show';
}
else {
initLegend[item.name] = '';
}
});
let legend = !self.isEmpty(self.state.legend[obj.name]) ? self.state.legend[obj.name] : initLegend;
self.state.legend[obj.name] = legend;
cookie.save('bandStatus', self.state.legend);
self.setState({
Expand All @@ -49,18 +59,19 @@ export default class Band extends Component {
}

initBand() {
let self = this;
let bandSeries = this.props.bandSeries;
let legend = cookie.load('bandStatus') || this.state.legend || {};
let list = this.props.list;
list.forEach(item => {
if (this.isEmpty(legend[item.name])) {
if (self.isEmpty(legend[item.name])) {
legend[item.name] = {};
bandSeries.forEach((series, index) => {
if (!index) {
legend[item.name][index] = 'show';
legend[item.name][series.name] = 'show';
}
else {
legend[item.name][index] = '';
legend[item.name][series.name] = '';
}
});
}
Expand Down Expand Up @@ -119,17 +130,17 @@ export default class Band extends Component {
}
});
bandSeries.forEach((item, index) => {
legend[dataName][index] = '';
legend[dataName][item.name] = '';
});
if (series.visible) {
series.hide();
bandSeries.forEach((item, i) => {
if (item.name === name) {
if (legend[dataName][i] === 'show') {
legend[dataName][i] = '';
if (legend[dataName][item.name] === 'show') {
legend[dataName][item.name] = '';
}
else {
legend[dataName][i] = '';
legend[dataName][item.name] = '';
}
}
});
Expand All @@ -138,11 +149,11 @@ export default class Band extends Component {
series.show();
bandSeries.forEach((item, i) => {
if (item.name === name) {
if (legend[dataName][i] === '') {
legend[dataName][i] = 'show';
if (legend[dataName][item.name] === '') {
legend[dataName][item.name] = 'show';
}
else {
legend[dataName][i] = '';
legend[dataName][item.name] = '';
}
}
});
Expand Down Expand Up @@ -175,15 +186,15 @@ export default class Band extends Component {
if (!legend[dataName]) {
legend[dataName] = {};
}
if (legend[dataName][index] === undefined) {
if (legend[dataName][item.name] === undefined) {
if (!index) {
legend[dataName][index] = 'show';
legend[dataName][item.name] = 'show';
}
else {
legend[dataName][index] = '';
legend[dataName][item.name] = '';
}
}
let className = legend[dataName][index];
let className = legend[dataName][item.name];
classes += className ? className : '';
let color = '';
chart.series.forEach(item => {
Expand Down
11 changes: 4 additions & 7 deletions web/src/common/baseComponent/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ import Highcharts from 'highcharts/highstock';
import {NoDataToDisplay} from 'react-highcharts-no-data-to-display';
import highchartsMore from 'highcharts/highcharts-more';
import eventProxy from '../../tools/eventProxy';
// import Boost from 'highcharts/modules/boost';

highchartsMore(Highcharts);
let ReactHighcharts = require('react-highcharts/ReactHighstock');
NoDataToDisplay(ReactHighcharts.Highcharts);
// let Boost = require('highcharts/modules/boost');
// Boost(ReactHighcharts.Highcharts);

// import HighchartsMore from 'highcharts/highcharts-more';
// var RHighcharts = require('react-highcharts/ReactHighstock');
// HighchartsMore(RHighcharts.Highcharts);
let Boost = require('highcharts/modules/boost');
Boost(Highcharts);

Highcharts.setOptions({
global: {
Expand Down Expand Up @@ -47,13 +42,15 @@ export default class Chart extends Component {
config = Object.assign({}, defaultConfig, config);
let chartConfig = config.chart;
let chartType = this.props.type || 'chart';

this.chart = new Highcharts[chartType]({
...config,
chart: {
...chartConfig,
renderTo: this.refs.chart
}
}, this.props.callback);

eventProxy.trigger('loadedChart', this.chart);
if (!this.props.neverReflow) {
this.chart && this.chart.options && this.chart.reflow();
Expand Down
2 changes: 1 addition & 1 deletion web/src/common/baseComponent/uploadData.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class UploadData extends Component {
num = 0;
}
num++;
}, 800);
}, 500);
window.timeIds1 = setInterval(function () {
let loadingWidth = 398 * step.percent / 100;
if (loadingWidth <= 398) {
Expand Down
12 changes: 9 additions & 3 deletions web/src/index/component/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,16 @@ export default class Sidebar extends Component {
}
// If the current name is not in the data list, the default jumps to the first one
else {
message.warning('No ' + self.props.params.name + ' Data', 2, function () {
url = '/home/' + name;
let showName = self.props.params.name;
if (showName) {
message.warning('No ' + showName + ' Data', 2, function () {
url = '/home/' + name;
self.redirect(url, data, name);
});
}
else {
self.redirect(url, data, name);
});
}
}
}
});
Expand Down
Loading

0 comments on commit 56edfb3

Please sign in to comment.