Răsfoiți Sursa

Merge branch 'feature/tidy' into develop

oldj 6 ani în urmă
părinte
comite
fc6d5cc1d3

+ 6 - 21
README.md

@@ -87,35 +87,20 @@ SwitchHosts! stores data at `~/.SwitchHosts` (Or folder `.SwitchHosts` under the
     npm run dev
     ```
 
-### Package and Zip
+### Package
 
- - It is recommended to use [electron-packager](https://github.com/electron-userland/electron-packager) for packaging.
-
-    ```bash
-    # install electron-packager for use from cli
-    npm install electron-packager -g
-    ```
-
- - Go to the `./` folder, run `npm run pack` . The packaged file will be the `./dist` folder.
+ - It is recommended to use [electron-builder](https://github.com/electron-userland/electron-builder) for packaging.
+ - Go to the `./` folder, run `npm run make` . The packaged file will be the `./dist` folder.
  - This command may take several minutes to finish when you run it the first time, as it needs time to download dependent files. You can download the dependencies manually [here](https://github.com/electron/electron/releases), or [Taobao mirror](https://npm.taobao.org/mirrors/electron/), then save the files to `~/.electron`. You can check the [Electron Docs](http://electron.atom.io/docs/) for more infomation.
 
     ```bash
     # pack
-    npm run pack  # the packed files will be in ./dist
+    npm run make # the packed files will be in ./dist
 
-    # or pack for a special platform
-    npm run pack-mac  # pack for macOS, the packed files will be in ./dist
-    npm run pack-win  # pack for Windows, the packed files will be in ./dist
+    # or 
+    npm run build-and-make
     ```
 
- - After packaging, you can make a zip file by running the following command.
-
-    ```bash
-    # zip
-    npm run zip  # the zipped files will be in ./dist
-    ```
-
-
 ## Copyright
 
 SwitchHosts! is a free and open source software, it is released under the MIT license.

+ 6 - 20
README_cn.md

@@ -87,32 +87,18 @@ SwitchHosts! 的数据文件在 `~/.SwitchHosts` 目录下(Windows 用户为
     npm run dev
     ```
 
-### 打包发布
+### 打包
 
- - 建议使用 [electron-packager](https://github.com/electron-userland/electron-packager) 进行打包
-
-    ```bash
-    # install electron-packager for use from cli
-    npm install electron-packager -g
-    ```
-
- - 在 `./` 目录下,运行 `npm run pack` 命令,打包后的文件位于 `./dist` 目录;
+ - 建议使用 [electron-builder](https://github.com/electron-userland/electron-builder) 进行打包
+ - 在 `./` 目录下,运行 `npm run make` 命令,打包后的文件位于 `./dist` 目录;
  - 首次执行此命令可能需要花费较多时间(需要下载对应的构建文件),也可先手动下载[对应的发布版本](https://github.com/electron/electron/releases)([淘宝镜像](https://npm.taobao.org/mirrors/electron/)),手动保存到 `~/.electron` 目录下。更多信息请参考 [Electron 文档](http://electron.atom.io/docs/)。
 
     ```bash
     # pack
-    npm run pack  # the packed files will be in ./dist
+    npm run make # the packed files will be in ./dist
 
-    # 也可以只打包特定平台的版本,如
-    npm run pack-mac  # pack for macOS, the packed files will be in ./dist
-    npm run pack-win  # pack for Windows, the packed files will be in ./dist
-    ```
-
- - 打包完成后,可运行以下命令将生成的程序压缩为 zip 文件。
-
-    ```bash
-    # zip
-    npm run zip  # the zipped files will be in ./dist
+    # 或者
+    npm run build-and-make
     ```
 
 ## 更新历史

+ 1 - 1
app-ui/App.jsx

@@ -7,7 +7,7 @@
 
 import React from 'react'
 import { notification } from 'antd'
-import Panel from './panel/Panel'
+import Panel from './Panel'
 import Content from './content/Content'
 import SudoPrompt from './frame/SudoPrompt'
 import EditPrompt from './frame/EditPrompt'

+ 11 - 11
app-ui/panel/Buttons.jsx → app-ui/Panel/Buttons.jsx

@@ -93,11 +93,11 @@ export default class Buttons extends React.Component {
       <div id="sh-buttons" className={styles.root}>
         <div className={styles.left}>
           <a
-            className={styles["btn-add"]}
+            className={styles['btn-add']}
             href="#"
             onClick={() => Buttons.btnAdd()}
           >
-            <Icon type="plus" className="iconfont" />
+            <Icon type="plus"/>
           </a>
         </div>
 
@@ -105,19 +105,19 @@ export default class Buttons extends React.Component {
           <Icon
             type="search"
             className={classnames({
-              iconfont: 1,
               on: this.state.search_on
             })}
             onClick={() => this.btnSearch()}
           />
-          <i
-            className={classnames({
-              iconfont: 1,
-              'icon-switchon': this.state.top_toggle_on,
-              'icon-switchoff': !this.state.top_toggle_on
-            })}
-            onClick={() => this.btnToggle()}
-          />
+          {/*<i*/}
+          {/*  className={classnames({*/}
+          {/*    iconfont: 1,*/}
+          {/*    'icon-switchon': this.state.top_toggle_on,*/}
+          {/*    'icon-switchoff': !this.state.top_toggle_on*/}
+          {/*  })}*/}
+          {/*  onClick={() => this.btnToggle()}*/}
+          {/*/>*/}
+          <Icon type="setting" onClick={() => Agent.emit('show_preferences')}/>
         </div>
       </div>
     )

+ 0 - 0
app-ui/panel/Buttons.less → app-ui/Panel/Buttons.less


+ 2 - 1
app-ui/panel/List.jsx → app-ui/Panel/List.jsx

@@ -84,7 +84,8 @@ export default class List extends React.Component {
         <ListItem
           data={this.props.sys_hosts}
           {...this.props}
-          sys="1"/>
+          sys="1"
+        />
         <div ref={c => this.el_items = c} className={styles['custom-items']}>
           {this.customItems()}
         </div>

+ 5 - 0
app-ui/panel/List.less → app-ui/Panel/List.less

@@ -9,3 +9,8 @@
   overflow: auto;
 }
 
+:global(.platform-darwin) {
+  .custom-items {
+    top: 72px;
+  }
+}

+ 14 - 28
app-ui/panel/ListItem.jsx → app-ui/Panel/ListItem.jsx

@@ -10,6 +10,8 @@ import classnames from 'classnames'
 import { Icon } from 'antd'
 import Agent from '../Agent'
 import isInViewport from 'wheel-js/src/browser/isInViewport'
+import IconOn from './images/on.svg'
+import IconOff from './images/off.svg'
 import styles from './ListItem.less'
 
 export default class ListItem extends React.Component {
@@ -93,39 +95,23 @@ export default class ListItem extends React.Component {
       >
         {sys ? null : (
           <div className={styles['item-buttons']}>
-            <i
-              className={classnames({
-                iconfont: 1,
-                'icon-edit': 1
-              })}
-              onClick={this.toEdit.bind(this)}
-            />
-            <i className={classnames({
-              iconfont: 1,
-              switch: 1,
-              'icon-on': data.on,
-              'icon-off': !data.on
-            })}
-               onClick={this.toggle.bind(this)}
+            {is_selected ? (
+              <Icon
+                type="form"
+                onClick={this.toEdit.bind(this)}
+                className={styles['icon-edit']}
+              />
+            ) : null}
+            <Icon
+              className={styles.switcher}
+              component={data.on ? IconOn : IconOff}
+              onClick={this.toggle.bind(this)}
             />
           </div>
         )}
-        {/*<i className={classnames({*/}
-        {/*'iconfont': 1*/}
-        {/*, 'item-icon': 1*/}
-        {/*, 'icon-warn': !!data.error*/}
-        {/*, 'icon-file': !sys && !data.error && data.where !== 'group'*/}
-        {/*, 'icon-files': data.where === 'group'*/}
-        {/*, 'icon-sysserver': sys && !data.error*/}
-        {/*})}*/}
-        {/*title={data.error || ''}*/}
-        {/*/>*/}
         <Icon
           type={icon_type}
-          className={classnames({
-            iconfont: 1,
-            'item-icon': 1
-          })}
+          className={styles['item-icon']}
           title={data.error || ''}
         />
         <span>{this.getTitle()}</span>

+ 19 - 27
app-ui/panel/ListItem.less → app-ui/Panel/ListItem.less

@@ -2,12 +2,13 @@
   position: relative;
   padding: 7px 10px 7px 12px;
   cursor: pointer;
+  -webkit-app-region: no-drag;
 
   &.sys-hosts {
     font-size: 14px;
     padding: 8px 10px 8px 10px;
 
-    i.item-icon {
+    .item-icon {
       width: 22px;
       font-size: 12px;
     }
@@ -20,47 +21,38 @@
       color: #fff;
     }
 
-    i.item-icon {
+    .item-icon {
       color: #fff;
     }
 
     &:hover {
-      :global(i.icon-edit) {
+      .icon-edit {
         display: inline-block;
         color: #fff;
       }
     }
   }
+}
 
-  :global {
-    i {
-      display: inline-block;
-      width: 20px;
-      text-align: center;
-      margin-right: 5px;
-
-      &.item-icon {
-        font-size: 10px;
-      }
-
-      &.switch {
-        cursor: pointer;
-        line-height: 23px;
+.item-icon {
+  margin-right: 0.5em;
+  width: 1.5em;
+}
 
-        &.icon-on {
-          color: #af9;
-        }
-      }
+.icon-edit {
+  margin-right: 0.5em;
+  font-size: 1.5em;
+  transform: scale(0.7);
+  cursor: pointer;
+}
 
-      &.icon-edit {
-        display: none;
-      }
-    }
-  }
+.switcher {
+  cursor: pointer;
+  font-size: 1.5em;
 }
 
 .item-buttons {
   position: absolute;
   right: 10px;
-  margin-top: -2px;
+  margin-top: -1px;
 }

+ 6 - 0
app-ui/Panel/images/off.svg

@@ -0,0 +1,6 @@
+<svg width="392" height="212" viewBox="0 0 392 212" fill="none" xmlns="http://www.w3.org/2000/svg">
+    <rect x="8" y="8" width="376" height="196" rx="98" fill="#373D47" stroke="#898E97" stroke-width="16"/>
+    <path fill-rule="evenodd" clip-rule="evenodd"
+          d="M106 176C144.66 176 176 144.66 176 106C176 67.3401 144.66 36 106 36C67.3401 36 36 67.3401 36 106C36 144.66 67.3401 176 106 176Z"
+          fill="#898E97"/>
+</svg>

+ 6 - 0
app-ui/Panel/images/on.svg

@@ -0,0 +1,6 @@
+<svg width="392" height="212" viewBox="0 0 392 212" fill="none" xmlns="http://www.w3.org/2000/svg">
+    <rect x="8" y="8" width="376" height="196" rx="98" fill="#373D47" stroke="#91D982" stroke-width="16"/>
+    <path fill-rule="evenodd" clip-rule="evenodd"
+          d="M286 176C324.66 176 356 144.66 356 106C356 67.3401 324.66 36 286 36C247.34 36 216 67.3401 216 106C216 144.66 247.34 176 286 176Z"
+          fill="#91D982"/>
+</svg>

+ 11 - 5
app-ui/panel/Panel.jsx → app-ui/Panel/index.jsx

@@ -9,11 +9,11 @@ import React from 'react'
 import Buttons from './Buttons'
 //import SearchBar from './searchbar'
 import List from './List'
-import styles from './Panel.less'
+import styles from './index.less'
 import Agent from '../Agent'
 
-export default class Panel extends React.Component {
-  
+export default class Index extends React.Component {
+
   handleOndragenter (events) {
     events.preventDefault()
   }
@@ -26,13 +26,19 @@ export default class Panel extends React.Component {
     events.preventDefault()
     let file = events.dataTransfer.files[0]
     if (file) {
-      Agent.emit('add_hosts', file.name, 'file://'+file.path)
+      Agent.emit('add_hosts', file.name, 'file://' + file.path)
     }
   }
 
   render () {
+    let {platform} = Agent
+
     return (
-      <div id="panel" className={styles.root} onDragEnter={this.handleOndragenter} onDragOver={this.handleOndragover} onDrop={this.handleOndrop}>
+      <div id="panel" className={styles.root} onDragEnter={this.handleOndragenter} onDragOver={this.handleOndragover}
+           onDrop={this.handleOndrop}>
+        {platform === 'darwin' ? (
+          <div className={styles.mac_handler}/>
+        ) : null}
         <List {...this.props}/>
         {/*<SearchBar/>*/}
         <Buttons/>

+ 6 - 0
app-ui/panel/Panel.less → app-ui/Panel/index.less

@@ -10,4 +10,10 @@
   //height: 100%;
   background: @bg_left;
   color: @font_color_left;
+  -webkit-app-region: drag;
+}
+
+.mac_handler {
+  height: 36px;
+  //-webkit-app-region: drag;
 }

+ 0 - 0
app-ui/panel/searchbar.jsx → app-ui/Panel/searchbar.jsx


+ 0 - 0
app-ui/panel/searchbar.less → app-ui/Panel/searchbar.less


+ 1 - 1
app-ui/content/Editor.jsx

@@ -186,7 +186,7 @@ export default class Editor extends React.Component {
     })
   }
 
-  componentWillReceiveProps (next_props) {
+  componentWillReceiveProps (next_props) { // todo ...
     //console.log(next_props);
     let cm = this.codemirror
     let doc = cm.getDoc()

+ 3 - 3
app-ui/content/cm_hl.js

@@ -19,12 +19,12 @@ export default function () {
         stream.skipToEnd()
         return 'comment'
       }
-      if (!s.match(/^\s*([\d\.]+|[\da-f:\.%lo]+)\s+\w/i)) {
+      if (!s.match(/^\s*([\d.]+|[\da-f:.%lo]+)\s+\w/i)) {
         return 'error'
       }
 
-      if (sol && ch.match(/[\w\.:%]/)) {
-        stream.eatWhile(/[\w\.:%]/)
+      if (sol && ch.match(/[\w.:%]/)) {
+        stream.eatWhile(/[\w.:%]/)
         return 'ip'
       }
 

+ 2 - 2
app-ui/frame/EditPrompt.jsx

@@ -54,7 +54,7 @@ export default class EditPrompt extends React.Component {
 
   componentDidMount () {
     Agent.on('add_hosts', (title, uri) => {
-      var goWhere = ''
+      let goWhere = ''
       if (uri) {
         goWhere = 'remote'
       }
@@ -207,7 +207,7 @@ export default class EditPrompt extends React.Component {
           <a href="#" className="del"
              onClick={this.confirmDel.bind(this)}
           >
-            <i className="iconfont icon-delete"/>
+            <Icon type="delete"/>
             <span>{lang.del_hosts}</span>
           </a>
         </div>

+ 3 - 2
app/main.js

@@ -12,6 +12,7 @@ const path = require('path')
 //const fs = require('fs')
 const app = electron.app
 const BrowserWindow = electron.BrowserWindow
+const platform = process.platform
 
 const paths = require('./server/paths')
 const pref = require('./server/pref')
@@ -55,9 +56,9 @@ function createWindow () {
     icon: path.join(__dirname, 'assets', 'logo_512.png'),
     webPreferences: {
       nodeIntegration: true
-    }
+    },
     // autoHideMenuBar: true,
-    // titleBarStyle: 'hiddenInset'
+     titleBarStyle: platform === 'darwin' ? 'hiddenInset' : 'default'
   })
 
   // Let us register listeners on the window, so we can update the state

+ 4 - 2
app/menu/main_menu.js

@@ -9,10 +9,10 @@ const path = require('path')
 const paths = require('../server/paths')
 const {Menu, shell, dialog} = require('electron')
 const m_lang = require('../server/lang')
-const getPref = require('../server/actions/getPref')
+//const getPref = require('../server/actions/getPref')
 const checkUpdate = require('../server/checkUpdate')
 const svr = require('../server/svr')
-const version = require('../version')
+//const version = require('../version')
 
 function doInit (app, lang) {
   let last_path = null
@@ -191,11 +191,13 @@ function doInit (app, lang) {
           label: lang.feedback,
           click () {
             shell.openExternal('https://github.com/oldj/SwitchHosts/issues')
+              .catch(e => console.log(e))
           }
         }, {
           label: lang.homepage,
           click () {
             shell.openExternal('https://oldj.github.io/SwitchHosts/')
+              .catch(e => console.log(e))
           }
         }]
     }

+ 1 - 1
app/package.json

@@ -1,6 +1,6 @@
 {
   "name": "switchhosts",
-  "version": "3.3.13",
+  "version": "3.3.14",
   "description": "Switch hosts quickly!",
   "main": "main.js",
   "scripts": {

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
app/ui/app.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
app/ui/app.js


+ 0 - 83
app/ui/iconfont/iconfont.css

@@ -1,83 +0,0 @@
-
-@font-face {font-family: "iconfont";
-  src: url('iconfont.eot?t=1491015432207'); /* IE9*/
-  src: url('iconfont.eot?t=1491015432207#iefix') format('embedded-opentype'), /* IE6-IE8 */
-  url('iconfont.woff?t=1491015432207') format('woff'), /* chrome, firefox */
-  url('iconfont.ttf?t=1491015432207') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
-  url('iconfont.svg?t=1491015432207#iconfont') format('svg'); /* iOS 4.1- */
-}
-
-.iconfont {
-  font-family:"iconfont" !important;
-  font-size:16px;
-  font-style:normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-
-.icon-switchoff:before { content: "\e60d"; }
-
-.icon-icon:before { content: "\e600"; }
-
-.icon-warnfill:before { content: "\e607"; }
-
-.icon-warn:before { content: "\e608"; }
-
-.icon-ok:before { content: "\e604"; }
-
-.icon-h:before { content: "\e617"; }
-
-.icon-lock:before { content: "\e61d"; }
-
-.icon-off:before { content: "\e613"; }
-
-.icon-on:before { content: "\e614"; }
-
-.icon-search:before { content: "\e61c"; }
-
-.icon-edit:before { content: "\e609"; }
-
-.icon-info:before { content: "\e601"; }
-
-.icon-add-s:before { content: "\e612"; }
-
-.icon-more:before { content: "\e602"; }
-
-.icon-grid:before { content: "\e603"; }
-
-.icon-movedown:before { content: "\e60a"; }
-
-.icon-moveup:before { content: "\e60b"; }
-
-.icon-add:before { content: "\e60c"; }
-
-.icon-folder:before { content: "\e618"; }
-
-.icon-group:before { content: "\e619"; }
-
-.icon-lock2:before { content: "\e61e"; }
-
-.icon-files:before { content: "\e61f"; }
-
-.icon-timescircle:before { content: "\e60e"; }
-
-.icon-earth:before { content: "\e61a"; }
-
-.icon-move:before { content: "\e60f"; }
-
-.icon-delete:before { content: "\e610"; }
-
-.icon-refresh:before { content: "\e63a"; }
-
-.icon-doc:before { content: "\e606"; }
-
-.icon-line:before { content: "\e611"; }
-
-.icon-file-box:before { content: "\e61b"; }
-
-.icon-switchon:before { content: "\e615"; }
-
-.icon-sysserver:before { content: "\e605"; }
-
-.icon-file:before { content: "\e77d"; }
-

BIN
app/ui/iconfont/iconfont.eot


Fișier diff suprimat deoarece este prea mare
+ 0 - 94
app/ui/iconfont/iconfont.js


+ 0 - 153
app/ui/iconfont/iconfont.svg

@@ -1,153 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
-<svg xmlns="http://www.w3.org/2000/svg">
-<metadata>
-Created by FontForge 20120731 at Sat Apr  1 10:57:12 2017
- By admin
-</metadata>
-<defs>
-<font id="iconfont" horiz-adv-x="1024" >
-  <font-face 
-    font-family="iconfont"
-    font-weight="500"
-    font-stretch="normal"
-    units-per-em="1024"
-    panose-1="2 0 6 3 0 0 0 0 0 0"
-    ascent="896"
-    descent="-128"
-    x-height="792"
-    bbox="0 -212 1024 896"
-    underline-thickness="0"
-    underline-position="0"
-    unicode-range="U+0078-E77D"
-  />
-<missing-glyph 
- />
-    <glyph glyph-name=".notdef" 
- />
-    <glyph glyph-name=".notdef" 
- />
-    <glyph glyph-name=".null" horiz-adv-x="0" 
- />
-    <glyph glyph-name="nonmarkingreturn" horiz-adv-x="341" 
- />
-    <glyph glyph-name="x" unicode="x" horiz-adv-x="1001" 
-d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
-t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
-t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
-    <glyph glyph-name="switchoff" unicode="&#xe60d;" 
-d="M832 812h-640q-80 0 -136 -56t-56 -136v-640q0 -79 56 -135.5t136 -56.5h640q79 0 135.5 56.5t56.5 135.5v640q0 80 -56.5 136t-135.5 56zM160 -84q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM160 620q-13 0 -22.5 9.5
-t-9.5 22.5t9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM704 -20q0 -27 -18.5 -45.5t-45.5 -18.5h-256q-27 0 -45.5 18.5t-18.5 45.5v640q0 26 19 45t45 19h256q27 0 45.5 -18.5t18.5 -45.5v-640zM864 -84q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5
-t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM864 620q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM576 300h-128q-26 0 -45 -19t-19 -45v-192q0 -27 18.5 -45.5t45.5 -18.5h128q27 0 45.5 18.5t18.5 45.5v192
-q0 27 -18.5 45.5t-45.5 18.5z" />
-    <glyph glyph-name="icon" unicode="&#xe600;" 
-d="M488 745l132 -269l297 -43l-215 -209l51 -296l-265 140l-266 -140l51 296l-215 209l297 43z" />
-    <glyph glyph-name="warnfill" unicode="&#xe607;" 
-d="M943 127l-341 609q-35 63 -90.5 63t-90.5 -63l-340 -609q-34 -62 -6 -111q29 -48 100 -48h674q71 0 99.5 48.5t-5.5 110.5zM480 576q0 13 9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5v-288q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5v288zM512 64q-20 0 -34 14t-14 34
-t14 34t34 14t34 -14t14 -34t-14 -34t-34 -14z" />
-    <glyph glyph-name="warn" unicode="&#xe608;" 
-d="M849 -33h-674q-71 0 -99.5 49t5.5 111l340 609q35 63 90.5 63t90.5 -63l341 -609q34 -63 5.5 -111.5t-99.5 -48.5zM512 735q-18 0 -35 -30l-340 -610q-17 -30 -7 -47t45 -17h674q35 0 45 17t-7 47l-341 610q-16 30 -34 30zM512 256q-13 0 -22.5 9.5t-9.5 22.5v288
-q0 13 9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5v-288q0 -13 -9.5 -22.5t-22.5 -9.5zM512 144zM464 144q0 20 14 34t34 14t34 -14t14 -34t-14 -34t-34 -14t-34 14t-14 34z" />
-    <glyph glyph-name="ok" unicode="&#xe604;" 
-d="M512 709q-111 0 -205.5 -54.5t-149 -149t-54.5 -205.5t54.5 -205.5t149 -149t205.5 -54.5t205.5 54.5t149 149t54.5 205.5t-54.5 205.5t-149 149t-205.5 54.5zM376 253q0 -1 5 -6l9 -9t10 -7.5t10 -3.5q16 0 109 104l138 158q7 8 15 9q13 0 21 -7l45 -44q7 -8 7.5 -18.5
-t-6.5 -18.5l-250 -264v0l-53 -57q-7 -7 -18 -7.5t-18 6.5l-151 142q-8 7 -8.5 18t7.5 19l35 37q7 8 18 8.5t19 -7.5z" />
-    <glyph glyph-name="h" unicode="&#xe617;" 
-d="M512 802q-104 0 -192.5 -51.5t-140 -140t-51.5 -193t51.5 -193t140 -140t192.5 -51.5t192.5 51.5t140 140t51.5 193t-51.5 193t-140 140t-192.5 51.5zM660 214h-50v175h-196v-175h-50v395h50v-179h196v179h50v-395z" />
-    <glyph glyph-name="lock" unicode="&#xe61d;" 
-d="M427 151q0 35 25 60t60 25t60 -25t25 -60q0 -47 -39 -72q9 -50 18 -110q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5l18 110q-39 25 -39 72zM341 385v150q0 70 50 120t121 50t121 -50t50 -120v-150h-342zM235 535v-150h-64q-36 0 -61 -25t-25 -60v-427
-q0 -35 25 -60t61 -25h682q36 0 61 25t25 60v427q0 35 -25 60t-61 25h-64v150q0 115 -81 196t-196 81t-196 -81t-81 -196v0z" />
-    <glyph glyph-name="off" unicode="&#xe613;" 
-d="M729 90h-434q-116 0 -197.5 81.5t-81.5 196.5v32q0 115 81.5 196.5t197.5 81.5h434q116 0 197.5 -81.5t81.5 -196.5v-32q0 -115 -81.5 -196.5t-197.5 -81.5zM946 400q0 90 -63.5 153t-153.5 63h-434q-90 0 -153.5 -63t-63.5 -153v-32q0 -90 63.5 -153.5t153.5 -63.5h434
-q90 0 153.5 63.5t63.5 153.5v32zM322 223q-68 0 -116 48.5t-48 116.5t48 116t116 48t116 -48t48 -116t-48 -116.5t-116 -48.5z" />
-    <glyph glyph-name="on" unicode="&#xe614;" 
-d="M729 90h-434q-116 0 -197.5 81.5t-81.5 196.5v32q0 115 81.5 196.5t197.5 81.5h434q116 0 197.5 -81.5t81.5 -196.5v-32q0 -115 -81.5 -196.5t-197.5 -81.5zM947 399q0 90 -63.5 153.5t-153.5 63.5h-436q-89 0 -152.5 -63.5t-63.5 -153.5v-31q0 -90 63.5 -153.5
-t152.5 -63.5h436q90 0 153.5 63.5t63.5 153.5v31v0zM702 223q-68 0 -116 48.5t-48 116.5t48 116t116 48t116.5 -48t48.5 -116t-48.5 -116.5t-116.5 -48.5z" />
-    <glyph glyph-name="search" unicode="&#xe61c;" 
-d="M995 3l-272 227q-2 2 -6 4q37 79 37 160q0 82 -34.5 158t-99.5 131q-105 89 -243 89q-82 0 -158 -35t-131 -100q-88 -105 -88 -243q0 -82 34.5 -158.5t100.5 -131.5q105 -88 241 -88h1q121 0 221 72q1 0 2 -1.5l1 -1.5l272 -227q27 -23 63 -18.5t59 33.5l6 7
-q24 28 22 64.5t-28 58.5zM585 219q-40 -47 -94.5 -72t-113.5 -25q-98 1 -174 64q-47 39 -72 94t-25 114q0 99 64 174q39 48 93.5 72.5t113.5 24.5q99 0 174 -63q47 -40 72 -94.5t25 -113.5q0 -99 -63 -175z" />
-    <glyph glyph-name="edit" unicode="&#xe609;" 
-d="M384 3l-169 169q-6 5 -6 13.5t6 14.5l380 380q6 6 14 6t14 -6l169 -169q6 -6 6 -14t-6 -14l-380 -380q-6 -6 -14.5 -6t-13.5 6zM693 678q18 18 42.5 18t42.5 -18l112 -112q18 -18 18 -42.5t-18 -42.5l-56 -56l-197 197zM116 -96l56 254l198 -198z" />
-    <glyph glyph-name="info" unicode="&#xe601;" 
-d="M512 -20q-110 0 -203 54t-147 147t-54 203t54 203t147 147t203 54t203 -54t147 -147t54 -203t-54 -203t-147 -147t-203 -54zM567 605q0 7 -5.5 12.5t-12.5 5.5h-74q-7 0 -12.5 -5.5t-5.5 -12.5v-74q0 -8 5.5 -13t12.5 -5h74q7 0 12.5 5t5.5 13v74zM567 402q0 8 -5.5 13.5
-t-12.5 5.5h-74q-7 0 -12.5 -5.5t-5.5 -13.5v-239q0 -7 5.5 -12.5t12.5 -5.5h74q7 0 12.5 5.5t5.5 12.5v239z" />
-    <glyph glyph-name="add-s" unicode="&#xe612;" 
-d="M699 358h-157v-158q0 -10 -7.5 -18t-18.5 -8t-19 8t-8 18v158h-157q-11 0 -18.5 7.5t-7.5 18.5t7.5 18.5t18.5 7.5h157v157q0 11 8 18.5t19 7.5t18.5 -7.5t7.5 -18.5v-157h157q11 0 18.5 -7.5t7.5 -18.5t-7.5 -18.5t-18.5 -7.5v0z" />
-    <glyph glyph-name="more" unicode="&#xe602;" 
-d="M174.5 501q-41.5 0 -71 -29.5t-29.5 -71.5t29.5 -71.5t71 -29.5t71.5 29.5t30 71.5t-30 71.5t-71.5 29.5zM511 501q-42 0 -71.5 -29.5t-29.5 -71.5t29.5 -71.5t71.5 -29.5t71.5 29.5t29.5 71.5t-29.5 71.5t-71.5 29.5zM848 501q-42 0 -71.5 -29.5t-29.5 -71.5t29.5 -71.5
-t71.5 -29.5t71.5 29.5t29.5 71.5t-29.5 71.5t-71.5 29.5z" />
-    <glyph glyph-name="grid" unicode="&#xe603;" 
-d="M601 830h-179q-12 0 -21 -9t-9 -21v-179q0 -12 9 -21t21 -9h179q12 0 21 9t9 21v179q0 12 -9 21t-21 9zM929 830h-179q-12 0 -21 -9t-9 -21v-179q0 -12 9 -21t21 -9h179q12 0 21 9t9 21v179q0 12 -9 21t-21 9zM273 830h-179q-12 0 -21 -9t-9 -21v-179q0 -12 9 -21t21 -9
-h179q12 0 21 9t9 21v179q0 12 -9 21t-21 9zM601 502h-179q-12 0 -21 -9t-9 -21v-179q0 -13 9 -21.5t21 -8.5h179q12 0 21 8.5t9 21.5v179q0 12 -9 21t-21 9zM929 502h-179q-12 0 -21 -9t-9 -21v-179q0 -13 9 -21.5t21 -8.5h179q12 0 21 8.5t9 21.5v179q0 12 -9 21t-21 9z
-M273 502h-179q-12 0 -21 -9t-9 -21v-179q0 -13 9 -21.5t21 -8.5h179q12 0 21 8.5t9 21.5v179q0 12 -9 21t-21 9zM601 174h-179q-12 0 -21 -9t-9 -21v-179q0 -13 9 -21.5t21 -8.5h179q12 0 21 8.5t9 21.5v179q0 12 -9 21t-21 9zM929 174h-179q-12 0 -21 -9t-9 -21v-179
-q0 -13 9 -21.5t21 -8.5h179q12 0 21 8.5t9 21.5v179q0 12 -9 21t-21 9zM273 174h-179q-12 0 -21 -9t-9 -21v-179q0 -13 9 -21.5t21 -8.5h179q12 0 21 8.5t9 21.5v179q0 12 -9 21t-21 9z" />
-    <glyph glyph-name="movedown" unicode="&#xe60a;" 
-d="M768 108v384h-64v-384h-160l192 -192l192 192h-160zM320 556v-192h-192v192h192zM384 620h-320v-320h320v320zM64 172h96v-64h-96v64zM192 172h96v-64h-96v64zM320 172h64v-96h-64v96zM64 -52h64v-96h-64v96zM160 -84h96v-64h-96v64zM288 -84h96v-64h-96v64zM64 76h64
-v-96h-64v96zM320 44h64v-96h-64v96z" />
-    <glyph glyph-name="moveup" unicode="&#xe60b;" 
-d="M704 300v-384h64v384h160l-192 192l-192 -192h160zM64 620h96v-64h-96v64zM192 620h96v-64h-96v64zM320 620h64v-96h-64v96zM64 396h64v-96h-64v96zM160 364h96v-64h-96v64zM288 364h96v-64h-96v64zM64 524h64v-96h-64v96zM320 492h64v-96h-64v96zM320 108v-192h-192v192
-h192zM384 172h-320v-320h320v320z" />
-    <glyph glyph-name="add" unicode="&#xe60c;" 
-d="M512 -41q-115 0 -213 57t-155 155t-57 213t57 213t155 155t213 57t213 -57t155 -155t57 -213t-57 -213t-155 -155t-213 -57zM724 426h-170v170h-84v-170h-170v-84h170v-170h84v170h170v84z" />
-    <glyph glyph-name="folder" unicode="&#xe618;" 
-d="M961 640q0 40 -28.5 68t-67.5 28h-186h-1h-1q-6 -1 -10 -2l-1 -1h-1q-5 -3 -8 -6q-18 -17 -35 -88q-3 -12 -4 -14q-4 -17 -27 -17h-7.5h-7.5h-416q-40 0 -68 -28.5t-28 -69.5l32 -414q0 -40 28 -68t68 -28h640q40 0 68 28t28 66zM864 96q0 -13 -9.5 -22.5t-22.5 -9.5
-h-640q-13 0 -22.5 10t-9.5 24l-32 414q0 13 9.5 22.5t22.5 9.5h416h7.5h7.5q35 0 58.5 17t30.5 48q2 4 4 15q8 34 13 48h168q13 0 22.5 -9.5t9.5 -22.5v-2v-1zM128 672h416q13 0 22.5 9.5t9.5 22.5t-9.5 22.5t-22.5 9.5h-416q-13 0 -22.5 -9.5t-9.5 -22.5t9.5 -22.5
-t22.5 -9.5z" />
-    <glyph glyph-name="group" unicode="&#xe619;" 
-d="M521 194l-376 247l-50 -52l426 -291l426 291l-51 53zM947 550l-426 291l-426 -291l426 -291zM521 756l302 -206l-302 -207l-302 207zM521 33l-376 248l-50 -52l426 -291l426 291l-51 53z" />
-    <glyph glyph-name="lock2" unicode="&#xe61e;" 
-d="M769 448v135v0q-3 104 -77.5 176.5t-178.5 72.5t-178.5 -72.5t-77.5 -175.5v0v-136h-1q-27 0 -45.5 -18.5t-18.5 -45.5v-384q0 -27 18.5 -45.5t45.5 -18.5h512q27 0 45.5 18.5t18.5 45.5v384q0 26 -18.5 45t-44.5 19zM321 581v0q2 78 58 132.5t134 54.5t134 -54.5
-t58 -132.5v0v-133h-384v133zM768 32q0 -13 -9.5 -22.5t-22.5 -9.5h-448q-13 0 -22.5 9.5t-9.5 22.5v320q0 13 9.5 22.5t22.5 9.5h448q13 0 22.5 -9.5t9.5 -22.5v-320zM544 206v52q0 13 -9.5 22.5t-22.5 9.5t-22.5 -9.5t-9.5 -22.5v-52q-28 -18 -28 -51q0 -25 17.5 -42.5
-t42.5 -17.5t42.5 17.5t17.5 42.5q0 33 -28 51z" />
-    <glyph glyph-name="files" unicode="&#xe61f;" 
-d="M744 434h-260q-12 0 -20.5 -8.5t-8.5 -20.5t8.5 -20.5t20.5 -8.5h260q12 0 20.5 8.5t8.5 20.5t-8.5 20.5t-20.5 8.5zM744 290h-260q-12 0 -20.5 -8.5t-8.5 -20.5t8.5 -20.5t20.5 -8.5h260q12 0 20.5 8.5t8.5 20.5t-8.5 20.5t-20.5 8.5zM744 839h-347q-45 0 -80 -35.5
-t-35 -80.5h-34q-45 0 -78 -35t-33 -80v-578q0 -45 35 -80.5t81 -35.5h433q46 0 81 35.5t35 80.5h29q46 0 81 35.5t35 79.5v405v57zM686 -28h-433q-23 0 -40.5 18t-17.5 40v578q0 22 16.5 39.5t38.5 17.5l32 1v-521q0 -44 35 -79.5t80 -35.5h347q0 -22 -17.5 -40t-40.5 -18v0
-zM889 145q0 -22 -17.5 -39.5t-40.5 -17.5h-434q-22 0 -39.5 17.5t-17.5 39.5v578q0 23 17.5 40.5t39.5 17.5h289v-116q0 -45 35 -80t81 -35h87v-405zM802 608q-21 0 -39.5 30.5t-18.5 55.5v86v0l145 -172h-87z" />
-    <glyph glyph-name="timescircle" unicode="&#xe60e;" 
-d="M657 171q0 15 -11 26l-104 103l104 103q11 11 11 26q0 16 -11 26l-52 52q-11 11 -26 11t-26 -11l-103 -104l-104 104q-10 11 -25 11q-16 0 -27 -11l-51 -52q-11 -10 -11 -26q0 -15 11 -26l103 -103l-103 -103q-11 -11 -11 -26q0 -16 11 -26l51 -52q11 -11 27 -11
-q15 0 25 11l104 104l103 -104q11 -11 26 -11t26 11l52 52q11 10 11 26zM878 300q0 -119 -59 -220t-160 -160t-220.5 -59t-220 59t-159.5 160t-59 220t59 220t159.5 160t220 59t220.5 -59t160 -160t59 -220z" />
-    <glyph glyph-name="earth" unicode="&#xe61a;" 
-d="M874 662q-73 73 -166 111.5t-196 38.5t-196 -38.5t-166 -111.5t-111.5 -166t-38.5 -196t38.5 -196t111.5 -166t166 -111.5t196 -38.5t196 38.5t166 111.5t111.5 166t38.5 196t-38.5 196t-111.5 166zM942 466q-7 12 -22 19.5t-46 18.5q-16 5 -28.5 20t-18.5 28.5t-15 41.5
-q-8 24 -13.5 37t-17 31t-25.5 29q130 -82 186 -225zM798 290q2 -19 2.5 -35.5t-8.5 -38.5t-29 -45q-12 -13 -26 -50q-8 -22 -13.5 -33.5t-16.5 -26t-28 -21t-41 -6.5q-7 8 -12 37q-4 24 -10 90q-8 111 -21 160q-25 92 -84 112q-26 9 -55 9q-14 0 -39 -3q-17 -2 -24 -2v0
-q-8 0 -13 1.5t-13 10.5t-16 26q-11 30 -10 63.5t20.5 69t53.5 57.5q55 37 89 37q27 0 69 -23q39 -20 81 -20q8 0 22 1h16q18 0 31 -9t21.5 -26t19.5 -48q8 -24 13.5 -37.5t16.5 -33t27 -32t37 -19.5q22 -8 31 -11q-9 -9 -36 -34q-21 -18 -30 -27q-21 -19 -25.5 -46t0.5 -47
-v0zM51 304q8 -1 18 -3q34 -8 48 -15q-3 -6 -12 -18q-28 -41 -22 -65q5 -22 -6 -56q-26 74 -26 153v2v2v0zM512 -161q-129 0 -238 66.5t-168 176.5q40 76 27 132q0 5 14 24q6 8 9 12.5t7 13t5.5 14.5t1 14.5t-4.5 15.5q-12 26 -80 41q-13 3 -31 6q14 113 78 206t164 146.5
-t216 53.5q119 0 223 -58q-19 8 -43 8h-19q-13 -1 -19 -1q-29 0 -57 15q-53 28 -93 28q-49 0 -117 -45q-64 -42 -88 -117q-23 -73 5 -136q30 -69 89 -69v0q10 0 30 2q22 3 33 3q20 0 38 -6q34 -11 51 -77q12 -44 20 -151q6 -80 13 -110q6 -26 17 -41q16 -24 41 -24
-q68 0 108 44q21 24 41 77q11 28 16 34q27 30 39.5 61.5t11 53.5t-2.5 44q-3 21 -1.5 31.5t9.5 18.5q13 11 30 26q32 29 41 39q22 24 18 44v1q27 -75 27 -156q0 -94 -36.5 -179t-98.5 -147t-147.5 -98.5t-178.5 -36.5v0z" />
-    <glyph glyph-name="move" unicode="&#xe60f;" 
-d="M1008 330l-156 155q-14 14 -33.5 14t-33 -13.5t-13.5 -33t14 -33.5l76 -76h-303v309l76 -75q14 -14 33.5 -14t33 13.5t13.5 33t-14 33.5l-155 155q-14 14 -33.5 14t-32.5 -14l-156 -155q-14 -14 -14 -33.5t13.5 -33t33 -13.5t33.5 13l76 76v-309h-304l76 76
-q14 14 14 33.5t-13.5 33t-33 13.5t-33.5 -14l-156 -155q-13 -14 -13 -33.5t13 -32.5l156 -156q14 -14 33.5 -14t33 14t13.5 33t-14 33l-76 76h304v-303l-76 76q-14 14 -33.5 14t-33 -13.5t-13.5 -33t14 -33.5l155 -155q14 -14 33.5 -14t33.5 14l155 155q14 14 14 33.5
-t-13.5 33t-33 13.5t-33.5 -14l-76 -75v302h303l-76 -76q-14 -14 -14 -33t13.5 -33t33 -14t33.5 14l156 156q13 13 13 32.5t-13 33.5z" />
-    <glyph glyph-name="delete" unicode="&#xe610;" 
-d="M924 573h-154v105q0 29 -20.5 49.5t-49.5 20.5h-376q-29 0 -49.5 -20.5t-20.5 -49.5v-105h-155q-14 0 -24 -10t-10 -24.5t10 -24.5t24 -10h79v-581q0 -29 20.5 -49.5t49.5 -20.5h528q29 0 49.5 20.5t20.5 49.5v558v0v23h78q15 0 25 10t10 24.5t-10 24.5t-25 10z
-M412.5 -10q-14.5 0 -24.5 10t-10 25l-1 372q0 15 10.5 25t25 10t24.5 -10t10 -25v-372q0 -15 -10 -25t-24.5 -10zM611.5 -10q-14.5 0 -24.5 10t-10 25v372q0 15 10 25t24.5 10t24.5 -10t10 -25l1 -372q0 -15 -10.5 -25t-25 -10zM323 635q0 17 13 30t31 13h290q18 0 31 -13
-t13 -30v-62h-378v62z" />
-    <glyph glyph-name="refresh" unicode="&#xe63a;" 
-d="M676 61q-75 -54 -167 -52q-12 0 -24 1q-2 0 -5 0.5t-4 0.5q-13 2 -18 3q-1 0 -11 2q-11 3 -17 5q-2 0 -5 1t-4 2q-12 4 -19 7q-1 0 -4 2q-13 6 -22 11h-1v0q-36 20 -65 50l-1 1q-8 9 -17 19q-1 1 -2 2.5l-1 1.5q-63 80 -63 182h66q3 0 4.5 2.5t-0.5 5.5l-111 170
-q-2 2 -4.5 2t-3.5 -2l-112 -170q-1 -3 0 -5.5t4 -2.5h67q0 -119 66 -217q0 -1 0.5 -2t1.5 -1q3 -5 14 -18q4 -6 5 -7q8 -10 21 -24q1 0 1.5 -1l0.5 -1q38 -39 85 -65q2 -1 2 -2q12 -6 28 -13q1 -1 3.5 -2t3.5 -1q10 -4 24 -9q10 -4 12 -4q8 -3 22 -6q11 -3 15 -3
-q0 -1 2 -1.5t4 -0.5q4 0 21 -3q1 0 3.5 -0.5t3.5 -0.5q21 -2 38 -2q117 0 215 70q15 11 18.5 29.5t-7.5 34.5t-29.5 19t-33.5 -8zM888 300q0 119 -66 217l-0.5 1.5t-1.5 1.5q-5 7 -16 22l-1 1l-1 1q-58 72 -141 108l-1.5 1t-2.5 1q-11 5 -26 10q-1 0 -4.5 1.5t-5.5 1.5
-q-8 3 -24 6q-1 1 -5.5 2t-7.5 1q-1 1 -3 1.5t-4 0.5t-5 0.5t-6.5 1t-5.5 0.5t-6 1t-7 1q-13 1 -30 1l-2 0.5t-3 0.5h-0.5h-0.5q-118 0 -215 -70q-15 -11 -18.5 -29.5t7.5 -34t29.5 -19t33.5 7.5q75 53 166 53q13 -1 25 -2q2 0 4.5 -0.5t3.5 -0.5q11 -1 20 -3q2 0 9 -2
-q11 -3 19 -5q1 0 3 -1t3 -1q12 -4 22 -8l0.5 -0.5t1.5 -0.5q63 -28 108 -82v-1v0q65 -81 65 -185h-66q-3 0 -4.5 -2.5t0.5 -4.5l111 -171q2 -2 4.5 -2t3.5 2l112 171q1 2 0 4.5t-4 2.5h-67v0v0v0z" />
-    <glyph glyph-name="doc" unicode="&#xe606;" horiz-adv-x="1281" 
-d="M1280 422zM492 -7q2 -1 3.5 -2t5.5 -5.5t5.5 -9.5t-1.5 -11.5t-12 -13.5h-151q-4 0 -10.5 1.5t-24.5 9.5t-32 20.5t-26.5 38t-15.5 58.5v397v0q0 4 1 12t7.5 28.5t17 37t32 32t49.5 19.5h341q4 0 10.5 -1.5t24 -10.5t31.5 -22t26.5 -40t14.5 -62v-102v-160t0 -75
-q-1 -4 -2.5 -11.5t-11.5 -29.5t-24.5 -43t-43 -48t-65.5 -49h-2h-5h-7h-8.5h-7.5h-5h-2q-15 4 -15.5 24.5t0.5 86.5v0q0 3 1 8t6 18.5t12.5 24.5t23.5 21.5t36 14.5h81v326q0 3 -1 8.5t-5.5 20t-11.5 25.5t-21 21.5t-32 12.5h-332q-3 0 -7.5 -1t-16.5 -6t-21 -13.5
-t-17.5 -27.5t-10.5 -44q-1 -203 -1 -386q1 -3 1.5 -9t5 -21t11.5 -26.5t21.5 -22.5t34.5 -13h146zM736 106h-70q-4 -1 -9.5 -3.5t-16.5 -15.5t-12 -30v-16v-31.5v-15.5l8 -1q5 0 34 29q37 37 66 84zM651 430q0 -10 -7.5 -17.5t-17.5 -7.5h-221q-10 0 -17.5 7.5t-7.5 17.5v0
-q0 11 7.5 18.5t17.5 7.5h221q10 0 17.5 -7.5t7.5 -18.5v0zM652 282q0 -11 -7.5 -18.5t-18.5 -7.5h-220q-11 0 -18.5 7.5t-7.5 18.5v0q0 11 7.5 18.5t18.5 7.5h220q11 0 18.5 -7.5t7.5 -18.5v0zM524 133q0 -11 -7.5 -19t-18.5 -8h-91q-11 0 -19 8t-8 19v0q0 11 8 19t19 8h91
-q11 0 18.5 -8t7.5 -19v0z" />
-    <glyph glyph-name="line" unicode="&#xe611;" 
-d="M960 552q0 -17 -12 -29.5t-30 -12.5h-812q-18 0 -30 12.5t-12 29.5v0q0 18 12 30t30 12h812q18 0 30 -12t12 -30v0zM960 300q0 -17 -12 -29.5t-30 -12.5h-812q-18 0 -30 12.5t-12 29.5v0q0 17 12 29.5t30 12.5h812q18 0 30 -12.5t12 -29.5v0zM960 48q0 -18 -12 -30
-t-30 -12h-812q-18 0 -30 12t-12 30v0q0 17 12 29.5t30 12.5h812q18 0 30 -12.5t12 -29.5v0z" />
-    <glyph glyph-name="file-box" unicode="&#xe61b;" 
-d="M804 770l50 -431l-57 -7l-45 386h-480l-45 -386l-57 7l50 431h584zM319 674h386v-48h-386v48zM319 577h386v-48h-386v48zM319 481h386v-49h-386v49zM319 384h386v-48h-386v48zM874 287h-724q-10 0 -15 -6.5t-2 -15.5l82 -244q3 -10 12 -16.5t19 -6.5h532q10 0 19 6.5
-t12 16.5l82 244q3 9 -2 15.5t-15 6.5zM609 191h-194v48h194v-48z" />
-    <glyph glyph-name="switchon" unicode="&#xe615;" 
-d="M832 896h-640q-80 0 -136 -56t-56 -136v-640q0 -79 56 -135.5t136 -56.5h640q79 0 135.5 56.5t56.5 135.5v640q0 80 -56.5 136t-135.5 56zM160 0q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM160 704q-13 0 -22.5 9.5
-t-9.5 22.5t9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM704 64q0 -27 -18.5 -45.5t-45.5 -18.5h-256q-27 0 -45.5 18.5t-18.5 45.5v640q0 26 19 45t45 19h256q27 0 45.5 -18.5t18.5 -45.5v-640zM864 0q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5
-t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM864 704q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5t-9.5 -22.5t-22.5 -9.5zM576 704h-128q-26 0 -45 -19t-19 -45v-192q0 -26 19 -45t45 -19h128q27 0 45.5 18.5t18.5 45.5v192q0 27 -18.5 45.5
-t-45.5 18.5z" />
-    <glyph glyph-name="sysserver" unicode="&#xe605;" 
-d="M515 145q-36 0 -71 -12t-64 -41t-36 -69h338q-5 53 -57 87.5t-110 34.5zM955 157q-3 265 0 528q0 34 -12.5 47t-46.5 13q-45 -1 -384 -1v0q-339 0 -390 1q-28 0 -40.5 -11t-12.5 -39q1 -231 0 -544q0 -28 11.5 -40.5t39.5 -11.5q35 1 107 0.5t107 0.5q25 1 48 17
-q56 40 115.5 45t116.5 -28q63 -37 150 -35q94 2 132 0q33 -2 46 11t13 47zM892 213h-760v456h760v-456z" />
-    <glyph glyph-name="file" unicode="&#xe77d;" 
-d="M645 809h-372q-44 0 -75 -31t-31 -75v-638q0 -44 31 -75t75 -31h478q44 0 75 31t31 75v532zM643 726l127 -127h-104q-9 0 -16 6.5t-7 16.5v104zM751 19h-478q-19 0 -32.5 13.5t-13.5 32.5v638q0 19 13.5 32.5t32.5 13.5h310v-127q0 -34 24.5 -58.5t58.5 -24.5h131v-474
-q0 -19 -13.5 -32.5t-32.5 -13.5zM682 388h-340q-12 0 -21 -9t-9 -21.5t9 -21t21 -8.5h340q12 0 21 8.5t9 21t-9 21.5t-21 9zM682 232h-340q-12 0 -21 -9t-9 -21.5t9 -21t21 -8.5h340q12 0 21 8.5t9 21t-9 21.5t-21 9z" />
-  </font>
-</defs></svg>

BIN
app/ui/iconfont/iconfont.ttf


BIN
app/ui/iconfont/iconfont.woff


+ 0 - 1
app/ui/index.html

@@ -3,7 +3,6 @@
 <head>
 	<meta charset="UTF-8">
 	<title>SwitchHosts!</title>
-	<link rel="stylesheet" href="iconfont/iconfont.css">
 	<link rel="stylesheet" href="app.css">
 </head>
 <body>

+ 1 - 1
app/version.js

@@ -1 +1 @@
-module.exports = [3, 3, 13, 5397]
+module.exports = [3, 3, 14, 5404]

+ 0 - 141
gulpfile.js

@@ -1,141 +0,0 @@
-/**
- * @author oldj
- * @blog http://oldj.net
- */
-
-'use strict'
-
-/**
- * 注:ELECTRON_VERSION 为对应的 Electron 版本
- * 直接运行命令会自动下载对应文件,
- * 也可手动从 https://github.com/electron/electron/releases 下载最新版本,放到 ~/.electron 目录下
- * 淘宝镜像:https://npm.taobao.org/mirrors/electron/
- */
-const ELECTRON_VERSION = require('./package.json').devDependencies.electron.replace(/\^/, '')
-
-const fs = require('fs')
-const path = require('path')
-// const util = require('util');
-const exec = require('child_process').exec
-const gulp = require('gulp')
-// const shell = require('gulp-shell')
-// const webpack = require('webpack')
-const beautify = require('js-beautify').js_beautify
-
-const args = require('yargs').argv
-//console.log(args)
-// const IS_DEBUG = !!args.debug;
-// const TPL_FILE_INFO = "echo '> (DEBUG " + (IS_DEBUG ? "on" : "off") + ") <%= file.path %>'";
-
-gulp.task('ver', (done) => {
-  let fn = path.join(__dirname, 'app', 'version.js')
-  let version = require('./app/version')
-  version[3]++
-
-  console.log(`version -> ${version.join('.')}`)
-
-  let cnt = `module.exports = [${version.join(', ')}]`
-  fs.writeFileSync(fn, cnt, 'utf-8')
-
-  function updatePackage (fn) {
-    cnt = fs.readFileSync(fn)
-    let d = JSON.parse(cnt)
-    d.version = version.slice(0, 3).join('.')
-    cnt = beautify(JSON.stringify(d), {indent_size: 2})
-    fs.writeFileSync(fn, cnt, 'utf-8')
-  }
-
-  // update package.json
-  updatePackage(path.join(__dirname, 'package.json'))
-  updatePackage(path.join(__dirname, 'app', 'package.json'))
-
-  done()
-})
-
-gulp.task('pack', (done) => {
-  let version = require('./app/version')
-  let v1 = version.slice(0, 3).join('.')
-  let v2 = version[3]
-
-  let pack = {}
-  pack.macOS = `
-# for macOS
-electron-packager ./app 'SwitchHosts!' --platform=darwin --arch=x64 --electron-version=${ELECTRON_VERSION} --overwrite --asar=true --prune --icon=./assets/app.icns --ignore=node_modules/.bin --ignore=.git --ignore=${__dirname}/dist --ignore="node_modules/electron-(?!(?:window-state)).*" --out=dist --app-version=${v1} --build-version=${v2}
-`
-  pack.win64 = `
-# for windows x64
-electron-packager ./app 'SwitchHosts!' --platform=win32  --arch=x64 --electron-version=${ELECTRON_VERSION} --overwrite --asar=true --prune --icon=./assets/app.ico  --ignore=node_modules/.bin --ignore=.git --ignore=${__dirname}/dist --ignore="node_modules/electron-(?!(?:window-state)).*" --out=dist --app-version=${v1} --build-version=${v2}
-`
-  pack.win32 = `
-# for windows ia32
-electron-packager ./app 'SwitchHosts!' --platform=win32  --arch=ia32 --electron-version=${ELECTRON_VERSION} --overwrite --asar=true --prune --icon=./assets/app.ico  --ignore=node_modules/.bin --ignore=.git --ignore=${__dirname}/dist --ignore="node_modules/electron-(?!(?:window-state)).*" --out=dist --app-version=${v1} --build-version=${v2}
-`
-  pack.linux = `
-# for linux x86_64
-electron-packager ./app 'SwitchHosts!' --platform=linux  --arch=x64 --electron-version=${ELECTRON_VERSION} --overwrite --asar=true --prune --icon=./assets/app.ico  --ignore=node_modules/.bin --ignore=.git --ignore=${__dirname}/dist --ignore="node_modules/electron-(?!(?:window-state)).*" --out=dist --app-version=${v1} --build-version=${v2}
-`
-
-  let cmds = []
-  if (!args.platform) {
-    cmds = [pack.macOS, pack.win64, pack.win32, pack.linux]
-  } else {
-    let a = args.platform.split(',')
-    a.map(i => cmds.push(pack[i] || ''))
-  }
-
-  console.log(`start packing, v: ${v1}.${v2} ..`)
-  console.log(cmds.join('\n'))
-  exec(cmds.join('\n'), (error, stdout, stderr) => {
-    console.log('end pack.')
-    if (error) {
-      console.error(`exec error: ${error}`)
-    }
-    // if (stdout) console.log(`${stdout}`);
-    // if (stderr) console.log(`${stderr}`);
-
-    done()
-  })
-})
-
-gulp.task('zip', (done) => {
-  let version = require('./app/version')
-  let v = version.join('.')
-
-  let cmds = `
-cd ./dist
-rm -f ./SwitchHosts-*.zip
-zip -ry SwitchHosts-macOS-x64_v${v}.zip ./SwitchHosts\\!-darwin-x64/SwitchHosts\\!.app
-zip -ry SwitchHosts-win32-x64_v${v}.zip ./SwitchHosts\\!-win32-x64
-zip -ry SwitchHosts-win32-ia32_v${v}.zip ./SwitchHosts\\!-win32-ia32
-zip -ry SwitchHosts-linux-x64_v${v}.zip ./SwitchHosts\\!-linux-x64
-cd ..
-`
-
-  console.log(`start zip ..`)
-  exec(cmds, (error, stdout, stderr) => {
-    console.log('end zip.')
-    if (error) {
-      console.error(`exec error: ${error}`)
-    }
-    // if (stdout) console.log(`${stdout}`);
-    // if (stderr) console.log(`${stderr}`);
-    done()
-  })
-
-})
-
-gulp.task('default', () => {
-  //gulp.start('webpack')
-
-  gulp.watch([
-    'app/**/*.*'
-    , '!app/bundle.*'
-    , '!app/node_modules/*'
-    , '!app/package.json'
-    , '!app/version.js'
-
-    , 'app-ui/**/*.*'
-    , '!app-ui/node_modules/*'
-  ], ['ver'])
-})
-

Fișier diff suprimat deoarece este prea mare
+ 11 - 762
package-lock.json


+ 19 - 8
package.json

@@ -1,6 +1,6 @@
 {
   "name": "switchhosts",
-  "version": "3.3.13",
+  "version": "3.3.14",
   "description": "A tool for managing and switching hosts.",
   "main": "",
   "scripts": {
@@ -8,7 +8,7 @@
     "start": "electron app",
     "dll": "webpack --config scripts/webpack.dll.js --progress --profile --colors",
     "dev": "cross-env ENV=dev electron app",
-    "build": "gulp ver && npm run dll && npm run build2",
+    "build": "npm run dll && npm run build2",
     "build2": "webpack --config scripts/webpack.config.js --progress --profile --colors",
     "w": "npm run build2 -- -w",
     "make": "rm -rf dist/* && node scripts/make.js",
@@ -87,8 +87,6 @@
     "file-loader": "^4.0.0",
     "friendly-errors-webpack-plugin": "^1.7.0",
     "function-bind": "^1.1.1",
-    "gulp": "^4.0.2",
-    "gulp-shell": "^0.7.1",
     "html-webpack-plugin": "^3.2.0",
     "http-proxy-middleware": "^0.19.1",
     "js-beautify": "^1.10.0",
@@ -121,16 +119,29 @@
     "yargs": "^13.2.4"
   },
   "ava": {
-    "files": ["src/**/*.ava.js", "test/*.js", "!**/node_modules/**/*.*"],
-    "source": ["**/*.{js,jsx}", "!dist/**/*"],
+    "files": [
+      "src/**/*.ava.js",
+      "test/*.js",
+      "!**/node_modules/**/*.*"
+    ],
+    "source": [
+      "**/*.{js,jsx}",
+      "!dist/**/*"
+    ],
     "match": [],
     "concurrency": 5,
     "failFast": true,
     "tap": true,
     "powerAssert": false,
-    "require": ["babel-polyfill", "babel-register"],
+    "require": [
+      "babel-polyfill",
+      "babel-register"
+    ],
     "babel": {
-      "presets": ["latest", "stage-0"]
+      "presets": [
+        "latest",
+        "stage-0"
+      ]
     }
   }
 }

+ 31 - 0
scripts/updateVersion.js

@@ -0,0 +1,31 @@
+/**
+ * @author oldj
+ * @blog https://oldj.net
+ */
+
+'use strict'
+
+//const path = require('path')
+const fs = require('fs')
+
+module.exports = (fn, pkgs) => {
+  let version = require(fn)
+  let ver0 = version.join('.')
+  version[3]++
+  let ver_str = version.join(', ')
+  console.log(`version: ${ver0} -> ${version.join('.')}`)
+
+  fs.writeFileSync(fn, `module.exports = [${ver_str}]`, 'utf-8')
+  //fs.writeFileSync(path.join(base_dir, fn_ver), `module.exports = [${ver_str}]`)
+
+  pkgs.map(pf => {
+    if (fs.existsSync(pf)) {
+      let pkg = require(pf)
+      pkg.version = version.slice(0, 3).join('.')
+      let c = JSON.stringify(pkg, null, 2)
+      fs.writeFileSync(pf, c, 'utf-8')
+    }
+  })
+
+  return version
+}

+ 10 - 4
scripts/webpack.config.js

@@ -7,13 +7,15 @@
 
 const path = require('path')
 const webpack = require('webpack')
-const moment = require('moment')
+//const moment = require('moment')
 const WebpackNotifierPlugin = require('webpack-notifier')
 const MiniCssExtractPlugin = require('mini-css-extract-plugin')
 const LESSPluginLists = require('less-plugin-lists')
 const TerserPlugin = require('terser-webpack-plugin')
 const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
-const version = require('../app/version').join('.')
+//const version = require('../app/version').join('.')
+const UpVersionPlugin = require('./webpack_up_version')
+const basedir = path.dirname(__dirname)
 
 const mini_css_loader = {
   loader: MiniCssExtractPlugin.loader,
@@ -187,6 +189,10 @@ module.exports = {
         NODE_ENV: JSON.stringify('production')
       }
     }),
+    new UpVersionPlugin({
+      fn: path.join(basedir, 'app', 'version.js'),
+      packages: [path.join(basedir, 'package.json'), path.join(basedir, 'app', 'package.json')],
+    }),
     new MiniCssExtractPlugin({
       // Options similar to the same options in webpackOptions.output
       // both options are optional
@@ -202,7 +208,7 @@ module.exports = {
       title: 'SwitchHosts!',
       alwaysNotify: true,
       excludeWarnings: true
-    }),
-    new webpack.BannerPlugin(`SwitchHosts! [file] v${version}, ${moment().format('YYYY-MM-DD HH:mm:ss')}`)
+    })
+    //new webpack.BannerPlugin(`SwitchHosts! [file] v${version}, ${moment().format('YYYY-MM-DD HH:mm:ss')}`)
   ]
 }

+ 32 - 0
scripts/webpack_up_version.js

@@ -0,0 +1,32 @@
+/**
+ * webpack_up_version.js
+ */
+
+'use strict'
+
+const updateVersion = require('./updateVersion')
+const STEP = 0.1
+
+class UpVersionWebpackPlugin {
+  constructor (options) {
+    this.options = options
+    this._score = -1
+  }
+
+  apply (compiler) {
+    compiler.plugin('compile', () => {
+      if (this._score >= 0 && this._score < 1) {
+        // 防止更新太频繁
+        this._score += STEP
+        return
+      }
+
+      console.log('~~~~~~~~~~~~~~~~~~~~~~ update version ~~~~~~~~~~~~~~~~~~~~~~')
+      let {fn, packages} = this.options
+      updateVersion(fn, packages)
+      this._score = 0
+    })
+  }
+}
+
+module.exports = UpVersionWebpackPlugin

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff