From 3ad5e03504d8275fd494a26d18152bbc345464f0 Mon Sep 17 00:00:00 2001 From: nineven Date: Mon, 16 May 2022 18:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=98=E5=82=A8=E6=89=A9=E5=AE=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_client/src/components/apps/FirApps.vue | 8 +- .../src/components/user/FirUserStorage.vue | 163 +++++++++++++++++- fir_client/src/restful/index.js | 12 ++ fir_ser/api/migrations/0001_initial.py | 1 + .../api/migrations/0002_auto_20220215_2129.py | 50 ++++++ .../api/migrations/0006_auto_20220513_0843.py | 23 ++- fir_ser/api/models.py | 25 ++- fir_ser/api/urls.py | 3 +- fir_ser/api/utils/modelutils.py | 27 ++- fir_ser/api/utils/serializer.py | 29 +++- fir_ser/api/utils/utils.py | 2 +- fir_ser/api/views/order.py | 5 +- fir_ser/api/views/storage.py | 64 +++++-- fir_ser/common/core/sysconfig.py | 8 + fir_ser/common/utils/caches.py | 44 +++-- fir_ser/common/utils/download.py | 3 +- fir_ser/config.py | 5 + 17 files changed, 418 insertions(+), 54 deletions(-) diff --git a/fir_client/src/components/apps/FirApps.vue b/fir_client/src/components/apps/FirApps.vue index 7acb684..59bb21c 100644 --- a/fir_client/src/components/apps/FirApps.vue +++ b/fir_client/src/components/apps/FirApps.vue @@ -445,8 +445,8 @@
- 1.下载应用,每100M消耗一次下载次数
- 2.超级签下载,下载消耗次数翻倍
+ 1.下载应用,每 {{ times_info.every_size|diskSize }} 消耗 {{ times_info.base_times / 100 }} 下载次数
+ 2.私有存储模式下载应用,每 {{ times_info.every_size|diskSize }} 消耗 {{ times_info.private_times / 100 }} 下载次数
购买次数
@@ -1167,6 +1167,10 @@ export default { getDelappTitle() { return `删除应用 ${this.delapp.name}` }, + times_info() { + let times_info = this.$store.state.userinfo.times_info + return times_info ? times_info : {} + } }, filters: { diskSize, diff --git a/fir_client/src/components/user/FirUserStorage.vue b/fir_client/src/components/user/FirUserStorage.vue index 8d308e9..ffdeefd 100644 --- a/fir_client/src/components/user/FirUserStorage.vue +++ b/fir_client/src/components/user/FirUserStorage.vue @@ -191,6 +191,37 @@ 取消 + + 请勿多次购买,多次购买,将按照最大的扩容容量进行计算 + + + + + {{ pay.title }} + + + + + + + + + + + + 扩容存储空间大小 {{ exchange_number }} GB + + + + + {{ exchangetimes }} + + + 确定扩容 + 取消 + + @@ -218,7 +249,9 @@ trigger="hover">
存储最大容量空间: {{ diskSize(storageinfo.max_storage_capacity) }} +
已经使用容量: {{ diskSize(storageinfo.used_number) }} +
当前可用容量: {{ diskSize(storageinfo.max_storage_capacity - storageinfo.used_number) }} @@ -265,6 +298,11 @@ 存储最大容量空间 {{ diskSize(storageinfo.max_storage_capacity) }} + + 容量即将不足,请立即扩容 扩容 + + 存储已经使用容量空间 {{ diskSize(storageinfo.used_number) }} @@ -663,6 +701,68 @@ + +
+ 该记录为默认存储扩容记录,私有存储无需扩容 +
+ + + + + + + + + + + + + + + + + + + +
@@ -770,7 +870,7 @@