瀏覽代碼

misc updates

Leopoldthecoder 7 年之前
父節點
當前提交
4aff63826c
共有 4 個文件被更改,包括 28 次插入31 次删除
  1. 18 0
      build/deploy-faas.sh
  2. 0 29
      examples/app.vue
  3. 5 1
      examples/components/side-nav.vue
  4. 5 1
      package.json

+ 18 - 0
build/deploy-faas.sh

@@ -0,0 +1,18 @@
+#! /bin/sh
+mkdir temp_web
+npm run deploy:build
+cd temp_web
+git clone -b gh-pages https://github.com/ElemeFE/element.git && cd element
+
+# build sub folder
+SUB_FOLDER='1.4'
+mkdir $SUB_FOLDER
+
+rm -rf *.js *.css *.map static
+rm -rf $SUB_FOLDER/**
+cp -rf ../../examples/element-ui/** .
+cp -rf ../../examples/element-ui/** $SUB_FOLDER/
+cd ../..
+
+# deploy domestic site
+faas deploy alpha

+ 0 - 29
examples/app.vue

@@ -199,35 +199,6 @@
       this.localize();
       this.renderAnchorHref();
       this.goAnchor();
-      setTimeout(() => {
-        const notified = localStorage.getItem('BETA_NOTIFIED');
-        if (!notified) {
-          const h = this.$createElement;
-          const title = this.lang === 'zh-CN'
-            ? '2.0.0 Beta 发布'
-            : '2.0.0 Beta released';
-          const messages = this.lang === 'zh-CN'
-            ? ['点击', '这里', '查看详情']
-            : ['Click ', 'here', ' to learn more'];
-          this.$notify.success({
-            title,
-            duration: 0,
-            message: h('span', [
-              messages[0],
-              h('a', {
-                attrs: {
-                  target: '_blank',
-                  href: `https://github.com/ElemeFE/element/issues/${ this.lang === 'zh-CN' ? '7612' : '7613' }`
-                }
-              }, messages[1]),
-              messages[2]
-            ]),
-            onClose() {
-              localStorage.setItem('BETA_NOTIFIED', 1);
-            }
-          });
-        }
-      }, 3500);
     },
 
     created() {

+ 5 - 1
examples/components/side-nav.vue

@@ -259,7 +259,11 @@
       const xhr = new XMLHttpRequest();
       xhr.onreadystatechange = _ => {
         if (xhr.readyState === 4 && xhr.status === 200) {
-          this.versions = JSON.parse(xhr.responseText);
+          const versions = JSON.parse(xhr.responseText);
+          this.versions = Object.keys(versions).slice(-2).reduce((prev, next) => {
+            prev[next] = versions[next];
+            return prev;
+          }, {});
         }
       };
       xhr.open('GET', '/versions.json');

+ 5 - 1
package.json

@@ -23,11 +23,15 @@
     "dist:all": "node build/bin/build-all.js && npm run build:theme",
     "i18n": "node build/bin/i18n.js",
     "lint": "eslint src/**/* test/**/* packages/**/*.{js,vue} build/**/* --quiet",
-    "pub": "npm run bootstrap && sh build/git-release.sh && sh build/release.sh",
+    "pub": "npm run bootstrap && sh build/git-release.sh && sh build/release.sh && sh build/deploy-faas.sh",
     "pub:all": "npm run dist:all && lerna publish --skip-git && git commit -am 'publish independent packages' && git push eleme dev",
     "test": "npm run lint && cross-env CI_ENV=/dev/ karma start test/unit/karma.conf.js --single-run",
     "test:watch": "karma start test/unit/karma.conf.js"
   },
+  "faas": {
+    "domain": "element",
+    "public": "temp_web/element"
+  },
   "repository": {
     "type": "git",
     "url": "git@github.com:ElemeFE/element.git"