forked from zhy0313/opsweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.py
executable file
·60 lines (57 loc) · 2.07 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#-*- coding: utf-8 -*-
from flask import Flask
from flask.templating import Environment
from pyecharts.engine import ECHAERTS_TEMPLATE_FUNCTIONS
from pyecharts.conf import PyEchartsConfig
from flask_limiter import Limiter
from flask_limiter.util import get_ipaddr
from flask_assets import Bundle
class WebLimiter(object):
def __init__(self,global_limits=["1000/minute"]):
self.app = Flask(__name__)
self.global_limits = global_limits
self.limiter = Limiter(self.app,key_func=get_ipaddr,global_limits=self.global_limits)
class FlaskEchartsEnvironment(Environment):
def __init__(self, *args, **kwargs):
super(FlaskEchartsEnvironment, self).__init__(*args, **kwargs)
self.pyecharts_config = PyEchartsConfig()
self.globals.update(ECHAERTS_TEMPLATE_FUNCTIONS)
def js_files():
js = Bundle('js/jquery.cookie.js',
'js/jquery.SuperSlide.js',
'js/autocomplete.js',
'js/spop.js',
'js/function.js',
'js/fishBone.js',
'js/dropdown.js',
'js/tooltip.min.js',
'js/clipboard.min.js',
'js/Modal.js',
'js/minigrid.js',
'js/dynamics.js',
'js/zh.js',
'js/jquery.step.min.js',
'js/jquery-rvnm.js',
'js/botui.min.js',
filters='jsmin',
output='js/js_packed.js'
)
return js
def css_files():
css = Bundle('css/material_blue.css',
'css/mstyle.css',
'css/style.css',
'css/spop.css',
'css/fishBone.css',
'css/buttons.css',
'css/radar.css',
'css/font-awesome.min.css',
'css/jquery-rvnm.css',
'css/jquery.step.css',
'css/botui.min.css',
'css/botui-theme-default.css',
'css/mimic.css',
filters='cssmin',
output='css/css_packed.css'
)
return css