mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 10:31:54 +08:00
refactoring
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
|
||||
|
||||
import asyncio
|
||||
import operator
|
||||
|
||||
from typing import Any
|
||||
from typing import List
|
||||
@@ -29,6 +28,8 @@ from typing import List
|
||||
from aiohttp.web import Request
|
||||
from aiohttp.web import Response
|
||||
|
||||
from .... import tools
|
||||
|
||||
from ....plugins.atx import BaseAtx
|
||||
|
||||
from ..info import InfoManager
|
||||
@@ -78,6 +79,6 @@ class ExportApi:
|
||||
"",
|
||||
])
|
||||
elif isinstance(value, dict):
|
||||
for (sub_key, sub_value) in sorted(value.items(), key=operator.itemgetter(0)):
|
||||
for (sub_key, sub_value) in tools.sorted_kvs(value):
|
||||
sub_path = (f"{path}_{sub_key}" if sub_key != "parsed_flags" else path)
|
||||
self.__append_prometheus_rows(rows, sub_value, sub_path)
|
||||
|
||||
Reference in New Issue
Block a user