Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hanahmily committed Sep 3, 2018
1 parent ad3ee45 commit 1f5fcab
Show file tree
Hide file tree
Showing 59 changed files with 11,597 additions and 7,917 deletions.
67 changes: 0 additions & 67 deletions .eslintrc

This file was deleted.

72 changes: 72 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier'],
env: {
browser: true,
node: true,
es6: true,
mocha: true,
jest: true,
jasmine: true,
},
rules: {
'generator-star-spacing': [0],
'consistent-return': [0],
'react/forbid-prop-types': [0],
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
'global-require': [1],
'import/prefer-default-export': [0],
'react/jsx-no-bind': [0],
'react/prop-types': [0],
'react/prefer-stateless-function': [0],
'react/jsx-one-expression-per-line': [0],
'react/jsx-wrap-multilines': [
'error',
{
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'ignore',
},
],
'no-else-return': [0],
'no-restricted-syntax': [0],
'import/no-extraneous-dependencies': [0],
'no-use-before-define': [0],
'jsx-a11y/no-static-element-interactions': [0],
'jsx-a11y/no-noninteractive-element-interactions': [0],
'jsx-a11y/click-events-have-key-events': [0],
'jsx-a11y/anchor-is-valid': [0],
'no-nested-ternary': [0],
'arrow-body-style': [0],
'import/extensions': [0],
'no-bitwise': [0],
'no-cond-assign': [0],
'import/no-unresolved': [0],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'object-curly-newline': [0],
'function-paren-newline': [0],
'no-restricted-globals': [0],
'require-yield': [1],
},
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
settings: {
polyfills: ['fetch', 'promises'],
},
};
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.md
**/*.svg
**/*.html
**/*.ejs
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
5 changes: 3 additions & 2 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "stylelint-config-standard",
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"rules": {
"selector-pseudo-class-no-unknown": null,
"shorthand-property-no-redundant-values": null,
Expand All @@ -17,10 +17,11 @@
"number-no-trailing-zeros": null,
"rule-empty-line-before": null,
"selector-combinator-space-after": null,
"selector-descendant-combinator-no-non-space": null,
"selector-list-comma-newline-after": null,
"selector-pseudo-element-colon-notation": null,
"unit-no-unknown": null,
"no-descending-specificity": null,
"value-list-max-empty-lines": null
}
}
}
53 changes: 28 additions & 25 deletions .webpackrc.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
const path = require('path');

const config = {
"entry": "src/index.js",
"extraBabelPlugins": [
"transform-decorators-legacy",
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }]
],
"env": {
"development": {
"extraBabelPlugins": [
"dva-hmr"
]
}
entry: 'src/index.js',
extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]],
env: {
development: {
extraBabelPlugins: ['dva-hmr'],
},
},
"ignoreMomentLocale": true,
"theme": "./src/theme.js",
"html": {
"template": "./src/index.ejs"
alias: {
components: path.resolve(__dirname, 'src/components/'),
},
"publicPath": "/",
"disableDynamicImport": false,
"hash": true
}
ignoreMomentLocale: true,
theme: './src/theme.js',
html: {
template: './src/index.ejs',
},
lessLoaderOptions: {
javascriptEnabled: true,
},
disableDynamicImport: false,
publicPath: '/',
hash: true,
};

if (process.env.NO_MOCK) {
config.proxy = {
"/api":{
target: "http://localhost:12800",
'/api': {
target: 'http://localhost:12800',
changeOrigin: true,
pathRewrite: (path) => {
pathRewrite: path => {
console.log(path);
return "/graphql"
}
}
return '/graphql';
},
},
};
}

Expand Down
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
testURL: 'http://localhost:8000',
};
65 changes: 65 additions & 0 deletions mock/metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import mockjs from 'mockjs';

export default {
getDashboard(req, res) {
res.json(
mockjs.mock({
data: {
getGlobalBrief: {
'numOfService|1-100': 1,
'numOfEndpoint|1-100': 1,
'numOfDatabase|1-100': 1,
'numOfCache|1-100': 1,
'numOfMQ|1-100': 1,
},
getAlarmTrend: {
'numOfAlarm|60': ['@natural(0, 9999)'],
},
getThermodynamic: {
nodes: () => {
const result = [];
for (let i = 0; i < 61; i += 1) {
for (let j = 0; j < 41; j += 1) {
result.push([i, j, mockjs.Random.natural(0, 999)]);
}
}
return result;
},
axisYStep: 50,
},
'getTopNSlowService|10': [
{
service: {
'key|+1': 1,
label: '@url',
'applicationId|+1': 1,
applicationName: '@name',
},
'value|200-1000': 1,
},
],
'getTopNApplicationThroughput|10': [
{ 'key|+1': 1, label: '@name', 'value|100-10000': 1 },
],
},
})
);
},
};
Loading

0 comments on commit 1f5fcab

Please sign in to comment.