Skip to content

Commit

Permalink
Merge pull request #294 from emqx/develop
Browse files Browse the repository at this point in the history
Release v1.3.3
  • Loading branch information
CrazyWisdom authored Aug 12, 2020
2 parents 7d744ba + 8dbf3cd commit d654680
Show file tree
Hide file tree
Showing 53 changed files with 1,537 additions and 961 deletions.
86 changes: 86 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
parser: 'vue-eslint-parser',
extends: [
"@vue/prettier",
'prettier/@typescript-eslint',
'plugin:@typescript-eslint/recommended',
],
plugins: ['@typescript-eslint'],
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
'prettier/prettier': 'error',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'array-bracket-spacing': 2,
'no-var': 2,
'no-eval': 2,
'arrow-spacing': 2,
'block-spacing': 2,
'key-spacing': 2,
'brace-style': 2,
'vue/camelcase': 2,
'vue/require-component-is': 0,
'vue/require-default-prop': 0,
'comma-dangle': [2, 'always-multiline'],
'vue/eqeqeq': [2, 'always', {
null: 'ignore'
}],
'object-curly-spacing': [2, 'always'],
'vue/singleline-html-element-content-newline': 0,
'vue/html-closing-bracket-newline': [
2,
{
singleline: 'never',
multiline: 'always',
},
],
'vue/max-attributes-per-line': 0,
'vue/html-self-closing': [
2,
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],

// 设置 typescript-eslint 规则
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules
'@typescript-eslint/camelcase': 0, // 目前埋点有部分字段无法更换
'@typescript-eslint/no-non-null-assertion': 0, // 允许非空断言运算符
'@typescript-eslint/member-delimiter-style': [
2,
{
multiline: {
delimiter: 'none',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/no-unused-vars': [0, {
args: 'none'
}],
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-explicit-any': 0,
},
}
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"trailingComma": "all",
"printWidth": 120,
"bracketSpacing": true
}
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "MQTTX",
"version": "1.3.2",
"version": "1.3.3",
"description": "MQTT desktop client",
"author": "EMQ X Team",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build --win --linux --mac",
"electron:serve": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.vue\" \"src/**/*.scss\"",
"lint": "eslint --fix --ext .ts,.vue src",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit"
},
Expand All @@ -28,6 +29,7 @@
"mqtt": "^4.1.0",
"vue": "^2.6.10",
"vue-class-component": "^7.0.2",
"vue-click-outside": "^1.1.0",
"vue-clipboard2": "^0.3.1",
"vue-i18n": "^8.11.2",
"vue-property-decorator": "^8.1.0",
Expand All @@ -44,17 +46,24 @@
"@types/lodash": "^4.14.142",
"@types/lowdb": "^1.0.9",
"@types/mocha": "^5.2.7",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"@vue/cli-plugin-babel": "^3.12.1",
"@vue/cli-plugin-e2e-cypress": "^3.12.1",
"@vue/cli-plugin-typescript": "^3.12.1",
"@vue/cli-plugin-unit-mocha": "^3.12.1",
"@vue/cli-service": "^3.12.1",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/test-utils": "1.0.0-beta.29",
"babel-plugin-component": "^1.1.1",
"chai": "^4.1.2",
"electron": "^5.0.0",
"eslint": "6.5.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"monaco-editor-webpack-plugin": "^1.9.0",
"node-sass": "^4.9.0",
"prettier": "^2.0.5",
"sass-loader": "^7.3.1",
"typescript": "^3.7.4",
"vue-cli-plugin-electron-builder": "^1.4.4",
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const IN_PRODUCTION = process.env.NODE_ENV === 'production'
module.exports = {
plugins: [
IN_PRODUCTION && require('@fullhuman/postcss-purgecss')({
content: [ `./public/**/*.html`, `./src/**/*.vue` ],
content: [`./public/**/*.html`, `./src/**/*.vue`, `./src/**/*.scss`],
defaultExtractor (content) {
const contentWithoutStyleBlocks = content.replace(/<style[^]+?<\/style>/gi, '')
return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || []
Expand Down
14 changes: 6 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<template>
<div id="app">
<RouterView/>
<RouterView />
</div>
</template>


<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
@Component
export default class App extends Vue {}
</script>


<style lang="scss">
@import "./assets/font/iconfont.css";
@import "./assets/scss/base.scss";
@import "./assets/scss/theme/dark.scss";
@import "./assets/scss/theme/light.scss";
@import "./assets/scss/theme/night.scss";
@import './assets/font/iconfont.css';
@import './assets/scss/base.scss';
@import './assets/scss/theme/dark.scss';
@import './assets/scss/theme/light.scss';
@import './assets/scss/theme/night.scss';
</style>
13 changes: 7 additions & 6 deletions src/assets/scss/base.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
@import './variable.scss';
@import './mixins.scss';

html, body, #app {
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
background: var(--color-bg-primary);
}

body {
font-family: system, -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI",
"Microsoft YaHei", "wenquanyi micro hei","Hiragino Sans GB", "Hiragino Sans GB W3",
"Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: system, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', 'Microsoft YaHei',
'wenquanyi micro hei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
'Fira Sans', 'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: $font-size--body;
font-weight: 400;
line-height: 1.5;
Expand Down Expand Up @@ -57,7 +58,7 @@ p {
pre {
font-size: $font-size--body;
margin-bottom: 0px;
font-family: Menlo, Monaco, "Courier New", monospace;
font-family: Menlo, Monaco, 'Courier New', monospace;
}

a {
Expand Down
14 changes: 8 additions & 6 deletions src/assets/scss/element/element-reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
width: 90px;
color: var(--color-text-light);
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
background-color: var(--color-bg-item);
color: var(--color-main-green);
border: 2px solid var(--color-main-green) !important;
Expand Down Expand Up @@ -65,8 +65,8 @@
}

/* Icon */
[class^="el-icon-"],
[class*=" el-icon-"] {
[class^='el-icon-'],
[class*=' el-icon-'] {
font-weight: 600;
}

Expand Down Expand Up @@ -160,6 +160,9 @@
.el-icon-success {
color: var(--color-main-green);
}
.el-notification__title {
word-break: break-word;
}
}

/* Dialog */
Expand Down Expand Up @@ -197,15 +200,14 @@
color: var(--color-text-default);
}
}
.el-popper[x-placement^="bottom"] .popper__arrow {
.el-popper[x-placement^='bottom'] .popper__arrow {
border-bottom-color: var(--color-border-default);
&::after {
border-bottom-color: var(--color-bg-messagebox);
}
}
.el-popper[x-placement^="top"] .popper__arrow {
.el-popper[x-placement^='top'] .popper__arrow {
border-top-color: var(--color-border-default);

&:after {
border-top-color: var(--color-bg-messagebox);
}
Expand Down
4 changes: 2 additions & 2 deletions src/assets/scss/element/element-variables.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Change element-ui theme variable */
$--color-primary: #22BB7A;
$--color-primary: #22bb7a;

/* Change icon font path,required */
$--font-path: '~element-ui/lib/theme-chalk/fonts';

@import '~element-ui/packages/theme-chalk/src/index';
@import '~element-ui/packages/theme-chalk/src/index';
2 changes: 1 addition & 1 deletion src/assets/scss/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

@mixin collapse-btn-transform($top, $bottom) {
a.collapse-btn {
transition: all .3s;
transition: all 0.3s;
display: inline-block;
&.top {
transform: rotate($top);
Expand Down
14 changes: 7 additions & 7 deletions src/assets/scss/theme/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body.dark {
--color-bg-leftbar: #282828;
--color-bg-leftbar_item: #303030;
--color-bg-item: #395449;
--color-bg-item_status: #9EA3B1;
--color-bg-item_status: #9ea3b1;
--color-bg-input: #323232;
--color-bg-messagebox: #303133;
--color-bg-follows: #4a4a4a;
Expand All @@ -20,17 +20,17 @@ body.dark {
--color-text-title: #ffffff;
--color-text-default: #d3d3d3;
--color-text-light: #a3a3a3;
--color-text-tips: #B4B4B4;
--color-text-tips: #b4b4b4;
--color-text-right_block: #484848;
--color-text-right_info: #959599;
--color-text-left_info: #959599;

/* Accent color */
--color-main-green: #34C388;
--color-second-green: #53DAA2;
--color-thrid-green: #EBF8F2;
--color-main-red: #E86AA6;
--color-second-red: #F56C6C;
--color-main-green: #34c388;
--color-second-green: #53daa2;
--color-thrid-green: #ebf8f2;
--color-main-red: #e86aa6;
--color-second-red: #f56c6c;
--color-third-red: #fcdee4;
--color-main-grey: #323232;
--color-main-yellow: #e6a23cb3;
Expand Down
32 changes: 16 additions & 16 deletions src/assets/scss/theme/light.scss
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
body.light {
/* Backgroud color */
--color-bg-normal: #ffffff;
--color-bg-primary: #F9FAFD;
--color-bg-topics: #F8F8F8;
--color-bg-primary: #f9fafd;
--color-bg-topics: #f8f8f8;
--color-bg-topics_active: #efefef;
--color-bg-topics_shadow: #e2e2e2d1;
--color-bg-leftbar: #333844;
--color-bg-leftbar_item: #232731;
--color-bg-item: #EBF8F2;
--color-bg-item_status: #9EA3B1;
--color-bg-item: #ebf8f2;
--color-bg-item_status: #9ea3b1;
--color-bg-input: #ffffff;
--color-bg-messagebox: #ffffff;
--color-bg-follows: #efefef;
--color-bg-code: #e6eef7;
--color-bg-input_btn: #F5F7FA;
--color-bg-input_btn: #f5f7fa;
--color-bg-radio: #f6f7fb;

/* Font color */
--color-text-title: #262626;
--color-text-default: #616161;
--color-text-light: #A2A9B0;
--color-text-tips: #B4B4B4;
--color-text-right_block: #34C388;
--color-text-right_info: #ADE7CF;
--color-text-light: #a2a9b0;
--color-text-tips: #b4b4b4;
--color-text-right_block: #34c388;
--color-text-right_info: #ade7cf;
--color-text-left_info: #959599;

/* Accent color */
--color-main-green: #34C388;
--color-second-green: #53DAA2;
--color-thrid-green: #EBF8F2;
--color-main-red: #E86AA6;
--color-second-red: #F56C6C;
--color-main-green: #34c388;
--color-second-green: #53daa2;
--color-thrid-green: #ebf8f2;
--color-main-red: #e86aa6;
--color-second-red: #f56c6c;
--color-third-red: #fcdee4;
--color-main-grey: #E9EAF0;
--color-main-grey: #e9eaf0;
--color-main-yellow: #e6a23cb3;

/* Border color */
--color-border-default: #E6E8F1;
--color-border-default: #e6e8f1;
--color-border-bold: #979797;
--color-shadow-card: #0000001a;
--color-shadow-message: #dcdcdc;
Expand Down
Loading

0 comments on commit d654680

Please sign in to comment.