Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Jan 12, 2025
1 parent 9d697ab commit 81edfa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion luci-app-openclash/luasrc/openclash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,11 @@ unlink = fs.unlink
readlink = fs.readlink

function filename(str)
if not str then
return nil
end
local idx = str:match(".+()%.%w+$")
if(idx) then
if idx then
return str:sub(1, idx-1)
else
return str
Expand Down
2 changes: 1 addition & 1 deletion luci-app-openclash/luasrc/view/openclash/update_config.htm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%+cbi/valueheader%>
<%
local fs = require "luci.openclash"
local filename = fs.filename(self:cfgvalue(section))
local filename = fs.filename(self:cfgvalue(section)) or "config"
local display = self.display or ""
local idname = math.random(1000)..(string.match(filename, "[%w_]+") or "")
%>
Expand Down

0 comments on commit 81edfa0

Please sign in to comment.