示例#1
0
文件: app.py 项目: zzygithub/pyxley
tb = DataTable("mytable",
               "/mytable/",
               gf,
               columns=cols,
               paging=True,
               pageLength=5)
ui.add_chart(tb)

app = Flask(__name__)
sb = ui.render_layout(app, "./project/static/layout.js")

# Create a webpack file and bundle our javascript
from pyxley.utils import Webpack
wp = Webpack(".")
wp.create_webpack_config("layout.js", "./project/static/", "bundle",
                         "./project/static/")
wp.run()


@app.route('/', methods=["GET"])
@app.route('/index', methods=["GET"])
def index():
    _scripts = ["./bundle.js"]
    return render_template('index.html',
                           title=TITLE,
                           base_scripts=scripts,
                           page_scripts=_scripts,
                           css=css)


if __name__ == "__main__":
示例#2
0
from buildui import make_ui

here = path.abspath(path.dirname(__file__))

app = Flask(__name__)

ui = make_ui(here+"/fitbit_data.csv")
ui.render_layout(app, "./demo/static/layout.js")

# Create a webpack file and bundle our javascript
from pyxley.utils import Webpack
wp = Webpack(".")
wp.create_webpack_config(
    "layout.js",
    "./demo/static/",
    "bundle",
    "./demo/static/"
)
wp.run()


css = [
    "./css/main.css"
]

@app.route('/', methods=["GET"])
def index():
    _scripts = ["./bundle.js"]
    return render_template('index.html',
        page_scripts=_scripts,
        base_scripts=[],
示例#3
0
文件: app.py 项目: Andor-Z/pyxley
ui = SimpleComponent(
    "Table",
    "pyxley",
    "component_id",
    tb.params
)

sb = ui.render("./project/static/layout.js")

# Create a webpack file and bundle our javascript
from pyxley.utils import Webpack
wp = Webpack(".")
wp.create_webpack_config(
    "layout.js",
    "./project/static/",
    "bundle",
    "./project/static/"
)
wp.run()

@app.route('/test', methods=["GET"])
def testtest():
    return jsonify(jsfunc)

@app.route('/', methods=["GET"])
@app.route('/index', methods=["GET"])
def index():
    _scripts = [
        "./bundle.js", "./dataTables.fixedColumns.js"
        ]
    return render_template('index.html',