mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
Update filemanager.py
revert python side changes
This commit is contained in:
@@ -174,14 +174,6 @@ class FileManager:
|
|||||||
print("Permisson not changed")
|
print("Permisson not changed")
|
||||||
|
|
||||||
|
|
||||||
def bytes_to_human_readable(num, suffix='B'):
|
|
||||||
for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
|
|
||||||
if abs(num) < 1024.0:
|
|
||||||
return "%3.1f%s%s" % (num, unit, suffix)
|
|
||||||
num /= 1024.0
|
|
||||||
return "%.1f%s%s" % (num, 'Yi', suffix)
|
|
||||||
|
|
||||||
|
|
||||||
def listForTable(self):
|
def listForTable(self):
|
||||||
try:
|
try:
|
||||||
finalData = {}
|
finalData = {}
|
||||||
@@ -230,7 +222,7 @@ class FileManager:
|
|||||||
if currentFile[0][0] == 'd':
|
if currentFile[0][0] == 'd':
|
||||||
dirCheck = 1
|
dirCheck = 1
|
||||||
|
|
||||||
size = bytes_to_human_readable(int(currentFile[4]))
|
size = str(int(int(currentFile[4]) / float(1024)))
|
||||||
lastModified = currentFile[5] + ' ' + currentFile[6] + ' ' + currentFile[7]
|
lastModified = currentFile[5] + ' ' + currentFile[6] + ' ' + currentFile[7]
|
||||||
finalData[str(counter)] = [currentFile[-1], currentFile[-1], lastModified, size, currentFile[0],
|
finalData[str(counter)] = [currentFile[-1], currentFile[-1], lastModified, size, currentFile[0],
|
||||||
dirCheck]
|
dirCheck]
|
||||||
|
|||||||
Reference in New Issue
Block a user