From 67e29be7d0078ec49f2a3c5be5074f56d297d4bf Mon Sep 17 00:00:00 2001 From: Allen Date: Mon, 3 Jun 2024 14:29:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=AB=98=E5=BA=A6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/downloaderhelper/__init__.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/plugins/downloaderhelper/__init__.py b/plugins/downloaderhelper/__init__.py index 5c69377..961cb94 100644 --- a/plugins/downloaderhelper/__init__.py +++ b/plugins/downloaderhelper/__init__.py @@ -2504,7 +2504,7 @@ class DownloaderHelper(_PluginBase): 'fixed-header': True, 'density': 'compact', 'style': { - 'height': '230px' + 'height': '242px' } }, 'content': [ @@ -2627,21 +2627,24 @@ class DownloaderHelper(_PluginBase): }] } - def __build_dashboard_speed_widget_list_item_element(self, mdi_icon: str, label: str, value: str) -> dict: + def __build_dashboard_speed_widget_list_item_element(self, mdi_icon: str, label: str, value: str, is_last: bool = False) -> dict: """ 构造仪表板实时速率组件列表item元素 """ if not mdi_icon or not label or not value: return None + div_style = { + 'display': 'grid', + 'grid-template-areas': '"prepend content append"', + 'grid-template-columns': 'max-content 1fr auto', + 'padding-bottom': '16px' + } + if is_last: + del div_style['padding-bottom'] return { 'component': 'div', 'props': { - 'style': { - 'display': 'grid', - 'grid-template-areas': '"prepend content append"', - 'grid-template-columns': 'max-content 1fr auto', - 'padding-bottom': '16px' - } + 'style': div_style }, 'content': [{ 'component': 'div', @@ -2700,13 +2703,13 @@ class DownloaderHelper(_PluginBase): list_items = [ self.__build_dashboard_speed_widget_list_item_element(mdi_icon='mdi-cloud-upload', label='总上传量', value=data.upload_size), self.__build_dashboard_speed_widget_list_item_element(mdi_icon='mdi-download-box', label='总下载量', value=data.download_size), - self.__build_dashboard_speed_widget_list_item_element(mdi_icon='mdi-content-save', label='磁盘剩余空间', value=data.free_space), + self.__build_dashboard_speed_widget_list_item_element(mdi_icon='mdi-content-save', label='磁盘剩余空间', value=data.free_space, is_last=True), ] return [{ 'component': 'div', 'props': { 'style': { - 'padding': '16px 0 20px 0' + 'padding': '16px 0 0 0' } }, 'content': [{