diff --git a/requirements.txt b/requirements.txt index 79b36ab..032beba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -uniparser>=1.4.1 +uniparser>=1.4.2 fastapi uvicorn databases diff --git a/watchdogs/__init__.py b/watchdogs/__init__.py index d2009c3..2dddf13 100644 --- a/watchdogs/__init__.py +++ b/watchdogs/__init__.py @@ -3,6 +3,6 @@ from .config import Config from .main import init_app -__version__ = '1.6.8' +__version__ = '1.6.9' __all__ = ['Config', 'init_app'] logging.getLogger('watchdogs').addHandler(logging.NullHandler()) diff --git a/watchdogs/settings.py b/watchdogs/settings.py index d982648..eddc66d 100644 --- a/watchdogs/settings.py +++ b/watchdogs/settings.py @@ -80,6 +80,10 @@ def setup_models(): async def setup_uniparser(): + import re + import datetime + import math + import random from torequests.utils import (curlparse, escape, guess_interval, itertools_chain, json, parse_qs, parse_qsl, ptime, quote, quote_plus, slice_by_size, @@ -91,7 +95,11 @@ async def setup_uniparser(): from uniparser.config import GlobalConfig import uniparser.fastapi_ui UDFParser._GLOBALS_ARGS.update({ + 're': re, + 'datetime': datetime, 'curlparse': curlparse, + 'math': math, + 'random': random, 'escape': escape, 'guess_interval': guess_interval, 'itertools_chain': itertools_chain, diff --git a/watchdogs/static/css/watchdogs.css b/watchdogs/static/css/watchdogs.css index aff9fe8..5d37ee0 100644 --- a/watchdogs/static/css/watchdogs.css +++ b/watchdogs/static/css/watchdogs.css @@ -1,7 +1,7 @@ .full-screen, body, .el-tabs__content, -.el-tabs__content>* { +.el-tabs__content > * { width: 100%; height: 100%; } @@ -29,16 +29,16 @@ html { padding-left: 3em; } -#input_host_form>.el-form-item:first-child .el-form-item__content, -#input_host_form>.el-form-item:first-child { +#input_host_form > .el-form-item:first-child .el-form-item__content, +#input_host_form > .el-form-item:first-child { width: 100%; } -[aria-label="Edit Crawler JSON"] .el-textarea__inner { +[aria-label='Edit Crawler JSON'] .el-textarea__inner { height: 10em; } -.el-table_1_column_8>.cell { +.el-table_1_column_8 > .cell { white-space: nowrap; } @@ -66,7 +66,7 @@ p.custom_links { color: black; background-color: rgba(223, 223, 223, 0.5); padding: 0.5em 0 0.5em 0; - box-shadow: 3px 3px 5px #888888 + box-shadow: 3px 3px 5px #888888; } .request_args_pre { @@ -76,3 +76,10 @@ p.custom_links { [v-cloak] { display: none; } +.el-popover { + max-width: 50%; +} +pre { + word-wrap: break-word; + white-space: pre-wrap; +} diff --git a/watchdogs/static/css/watchdogs.min.css b/watchdogs/static/css/watchdogs.min.css index ebb5cf4..58c7128 100644 --- a/watchdogs/static/css/watchdogs.min.css +++ b/watchdogs/static/css/watchdogs.min.css @@ -1 +1 @@ -.el-tabs__content,.el-tabs__content>*,.full-screen,body{width:100%;height:100%}html{margin:0 auto;width:90%;height:90%}.el-tabs__item{font-weight:700}.el-message-box--center{min-width:50%}.el-message-box{width:auto}.time-td{min-width:16em;padding-left:3em}#input_host_form>.el-form-item:first-child,#input_host_form>.el-form-item:first-child .el-form-item__content{width:100%}[aria-label="Edit Crawler JSON"] .el-textarea__inner{height:10em}.el-table_1_column_8>.cell{white-space:nowrap}div.foot{display:flex;justify-content:center}.host-tag{margin:.5em;cursor:pointer}.el-table .warning-row{background:#fdf5e6}.cb_name{cursor:pointer;padding-left:1em}p.custom_links{text-align:center;color:#000;background-color:rgba(223,223,223,.5);padding:.5em 0 .5em 0;box-shadow:3px 3px 5px #888}.request_args_pre{font-size:.9em}[v-cloak]{display:none} +.el-tabs__content,.el-tabs__content>*,.full-screen,body{width:100%;height:100%}html{margin:0 auto;width:90%;height:90%}.el-tabs__item{font-weight:700}.el-message-box--center{min-width:50%}.el-message-box{width:auto}.time-td{min-width:16em;padding-left:3em}#input_host_form>.el-form-item:first-child,#input_host_form>.el-form-item:first-child .el-form-item__content{width:100%}[aria-label='Edit Crawler JSON'] .el-textarea__inner{height:10em}.el-table_1_column_8>.cell{white-space:nowrap}div.foot{display:flex;justify-content:center}.host-tag{margin:.5em;cursor:pointer}.el-table .warning-row{background:#fdf5e6}.cb_name{cursor:pointer;padding-left:1em}p.custom_links{text-align:center;color:#000;background-color:rgba(223,223,223,.5);padding:.5em 0 .5em 0;box-shadow:3px 3px 5px #888}.request_args_pre{font-size:.9em}[v-cloak]{display:none}.el-popover{max-width:50%}pre{word-wrap:break-word;white-space:pre-wrap} diff --git a/watchdogs/templates/index.html b/watchdogs/templates/index.html index 648227e..93e62bf 100644 --- a/watchdogs/templates/index.html +++ b/watchdogs/templates/index.html @@ -3,28 +3,30 @@
- - + +${JSON.stringify(scope.request_args_dict, null, 2)}
${ a.label || a.name }
+${ a.label || a.name }
${current_cb_doc}
+ style="margin: 0px; border: 1px solid #8080802b; padding-left: 1em;">${current_cb_doc}