58 lines
1.4 KiB
Markdown
58 lines
1.4 KiB
Markdown
# DownloadMgr
|
|
a web ui for aria2
|
|
|
|
## Dependent
|
|
* [apppublic](https://git.opencomputing.cn/yumoqing/apppublic)
|
|
* [sqlor](https://git.opencomputing.cn/yumoqing/sqlor)
|
|
* [ahserver](https://git.opencomputing.cn/yumoqing/ahserver)
|
|
* [appbase](https://git.opencomputing.cn/yumoqing/appbase)
|
|
* [rbac](https://git.opencomputing.cn/yumoqing/rbac)
|
|
* [uapi](https://git.opencomputing.cn/yumoqing/uapi)
|
|
* [bricks](https://git.opencomputing.cn/yumoqing/bricks)
|
|
|
|
also depentent on
|
|
* [xls2ddl](https://git.opencomputing.cn/yumoqing/xls2ddl)
|
|
use it to translates database definintion excel file to database ddl sql file
|
|
and translate table information to CRUD UI for bricks.
|
|
|
|
## Install
|
|
```
|
|
pip install git+https://git.opencomputing.cn/yumoqing/downloadmgr
|
|
```
|
|
|
|
## Usage
|
|
|
|
in your web app
|
|
```
|
|
from downloadmgr.init import load_downloadmgr
|
|
# call the load_downloadmgr() before the web server start listening
|
|
|
|
```
|
|
|
|
## examples:
|
|
```
|
|
from ahserver.webapp import webapp
|
|
from ahserver.serverenv import ServerEnv
|
|
from appbase.init import load_appbase
|
|
from rbac.init import load_rbac
|
|
from downloadmgr.init import load_downloadmgr
|
|
|
|
def get_module_dbanme(modulename):
|
|
return 'mydb' # assume all modules use same database 'mydb'
|
|
|
|
def init():
|
|
env = ServerEnv()
|
|
env.get_module_dbname = get_module_dbname
|
|
load_appbase()
|
|
load_rbac()
|
|
load_downloadmgr()
|
|
|
|
if __name__ == '__main__':
|
|
webapp(init)
|
|
```
|
|
|
|
## database table
|
|
downloadmgr use a table named "download", it record the user download infomation
|
|
|
|
|