2021-09-14 00:50:56 +08:00
local uci = luci.model . uci.cursor ( )
local m , e
2021-10-29 20:30:36 +08:00
m = Map ( " aliyundrive-webdav " )
m.title = translate ( " AliyunDrive WebDAV " )
m.description = translate ( " <a href= \" https://github.com/messense/aliyundrive-webdav \" target= \" _blank \" >Project GitHub URL</a> " )
2021-09-14 00:50:56 +08:00
m : section ( SimpleSection ) . template = " aliyundrive-webdav/aliyundrive-webdav_status "
e = m : section ( TypedSection , " server " )
e.anonymous = true
enable = e : option ( Flag , " enable " , translate ( " Enable " ) )
enable.rmempty = false
2021-10-29 20:30:36 +08:00
refresh_token = e : option ( Value , " refresh_token " , translate ( " Refresh Token " ) )
refresh_token.description = translate ( " <a href= \" https://github.com/messense/aliyundrive-webdav#%E8%8E%B7%E5%8F%96-refresh_token \" target= \" _blank \" >How to get refresh token</a> " )
2021-09-14 00:50:56 +08:00
2021-10-29 20:30:36 +08:00
root = e : option ( Value , " root " , translate ( " Root Directory " ) )
root.description = translate ( " Restrict access to a folder of aliyundrive, defaults to / which means no restrictions " )
2021-09-21 00:56:12 +08:00
root.default = " / "
2021-09-14 00:50:56 +08:00
host = e : option ( Value , " host " , translate ( " Host " ) )
host.default = " 0.0.0.0 "
host.datatype = " ipaddr "
port = e : option ( Value , " port " , translate ( " Port " ) )
port.default = " 8080 "
port.datatype = " port "
auth_user = e : option ( Value , " auth_user " , translate ( " Username " ) )
auth_password = e : option ( Value , " auth_password " , translate ( " Password " ) )
auth_password.password = true
read_buffer_size = e : option ( Value , " read_buffer_size " , translate ( " Read Buffer Size " ) )
read_buffer_size.default = " 10485760 "
read_buffer_size.datatype = " uinteger "
cache_size = e : option ( Value , " cache_size " , translate ( " Cache Size " ) )
cache_size.default = " 1000 "
cache_size.datatype = " uinteger "
2021-10-12 09:05:00 +08:00
cache_ttl = e : option ( Value , " cache_ttl " , translate ( " Cache Expiration Time (seconds) " ) )
cache_ttl.default = " 600 "
cache_ttl.datatype = " uinteger "
2021-10-07 23:18:33 +08:00
no_trash = e : option ( Flag , " no_trash " , translate ( " Delete file permanently instead of trashing " ) )
no_trash.rmempty = false
2021-12-24 09:03:49 +08:00
read_only = e : option ( Flag , " read_only " , translate ( " Enable read only mode " ) )
read_only.description = translate ( " Disallow upload, modify and delete file operations " )
read_only.rmempty = false
2021-10-29 20:30:36 +08:00
domain_id = e : option ( Value , " domain_id " , translate ( " Domain ID " ) )
domain_id.description = translate ( " Input domain_id option will use <a href= \" https://www.aliyun.com/product/storage/pds \" target= \" _blank \" >Aliyun PDS</a> instead of <a href= \" https://www.aliyundrive.com \" target= \" _blank \" >AliyunDrive</a> " )
2021-10-29 08:58:41 +08:00
2021-09-14 00:50:56 +08:00
debug = e : option ( Flag , " debug " , translate ( " Debug Mode " ) )
debug.rmempty = false
return m