zoukankan      html  css  js  c++  java
  • Superset深度汉化以及框架使用

    编译messages.po文件
    pybabel compile -d translations

    修改config文件

    # ---------------------------------------------------
    # Babel config for translations
    # ---------------------------------------------------
    # Setup default language
    BABEL_DEFAULT_LOCALE = 'zh'
    # Your application default translation path
    BABEL_DEFAULT_FOLDER = 'babel/translations'
    # The allowed translation for you app
    LANGUAGES = {
         'en': {'flag': 'us', 'name': 'English'},
        #'it': {'flag': 'it', 'name': 'Italian'},
        # 'fr': {'flag': 'fr', 'name': 'French'},
         'zh': {'flag': 'cn', 'name': 'Chinese'},
    }

    可详见Flask AppBuilder文档

    http://flask-appbuilder.readthedocs.io/en/latest/_modules/flask_appbuilder/baseviews.html?highlight=description_columns

    Sqlalchemy文档

    http://docs.sqlalchemy.org/en/latest/core/tutorial.html

    SuperSet深度汉化

      SuperSet前段修改需要重新打包需要npm run build或者npm run dev

      因为在supersetstaticassets路径下package.json
       "test": "mocha --require ignore-styles --compilers js:babel-core/register --require spec/helpers/browser.js --recursive spec/**/*_spec.*",
        "cover": "babel-node node_modules/.bin/babel-istanbul cover _mocha -- --require spec/helpers/browser.js --recursive spec/**/*_spec.*",
        "dev": "NODE_ENV=dev webpack --watch --colors --progress --debug --output-pathinfo --devtool inline-source-map",
        "dev-fast": "NODE_ENV=dev webpack --watch --colors --progress --debug --output-pathinfo --devtool eval-cheap-source-map",
        "prod": "NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js -p --colors --progress",
        "build": "NODE_ENV=production webpack --colors --progress",
        "lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx .",
        "sync-backend": "babel-node --presets es2015 javascripts/syncBackend.js"
    

      npm run xxx:执行package.json,xxx可以在”scripts”中找到,build、prod之类的都是自己配的。每当执行npm run,就会自动新建一个 Shell,在这个 Shell 里面执行指定的脚本命令。会生成dist目录,即压缩之后的js文件目录,其中webpack –watch为监听页面变动并自动打包

    sync-backend方式打包

    $ node --version
       v7.9.0
    $ npm --version
       4.2.0
    $ cd superset/assets/
    $ yarn --version
       0.27.5
    $ yarn
    $ npm run sync-backend
    $ npm run prod
    $ npm run dev
  • 相关阅读:
    How to use epoll? A complete example in C
    分享:libzip 0.11 发布,C 语言的 zip 压缩开发包
    linux AIO (异步IO) 那点事儿
    通过引用计数解决野指针的问题(C&C++)
    [原]浅谈几种服务器端模型——反应堆模式(epoll 简介) _Boz 博客园
    基于EPOLL写的HTTP服务器(加入了线程池)_没落都城_新浪博客
    jQuery检测浏览器名称和版本信息
    Jquery.ajax中dataType不可少
    jquery 手风琴效果
    ie下ajax错误:由于出现错误 c00ce56e 而导致此项操作无法完成
  • 原文地址:https://www.cnblogs.com/Jonecmnn/p/7551793.html
Copyright © 2011-2022 走看看