diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json
index 331c466..2024a6b 100644
--- a/dashboard/package-lock.json
+++ b/dashboard/package-lock.json
@@ -5759,9 +5759,9 @@
"dev": true
},
"element-ui": {
- "version": "2.15.4",
- "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.4.tgz",
- "integrity": "sha512-b9Tlc6NjygcHv3QNzfPPDQvyAmLdbjQR7q1FMypqFKjowpQzlaL3zlNZ4jrpm0stEBWLeHVIT733z/i6F3o+cA==",
+ "version": "2.15.14",
+ "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.14.tgz",
+ "integrity": "sha512-2v9fHL0ZGINotOlRIAJD5YuVB8V7WKxrE9Qy7dXhRipa035+kF7WuU/z+tEmLVPBcJ0zt8mOu1DKpWcVzBK8IA==",
"requires": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
diff --git a/dashboard/package.json b/dashboard/package.json
index 5cf940e..e1d43a7 100644
--- a/dashboard/package.json
+++ b/dashboard/package.json
@@ -15,7 +15,7 @@
},
"dependencies": {
"axios": "0.21.1",
- "element-ui": "^2.15.4",
+ "element-ui": "^2.15.14",
"js-cookie": "2.2.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
diff --git a/dashboard/src/api/statistic.js b/dashboard/src/api/statistic.js
new file mode 100644
index 0000000..89a21f8
--- /dev/null
+++ b/dashboard/src/api/statistic.js
@@ -0,0 +1,7 @@
+import request from '@/utils/request'
+
+export const getStatistic = () =>
+ request({
+ url: `admin/statistic`,
+ method: 'GET',
+ })
diff --git a/dashboard/src/main.js b/dashboard/src/main.js
index 369623e..62da0d0 100755
--- a/dashboard/src/main.js
+++ b/dashboard/src/main.js
@@ -29,9 +29,10 @@ if (process.env.NODE_ENV === 'production') {
}
// set ElementUI lang to EN
-Vue.use(ElementUI, { locale })
+// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui,按如下方式声明
-// Vue.use(ElementUI)
+Vue.use(ElementUI)
+console.log('ElementUI', ElementUI)
Vue.config.productionTip = false
diff --git a/dashboard/src/views/dashboard/components/refresh-thumbs.vue b/dashboard/src/views/dashboard/components/refresh-thumbs.vue
index 8c3c255..2146df4 100644
--- a/dashboard/src/views/dashboard/components/refresh-thumbs.vue
+++ b/dashboard/src/views/dashboard/components/refresh-thumbs.vue
@@ -1,16 +1,17 @@
+
刷新缩略图
-
@@ -21,6 +22,10 @@ import { getList as getMemberList } from '@/api/member'
const initProgress = () => ({ total: 0, success: 0, failure: 0 })
export default {
+ props: {
+ showButton: { type: Boolean, default: true }
+ },
+
data: () => ({
...initProgress(),
processing: false,
@@ -74,35 +79,21 @@ export default {
}
}
},
- async refreshThumbsConfirm() {
- const confirm = await this.confirm('', `你确定要刷新吗?`, {
- confirmButtonClass: 'el-button--warning',
- })
- if (!confirm) { return }
- try {
- this.processing = true
- await this.refreshThumbs()
- if (this.failure === 0) {
- this.$emit('success', `所有缩略图已刷新`)
+ async refreshThumbsConfirmProcessing() {
+ if (this.processing === false) {
+ try {
+ this.processing = true
+ await this.refreshThumbs()
+ if (this.failure === 0) {
+ this.$emit('success', `所有缩略图已刷新`)
+ }
+ } catch (err) {
+ this.$emit('error', '刷新缓存失败', err)
+ } finally {
+ this.processing = false
}
- } catch (err) {
- this.$emit('error', '刷新缓存失败', err)
- } finally {
- this.processing = false
}
},
-
- async confirm(title, content, appendOpt = {}) {
- const opt = Object.assign({
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- confirmButtonClass: 'el-button--warning',
- showClose: false,
- }, appendOpt)
- return this.$confirm(content, title, opt)
- .then(() => true)
- .catch(() => false)
- },
}
}
diff --git a/dashboard/src/views/dashboard/index.vue b/dashboard/src/views/dashboard/index.vue
index fdb2692..80ac474 100755
--- a/dashboard/src/views/dashboard/index.vue
+++ b/dashboard/src/views/dashboard/index.vue
@@ -1,17 +1,81 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ statistic.available_photo_count }}
+
+
+
+
+
+ 清理
+
+ {{ statistic.src_total_size }}
+
+
+ 清理
+
+
+
+
+
+
+
+
+ 重新生成
+
+ {{ statistic.thumb_total_size }}
+
+
+ 重新生成
+
+
+
+
+
+
+
+
+
+
+