diff --git a/package.json b/package.json index c34b19709..52d687dc3 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "dependencies": { "axios": "0.18.1", "deepmerge": "^4.2.2", + "echarts": "^4.7.0", "element-ui": "2.13.0", "eslint-plugin-html": "^6.0.0", "jquery": "^3.5.0", @@ -41,6 +42,7 @@ "normalize.css": "7.0.0", "nprogress": "0.2.0", "path-to-regexp": "2.4.0", + "v-charts": "^1.19.0", "vue": "2.6.10", "vue-codemirror-lite": "^1.0.4", "vue-cookie": "^1.1.4", diff --git a/src/components/IBox/index.vue b/src/components/IBox/index.vue index b339ac5c6..f1960a17f 100644 --- a/src/components/IBox/index.vue +++ b/src/components/IBox/index.vue @@ -1,8 +1,12 @@ diff --git a/src/components/SummaryCard/index.vue b/src/components/SummaryCard/index.vue index f32436979..ce5877a03 100644 --- a/src/components/SummaryCard/index.vue +++ b/src/components/SummaryCard/index.vue @@ -1,12 +1,21 @@ @@ -14,12 +23,55 @@ export default { name: 'SummaryCard', props: { + title: { + type: String, + default: '' + }, + rightSideLabel: { + type: Object, + default: () => ({}) + }, + body: { + type: Object, + default: () => ({}) + } } } - diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 6936b4157..ca0f620b2 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -732,5 +732,11 @@ "Assets": "", "settings": { "setting": "" + }, + "dashboard": { + "UsersTotal": "用户总数", + "AssetsTotal": "资产总数", + "OnlineUsers": "在线用户", + "OnlineSessions": "在线会话" } } diff --git a/src/main.js b/src/main.js index 15b642fea..3d2daab63 100644 --- a/src/main.js +++ b/src/main.js @@ -36,6 +36,9 @@ Vue.use(ElementUI, { locale }) Vue.config.productionTip = false +import VCharts from 'v-charts' +Vue.use(VCharts) + // cookie import VueCookie from 'vue-cookie' Vue.use(VueCookie) diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index f297bfbf0..704275391 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -384,3 +384,20 @@ td .el-button.el-button--mini { padding-left: 10px; padding-right: 14px; } + +.el-tag--dark.el-tag--info { + background-color: #23c6c8; + border-color: #23c6c8; + color: #fff; +} + +a { + color: #428bca !important; + text-decoration: none; +} + +.el-tag--default.el-tag--dark { + background-color: #d1dade; + color: #5e5e5e; + border: none; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index ecfd65448..0d16c3c64 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -71,3 +71,11 @@ div:focus { .el-tooltip__popper.is-light.help-tips div span { padding: 50px; } + +.white-bg { + background-color: #ffffff; +} + +.small, small { + font-size: 85%; +} diff --git a/src/views/dashboard/DatesLoginSummary/LoginActivePin.vue b/src/views/dashboard/DatesLoginSummary/LoginActivePin.vue new file mode 100644 index 000000000..da96177f0 --- /dev/null +++ b/src/views/dashboard/DatesLoginSummary/LoginActivePin.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/views/dashboard/DatesLoginSummary/LoginMetric.vue b/src/views/dashboard/DatesLoginSummary/LoginMetric.vue new file mode 100644 index 000000000..d8ffd30ec --- /dev/null +++ b/src/views/dashboard/DatesLoginSummary/LoginMetric.vue @@ -0,0 +1,134 @@ + + + diff --git a/src/views/dashboard/DatesLoginSummary/LoginTop.vue b/src/views/dashboard/DatesLoginSummary/LoginTop.vue new file mode 100644 index 000000000..fbfdc7fb5 --- /dev/null +++ b/src/views/dashboard/DatesLoginSummary/LoginTop.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/views/dashboard/DatesLoginSummary/index.vue b/src/views/dashboard/DatesLoginSummary/index.vue new file mode 100644 index 000000000..6f0f04040 --- /dev/null +++ b/src/views/dashboard/DatesLoginSummary/index.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/views/dashboard/ResourceSummary.vue b/src/views/dashboard/ResourceSummary.vue new file mode 100644 index 000000000..e6267956d --- /dev/null +++ b/src/views/dashboard/ResourceSummary.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 8584b25a7..6e43cf567 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,42 +1,27 @@ diff --git a/yarn.lock b/yarn.lock index 713bdbd3c..7fc333ac1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3331,6 +3331,28 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +echarts-amap@1.0.0-rc.6: + version "1.0.0-rc.6" + resolved "https://registry.npm.taobao.org/echarts-amap/download/echarts-amap-1.0.0-rc.6.tgz#5782a74daee52ed44ce3f8f62577561783f09e16" + integrity sha1-V4KnTa7lLtRM4/j2JXdWF4PwnhY= + +echarts-liquidfill@^2.0.2: + version "2.0.5" + resolved "https://registry.npm.taobao.org/echarts-liquidfill/download/echarts-liquidfill-2.0.5.tgz#0d505a75c2dfb69950e18d440bdf3fe1795a0eed" + integrity sha1-DVBadcLftplQ4Y1EC98/4XlaDu0= + +echarts-wordcloud@^1.1.3: + version "1.1.3" + resolved "https://registry.npm.taobao.org/echarts-wordcloud/download/echarts-wordcloud-1.1.3.tgz#07b140c8ba76b19c317b43c310f3d5dc99289ff2" + integrity sha1-B7FAyLp2sZwxe0PDEPPV3Jkon/I= + +echarts@^4.7.0: + version "4.7.0" + resolved "https://registry.npm.taobao.org/echarts/download/echarts-4.7.0.tgz?cache=0&sync_timestamp=1584522755461&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fecharts%2Fdownload%2Fecharts-4.7.0.tgz#5b3875a4c2f91e3929425fabab9eace7e4098b3f" + integrity sha1-Wzh1pML5HjkpQl+rq56s5+QJiz8= + dependencies: + zrender "4.3.0" + editorconfig@^0.15.3: version "0.15.3" resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5" @@ -6842,6 +6864,11 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" +numerify@1.2.9: + version "1.2.9" + resolved "https://registry.npm.taobao.org/numerify/download/numerify-1.2.9.tgz#af4696bb1d57f8d3970a615d8b0cd53d932bd559" + integrity sha1-r0aWux1X+NOXCmFdiwzVPZMr1Vk= + nwsapi@^2.0.7: version "2.2.0" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" @@ -9525,6 +9552,11 @@ utila@^0.4.0, utila@~0.4: version "0.4.0" resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" +utils-lite@0.1.10: + version "0.1.10" + resolved "https://registry.npm.taobao.org/utils-lite/download/utils-lite-0.1.10.tgz#d2908c0482e23c31e6b082558540e7134ffad7d7" + integrity sha1-0pCMBILiPDHmsIJVhUDnE0/619c= + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -9533,6 +9565,17 @@ uuid@^3.0.1, uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" +v-charts@^1.19.0: + version "1.19.0" + resolved "https://registry.npm.taobao.org/v-charts/download/v-charts-1.19.0.tgz#07b701800b159bd514264ffc8bf12b0405142da3" + integrity sha1-B7cBgAsVm9UUJk/8i/ErBAUULaM= + dependencies: + echarts-amap "1.0.0-rc.6" + echarts-liquidfill "^2.0.2" + echarts-wordcloud "^1.1.3" + numerify "1.2.9" + utils-lite "0.1.10" + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -10152,6 +10195,11 @@ yorkie@^2.0.0: normalize-path "^1.0.0" strip-indent "^2.0.0" +zrender@4.3.0: + version "4.3.0" + resolved "https://registry.npm.taobao.org/zrender/download/zrender-4.3.0.tgz#9f056121b20bbae44414d287bf6a119ff7042661" + integrity sha1-nwVhIbILuuREFNKHv2oRn/cEJmE= + ztree@^3.5.24: version "3.5.24" resolved "https://registry.yarnpkg.com/ztree/-/ztree-3.5.24.tgz#b63fe52981fdf2c329675cfd2772f0d147521ff1"