mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
luci-app-diskman: bump to v0.2.2
This commit is contained in:
parent
10979c88b3
commit
ce9c3b4da9
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-diskman
|
||||
PKG_VERSION:=v0.2.1
|
||||
PKG_VERSION:=v0.2.2
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=lisaac <https://github.com/lisaac/luci-app-diskman>
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
@ -43,4 +43,4 @@ define Package/$(PKG_NAME)/install
|
||||
po2lmo ./po/pl/diskman.po $(1)/usr/lib/lua/luci/i18n/diskman.pl.lmo
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
@ -166,6 +166,11 @@ v_device.render = function(self, section, scope)
|
||||
if mount_point[section].device == 0 then
|
||||
self.template = "cbi/value"
|
||||
self.forcewrite = true
|
||||
for dev, info in pairs(disks) do
|
||||
for i, v in ipairs(info.partitions) do
|
||||
self:value("/dev/".. v.name, "/dev/".. v.name .. " ".. v.size_formated)
|
||||
end
|
||||
end
|
||||
Value.render(self, section, scope)
|
||||
else
|
||||
self.template = "cbi/dvalue"
|
||||
|
@ -6,7 +6,7 @@ Copyright 2019 lisaac <https://github.com/lisaac/luci-app-diskman>
|
||||
require "luci.util"
|
||||
local ver = require "luci.version"
|
||||
|
||||
local CMD = {"parted", "mdadm", "blkid", "smartctl", "df", "sgdisk", "btrfs", "mergerfs", "snapraid"}
|
||||
local CMD = {"parted", "mdadm", "blkid", "smartctl", "df", "btrfs", "lsblk"}
|
||||
|
||||
local d = {command ={}}
|
||||
for _, cmd in ipairs(CMD) do
|
||||
@ -17,7 +17,8 @@ end
|
||||
d.command.mount = nixio.fs.access("/usr/bin/mount") and "/usr/bin/mount" or "/bin/mount"
|
||||
d.command.umount = nixio.fs.access("/usr/bin/umount") and "/usr/bin/umount" or "/bin/umount"
|
||||
|
||||
local mounts = nixio.fs.readfile("/proc/mounts") or ""
|
||||
local proc_mounts = nixio.fs.readfile("/proc/mounts") or ""
|
||||
local mounts = luci.util.exec(d.command.mount) or ""
|
||||
local swaps = nixio.fs.readfile("/proc/swaps") or ""
|
||||
local df = luci.sys.exec(d.command.df) or ""
|
||||
|
||||
@ -121,8 +122,7 @@ local get_mount_point = function(partition)
|
||||
dk_root_dir = dk.new():info().body.DockerRootDir
|
||||
end
|
||||
-- end
|
||||
|
||||
for m in mounts:gmatch("/dev/"..partition.." ([^ ]*)") do
|
||||
for m in mounts:gmatch("/dev/"..partition.." on ([^ ]*)") do
|
||||
if dk_root_dir and m:match(dk_root_dir) then
|
||||
else
|
||||
mount_point = (mount_point and (mount_point .. " ") or "") .. m
|
||||
@ -194,6 +194,9 @@ local get_parted_info = function(device)
|
||||
elseif device:match("mmcblk") or device:match("md") or device:match("nvme") then
|
||||
partition_temp["name"] = device.."p"..partition_temp["number"]
|
||||
end
|
||||
if partition_temp["number"] > 0 and partition_temp["fs"] == "" and d.command.lsblk then
|
||||
partition_temp["fs"] = luci.util.exec(d.command.lsblk .. " /dev/"..device.. tostring(partition_temp["number"]) .. " -no fstype")
|
||||
end
|
||||
partition_temp["fs"] = partition_temp["fs"] == "" and "raw" or partition_temp["fs"]
|
||||
partition_temp["sec_start"] = partition_temp["sec_start"] and partition_temp["sec_start"]:sub(1,-2)
|
||||
partition_temp["sec_end"] = partition_temp["sec_end"] and partition_temp["sec_end"]:sub(1,-2)
|
||||
@ -275,7 +278,7 @@ d.get_mount_points = function()
|
||||
if _o and dk then
|
||||
dk_root_dir = dk.new():info().body.DockerRootDir
|
||||
end
|
||||
for mount in mounts:gmatch("[^\n]+") do
|
||||
for mount in proc_mounts:gmatch("[^\n]+") do
|
||||
local device = mount:match("^([^%s]+)%s+.+")
|
||||
-- only show /dev/xxx device
|
||||
if device and device:match("/dev/") then
|
||||
|
Loading…
x
Reference in New Issue
Block a user