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
  • 相关阅读:
    facade 对于有很多接口的提供一个简单的接口
    UML 常用符号 转
    <html> 按钮换行
    javascript: change the content of table
    [转载]当今计算机软件开发和应用领域最重要十种关键技术
    括号匹配算法
    求出给定两日期段 之间的交集算法
    表中的数据导出为insert语句的简单方法
    投色子下注的小程序
    未来社会发展趋势__P2p时代
  • 原文地址:https://www.cnblogs.com/Jonecmnn/p/7551793.html
Copyright © 2011-2022 走看看