├── .gitignore ├── LICENSE.md ├── README.md ├── app ├── css │ ├── antdv1.6.3.css │ ├── assets │ │ ├── logo.svg │ │ ├── pattern.png │ │ └── test.png │ ├── font │ │ ├── deadstar.otf │ │ ├── font_1463992151_360388.eot │ │ ├── font_1463992151_360388.svg │ │ ├── font_1463992151_360388.ttf │ │ ├── font_1463992151_360388.woff │ │ ├── iconfont.css │ │ ├── iconfont.woff │ │ └── ruixian.ttf │ ├── iconfont │ │ ├── iconfont.css │ │ ├── iconfont.eot │ │ ├── iconfont.js │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ ├── jeffui.css │ ├── jeffui_test.css │ ├── ruffhelper.css │ ├── ruffhelper_1.css │ └── ruffhelper_test.css ├── icon │ ├── icon.icns │ └── icon.ico ├── index.html ├── index.js ├── index_public.html ├── package.json ├── pages │ └── background │ │ ├── index.html │ │ ├── libs │ │ └── modules │ │ │ ├── egret │ │ │ ├── egret.min.js │ │ │ └── egret.web.min.js │ │ │ ├── game │ │ │ ├── game.min.js │ │ │ └── game.web.min.js │ │ │ ├── res │ │ │ └── res.min.js │ │ │ └── tween │ │ │ └── tween.min.js │ │ ├── main.min.js │ │ └── resource │ │ ├── default.res.json │ │ └── packs0 │ │ ├── preload-0sheet_2b549e82.json │ │ └── preload-0sheet_662dedb5.png ├── public │ ├── app.js │ └── vendors.js └── server │ ├── RapLogServer.js │ ├── package.json │ ├── raplog │ ├── raplog.css │ ├── raplog.html │ ├── raplog.js │ ├── socket.io-1.4.5.js │ └── xiangsu.ttf │ ├── test.js │ └── testing.txt ├── build ├── electronzip │ └── electron的对应版本zip包放这 ├── install │ ├── darwin │ │ ├── dmg.js │ │ └── media │ │ │ ├── background.png │ │ │ └── icon.icns │ └── win32 │ │ ├── inno.js │ │ ├── inno │ │ ├── Compil32.exe │ │ ├── Config.ini │ │ ├── Default.isl │ │ ├── ISCC.exe │ │ ├── ISCmplr.dll │ │ ├── ISCrypt.dll │ │ ├── ISPP.chm │ │ ├── ISPP.dll │ │ ├── ISPPBuiltins.iss │ │ ├── ISetup.chm │ │ ├── IsExtend.chm │ │ ├── Languages │ │ │ ├── BrazilianPortuguese.isl │ │ │ ├── Catalan.isl │ │ │ ├── ChineseSimplified.isl │ │ │ ├── ChineseTrad.isl │ │ │ ├── Corsican.isl │ │ │ ├── Czech.isl │ │ │ ├── Danish.isl │ │ │ ├── Dutch.isl │ │ │ ├── English.isl │ │ │ ├── Finnish.isl │ │ │ ├── French.isl │ │ │ ├── German.isl │ │ │ ├── Greek.isl │ │ │ ├── Hebrew.isl │ │ │ ├── Hungarian.isl │ │ │ ├── Italian.isl │ │ │ ├── Japanese.isl │ │ │ ├── Nepali.islu │ │ │ ├── Norwegian.isl │ │ │ ├── Polish.isl │ │ │ ├── Portuguese.isl │ │ │ ├── Russian.isl │ │ │ ├── ScottishGaelic.isl │ │ │ ├── SerbianCyrillic.isl │ │ │ ├── SerbianLatin.isl │ │ │ ├── Slovenian.isl │ │ │ ├── Spanish.isl │ │ │ ├── Turkish.isl │ │ │ └── Ukrainian.isl │ │ ├── Office2007.bmp │ │ ├── Office2007Gray.bmp │ │ ├── Setup.e32 │ │ ├── SetupLdr.e32 │ │ ├── WizModernImage-Is.bmp │ │ ├── WizModernImage.bmp │ │ ├── WizModernSmallImage-Is.bmp │ │ ├── WizModernSmallImage.bmp │ │ ├── isbunzip.dll │ │ ├── isbzip.dll │ │ ├── isfaq.htm │ │ ├── islzma.dll │ │ ├── islzma32.exe │ │ ├── islzma64.exe │ │ ├── isscint.dll │ │ ├── isunzlib.dll │ │ ├── iszlib.dll │ │ ├── license.txt │ │ ├── unins000.dat │ │ ├── unins000.exe │ │ ├── unins000.msg │ │ └── whatsnew.htm │ │ └── media │ │ ├── WizModernImage.bmp │ │ ├── WizModernSmallImage.bmp │ │ ├── signtool.exe │ │ ├── win32.iss │ │ └── win64.iss ├── prerelease │ └── 预发布文件夹 └── release │ └── 发布版本文件夹 ├── doc ├── ReleaseNotes.MD ├── RuffLink.MD ├── pic.png ├── publish.MD ├── version │ ├── v0.3.0.png │ ├── v0.4.0.png │ ├── v0.5.0.png │ └── v1.5.0.png ├── 发布流程说明.txt ├── 工作日志.txt ├── 说明.txt └── 遇到的一些问题.MD ├── gulpfile.js ├── index.js ├── npm-debug.log ├── package.json ├── pages └── background │ ├── .wing │ ├── launch.json │ └── tasks.json │ ├── bin-debug │ ├── Main.js │ └── Star.js │ ├── egretProperties.json │ ├── index.html │ ├── libs │ └── modules │ │ ├── egret │ │ ├── egret.d.ts │ │ ├── egret.js │ │ ├── egret.min.js │ │ ├── egret.native.js │ │ ├── egret.native.min.js │ │ ├── egret.web.js │ │ └── egret.web.min.js │ │ ├── game │ │ ├── game.d.ts │ │ ├── game.js │ │ ├── game.min.js │ │ ├── game.native.js │ │ ├── game.native.min.js │ │ ├── game.web.js │ │ └── game.web.min.js │ │ ├── res │ │ ├── res.d.ts │ │ ├── res.js │ │ └── res.min.js │ │ └── tween │ │ ├── tween.d.ts │ │ ├── tween.js │ │ └── tween.min.js │ ├── resource │ ├── assets │ │ ├── bg.png │ │ ├── c1-1.png │ │ ├── c1-2.png │ │ ├── c2.png │ │ ├── c3.png │ │ ├── c4.png │ │ ├── c5-1.png │ │ ├── c5-2.png │ │ ├── c5-3.png │ │ ├── c5-4.png │ │ ├── c6-1.png │ │ ├── c6-2.png │ │ ├── c6-3.png │ │ └── star.png │ └── default.res.json │ ├── src │ ├── Main.ts │ └── Star.ts │ ├── template │ └── runtime │ │ ├── native_loader.js │ │ ├── native_require.js │ │ └── runtime_loader.js │ ├── tsconfig.json │ └── wingProperties.json ├── psd ├── background.psd ├── cankao │ ├── css颜色表.gif │ └── ui.gif ├── clear │ ├── demo │ │ ├── main.js │ │ ├── question.js │ │ └── work.js │ └── demo1 │ │ ├── clear1.js │ │ ├── cluster-logger.js │ │ ├── data.txt │ │ ├── exec.js │ │ ├── exec2.js │ │ ├── execfile.js │ │ ├── fork.js │ │ ├── fork2.js │ │ ├── forkrap.js │ │ ├── listen1.js │ │ ├── listen2.js │ │ ├── listen3.js │ │ ├── package.json │ │ ├── spawn.js │ │ └── spawn2.js ├── css.css ├── icon_128.psd ├── icon_256.psd ├── icon_48.psd ├── icon_64.psd ├── newui.sketch ├── t1.js ├── test1.sketch ├── test1 │ └── index.html ├── ui2.psd └── 配色.txt ├── script ├── remove-use-strict.js ├── webpack.config.js ├── webpack.config_not_hot_loader.js └── webpack.production.config.js └── src ├── Main.jsx ├── Router.jsx ├── actions ├── AppActions.jsx └── AppActions_1.jsx ├── component ├── Alerts.jsx ├── LeftArea.jsx ├── Loading.jsx ├── MainShell.jsx ├── RightArea.jsx ├── Template.jsx ├── TestUI.jsx ├── _alerts │ ├── InputPanel.jsx │ ├── SDKSelecter.jsx │ ├── SaveLog.jsx │ ├── Selecter.jsx │ ├── SystemUpgrade.jsx │ └── WifiPanel.jsx ├── _left │ ├── NewProject.jsx │ ├── OpenProject.jsx │ ├── RapCommand.jsx │ ├── RuffSDK.jsx │ └── cp │ │ └── LocationSelector.jsx ├── _rights │ ├── CommandsArea.jsx │ ├── ExtraButton.jsx │ ├── ExtraQrCode.jsx │ └── LogsArea.jsx ├── _test │ └── Test1.jsx ├── alerts │ └── SaveLog.jsx ├── backup │ ├── Alerts_1.jsx │ ├── LeftArea_1.jsx │ ├── Loading_1.jsx │ ├── RightArea_1.jsx │ └── TestUI_1.jsx ├── left │ ├── C1_RapCommand.jsx │ ├── C2_OpenProject.jsx │ ├── C3_NewProject.jsx │ ├── LeftContainer.jsx │ └── openproject │ │ └── Item.jsx ├── right │ ├── ExtraButton.jsx │ ├── InfoArea.jsx │ └── LogContent.jsx └── ui │ ├── Button.jsx │ ├── FolderSelector.jsx │ ├── Input.jsx │ └── ToggleSwitch.jsx ├── config.js ├── lib ├── FileUtil.js ├── RapCommand.js ├── Utils.js ├── _Commands.js ├── locales │ ├── en_US.js │ └── zh_CN.js └── ~Files.js └── reducers ├── Reducers.jsx └── Reducers_1.jsx /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .idea/ 3 | .rap/ 4 | .wing/ 5 | test/ 6 | build/electronzip/ 7 | ~/ 8 | config/ 9 | pages/background/.wing 10 | pages/background/bin-debug 11 | pages/background/bin-release 12 | pages/background/wingProperties.json 13 | pages/background/libs -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2015, ZhangYu. 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, 9 | this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the ZhangYu nor 12 | the names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY ZHANGYU AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZHANGYU AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #RuffHelper 2 | 一个 Ruff 开发辅助工具,把常用的 rap 命令可视化操作。 3 | 使用 React + Electron 框架,webpack 编译。 4 | 5 | [Ruff -- 用 js 开发智能硬件](https://ruff.io/zh-cn/) 6 | 7 | ![preview](./doc/version/v1.5.0.png) 8 | ###[发布日志 v1.5.0](doc/ReleaseNotes.MD) 9 | 10 | ###原理 11 | 工作原理很简单,就是使用 node 子进程调用 rap 的命令,然后把返回的消息显示出来。 12 | 13 | 14 | 15 | ###注意 16 | master 分支为开发调试版本,我在重构代码,重新制作动态UI。如果需要稳定的版本,请使用1.5.0的Tag 17 | 18 | ###调试开发流程 19 | 1. **npm install** 安装各种包,有的需要翻墙,可以使用 [cnpm](https://npm.taobao.org/) 20 | 2. **npm install electron@1.5.0 -g** 全局安装 electron 21 | 3. **npm run dev** 启动 webpack,自动编译 react 22 | 4. **npm run start** 启动 electron 23 | 5. happy coding 24 | 25 | ###[发布流程](doc/publish.MD) 26 | 27 | 28 | ###发布版本地址 29 | [git最大附件25M,只能放百度网盘了](http://pan.baidu.com/s/1kVRI98b#path=%252Fruffhelper) 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/css/assets/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/assets/pattern.png -------------------------------------------------------------------------------- /app/css/assets/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/assets/test.png -------------------------------------------------------------------------------- /app/css/font/deadstar.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/font/deadstar.otf -------------------------------------------------------------------------------- /app/css/font/font_1463992151_360388.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/font/font_1463992151_360388.eot -------------------------------------------------------------------------------- /app/css/font/font_1463992151_360388.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/font/font_1463992151_360388.ttf -------------------------------------------------------------------------------- /app/css/font/font_1463992151_360388.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/font/font_1463992151_360388.woff -------------------------------------------------------------------------------- /app/css/font/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('iconfont.eot?t=1485683275103'); /* IE9*/ 4 | src: url('iconfont.eot?t=1485683275103#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('iconfont.woff?t=1485683275103') format('woff'), /* chrome, firefox */ 6 | url('iconfont.ttf?t=1485683275103') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('iconfont.svg?t=1485683275103#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:12px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-delete:before { content: "\e605";font-size: 14px; } 19 | 20 | .icon-ellipsis:before { content: "\e8e5"; } 21 | 22 | .icon-save:before { content: "\e651"; } 23 | 24 | .icon-folder:before { content: "\e604"; } 25 | 26 | -------------------------------------------------------------------------------- /app/css/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/font/iconfont.woff -------------------------------------------------------------------------------- /app/css/font/ruixian.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/font/ruixian.ttf -------------------------------------------------------------------------------- /app/css/iconfont/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('iconfont.woff?t=1485338156711') format('woff') /* chrome, firefox */ 4 | } 5 | 6 | .iconfont { 7 | font-family:"iconfont" !important; 8 | font-size:16px; 9 | font-style:normal; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | 14 | .icon-ellipsis:before { content: "\e8e5"; } 15 | 16 | .icon-folder:before { content: "\e604"; } 17 | 18 | -------------------------------------------------------------------------------- /app/css/iconfont/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/iconfont/iconfont.eot -------------------------------------------------------------------------------- /app/css/iconfont/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Created by FontForge 20120731 at Wed Jan 25 17:55:56 2017 6 | By admin 7 | 8 | 9 | 10 | 24 | 26 | 28 | 30 | 32 | 34 | 38 | 41 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/css/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /app/css/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/css/iconfont/iconfont.woff -------------------------------------------------------------------------------- /app/css/jeffui.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'ruixian'; 3 | src: url('font/ruixian.ttf') format('truetype'); 4 | } 5 | 6 | .JUI { 7 | font-family: ruixian; 8 | font-size: 12px; 9 | color: #5EFDFF; 10 | border-radius: 2px; 11 | border: 1px solid rgba(76, 193, 253, 0.6); 12 | background: rgba(76, 193, 253, 0.3); 13 | width: 100%; 14 | } 15 | 16 | .JInput { 17 | padding: 3px 4px 3px 4px; 18 | } 19 | 20 | input::-webkit-input-placeholder { 21 | color: rgba(94, 253, 255, 0.6) !important; 22 | } 23 | 24 | .JButton { 25 | cursor: pointer; 26 | text-align: center; 27 | display: flex; 28 | } 29 | 30 | .JButton:hover { 31 | background: rgba(76, 193, 253, 0.6); 32 | } 33 | 34 | .JButton:active { 35 | background: rgba(76, 193, 253, 1); 36 | } 37 | 38 | .JButton:disabled { 39 | color: rgba(94, 253, 255, 0.4); 40 | background: rgba(76, 193, 253, 0.1); 41 | } 42 | 43 | .JButton:focus { 44 | outline: none; 45 | } 46 | .JToggleSwitch{ 47 | text-align: center; 48 | font-weight: lighter; 49 | color: rgba(94, 253, 255, 0.8); 50 | } 51 | .JToggleSwitch .on{ 52 | background: rgba(76, 193, 253, 0.5); 53 | } 54 | .JToggleSwitch .off{ 55 | background: rgba(76, 193, 253, 0.3); 56 | } 57 | .JToggleSwitch:hover{ 58 | background: rgba(76, 193, 253, 0.6); 59 | } 60 | 61 | /*.JSelector{!*文件夹选择器*!*/ 62 | /*text-align: center;*/ 63 | /*}*/ 64 | /*.JSelector:hover{*/ 65 | /*background: rgba(76, 193, 253, 0.6);*/ 66 | /*}*/ -------------------------------------------------------------------------------- /app/css/jeffui_test.css: -------------------------------------------------------------------------------- 1 | .JUI { 2 | font-size: 12px; 3 | /*color: #5EFDFF;*/ 4 | border-radius: 2px; 5 | border: 1px solid rgba(76, 193, 253, 0.6); 6 | /*background: rgba(76, 193, 253, 0.3);*/ 7 | width: 100%; 8 | } 9 | 10 | .JInput { 11 | padding: 0 4px 0 4px; 12 | } 13 | 14 | .JButton { 15 | cursor: pointer; 16 | } 17 | 18 | .JButton:hover { 19 | background: rgba(76, 193, 253, 0.6); 20 | } 21 | 22 | .JButton:disabled { 23 | color: gray; 24 | /*background: gray;*/ 25 | /*color: rgba(94, 253, 255, 0.4);*/ 26 | /*background: rgba(76, 193, 253, 0.1);*/ 27 | background: rgba(0, 0, 0, 0.1); 28 | } 29 | 30 | .JButton:focus { 31 | outline: none; 32 | } 33 | 34 | .JSelector{/*文件夹选择器*/ 35 | text-align: center; 36 | } 37 | .JSelector:hover{ 38 | background: rgba(76, 193, 253, 0.6); 39 | } -------------------------------------------------------------------------------- /app/icon/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/icon/icon.icns -------------------------------------------------------------------------------- /app/icon/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/icon/icon.ico -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /app/index.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron'); 2 | const Menu = electron.Menu; 3 | const MenuItem = electron.MenuItem; 4 | const {app} = electron; // Module to control application life. 5 | const {BrowserWindow} = electron; // Module to create native browser window. 6 | var mainWindow = null; 7 | // var appIcon = null; 8 | // Quit when all windows are closed. 9 | app.on('window-all-closed', function () { 10 | // On OS X it is common for applications and their menu bar 11 | // to stay active until the user quits explicitly with Cmd + Q 12 | app.quit(); 13 | // if (process.platform != 'darwin') { 14 | // 15 | // } 16 | }); 17 | 18 | // var version = '0.1.0' 19 | // This method will be called when Electron has finished 20 | // initialization and is ready to create browser windows. 21 | app.on('ready', function () { 22 | // Create the browser window. 23 | //center 在屏幕中间显示 resizable 不可以调整大小 24 | //icon dock 区域显示的图标 25 | //appIcon = new Tray('./assets/images/icon.png'); 26 | //console.log(appIcon) 27 | //mainWindow = new BrowserWindow({width: 730, height: 530, 28 | var version = app.getVersion() 29 | mainWindow = new BrowserWindow({ 30 | width: 730, height: 530, 31 | title: "RuffHelper " + version, 32 | center: true, resizable: false, useContentSize: true 33 | }); 34 | //cosnole.log(123,Menu) 35 | var menu = new Menu(); 36 | menu.append(new MenuItem({ 37 | role: 'window', 38 | label: 'RuffHelper', 39 | submenu: [ 40 | {label: 'Copy',accelerator: 'CmdOrCtrl+C',role: 'copy'}, 41 | {label: 'Cut',accelerator: 'CmdOrCtrl+X',role: 'cut'}, 42 | {label: 'Paste',accelerator: 'CmdOrCtrl+V',role: 'paste'}, 43 | {label: 'Select All',accelerator: 'CmdOrCtrl+A',role: 'selectall'}, 44 | {label: 'Undo',accelerator: 'CmdOrCtrl+Z',role: 'undo'}, 45 | {label: 'Redo',accelerator: 'Shift+CmdOrCtrl+Z',role: 'redo'}, 46 | {type: 'separator'}, 47 | {label: 'author: coolgods@sina.com'}, 48 | {type: 'separator'}, 49 | ] 50 | })) 51 | if (process.platform == 'darwin') {//mac 平台替换菜单 52 | Menu.setApplicationMenu(menu); 53 | } 54 | 55 | mainWindow.on('page-title-updated', function (event) { 56 | //阻止替换标题 57 | event.preventDefault(); 58 | }) 59 | // 60 | //mainWindow.setRepresentedFilename('./assets/images/icon.png') 61 | //appIcon.setToolTip('This is my application.'); 62 | //console.log(1231,mainWindow.id) 63 | // and load the index.html of the app. 64 | //从指定位置加载 65 | mainWindow.loadURL('file://' + __dirname + '/index_public.html'); 66 | // mainWindow.title = "RuffHelper "+version; 67 | //var appIcon = new Tray('/assets/images/icon.png'); 68 | //从服务器位置加载 69 | // mainWindow.loadURL("http://localhost:8080"); 70 | //window.onresize = function(){ 71 | // var wid = document.documentElement.clientWidth; 72 | // var hei = document.documentElement.clientHeight; 73 | // console.log(wid,hei); 74 | //} 75 | // Open the DevTools. 76 | // mainWindow.openDevTools();//调试面板 77 | //mainWindow.setMenu(null);//清除菜单 78 | //mainWindow.setMenuBarVisibility(false);//隐藏顶部的选项条 79 | mainWindow.setContentSize(730, 530);//重新设置窗口大小 80 | 81 | // Emitted when the window is closed. 82 | mainWindow.on('closed', function () { 83 | // Dereference the window object, usually you would store windows 84 | // in an array if your app supports multi windows, this is the time 85 | // when you should delete the corresponding element. 86 | mainWindow = null; 87 | }); 88 | 89 | //mainWindow.on('resize', function() { 90 | // // Dereference the window object, usually you would store windows 91 | // // in an array if your app supports multi windows, this is the time 92 | // // when you should delete the corresponding element. 93 | // console.log(1212,app.getAppPath()) 94 | //}); 95 | 96 | }); 97 | -------------------------------------------------------------------------------- /app/index_public.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ruffhelper", 3 | "version": "1.5.0", 4 | "description": "", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /app/pages/background/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Egret 6 | 7 | 8 | 9 | 10 | 11 | 12 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
55 |
56 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /app/pages/background/libs/modules/game/game.web.min.js: -------------------------------------------------------------------------------- 1 | var egret;!function(e){var t;!function(t){var n=function(t){function n(){t.call(this)}__extends(n,t);var r=(__define,n),a=r.prototype;return a.proceed=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(){switch(o(),t.dataFormat){case e.URLLoaderDataFormat.VARIABLES:t.data=new e.URLVariables(d.response);break;default:t.data=d.response}window.setTimeout(function(){e.Event.dispatchEvent(t,e.Event.COMPLETE)},0)}function o(){d.removeEventListener(e.Event.COMPLETE,a,i),d.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),d.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this;if(t.dataFormat==e.URLLoaderDataFormat.TEXTURE)return void this.loadTexture(t);if(t.dataFormat==e.URLLoaderDataFormat.SOUND)return void this.loadSound(t);var s=t._request,E=i.getVirtualUrl(e.$getUrl(s)),d=new e.HttpRequest;if(d.addEventListener(e.Event.COMPLETE,a,this),d.addEventListener(e.IOErrorEvent.IO_ERROR,r,this),d.addEventListener(e.ProgressEvent.PROGRESS,n,this),d.open(E,s.method),d.responseType=this.getResponseType(t.dataFormat),s.method!=e.URLRequestMethod.GET&&s.data)if(s.data instanceof e.URLVariables){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var v=s.data;d.send(v.toString())}else d.setRequestHeader("Content-Type","multipart/form-data"),d.send(s.data);else d.send()},a.getResponseType=function(t){switch(t){case e.URLLoaderDataFormat.TEXT:case e.URLLoaderDataFormat.VARIABLES:return e.URLLoaderDataFormat.TEXT;case e.URLLoaderDataFormat.BINARY:return"arraybuffer";default:return t}},a.loadSound=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o(),t.data=E,window.setTimeout(function(){t.dispatchEventWith(e.Event.COMPLETE)},0)}function o(){E.removeEventListener(e.Event.COMPLETE,a,i),E.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,s=this.getVirtualUrl(t._request.url),E=new e.Sound;E.addEventListener(e.Event.COMPLETE,a,i),E.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.addEventListener(e.ProgressEvent.PROGRESS,n,i),E.load(s)},a.loadTexture=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o();var r=E.data;r.source.setAttribute("bitmapSrc",s);var a=new e.Texture;a._setBitmapData(r),t.data=a,window.setTimeout(function(){t.dispatchEventWith(e.Event.COMPLETE)},i)}function o(){E.removeEventListener(e.Event.COMPLETE,a,i),E.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,s=this.getVirtualUrl(t._request.url),E=new e.ImageLoader;E.addEventListener(e.Event.COMPLETE,a,i),E.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.addEventListener(e.ProgressEvent.PROGRESS,n,i),E.load(s)},a.getChangeList=function(){return[]},a.getVirtualUrl=function(e){return e},n.getNetContext=function(){return null==n._instance&&(n._instance=new n),n._instance},n}(e.HashObject);t.HTML5NetContext=n,e.registerClass(n,"egret.web.HTML5NetContext",["egret.NetContext"]),e.NetContext=n}(t=e.web||(e.web={}))}(egret||(egret={})); -------------------------------------------------------------------------------- /app/pages/background/resource/default.res.json: -------------------------------------------------------------------------------- 1 | {"groups":[{"keys":"star_png,bg_png,c1-1_png,c1-2_png,c2_png,c3_png,c4_png,c5-1_png,c5-2_png,c5-3_png,c5-4_png,c6-1_png,c6-2_png,c6-3_png","name":"preload"}],"resources":[{"url":"packs0/preload-0sheet_2b549e82.json","type":"sheet","name":"preload-0sheet","subkeys":"star_png,c6-3_png,c6-2_png,c6-1_png,c5-4_png,c5-3_png,c5-2_png,c5-1_png,c4_png,c3_png,c2_png,c1-2_png,c1-1_png,bg_png"}]} -------------------------------------------------------------------------------- /app/pages/background/resource/packs0/preload-0sheet_2b549e82.json: -------------------------------------------------------------------------------- 1 | {"frames":{"bg_png":{"x":0,"y":0,"w":730,"h":530,"offX":0,"offY":0,"sourceW":730,"sourceH":530},"c1-1_png":{"x":732,"y":0,"w":188,"h":224,"offX":0,"offY":0,"sourceW":188,"sourceH":224},"c3_png":{"x":922,"y":0,"w":134,"h":256,"offX":0,"offY":0,"sourceW":134,"sourceH":256},"c4_png":{"x":1058,"y":0,"w":123,"h":228,"offX":0,"offY":0,"sourceW":123,"sourceH":228},"c5-1_png":{"x":1183,"y":0,"w":100,"h":162,"offX":0,"offY":0,"sourceW":100,"sourceH":162},"c5-2_png":{"x":1285,"y":0,"w":98,"h":88,"offX":0,"offY":0,"sourceW":98,"sourceH":88},"c5-4_png":{"x":1385,"y":0,"w":97,"h":56,"offX":0,"offY":0,"sourceW":97,"sourceH":56},"c1-2_png":{"x":1484,"y":0,"w":109,"h":39,"offX":0,"offY":0,"sourceW":109,"sourceH":39},"c5-3_png":{"x":1595,"y":0,"w":74,"h":53,"offX":0,"offY":0,"sourceW":74,"sourceH":53},"c2_png":{"x":1671,"y":0,"w":96,"h":32,"offX":0,"offY":0,"sourceW":96,"sourceH":32},"c6-3_png":{"x":1769,"y":0,"w":5,"h":93,"offX":0,"offY":0,"sourceW":5,"sourceH":93},"c6-1_png":{"x":1776,"y":0,"w":6,"h":71,"offX":0,"offY":0,"sourceW":6,"sourceH":71},"c6-2_png":{"x":1784,"y":0,"w":3,"h":49,"offX":0,"offY":0,"sourceW":3,"sourceH":49},"star_png":{"x":1789,"y":0,"w":6,"h":6,"offX":0,"offY":0,"sourceW":6,"sourceH":6}},"file":"preload-0sheet_662dedb5.png"} -------------------------------------------------------------------------------- /app/pages/background/resource/packs0/preload-0sheet_662dedb5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/pages/background/resource/packs0/preload-0sheet_662dedb5.png -------------------------------------------------------------------------------- /app/server/RapLogServer.js: -------------------------------------------------------------------------------- 1 | // process.on('message', function(m) { 2 | // console.log(m); 3 | // //打印{ input: 9 } 4 | // process.send({result: m}); 5 | // }); 6 | 7 | 8 | var arguments = process.argv.splice(2); 9 | console.log("arguments", arguments) 10 | process.send(`arguments:${arguments}`) 11 | var host = arguments[0]; 12 | var port = parseInt(arguments[1]); 13 | // port = 8081; 14 | console.log(`host:${host},port:${port}`) 15 | 16 | 17 | 18 | var app = require('http').createServer(serverHandler); 19 | var io = require('socket.io').listen(app); 20 | var url = require("url"); 21 | var net = require("net"); 22 | var fs = require("fs"); 23 | var path = require('path'); 24 | app.listen(port); 25 | function serverHandler(req, res) { 26 | var urlObj = url.parse(req.url); 27 | var pathname = urlObj.pathname; 28 | // console.log('pathName:',pathname) 29 | if (!pathname.indexOf('/favicon.ico')) { 30 | return; 31 | } 32 | switch (pathname) { 33 | case "/": 34 | case "/index.html": 35 | var htmlName = __dirname+'/raplog/raplog.html'; 36 | fs.readFile(htmlName, function (err, data) { 37 | if (!err) { 38 | res.end(data); 39 | } else { 40 | console.log('createServer err:', err) 41 | } 42 | }); 43 | break; 44 | default: 45 | var fullpathname = __dirname+'/raplog' + pathname; 46 | // console.log('fullpathname:', fullpathname) 47 | fs.exists(fullpathname, function (exists) { 48 | var contentType ={} 49 | if (exists) { 50 | switch (path.extname(pathname)) { 51 | case '.js': 52 | contentType = "text/javascript"; 53 | break; 54 | case '.css': 55 | contentType = "text/css"; 56 | break; 57 | } 58 | res.writeHead(200, { "Content-Type": contentType }); 59 | fs.readFile(fullpathname, function (err, data) { 60 | res.end(data); 61 | }); 62 | } else { 63 | console.log(777, '资源不存在')// 64 | res.writeHead(404, { "Content-Type": "text/html" }); 65 | res.end("

404 Not Found

"); 66 | } 67 | // console.log('exists:', exists) 68 | }) 69 | break; 70 | } 71 | } 72 | var socketObj = {}; 73 | var numUser = 0; 74 | io.on('connection', function (socket) { 75 | // socket = _socket; 76 | // console.log('a user connected'); 77 | socket.on('login', function (obj) { 78 | socket.name = obj.userid; 79 | // console.log('login',socket.name) 80 | socketObj[obj.userid] = socket; 81 | numUser += 1; 82 | // socket.emit('login', 'you are login '+numUser); 83 | }) 84 | socket.on('disconnect', function () { 85 | numUser -= 1; 86 | if (socketObj[socket.name]) { 87 | // console.log('have user',socket.name) 88 | delete socketObj[socket.name]; 89 | } 90 | // for (var i in socketObj) { 91 | // console.log('id:', i); 92 | // } 93 | }) 94 | // socket.on('message', function (obj) { 95 | // //收到electron 发来的消息,转发给其他的网页 96 | // io.emit('message', obj); 97 | // }) 98 | process.on('message', function (obj) { 99 | //收到electron 发来的消息,转发给其他的网页 100 | io.emit('message',obj) 101 | }) 102 | }) 103 | // var testIdx = 0; 104 | // setInterval(function () { 105 | // testIdx++; 106 | // io.emit('test1', "okokoko你好"+testIdx); 107 | // },1000) 108 | 109 | console.log(`start http://${host}:${port}`) -------------------------------------------------------------------------------- /app/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "RapLogServer.1.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "socket.io": "^1.4.6" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/server/raplog/raplog.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'xiangsuRegular'; 3 | src: url('xiangsu.ttf'); 4 | src: local('xiangsu Regular'), 5 | local('xiangsu'), 6 | url('xiangsu.ttf') format('truetype'), 7 | } 8 | body{ 9 | font: 14px xiangsuRegular; 10 | word-break: break-all; 11 | } 12 | #topHeader{ 13 | } -------------------------------------------------------------------------------- /app/server/raplog/raplog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Rap Log 7 | 8 | 9 | 10 | 11 | 12 | 31 | 32 | 33 | 34 |
35 |
36 |
37 |
38 | 39 | 40 | 41 | 42 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /app/server/raplog/raplog.js: -------------------------------------------------------------------------------- 1 | var socket = io.connect(window.location.href, { reconnection: true, reconnectionDelay: 1000 }); 2 | var userid = uuid(); 3 | var containerDiv = document.getElementById('container') 4 | var contentDiv = document.getElementById('content'); 5 | var output = '98765
987659876598765987659876598765987659876598765987659876598765987659876598765987659876598765
98765
98765
98765
' + 6 | '98765
98765
98765
98765
98765
' + 7 | '98765
98765
98765
98765
98765
' + 8 | '98765
98765
98765
98765
98765
'; 9 | output =''; 10 | socket.on('connect', function () { 11 | socket.emit('login', { userid: userid }); 12 | output += '
Connect to the RuffHelper
Successful'; 13 | showOutput(); 14 | // contentDiv.dangerouslySetInnerHTML += 15 | // setPosition(); 16 | // console.log('----connection----'); 17 | }); 18 | socket.on('disconnect', function () { 19 | output += '
Disconnect, waiting to reconnect...'; 20 | showOutput(); 21 | // contentDiv.innerHTML += '
Disconnect, waiting to reconnect...'; 22 | // setPosition(); 23 | // console.log('----disconnect----'); 24 | }) 25 | socket.on('reconnect', function () { 26 | output += '
Reconnect'; 27 | showOutput(); 28 | // contentDiv.innerHTML += '
Reconnect'; 29 | // setPosition(); 30 | // console.log('----reconnect----'); 31 | }) 32 | socket.on('login', function (o) { 33 | output += `
login ${o} `; 34 | showOutput(); 35 | // contentDiv.innerHTML += `
login ${o} `; 36 | // // console.log('----login----', o) 37 | // setPosition(); 38 | }); 39 | socket.on('message', function (o) { 40 | if(o.indexOf('
')>-1){ 41 | output += o; 42 | }else{ 43 | output += `
${o}`; 44 | } 45 | 46 | showOutput(); 47 | // contentDiv.innerHTML += `
${o}`; 48 | // setPosition(); 49 | // console.log('----login----', o) 50 | }); 51 | socket.on('test1', function (o) { 52 | output += `
test ${o}`; 53 | showOutput(); 54 | // contentDiv.innerHTML += `
test ${o}`; 55 | // setPosition(); 56 | // console.log('----test----', o) 57 | }); 58 | function showOutput() { 59 | var body = document.body; 60 | contentDiv.innerHTML = output; 61 | // body.scrollTop = body.scrollHeight-100; 62 | containerDiv.scrollTop = containerDiv.scrollHeight-100; 63 | // console.log('containerDiv',containerDiv.scrollTop,containerDiv.scrollHeight) 64 | } 65 | /**定位到最底下 */ 66 | // function setPosition(){ 67 | // // var ex = document.getElementById("rapCommandArea");//定位到最下面一行 68 | // // console.log('setPosition1',contentDiv.scrollTop,contentDiv.scrollHeight) 69 | // containerDiv.scrollTop = containerDiv.scrollHeight; 70 | // console.log('setPosition2', contentDiv.scrollTop, contentDiv.scrollHeight) 71 | // console.log('contentDiv:',contentDiv) 72 | // } 73 | 74 | function uuid() { 75 | var s = []; 76 | var hexDigits = "0123456789abcdef"; 77 | for (var i = 0; i < 36; i++) { 78 | s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); 79 | } 80 | s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 81 | s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 82 | s[8] = s[13] = s[18] = s[23] = "-"; 83 | 84 | var uuid = s.join(""); 85 | return uuid; 86 | } 87 | -------------------------------------------------------------------------------- /app/server/raplog/xiangsu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/app/server/raplog/xiangsu.ttf -------------------------------------------------------------------------------- /app/server/test.js: -------------------------------------------------------------------------------- 1 | var child_process = require("child_process"); 2 | const p = child_process.fork( 3 | 'E:/ZhiHuaSiStudio/2016/RuffHelperGit/app/server/RapLogServer.js', ["10.0.2.164",9254] 4 | ); 5 | p.on('message',m=>{ 6 | console.log('message in child2',m) 7 | }) 8 | p.send('send from parent') -------------------------------------------------------------------------------- /app/server/testing.txt: -------------------------------------------------------------------------------- 1 | node RapLogServer.js 10.0.2.190 9254 -------------------------------------------------------------------------------- /build/electronzip/electron的对应版本zip包放这: -------------------------------------------------------------------------------- 1 | 配置文件地址: /Users/zhangyu/Library/Application Support/RuffHelper/config/ruffhelper.cfg -------------------------------------------------------------------------------- /build/install/darwin/dmg.js: -------------------------------------------------------------------------------- 1 | var appdmg = require('appdmg'); 2 | var path = require('path'); 3 | 4 | module.exports = function (datas,callBack) { 5 | console.log('dmg',datas) 6 | var version = datas.version; 7 | var basepath = path.join(__dirname,'../../'); 8 | var oldAppdir = path.join(basepath, 'prerelease/RuffHelper-darwin-x64/RuffHelper.app'); 9 | var target = path.join(basepath, 'release/RuffHelper-mac-v' + version + '.dmg'); 10 | // console.log('oldAppdir:',oldAppdir); 11 | // console.log('target:',target); 12 | var ee = appdmg({ 13 | target: target, 14 | basepath: basepath, 15 | specification: { 16 | "title": "RuffHelper", 17 | "icon": "install/darwin/media/icon.icns", 18 | "background": path.join(__dirname, "media/background.png"), 19 | "icon-size": 80, 20 | "contents": [ 21 | { "x": 150, "y": 192, "type": "file", "path": oldAppdir }, 22 | { "x": 350, "y": 192, "type": "link", "path": "/Applications" } 23 | ] 24 | } 25 | }); 26 | ee.on('progress', function (info) { 27 | console.log('progress:',info.current + '/' + info.total + ' ' + info.type + ' ' + (info.title || info.status)); 28 | }); 29 | 30 | ee.on('error', function (err) { 31 | console.log('error', err); 32 | // self.emit('error', err); 33 | }); 34 | 35 | ee.on('finish', function () { 36 | console.log('finish'); 37 | if(callBack)callBack(); 38 | }); 39 | } -------------------------------------------------------------------------------- /build/install/darwin/media/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/darwin/media/background.png -------------------------------------------------------------------------------- /build/install/darwin/media/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/darwin/media/icon.icns -------------------------------------------------------------------------------- /build/install/win32/inno.js: -------------------------------------------------------------------------------- 1 | var spawn = require('child_process').spawn; 2 | var path = require('path'); 3 | module.exports = function (datas,callBack) { 4 | var compil = path.resolve(path.join(__dirname, 'inno/ISCC.exe')); 5 | var args = []; 6 | args.push('/DAppVersion='+datas.version); 7 | args.push(path.resolve(path.join(__dirname, 'media/'+datas.platform+'.iss'))); 8 | console.log('inno',args) 9 | var run = spawn(compil,args); 10 | run.stdout.on('data', function (data) { 11 | //console.log(data.toString('utf8').trim()); 12 | }); 13 | run.stderr.on('data', function (data) { 14 | //console.log("error:",data.toString('utf8').trim()); 15 | }); 16 | run.on('close', function (code) { 17 | console.log('close',code) 18 | // return next(null); 19 | if(callBack){ 20 | callBack(); 21 | } 22 | }); 23 | } -------------------------------------------------------------------------------- /build/install/win32/inno/Compil32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Compil32.exe -------------------------------------------------------------------------------- /build/install/win32/inno/Config.ini: -------------------------------------------------------------------------------- 1 | [State] 2 | WindowMaximized=1 3 | -------------------------------------------------------------------------------- /build/install/win32/inno/ISCC.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/ISCC.exe -------------------------------------------------------------------------------- /build/install/win32/inno/ISCmplr.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/ISCmplr.dll -------------------------------------------------------------------------------- /build/install/win32/inno/ISCrypt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/ISCrypt.dll -------------------------------------------------------------------------------- /build/install/win32/inno/ISPP.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/ISPP.chm -------------------------------------------------------------------------------- /build/install/win32/inno/ISPP.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/ISPP.dll -------------------------------------------------------------------------------- /build/install/win32/inno/ISetup.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/ISetup.chm -------------------------------------------------------------------------------- /build/install/win32/inno/IsExtend.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/IsExtend.chm -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/BrazilianPortuguese.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/BrazilianPortuguese.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Catalan.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Catalan.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/ChineseSimplified.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/ChineseSimplified.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/ChineseTrad.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/ChineseTrad.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Corsican.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Corsican.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Czech.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Czech.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Danish.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Danish.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Dutch.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Dutch.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Finnish.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Finnish.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/French.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/French.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/German.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/German.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Greek.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Greek.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Hebrew.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Hebrew.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Hungarian.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Hungarian.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Italian.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Italian.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Japanese.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Japanese.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Norwegian.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Norwegian.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Polish.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Polish.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Portuguese.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Portuguese.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Russian.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Russian.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/ScottishGaelic.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/ScottishGaelic.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/SerbianCyrillic.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/SerbianCyrillic.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/SerbianLatin.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/SerbianLatin.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Slovenian.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Slovenian.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Spanish.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Spanish.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Turkish.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Turkish.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Languages/Ukrainian.isl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Languages/Ukrainian.isl -------------------------------------------------------------------------------- /build/install/win32/inno/Office2007.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Office2007.bmp -------------------------------------------------------------------------------- /build/install/win32/inno/Office2007Gray.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Office2007Gray.bmp -------------------------------------------------------------------------------- /build/install/win32/inno/Setup.e32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/Setup.e32 -------------------------------------------------------------------------------- /build/install/win32/inno/SetupLdr.e32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/SetupLdr.e32 -------------------------------------------------------------------------------- /build/install/win32/inno/WizModernImage-Is.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/WizModernImage-Is.bmp -------------------------------------------------------------------------------- /build/install/win32/inno/WizModernImage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/WizModernImage.bmp -------------------------------------------------------------------------------- /build/install/win32/inno/WizModernSmallImage-Is.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/WizModernSmallImage-Is.bmp -------------------------------------------------------------------------------- /build/install/win32/inno/WizModernSmallImage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/WizModernSmallImage.bmp -------------------------------------------------------------------------------- /build/install/win32/inno/isbunzip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/isbunzip.dll -------------------------------------------------------------------------------- /build/install/win32/inno/isbzip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/isbzip.dll -------------------------------------------------------------------------------- /build/install/win32/inno/islzma.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/islzma.dll -------------------------------------------------------------------------------- /build/install/win32/inno/islzma32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/islzma32.exe -------------------------------------------------------------------------------- /build/install/win32/inno/islzma64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/islzma64.exe -------------------------------------------------------------------------------- /build/install/win32/inno/isscint.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/isscint.dll -------------------------------------------------------------------------------- /build/install/win32/inno/isunzlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/isunzlib.dll -------------------------------------------------------------------------------- /build/install/win32/inno/iszlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/iszlib.dll -------------------------------------------------------------------------------- /build/install/win32/inno/license.txt: -------------------------------------------------------------------------------- 1 | Inno Setup License 2 | ================== 3 | 4 | Except where otherwise noted, all of the documentation and software included 5 | in the Inno Setup package is copyrighted by Jordan Russell. 6 | 7 | Copyright (C) 1997-2016 Jordan Russell. All rights reserved. 8 | Portions Copyright (C) 2000-2016 Martijn Laan. All rights reserved. 9 | 10 | This software is provided "as-is," without any express or implied warranty. 11 | In no event shall the author be held liable for any damages arising from the 12 | use of this software. 13 | 14 | Permission is granted to anyone to use this software for any purpose, 15 | including commercial applications, and to alter and redistribute it, 16 | provided that the following conditions are met: 17 | 18 | 1. All redistributions of source code files must retain all copyright 19 | notices that are currently in place, and this list of conditions without 20 | modification. 21 | 22 | 2. All redistributions in binary form must retain all occurrences of the 23 | above copyright notice and web site addresses that are currently in 24 | place (for example, in the About boxes). 25 | 26 | 3. The origin of this software must not be misrepresented; you must not 27 | claim that you wrote the original software. If you use this software to 28 | distribute a product, an acknowledgment in the product documentation 29 | would be appreciated but is not required. 30 | 31 | 4. Modified versions in source or binary form must be plainly marked as 32 | such, and must not be misrepresented as being the original software. 33 | 34 | 35 | Jordan Russell 36 | jr-2010 AT jrsoftware.org 37 | http://www.jrsoftware.org/ 38 | -------------------------------------------------------------------------------- /build/install/win32/inno/unins000.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/unins000.dat -------------------------------------------------------------------------------- /build/install/win32/inno/unins000.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/unins000.exe -------------------------------------------------------------------------------- /build/install/win32/inno/unins000.msg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/inno/unins000.msg -------------------------------------------------------------------------------- /build/install/win32/media/WizModernImage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/media/WizModernImage.bmp -------------------------------------------------------------------------------- /build/install/win32/media/WizModernSmallImage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/media/WizModernSmallImage.bmp -------------------------------------------------------------------------------- /build/install/win32/media/signtool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/build/install/win32/media/signtool.exe -------------------------------------------------------------------------------- /build/install/win32/media/win32.iss: -------------------------------------------------------------------------------- 1 | ; Script generated by the Inno Setup Script Wizard. 2 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! 3 | 4 | #define MyAppName "RuffHelper" 5 | #define MyAppPublisher "ZhangYu" 6 | #define MyAppExeName "RuffHelper.exe" 7 | #define MyAppSourcePath SourcePath+"..\..\.." 8 | #define MyRootPath SourcePath+"\..\..\..\.." 9 | 10 | [Setup] 11 | ; 注: AppId的值为单独标识该应用程序。 12 | ; 不要为其他安装程序使用相同的AppId值。 13 | ; (生成新的GUID,点击 工具|在IDE中生成GUID。) 14 | AppId={{F8D5CEA0-6DC7-43C2-BB01-4B203FEF6AD7} 15 | AppName={#MyAppName} 16 | AppVersion={#AppVersion} 17 | ;在卸载程序列表里的名字 18 | AppVerName={#MyAppName} ({#AppVersion}) 19 | VersionInfoVersion={#AppVersion} 20 | AppPublisher={#MyAppPublisher} 21 | SourceDir={#MyAppSourcePath} 22 | DefaultDirName={pf}\{#MyAppName} 23 | DisableProgramGroupPage=yes 24 | OutputDir={#MyAppSourcePath}\release 25 | OutputBaseFilename=RuffHelper-win32-v{#AppVersion} 26 | SetupIconFile={#MyRootPath}\app\icon\icon.ico 27 | WizardSmallImageFile={#SourcePath}WizModernSmallImage.bmp 28 | WizardImageFile={#SourcePath}WizModernImage.bmp 29 | Compression=lzma 30 | SolidCompression=yes 31 | 32 | 33 | [Languages] 34 | Name: "english"; MessagesFile: "compiler:Default.isl" 35 | Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" 36 | 37 | [Tasks] 38 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 39 | 40 | [Files] 41 | Source: "prerelease\RuffHelper-win32-ia32\RuffHelper.exe"; DestDir: "{app}"; Flags: ignoreversion 42 | Source: "prerelease\RuffHelper-win32-ia32\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs 43 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 44 | 45 | [Icons] 46 | Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" 47 | Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" 48 | Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon 49 | 50 | [Run] 51 | Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent 52 | 53 | -------------------------------------------------------------------------------- /build/install/win32/media/win64.iss: -------------------------------------------------------------------------------- 1 | ; Script generated by the Inno Setup Script Wizard. 2 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! 3 | 4 | #define MyAppName "RuffHelper" 5 | #define MyAppPublisher "ZhangYu" 6 | #define MyAppExeName "RuffHelper.exe" 7 | #define MyAppSourcePath SourcePath+"..\..\.." 8 | #define MyRootPath SourcePath+"\..\..\..\.." 9 | 10 | [Setup] 11 | ; 注: AppId的值为单独标识该应用程序。 12 | ; 不要为其他安装程序使用相同的AppId值。 13 | ; (生成新的GUID,点击 工具|在IDE中生成GUID。) 14 | AppId={{F8D5CEA0-6DC7-43C2-BB01-4B203FEF6AD7} 15 | AppName={#MyAppName} 16 | AppVersion={#AppVersion} 17 | ;在卸载程序列表里的名字 18 | AppVerName={#MyAppName} ({#AppVersion}) 19 | VersionInfoVersion={#AppVersion} 20 | AppPublisher={#MyAppPublisher} 21 | SourceDir={#MyAppSourcePath} 22 | DefaultDirName={pf}\{#MyAppName} 23 | DisableProgramGroupPage=yes 24 | OutputDir={#MyAppSourcePath}\release 25 | OutputBaseFilename=RuffHelper-win64-v{#AppVersion} 26 | SetupIconFile={#MyRootPath}\app\icon\icon.ico 27 | WizardSmallImageFile={#SourcePath}WizModernSmallImage.bmp 28 | WizardImageFile={#SourcePath}WizModernImage.bmp 29 | Compression=lzma 30 | SolidCompression=yes 31 | ;卸载图标 32 | Uninstallable=yes 33 | 34 | [Languages] 35 | Name: "english"; MessagesFile: "compiler:Default.isl" 36 | Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" 37 | 38 | [Tasks] 39 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 40 | 41 | [Files] 42 | Source: "prerelease\RuffHelper-win32-x64\RuffHelper.exe"; DestDir: "{app}"; Flags: ignoreversion 43 | Source: "prerelease\RuffHelper-win32-x64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs 44 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 45 | 46 | [Icons] 47 | Name: "{group}\Uninstall {#MyAppName}"; Filename: "{uninstallexe}" 48 | Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" 49 | Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon 50 | 51 | [Run] 52 | Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent 53 | 54 | -------------------------------------------------------------------------------- /build/prerelease/预发布文件夹: -------------------------------------------------------------------------------- 1 | 配置文件地址: /Users/zhangyu/Library/Application Support/RuffHelper/config/ruffhelper.cfg -------------------------------------------------------------------------------- /build/release/发布版本文件夹: -------------------------------------------------------------------------------- 1 | 配置文件地址: /Users/zhangyu/Library/Application Support/RuffHelper/config/ruffhelper.cfg -------------------------------------------------------------------------------- /doc/ReleaseNotes.MD: -------------------------------------------------------------------------------- 1 | ####v1.x.x 2 | 未发布 3 | 4 | 1. 重新制作了一套科技感的界面 5 | 2. 重构所有代码 6 | 3. 界面中增加大量动态效果 7 | 4. rap1.7以后某些命令增加了特殊功能,无法用node子进程监听。 8 | 已知有问题的命令有rap deploy 和 rap systemupgrade 9 | 10 | 11 | ####v1.5.0 12 | 2016.10.5 发布 13 | 14 | 1. 主要为适配rap 1.5。因为有了sdk安装包,移除了手动选择sdk包的相关功能。 15 | 2. 版本号与rap sdk 保持一致。 16 | 3. electron-packager的打包API发生变化,同步修改 17 | 18 | ![preview](./version/v1.5.0.png) 19 | 20 | 21 | 22 | ####v0.5.0 23 | 2016.7.13 发布 24 | 25 | 1. 界面调整,把 rap log 部分和 rap command 分开了 26 | 2. rap log 区域增加清除日志的功能 27 | 3. rap log 区域增加保存日志的功能 28 | 4. rap log 区域增加二维码功能,可以在手机上查看日志 29 | 30 | ![preview](./version/v0.5.0.png) 31 | 32 | ####v0.4.0 33 | 2016.5.27 发布 34 | 35 | 这个版本的 rap 命令很完善了,基本可以替代命令行。 36 | 支持最新的 ruff sdk 1.1.0。老版本的 ruff sdk 不确定能正否常使用。 37 | 38 | 1. 子进程调用方式改为 spawn ,让 rap log 更稳定 39 | 2. 增加 rap device add 添加设备的命令 40 | 3. 增加 rap device remove 移除设备的命令 41 | 4. 增加 rap device update 更新设备的命令 42 | 5. 大量细节优化,详情请看doc/工作日志.txt 43 | 44 | ![preview](./version/v0.4.0.png) 45 | 46 | ####v0.3.0 47 | 2016.5.2 发布 48 | 49 | 1. 打通了rap scan、rap wifi、固件更新等复杂交互的功能。 50 | 2. 鼠标移到rap 命令上会有相应的提示 51 | 3. 增加拷贝黏贴等快捷操作 52 | 4. 因为我只有一块板子,没测试过 rap scan 多块开发板时是否能正常使用 53 | 54 | ![preview](./version/v0.3.0.png) 55 | 56 | ####v0.2.0 57 | 2016.4.23 发布 58 | 59 | 功能基本没变化。主要完成了自动化构建exe和dmg安装包的功能 60 | 61 | 62 | ####v0.1.0 63 | 2016.4.15 发布 64 | 65 | 主要架构搭建完成。 66 | 67 | 实现功能有: 68 | 69 | 1. 创建 Ruff 项目 70 | 2. 选择 Ruff SDK 71 | 3. rap deploy -s 72 | 4. rap version 73 | 5. rap log 74 | -------------------------------------------------------------------------------- /doc/RuffLink.MD: -------------------------------------------------------------------------------- 1 | [Ruff 开发板网络连接的几种模式](https://ruff.io/zh-cn/docs/ruff_network_modes.html) -------------------------------------------------------------------------------- /doc/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/doc/pic.png -------------------------------------------------------------------------------- /doc/publish.MD: -------------------------------------------------------------------------------- 1 | ##发布流程 2 | 3 | 1. 修改 app/package.json 里的版本号 4 | 2. config.js 里要设置为发布版本 5 | 3. npm run deploy 发布最终版 6 | 4. http-server 启动本地服务器,使用electron本地镜像,避免翻墙。zip包要预先放到这个路径下:/RuffHelper/build/electronzip/0.37.6/electron-v0.37.6-win32-ia32.zip 7 | 5. 淘宝镜像地址 8 | https://npm.taobao.org/mirrors/electron 9 | 6. 把 build/prelease 和 release 文件夹里的内容全部删除 10 | 7. gulp 在win和mac平台各执行一次,所有的安装包全部自动生成。 11 | win 平台生成win32和win64位的 12 | mac 平台成成mac和linux的 13 | 14 | ##打包的注意事项 15 | 需要全局安装的包 16 | 17 | ``` 18 | npm install asar -g 19 | npm install gulp -g 20 | npm install http-server -g 21 | npm install electron-packager -g 22 | ``` 23 | 24 | 注意 app 文件夹内一定不能有中文名的文件 25 | 26 | ``` 27 | tree-kill 包内 killPid 方法 28 | process 要改为 window.process 29 | ``` 30 | 31 | mac 图标的后缀为 icns 32 | 33 | win 图标的后缀为 ico 34 | 35 | asar 打包的 app 文件夹内必须有个package.json文件,表明启动文件--"main": "index.js" 36 | 37 | 38 | -------------------------------------------------------------------------------- /doc/version/v0.3.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/doc/version/v0.3.0.png -------------------------------------------------------------------------------- /doc/version/v0.4.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/doc/version/v0.4.0.png -------------------------------------------------------------------------------- /doc/version/v0.5.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/doc/version/v0.5.0.png -------------------------------------------------------------------------------- /doc/version/v1.5.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/doc/version/v1.5.0.png -------------------------------------------------------------------------------- /doc/发布流程说明.txt: -------------------------------------------------------------------------------- 1 | //--------------最新版流程------- 2 | 0. 修改 app/package.json 里的版本号 3 | 1. config.js 里要设置为发布版本 4 | 2. npm run deploy 发布最终版 5 | 3. http-server 启动本地服务器,使用electron本地镜像,避免翻墙 6 | 4. npm run packageXXX 发布对应的版本(packagemac,packagewin64) 7 | 8 | //electron 打包的注意事项 9 | 需要全局安装的包 10 | npm install asar -g 11 | npm install gulp -g 12 | npm install http-server -g 13 | 14 | mac 图标的后缀为 icns 15 | win 图标的后缀为 ico 16 | asar 打包的 app 文件夹内必须有个package.json文件,表明启动文件"main": "index.js" 17 | 注意 app 文件夹内一定不能有中文名 18 | 19 | npm run asar 发布 app.asar 可以单独替换 asar 文件,打包出来的文件名一定要是 app.asar。放在应用的 resource 文件夹内,替换原来的 20 | win 打包的 inno ,是以 iss 代码位置为相对路径的起点的 21 | 22 | 淘宝镜像地址 23 | https://npm.taobao.org/mirrors/electron 24 | //---------------老的流程------ 25 | 0. 修改 app/package.json 里的版本号 26 | 1. config.js 里要设置为发布版本 27 | 2. npm run deploy 发布最终版 28 | 3. npm run asar 发布 app.asar 29 | 3. serve 启动本地服务器 30 | 4. npm run packageXXX 发布对应的版本 31 | 5. 把 app.asar 拷贝到对应的文件夹内,比如 RuffHelper-win32-x64\resources,同时删除原有的 app 文件夹 32 | -------------------------------------------------------------------------------- /doc/工作日志.txt: -------------------------------------------------------------------------------- 1 | //todo 2 | 手机上清除log,开/关自动滚动(pc,手机) 3 | 手机log页面,命令行样式 4 | mac上release版需要用户多次确认网络请求 5 | autoCmdLog、autoRapLog要保存到配置文件里 6 | 测试log区域是否能自动滚屏 7 | 切换到log区域,自动打开log调试功能 8 | 保存自动滚屏的开关状态 9 | 保存日志—保存上次选定的路径,判断一下是否存在 10 | rap install 11 | icon.png的位置? 12 | mainWindow = new BrowserWindow({icon:'./assets/images/icon.png',width: 730, height: 530, 13 | --------------------------------- 14 | 2017年2月6日 周一 15 | 增加保存log信息的面板 16 | 17 | 2017年1月29日 周日 18 | 增加右上方的的命令按钮和提示文字 19 | 20 | 2017年1月28日 周六 21 | 合并fileUtil和File两个文件,优化右侧log信息样式 22 | 23 | 2017年1月27日 周五 24 | 增加按钮组件,优化样式 25 | 26 | 2017年1月26日 周四 27 | 移除了antd的样式 28 | 29 | 2017年01月25日 星期三 30 | 增加版本号的验证 31 | 32 | 2017年01月21日 星期六 33 | 移除router,重新整合loading和Mainshell 34 | 增加新建项目的动画 35 | 36 | 2017年1月20日 周五 37 | 增加命令行结束的监听 38 | 39 | 2017年01月16日 星期一 40 | 增加打开历史的循环动画 41 | 42 | 2017年01月14日 星期六 43 | 增加左侧新建项目的输入框 44 | 把输入框和文件夹选择器单独提UI组件 45 | 46 | 2017年01月13日 星期五 47 | 选择ruff项目,如果文件名过长,需要截掉一段 48 | 隐藏了左侧的滚动条 49 | 50 | 2017年01月11日 星期三 51 | 增加移除历史记录和选择历史记录的功能 52 | 53 | 2017年01月11日 星期三 54 | 增加选中历史项目的效果 55 | 56 | 2017年01月10日 星期二 57 | 增加打开项目的动画和相关逻辑 58 | 59 | 2017年01月08日 星期日 60 | 增加了右侧显示区域的动态文字出现效果 61 | 62 | 2016年10月03日 星期一 63 | 移除选择 ruff sdk 的相关功能,因为有了安装包,不需要设定路径了 64 | rap init 创建项目中的 project name 改为 app name 65 | 适配 1.5 的项目结构 66 | 67 | 2016年7月27日 星期三 68 | 增加切换自动滚屏的开关 69 | 70 | 2016年7月12日 星期二 71 | child_process.spawn 方法在mac的release版本里不能用, 72 | 需要改成 child_process.fork(url, [this.props.ip, this.props.port]); 73 | 74 | 2016年7月5日 星期二 75 | 修复正式版进入后不能自动定位到tabbar的问题 76 | 升级antd的版本 77 | 78 | 2016年7月4日 星期一 79 | 解决发布版无法调用asar包里内容的问题 80 | 81 | 2016年07月03日 星期日 82 | 调试正式版的参数 83 | 84 | 2016年07月02日 星期六 85 | 把测试功能添加到正式界面中 86 | 87 | 2016年7月1日 星期五 88 | 保存日志到本地 89 | 90 | 2016年06月30日 星期四 91 | 把rap log数据传给二维码服务器 92 | 93 | 2016年06月28日 星期二 94 | 完善二维码组件 95 | 96 | 2016年06月27日 星期一 97 | 增加像素字,增加二维码组件 98 | 99 | 2016年06月26日 星期日 100 | 增加停止显示调试日志和清除调试日志内容的功能 101 | 102 | 2016年06月25日 星期六 103 | 修复bug: rap log 引起的rap command显示区域的重复定位 104 | 105 | 2016年6月15日 星期三 106 | 添加 react-hot-loader 热替换功能 107 | 108 | 2016年06月14日 星期二 109 | 完善 raplog 服务器,使用 socket.io 通讯 110 | 完善 扩展按钮 111 | 112 | 2016年6月13日 星期一 113 | 更新 electron、react 和各种依赖库到最新版本 114 | 重构界面 115 | 116 | 2016年05月31日 星期二 117 | 只保留一个 rap log 的进程,重复的会杀掉 118 | 自动换行功能 119 | 120 | 2016年5月27日 星期五 121 | 把 antd 的字体文件拿到本地,修改对应的 css 122 | 发布0.4.0 123 | 124 | 2016年5月26日 星期四 125 | 前段时间用 ruff 做了个打鼓机,基本弄好了,继续完善 ruffHelper 126 | 把子进程的 exec 方法替换为 spawn 方法,这样不限制 buffer 大小,可以长期显示 log 127 | 更新 andt 为最新版本 128 | 限制项目名称只能是小写的英文字母 129 | 给按钮增加手型 130 | 解决 ruff 项目右侧删除叉子的错位问题 131 | 使用通用规则根据 ? 来判断弹出面板的类型,不再单独匹配 132 | 增加 rap device add 添加设备的命令 133 | 增加 rap device remove 移除设备的命令 134 | 增加 rap device update 更新设备的命令 135 | 136 | 2016年05月02日 星期一 137 | 打通 固件更新 rap wifi 的全部流程 138 | 139 | 2016年05月01日 星期日 140 | mac增加菜单,可以拷贝黏贴内容 141 | 开始制作固件更新功能 142 | 143 | 2016年04月29日 星期五 144 | 打通 rap scan 的全部流程。多块开发版没测试过,理论上是可行的... 145 | 146 | 2016年04月28日 星期四 147 | 优化命令模块 148 | 149 | 2016年04月28日 星期四 150 | 重构命令模块 151 | 152 | 2016年4月26日 星期二 153 | 增加更多的命令。手机划过命令,增加提示信息 154 | 修改删除历史记录后不能再打开的bug 155 | 156 | 2016年04月25日 星期一 157 | 重构弹窗系统 158 | 159 | 2016年04月20日 星期三 160 | 自动化构建安装程序-windows 161 | 优化弹出面板的逻辑 162 | 163 | 2016年4月19日 星期二 164 | 优化自动打包配置 165 | 修改平台的判断方法, 不再使用 ua 判断 166 | 把保存的配置文件不放在应用文件夹内,改为全局存储 167 | 获取版本号放在 loading 的时候,进入应用以后就可以直接显示了 168 | 打开的项目右侧增加删除的小叉子,点以后移除该条记录,打开的历史记录增加到20条 169 | 打开项目的文件夹名过长的时候做截取处理 170 | 171 | 2016年4月15日 星期五 172 | win 和 mac 的配置文件位置不同,mac因为权限的问题暂时放在项目文件下 173 | 打开应用默认选择第一个项目 174 | 增加打开当前项目文件夹的按钮 175 | 176 | 2016年4月14日 星期四 177 | 优化 sdk 选择的逻辑 178 | 修改了win的配置文件储存位置 179 | 初始化重新读取打开项目的文件名 180 | 181 | 2016年4月13日 星期三 182 | 把判断 rap sdk 存在的方法单独提出来 183 | 184 | 2016年4月12日 星期二 185 | win下 SDK 可能包含2层目录,自动识别 186 | 增加进入应用的 sdk 选择界面 187 | 188 | 2016年04月11日 星期一 189 | 增加 Ruff SDK 路径存储功能 190 | 完善 sdk 选择版本的功能 191 | 192 | 2016年04月09日 星期六 193 | 优化loading效果 194 | 195 | 2016年04月08日 星期五 196 | 基本完成,成功部署设备+显示log 197 | 增加loading界面的动画 198 | 199 | 2016年04月06日 星期三 200 | 打开历史里不存在的项目自动移除 201 | 202 | 2016年04月05日 星期二 203 | 自动创建配置文件夹 204 | 配置文件记录打开历史 205 | 增加打开文件的历史记录,最多10条 206 | 207 | 2016年04月04日 星期一 208 | 创建项目功能 209 | 210 | 2016年04月03日 星期日 211 | 调整界面,修改滚动条样式 212 | 修改右侧命令行区域的样式 213 | 路径和版本号校验功能 -------------------------------------------------------------------------------- /doc/说明.txt: -------------------------------------------------------------------------------- 1 | antd -- react ui 2 | http://ant.design/components/collapse/ 3 | 淘宝镜像 4 | https://npm.taobao.org/mirrors/electron/ 5 | 6 | 配置环境变量 7 | /private/etc/bashrc 8 | export RUFF_HOME=/Volumes/D/apps/ruff-sdk-mac-0.8.0 9 | export PATH=$PATH:$RUFF_HOME/bin 10 | 11 | 矢量图标 12 | http://www.iconfont.cn 13 | 字号大小 12 14 | 15 | electron-packager platform参数有 --all:全部;或者 --platform=darwin 、linux、mas、win32 16 | 17 | 18 | 然后在 electron-packager/index.js 第104行增加 mirror 的属性 19 | version: opts.version, 20 | cache: opts.cache, 21 | mirror: opts.mirror, 22 | 23 | 打包教程 24 | http://www.open-open.com/lib/view/open1451121270448.html 25 | https://www.sdk.cn/news/732 26 | 27 | 28 | win icon 16*16、32*32、48*48和256*256 29 | 30 | 31 | Mac 32 | 配置文件经常保存在/Library/Preferences/com.xxxxxxx.plist和/Library/Application Support/xxxxxx,还有/User/user name/Library/Application Support里面(xxxxx表示要卸载的程序名称) 33 | 不过不一定都在这里面,所以建议用卸载软件能自动找比较方便 34 | 35 | /usr/local/share/vim/vimrc 全局配置文件 36 | 还可以参考sublime插件的位置 37 | 38 | 配置文件相对路径的问题,参考这个文章 39 | http://www.css88.com/archives/4497 40 | -------------------------------------------------------------------------------- /doc/遇到的一些问题.MD: -------------------------------------------------------------------------------- 1 | ###2017年2月10日 周五 2 | rap 1.7以后使用了clearLine()方法,用于美化输出的信息 3 | 但是node子进程不是TTY数据流,没有这个方法,会报错。 4 | 暂时没有发现方法能解决 5 | 6 | ###2016年10月04日 星期二 v1.5.0 7 | 8 | child_process.spawn 方法在mac的release版本里不能用,报错信息 Uncaught Error: spawn rap ENOENT 9 | 10 | 最后发现,在mac系统下的electron里,spawn('rap',['--v'])这样是无效的, 11 | 第一个参数要写绝对路径 spawn('/usr/local/bin/rap',['--v']) 12 | 13 | childProcess.on('error',fuc(err){如果路径不存在,在此获取错误信息}) 14 | 15 | ###2016年7月13日 星期三 v0.5.0 16 | 17 | child_process.spawn 方法在mac的release版本里不能用, 18 | 需要改成 child_process.fork(url, [this.props.ip, this.props.port]); 19 | 20 | ###2016年7月4日 星期一 V0.5.0 21 | 22 | 使用子进程调用 js 代码,asar 包里的调不到里面的内容。 23 | 24 | child_process.spawn("node", [url]); 25 | 26 | 解决方法:把子进程里用到的内容不打到asar包里 27 | --asar-unpack-dir=server 28 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var spawn = require('child_process').spawn; 3 | var cp_exec = require('child_process').exec; 4 | var path = require('path'); 5 | var fs = require('fs'); 6 | var inno = require('./build/install/win32/inno'); 7 | var datas = {platform: '', version: ''} 8 | var preleasePath = './build/prerelease/'; 9 | var npmCmd={} 10 | gulp.task("default", ["getVersion","getPackageCmd","win","mac","linux"], function () { 11 | }); 12 | gulp.task("win", ['getVersion',"getPackageCmd"], function () { 13 | if (process.platform == "win32") { 14 | publishWin("win32", function () { 15 | publishWin('win64') 16 | }) 17 | } 18 | }); 19 | gulp.task("mac", ['getVersion',"getPackageCmd"], function () { 20 | if (process.platform == "win32") { 21 | return null; 22 | } 23 | var cmd = 'npm run packagemac'; 24 | commands(cmd,function () { 25 | var dmg = require('./build/install/darwin/dmg'); 26 | dmg(datas,null); 27 | }) 28 | }); 29 | 30 | gulp.task("linux", ['getVersion',"getPackageCmd"], function () { 31 | if (process.platform == "win32") { 32 | return null; 33 | } 34 | var srcPath = preleasePath+'RuffHelper-linux-x64-v'+datas.version+'/*'; 35 | var cmd = 'npm run packagelinux'; 36 | commands(cmd,function () { 37 | var srcPath = './build/prerelease/RuffHelper-linux-x64/*'; 38 | var zipName = 'RuffHelper-linux-v'+datas.version+'.zip'; 39 | var zipPath = './build/release'; 40 | console.log('srcPath:',srcPath); 41 | console.log('zipName:',zipName); 42 | console.log('zipPath:',zipPath); 43 | const zip = require('gulp-zip'); 44 | return gulp.src(srcPath) 45 | .pipe(zip(zipName)) 46 | .pipe(gulp.dest(zipPath)); 47 | }) 48 | }) 49 | 50 | function publishWin(platform, next) { 51 | datas.platform = platform; 52 | //var compil = path.resolve(path.join(__dirname, 'inno/ISCC.exe')); 53 | //console.log('compil',compil) 54 | //console.log('publishWin.platform',datas.platform); 55 | var cmd1 = npmCmd['package'+platform]; 56 | //commands(cmd1,inno(datas,next)) 57 | commands(cmd1,function(){ 58 | inno(datas,next) 59 | }) 60 | //if(next)next(); 61 | } 62 | gulp.task("getVersion", function () { 63 | //读取版本号 64 | var jsonPath = path.join(__dirname, '/app/package.json'); 65 | var jsonStr = fs.readFileSync(jsonPath, "utf-8"); 66 | var obj = JSON.parse(jsonStr); 67 | datas.version = obj.version; 68 | console.log('getVersion:', datas.version) 69 | }); 70 | gulp.task("getPackageCmd", function () { 71 | //读取package里的npm 命令 72 | console.log('getPackageCmd') 73 | var jsonPath = path.join(__dirname, '/package.json'); 74 | var jsonStr = fs.readFileSync(jsonPath, "utf-8"); 75 | var obj = JSON.parse(jsonStr); 76 | npmCmd = obj.scripts; 77 | //console.log("getPackageCmd",npmCmd) 78 | }); 79 | function commands(command, callBack) { 80 | console.log('command:', command) 81 | //console.log('arg:', args) 82 | console.log('cwd:',process.cwd()) 83 | var run = cp_exec(command); 84 | run.stdout.on('data', function (data) { 85 | console.log(data.toString('utf8').trim()); 86 | }); 87 | run.stderr.on('data', function (data) { 88 | console.log("error:", data.toString('utf8').trim()); 89 | }); 90 | run.on('close', function (code) { 91 | console.log('close', code) 92 | // return next(null); 93 | if (callBack) { 94 | callBack(); 95 | } 96 | }); 97 | } -------------------------------------------------------------------------------- /npm-debug.log: -------------------------------------------------------------------------------- 1 | 0 info it worked if it ends with ok 2 | 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ] 3 | 2 info using npm@3.10.8 4 | 3 info using node@v6.9.1 5 | 4 verbose run-script [ 'predev', 'dev', 'postdev' ] 6 | 5 info lifecycle ruffhelper@0.0.0~predev: ruffhelper@0.0.0 7 | 6 silly lifecycle ruffhelper@0.0.0~predev: no script for predev, continuing 8 | 7 info lifecycle ruffhelper@0.0.0~dev: ruffhelper@0.0.0 9 | 8 verbose lifecycle ruffhelper@0.0.0~dev: unsafe-perm in lifecycle true 10 | 9 verbose lifecycle ruffhelper@0.0.0~dev: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/zhangyu/zhihuasi/2016/ruffhelper/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 11 | 10 verbose lifecycle ruffhelper@0.0.0~dev: CWD: /Users/zhangyu/zhihuasi/2016/ruffhelper 12 | 11 silly lifecycle ruffhelper@0.0.0~dev: Args: [ '-c', 13 | 11 silly lifecycle 'webpack-dev-server --config script/webpack.config.js --hot --devtool eval --progress --colors --hot --content-base app' ] 14 | 12 silly lifecycle ruffhelper@0.0.0~dev: Returned: code: 1 signal: null 15 | 13 info lifecycle ruffhelper@0.0.0~dev: Failed to exec dev script 16 | 14 verbose stack Error: ruffhelper@0.0.0 dev: `webpack-dev-server --config script/webpack.config.js --hot --devtool eval --progress --colors --hot --content-base app` 17 | 14 verbose stack Exit status 1 18 | 14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) 19 | 14 verbose stack at emitTwo (events.js:106:13) 20 | 14 verbose stack at EventEmitter.emit (events.js:191:7) 21 | 14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 22 | 14 verbose stack at emitTwo (events.js:106:13) 23 | 14 verbose stack at ChildProcess.emit (events.js:191:7) 24 | 14 verbose stack at maybeClose (internal/child_process.js:877:16) 25 | 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 26 | 15 verbose pkgid ruffhelper@0.0.0 27 | 16 verbose cwd /Users/zhangyu/zhihuasi/2016/ruffhelper 28 | 17 error Darwin 16.4.0 29 | 18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev" 30 | 19 error node v6.9.1 31 | 20 error npm v3.10.8 32 | 21 error code ELIFECYCLE 33 | 22 error ruffhelper@0.0.0 dev: `webpack-dev-server --config script/webpack.config.js --hot --devtool eval --progress --colors --hot --content-base app` 34 | 22 error Exit status 1 35 | 23 error Failed at the ruffhelper@0.0.0 dev script 'webpack-dev-server --config script/webpack.config.js --hot --devtool eval --progress --colors --hot --content-base app'. 36 | 23 error Make sure you have the latest version of node.js and npm installed. 37 | 23 error If you do, this is most likely a problem with the ruffhelper package, 38 | 23 error not with npm itself. 39 | 23 error Tell the author that this fails on your system: 40 | 23 error webpack-dev-server --config script/webpack.config.js --hot --devtool eval --progress --colors --hot --content-base app 41 | 23 error You can get information on how to open an issue for this project with: 42 | 23 error npm bugs ruffhelper 43 | 23 error Or if that isn't available, you can get their info via: 44 | 23 error npm owner ls ruffhelper 45 | 23 error There is likely additional logging output above. 46 | 24 verbose exit [ 1, true ] 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ruffhelper", 3 | "version": "0.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "webpack-dev-server --config script/webpack.config.js --hot --devtool eval --progress --colors --hot --content-base app", 8 | "deploy": "webpack --config script/webpack.production.config.js && node script/remove-use-strict.js", 9 | "packagewin64": "electron-packager ./app/ RuffHelper --platform=win32 --arch=x64 --out=build/prerelease --download.mirror=http://127.0.0.1:8080/build/electronzip/ --asar.unpackDir=server --version=1.4.2 --overwrite --icon=./app/icon/icon.ico", 10 | "packagewin32": "electron-packager ./app/ RuffHelper --platform=win32 --arch=ia32 --out=build/prerelease --download.mirror=http://127.0.0.1:8080/build/electronzip/ --asar.unpackDir=server --version=1.4.2 --overwrite --icon=./app/icon/icon.ico", 11 | "packagetest": "electron-packager ./app/ RuffHelper --platform=win32 --arch=ia32 --out=build/prerelease --download.mirror=http://127.0.0.1:8080/build/electronzip/ --version=1.4.2 --overwrite --icon=./app/icon/icon.ico", 12 | "packagemac": "electron-packager ./app/ RuffHelper --platform=darwin --arch=x64 --out=build/prerelease --download.mirror=http://127.0.0.1:8080/build/electronzip/ --asar.unpackDir=server --version=1.4.2 --overwrite --icon=./app/icon/icon.icns", 13 | "packagelinux": "electron-packager ./app/ RuffHelper --platform=linux --arch=x64 --out=build/prerelease --download.mirror=http://127.0.0.1:8080/build/electronzip/ --asar.unpackDir=server --version=1.4.2 --overwrite --icon=./app/icon/icon.icns", 14 | "gulp": "gulp", 15 | "asar": "asar pack app app.asar", 16 | "start": "electron ." 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "https://git.coding.net/coolgods/RuffHelper.git" 21 | }, 22 | "author": "ZhangYu coolgods@sina.com", 23 | "license": "ISC", 24 | "dependencies": { 25 | "antd": "^1.6.3", 26 | "babel-core": "^6.9.1", 27 | "babel-loader": "^6.2.4", 28 | "babel-preset-es2015": "^6.9.0", 29 | "babel-preset-react": "^6.5.0", 30 | "babel-preset-stage-0": "^6.5.0", 31 | "css-loader": "^0.23.1", 32 | "electron-hot-loader": "^0.8.0", 33 | "event-stream": "^3.3.2", 34 | "gulp": "^3.9.1", 35 | "gulp-zip": "^3.2.0", 36 | "iconv-lite": "^0.4.13", 37 | "immutable": "^3.7.6", 38 | "json-loader": "^0.5.4", 39 | "qrcode.react": "^0.6.1", 40 | "react": "^15.4.2", 41 | "react-dom": "^15.4.2", 42 | "react-hot-loader": "^1.3.0", 43 | "react-redux": "^4.4.5", 44 | "react-router": "^2.4.1", 45 | "redux": "^3.3.1", 46 | "socket.io-client": "^1.4.6", 47 | "style-loader": "^0.13.0", 48 | "tree-kill": "^1.1.0", 49 | "validate-version": "^1.0.2", 50 | "webpack": "^1.13.1", 51 | "webpack-dev-server": "^1.14.1" 52 | }, 53 | "devDependencies": { 54 | "appdmg": "^0.3.7", 55 | "electron-packager": "^8.1.0" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /pages/background/.wing/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Wing 内置播放器调试", 6 | "type": "chrome", 7 | "request": "launch", 8 | "file": "index.html", 9 | //"url": "http://mysite.com/index.html", //使用外部服务器时,请注释掉 file, 改用 url, 并将 useBuildInServer 设置为 false 10 | "runtimeExecutable": "${execPath}", 11 | "sourceMaps": true, 12 | "webRoot": "${workspaceRoot}", 13 | "preLaunchTask":"build", 14 | "port":5800 15 | }, 16 | { 17 | "name": "使用本机 Chrome 调试", 18 | "type": "chrome", 19 | "request": "launch", 20 | "file": "index.html", 21 | //"url": "http://mysite.com/index.html", //使用外部服务器时,请注释掉 file, 改用 url, 并将 useBuildInServer 设置为 false 22 | "runtimeExecutable": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", // 改成您的 Chrome 安装路径 23 | "sourceMaps": true, 24 | "webRoot": "${workspaceRoot}", 25 | "preLaunchTask":"build", 26 | "userDataDir":"${tmpdir}", 27 | "port":5800 28 | }, 29 | { 30 | "name": "附加到 Chrome 进程", 31 | "type": "chrome", 32 | "request": "attach", 33 | "port": 9222, 34 | "webRoot": "${workspaceRoot}" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /pages/background/.wing/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "command": "egret", 4 | "isShellCommand": true, 5 | "tasks": [ 6 | { 7 | "taskName": "build", 8 | "showOutput": "always", 9 | "args": [ 10 | "build", 11 | "-sourcemap" 12 | ], 13 | "problemMatcher": "$tsc" 14 | }, 15 | { 16 | "taskName": "clean", 17 | "showOutput": "always", 18 | "args": [ 19 | "build", 20 | "-e" 21 | ], 22 | "problemMatcher": "$tsc" 23 | }, 24 | { 25 | "taskName": "publish", 26 | "showOutput": "always", 27 | "args": [ 28 | "publish" 29 | ], 30 | "problemMatcher": "$tsc" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /pages/background/bin-debug/Star.js: -------------------------------------------------------------------------------- 1 | var Star = (function (_super) { 2 | __extends(Star, _super); 3 | function Star(id, time) { 4 | _super.call(this); 5 | this.id = 0; 6 | this.radius = 200; 7 | this.id = id; 8 | this.time = time; 9 | var bmp = new egret.Bitmap(RES.getRes("star_png")); 10 | bmp.anchorOffsetX = 3; 11 | bmp.anchorOffsetY = 3; 12 | this.bmp = bmp; 13 | this.addChild(bmp); 14 | var alpha = id * 6.28 / 60; 15 | bmp.x = this.radius * Math.cos(alpha); 16 | bmp.y = this.radius * Math.sin(alpha); 17 | } 18 | var d = __define,c=Star,p=c.prototype; 19 | p.onMove = function (time) { 20 | var angle = this.getAngle(time); 21 | this.bmp.x = this.radius * Math.cos(angle); 22 | this.bmp.y = this.radius * Math.sin(angle); 23 | }; 24 | p.getAngle = function (timeNow) { 25 | var dt = timeNow - this.time; 26 | if (Math.floor(dt / 5000) % 2 == 0) { 27 | this.radius = 200 + dt % 5000 * 0.006; 28 | } 29 | else { 30 | //最大值为 5000*间隔值+200 31 | this.radius = 230 - dt % 5000 * 0.006; 32 | } 33 | var angle = (this.id * 360 / 60 + dt * 0.004) * 6.28 / 360; 34 | return angle; 35 | }; 36 | return Star; 37 | }(egret.DisplayObjectContainer)); 38 | egret.registerClass(Star,'Star'); 39 | -------------------------------------------------------------------------------- /pages/background/egretProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "native": { 3 | "path_ignore": [] 4 | }, 5 | "publish": { 6 | "web": 0, 7 | "native": 1, 8 | "path": "bin-release" 9 | }, 10 | "egret_version": "3.2.3", 11 | "modules": [ 12 | { 13 | "name": "egret" 14 | }, 15 | { 16 | "name": "game" 17 | }, 18 | { 19 | "name": "tween" 20 | }, 21 | { 22 | "name": "res" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /pages/background/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Egret 6 | 7 | 8 | 9 | 10 | 11 | 12 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
56 |
57 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /pages/background/libs/modules/game/game.native.min.js: -------------------------------------------------------------------------------- 1 | var egret;!function(e){var t;!function(t){var n=function(t){function n(){t.call(this),this.urlData={}}__extends(n,t);var r=(__define,n),a=r.prototype;return a.proceed=function(t){var n=this;if(t.dataFormat==e.URLLoaderDataFormat.TEXTURE)return void n.loadTexture(t);if(t.dataFormat==e.URLLoaderDataFormat.SOUND)return void n.loadSound(t);var r=t._request,a=n.getVirtualUrl(e.$getUrl(r)),o=new e.HttpRequest;o.open(a,r.method==e.URLRequestMethod.POST?e.HttpMethod.POST:e.HttpMethod.GET);for(var i=r.requestHeaders.length,E=0;i>E;E++){var s=r.requestHeaders[E];o.setRequestHeader(s.name,s.value)}o.addEventListener(e.Event.COMPLETE,function(){t.data=o.response,e.Event.dispatchEvent(t,e.Event.COMPLETE)},this),o.addEventListener(e.IOErrorEvent.IO_ERROR,function(){e.IOErrorEvent.dispatchIOErrorEvent(t)},this),o.responseType=t.dataFormat==e.URLLoaderDataFormat.BINARY?e.HttpResponseType.ARRAY_BUFFER:e.HttpResponseType.TEXT,o.send(r.data)},a.loadSound=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o(),t.data=s;var r=function(){t.dispatchEventWith(e.Event.COMPLETE)};__global.setTimeout?__global.setTimeout(r,0):e.$callAsync(r,i)}function o(){s.removeEventListener(e.Event.COMPLETE,a,i),s.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),s.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,E=this.getVirtualUrl(t._request.url),s=new e.Sound;s.addEventListener(e.Event.COMPLETE,a,i),s.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),s.addEventListener(e.ProgressEvent.PROGRESS,n,i),s.load(E)},a.loadTexture=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o();var r=v.data,a=new e.Texture;a._setBitmapData(r),t.data=a;var E=function(){t.dispatchEventWith(e.Event.COMPLETE)};__global.setTimeout?__global.setTimeout(E,0):e.$callAsync(E,i)}function o(){v.removeEventListener(e.Event.COMPLETE,a,i),v.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),v.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,E=t._request,s=i.getVirtualUrl(E.url),v=new e.ImageLoader;v.addEventListener(e.Event.COMPLETE,a,i),v.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),v.addEventListener(e.ProgressEvent.PROGRESS,n,i),v.load(s)},a.isNetUrl=function(e){return-1!=e.indexOf("http://")||-1!=e.indexOf("HTTP://")},a.getVirtualUrl=function(e){return e},n.getNetContext=function(){return null==n._instance&&(n._instance=new n),n._instance},n.__use_asyn=null==egret_native.readFileAsync?!1:!0,n}(e.HashObject);t.NativeNetContext=n,e.registerClass(n,"egret.native.NativeNetContext",["egret.NetContext"]),e.NetContext=n}(t=e["native"]||(e["native"]={}))}(egret||(egret={})); -------------------------------------------------------------------------------- /pages/background/libs/modules/game/game.web.min.js: -------------------------------------------------------------------------------- 1 | var egret;!function(e){var t;!function(t){var n=function(t){function n(){t.call(this)}__extends(n,t);var r=(__define,n),a=r.prototype;return a.proceed=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(){switch(o(),t.dataFormat){case e.URLLoaderDataFormat.VARIABLES:t.data=new e.URLVariables(d.response);break;default:t.data=d.response}window.setTimeout(function(){e.Event.dispatchEvent(t,e.Event.COMPLETE)},0)}function o(){d.removeEventListener(e.Event.COMPLETE,a,i),d.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),d.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this;if(t.dataFormat==e.URLLoaderDataFormat.TEXTURE)return void this.loadTexture(t);if(t.dataFormat==e.URLLoaderDataFormat.SOUND)return void this.loadSound(t);var s=t._request,E=i.getVirtualUrl(e.$getUrl(s)),d=new e.HttpRequest;if(d.addEventListener(e.Event.COMPLETE,a,this),d.addEventListener(e.IOErrorEvent.IO_ERROR,r,this),d.addEventListener(e.ProgressEvent.PROGRESS,n,this),d.open(E,s.method),d.responseType=this.getResponseType(t.dataFormat),s.method!=e.URLRequestMethod.GET&&s.data)if(s.data instanceof e.URLVariables){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var v=s.data;d.send(v.toString())}else d.setRequestHeader("Content-Type","multipart/form-data"),d.send(s.data);else d.send()},a.getResponseType=function(t){switch(t){case e.URLLoaderDataFormat.TEXT:case e.URLLoaderDataFormat.VARIABLES:return e.URLLoaderDataFormat.TEXT;case e.URLLoaderDataFormat.BINARY:return"arraybuffer";default:return t}},a.loadSound=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o(),t.data=E,window.setTimeout(function(){t.dispatchEventWith(e.Event.COMPLETE)},0)}function o(){E.removeEventListener(e.Event.COMPLETE,a,i),E.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,s=this.getVirtualUrl(t._request.url),E=new e.Sound;E.addEventListener(e.Event.COMPLETE,a,i),E.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.addEventListener(e.ProgressEvent.PROGRESS,n,i),E.load(s)},a.loadTexture=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o();var r=E.data;r.source.setAttribute("bitmapSrc",s);var a=new e.Texture;a._setBitmapData(r),t.data=a,window.setTimeout(function(){t.dispatchEventWith(e.Event.COMPLETE)},i)}function o(){E.removeEventListener(e.Event.COMPLETE,a,i),E.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,s=this.getVirtualUrl(t._request.url),E=new e.ImageLoader;E.addEventListener(e.Event.COMPLETE,a,i),E.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.addEventListener(e.ProgressEvent.PROGRESS,n,i),E.load(s)},a.getChangeList=function(){return[]},a.getVirtualUrl=function(e){return e},n.getNetContext=function(){return null==n._instance&&(n._instance=new n),n._instance},n}(e.HashObject);t.HTML5NetContext=n,e.registerClass(n,"egret.web.HTML5NetContext",["egret.NetContext"]),e.NetContext=n}(t=e.web||(e.web={}))}(egret||(egret={})); -------------------------------------------------------------------------------- /pages/background/resource/assets/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/bg.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c1-1.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c1-2.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c2.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c3.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c4.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c5-1.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c5-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c5-2.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c5-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c5-3.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c5-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c5-4.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c6-1.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c6-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c6-2.png -------------------------------------------------------------------------------- /pages/background/resource/assets/c6-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/c6-3.png -------------------------------------------------------------------------------- /pages/background/resource/assets/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/pages/background/resource/assets/star.png -------------------------------------------------------------------------------- /pages/background/resource/default.res.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": [ 3 | { 4 | "keys": "star_png,bg_png,c1-1_png,c1-2_png,c2_png,c3_png,c4_png,c5-1_png,c5-2_png,c5-3_png,c5-4_png,c6-1_png,c6-2_png,c6-3_png", 5 | "name": "preload" 6 | } 7 | ], 8 | "resources": [ 9 | { 10 | "url": "assets/star.png", 11 | "type": "image", 12 | "name": "star_png" 13 | }, 14 | { 15 | "url": "assets/bg.png", 16 | "type": "image", 17 | "name": "bg_png" 18 | }, 19 | { 20 | "url": "assets/c1-1.png", 21 | "type": "image", 22 | "name": "c1-1_png" 23 | }, 24 | { 25 | "url": "assets/c1-2.png", 26 | "type": "image", 27 | "name": "c1-2_png" 28 | }, 29 | { 30 | "url": "assets/c2.png", 31 | "type": "image", 32 | "name": "c2_png" 33 | }, 34 | { 35 | "url": "assets/c3.png", 36 | "type": "image", 37 | "name": "c3_png" 38 | }, 39 | { 40 | "url": "assets/c4.png", 41 | "type": "image", 42 | "name": "c4_png" 43 | }, 44 | { 45 | "url": "assets/c5-1.png", 46 | "type": "image", 47 | "name": "c5-1_png" 48 | }, 49 | { 50 | "name": "c5-2_png", 51 | "type": "image", 52 | "url": "assets/c5-2.png" 53 | }, 54 | { 55 | "name": "c5-3_png", 56 | "type": "image", 57 | "url": "assets/c5-3.png" 58 | }, 59 | { 60 | "name": "c5-4_png", 61 | "type": "image", 62 | "url": "assets/c5-4.png" 63 | }, 64 | { 65 | "name": "c6-1_png", 66 | "type": "image", 67 | "url": "assets/c6-1.png" 68 | }, 69 | { 70 | "name": "c6-2_png", 71 | "type": "image", 72 | "url": "assets/c6-2.png" 73 | }, 74 | { 75 | "name": "c6-3_png", 76 | "type": "image", 77 | "url": "assets/c6-3.png" 78 | } 79 | ] 80 | } -------------------------------------------------------------------------------- /pages/background/src/Star.ts: -------------------------------------------------------------------------------- 1 | class Star extends egret.DisplayObjectContainer { 2 | private id: number = 0; 3 | private bmp: egret.Bitmap; 4 | private time: number; 5 | private radius = 200; 6 | constructor(id: number, time: number) { 7 | super(); 8 | this.id = id; 9 | this.time = time; 10 | var bmp = new egret.Bitmap(RES.getRes("star_png")); 11 | bmp.anchorOffsetX = 3; 12 | bmp.anchorOffsetY = 3; 13 | this.bmp = bmp; 14 | this.addChild(bmp); 15 | var alpha = id * 6.28 / 60; 16 | bmp.x = this.radius * Math.cos(alpha); 17 | bmp.y = this.radius * Math.sin(alpha); 18 | 19 | } 20 | public onMove(time: number) { 21 | var angle = this.getAngle(time); 22 | this.bmp.x = this.radius * Math.cos(angle); 23 | this.bmp.y = this.radius * Math.sin(angle); 24 | } 25 | private getAngle(timeNow): number { 26 | var dt = timeNow - this.time; 27 | if (Math.floor(dt / 5000) % 2 == 0) {//向外扩张 28 | this.radius = 200 + dt % 5000 * 0.006; 29 | } else {//向内扩张 30 | //最大值为 5000*间隔值+200 31 | this.radius = 230 - dt % 5000 * 0.006; 32 | } 33 | var angle = (this.id * 360 / 60 + dt * 0.004) * 6.28 / 360; 34 | return angle; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /pages/background/template/runtime/native_loader.js: -------------------------------------------------------------------------------- 1 | require("launcher/native_require.js"); 2 | 3 | egret_native.egtMain = function () { 4 | egret_native.nativeType = "native"; 5 | 6 | egret_native.egretInit(); 7 | egret_native.egretStart(); 8 | }; 9 | -------------------------------------------------------------------------------- /pages/background/template/runtime/native_require.js: -------------------------------------------------------------------------------- 1 | 2 | var game_file_list = [ 3 | //以下为自动修改,请勿修改 4 | //----auto game_file_list start---- 5 | "libs/modules/egret/egret.js", 6 | "libs/modules/egret/egret.native.js", 7 | "libs/modules/game/game.js", 8 | "libs/modules/game/game.native.js", 9 | "libs/modules/tween/tween.js", 10 | "libs/modules/res/res.js", 11 | "bin-debug/Main.js", 12 | "bin-debug/Star.js", 13 | //----auto game_file_list end---- 14 | ]; 15 | 16 | var window = this; 17 | 18 | egret_native.setSearchPaths([""]); 19 | 20 | egret_native.requireFiles = function () { 21 | for (var key in game_file_list) { 22 | var src = game_file_list[key]; 23 | require(src); 24 | } 25 | }; 26 | 27 | egret_native.egretInit = function () { 28 | if(egret_native.featureEnable) { 29 | //控制一些优化方案是否开启 30 | egret_native.featureEnable({ 31 | 32 | }); 33 | } 34 | egret_native.requireFiles(); 35 | //egret.dom为空实现 36 | egret.dom = {}; 37 | egret.dom.drawAsCanvas = function () { 38 | }; 39 | }; 40 | 41 | egret_native.egretStart = function () { 42 | var option = { 43 | //以下为自动修改,请勿修改 44 | //----auto option start---- 45 | entryClassName: "Main", 46 | frameRate: 60, 47 | scaleMode: "noScale", 48 | contentWidth: 730, 49 | contentHeight: 530, 50 | showPaintRect: false, 51 | showFPS: false, 52 | fpsStyles: "x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9", 53 | showLog: false, 54 | logFilter: "", 55 | maxTouches: 2, 56 | textureScaleFactor: 1 57 | //----auto option end---- 58 | }; 59 | 60 | egret.native.NativePlayer.option = option; 61 | egret.runEgret(); 62 | egret_native.Label.createLabel("/system/fonts/DroidSansFallback.ttf", 20, "", 0); 63 | egret_native.EGTView.preSetOffScreenBufferEnable(true); 64 | }; -------------------------------------------------------------------------------- /pages/background/template/runtime/runtime_loader.js: -------------------------------------------------------------------------------- 1 | require("launcher/native_require.js"); 2 | 3 | egret_native.egtMain = function () { 4 | egret_native.nativeType = "runtime"; 5 | 6 | egret_native.egretInit(); 7 | egret_native.egretStart(); 8 | }; -------------------------------------------------------------------------------- /pages/background/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | }, 5 | "exclude": [ 6 | "node_modules" 7 | ] 8 | } -------------------------------------------------------------------------------- /pages/background/wingProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourcePlugin": { 3 | "configs": [ 4 | { 5 | "configPath": "resource/default.res.json", 6 | "relativePath": "resource/" 7 | } 8 | ] 9 | }, 10 | "theme": "resource/default.thm.json" 11 | } -------------------------------------------------------------------------------- /psd/background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/background.psd -------------------------------------------------------------------------------- /psd/cankao/css颜色表.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/cankao/css颜色表.gif -------------------------------------------------------------------------------- /psd/cankao/ui.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/cankao/ui.gif -------------------------------------------------------------------------------- /psd/clear/demo/main.js: -------------------------------------------------------------------------------- 1 | var spawn = require('child_process').spawn; 2 | var child = spawn('node',['work.js']); 3 | child.stdout.on('data', function (data) { 4 | console.log('data:',data.toString()); 5 | }) 6 | child.stderr.on('data', function (data) { 7 | console.log("stderr:", data.toString()); 8 | }); -------------------------------------------------------------------------------- /psd/clear/demo/question.js: -------------------------------------------------------------------------------- 1 | var spawn = require('child_process').spawn; 2 | var child = spawn('node',['work.js']); 3 | child.stdout.on('data', function (data) { 4 | console.log('data:',data.toString()); 5 | }) 6 | child.stderr.on('data', function (data) { 7 | console.log("stderr:", data.toString()); 8 | }); -------------------------------------------------------------------------------- /psd/clear/demo/work.js: -------------------------------------------------------------------------------- 1 | var out = process.stdout; 2 | var idx = 0; 3 | var id = setInterval(()=>{ 4 | idx++; 5 | out.clearLine(); 6 | out.cursorTo(0); 7 | out.write('workTime:' + idx); 8 | if(idx>3){ 9 | clearInterval(id); 10 | console.log(); 11 | console.log('end') 12 | } 13 | },100) -------------------------------------------------------------------------------- /psd/clear/demo1/clear1.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var text = fs.readFileSync('data.txt','utf-8'); 3 | console.log('text:',text); 4 | var out = process.stdout; 5 | console.log('out.clearLine:',out.clearLine); 6 | console.log('clear.process.pid:',process.pid); 7 | // console.log('out.clear1:',out); 8 | // process.stdout.on('resize', function() { 9 | // console.log('screen size has changed!'); 10 | // console.log(process.stdout.columns + 'x' + process.stdout.rows); 11 | // }); 12 | // var readline = require('readline'); 13 | // console.log('readline:',readline.clearLine) 14 | // out.clearLine = function (dir) { 15 | // require('readline').clearLine(this, dir); 16 | // } 17 | // out.cursorTo = function (x, y) { 18 | // require('readline').cursorTo(this, x, y); 19 | // } 20 | 21 | var idx = 0; 22 | var id = setInterval(()=>{ 23 | idx++; 24 | // console.log('idx:',idx); 25 | // console.log(88,process.stdout.isTTY) 26 | out.clearLine(); 27 | out.cursorTo(0); 28 | out.write('已完成' + idx); 29 | // console.log('ok:',idx) 30 | if(idx>3){ 31 | clearInterval(id); 32 | console.log(); 33 | var str = Number(text)+1; 34 | console.log('end.data=',str) 35 | fs.writeFile('data.txt',str.toString()); 36 | } 37 | },100) -------------------------------------------------------------------------------- /psd/clear/demo1/cluster-logger.js: -------------------------------------------------------------------------------- 1 | var cluster = require('cluster') 2 | 3 | function sendLog(type){ 4 | return function(){ 5 | process.send({ type: 'log', message: Array.from(arguments).join(' ') }) 6 | } 7 | } 8 | 9 | function receiveLog(message){ 10 | console.log('message.type:',message.type) 11 | console.log('message.message:',message.message) 12 | // console[message.type](message.message) 13 | } 14 | 15 | if(cluster.isWorker){ 16 | console.log = sendLog('log') 17 | console.error = sendLog('error') 18 | 19 | } else if(cluster.isMaster) { 20 | cluster.on('message', receiveLog) 21 | } 22 | console.log('cluster-logger') 23 | return cluster; 24 | // console.log(11,cluster.isMaster) 25 | // console.log(22,cluster) -------------------------------------------------------------------------------- /psd/clear/demo1/data.txt: -------------------------------------------------------------------------------- 1 | 149 -------------------------------------------------------------------------------- /psd/clear/demo1/exec.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------exec-------') 3 | var exec = require('child_process').exec; 4 | 5 | var child = exec('node clear1.js',(e,stdout,stderr)=>{ 6 | console.log('err:',e); 7 | console.log('stdout:',stdout); 8 | console.log('stderr:',stderr); 9 | }) 10 | // child.stdout.on('data', function (data) { 11 | // var result = data.toString('utf8'); 12 | // console.log('data:',result); 13 | // }) 14 | // child.stdout.on('end', function (data) { 15 | // console.log("stdout.end:", data); 16 | // }) 17 | // child.stderr.on('data', function (data) { 18 | // // console.log('outabbb:',child.stdout.clearLine) 19 | // var result = data.toString('utf8'); 20 | // console.log("stderr:", result); 21 | // }); 22 | // child.on('message', function (data) { 23 | // console.log('stdout.message:', data) 24 | // }); 25 | // child.on('exit', function (code, signal) { 26 | // console.log('stdout.exit:', code, signal) 27 | // }); 28 | // child.on('error', function (error) { 29 | // console.log('error:', error) 30 | // }); -------------------------------------------------------------------------------- /psd/clear/demo1/exec2.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------exec2-------') 3 | // var exec = require('child_process').exec; 4 | const execa = require('execa'); 5 | 6 | execa('node',['clear1.js']).then(result =>{ 7 | console.log('result:',result.stdout) 8 | }) 9 | execa('node', ['clear1.js']).stdout.pipe(process.stdout); -------------------------------------------------------------------------------- /psd/clear/demo1/execfile.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------exec-------') 3 | var execFile = require('child_process').execFile; 4 | 5 | var child = execFile('node', ['clear1.js'],(e,stdout,stderr)=>{ 6 | console.log('err:',e); 7 | console.log('stdout:',stdout); 8 | console.log('stderr:',stderr); 9 | }) 10 | // child.stdout.on('data', function (data) { 11 | // var result = data.toString('utf8'); 12 | // console.log('data:',result); 13 | // }) 14 | // child.stdout.on('end', function (data) { 15 | // console.log("stdout.end:", data); 16 | // }) 17 | // child.stderr.on('data', function (data) { 18 | // // console.log('outabbb:',child.stdout.clearLine) 19 | // var result = data.toString('utf8'); 20 | // console.log("stderr:", result); 21 | // }); 22 | // child.on('message', function (data) { 23 | // console.log('stdout.message:', data) 24 | // }); 25 | // child.on('exit', function (code, signal) { 26 | // console.log('stdout.exit:', code, signal) 27 | // }); 28 | // child.on('error', function (error) { 29 | // console.log('error:', error) 30 | // }); -------------------------------------------------------------------------------- /psd/clear/demo1/fork.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------fork1-------') 3 | var childProcess = require('child_process'); 4 | 5 | // var options = { 6 | // stdio:['pipe','pipe','pipe','ipc'], 7 | // execPath:'rap' 8 | // } 9 | // var child = childProcess.fork('--version',options); 10 | 11 | var options = { 12 | stdio:['pipe','pipe','pipe','ipc'] 13 | } 14 | 15 | 16 | // options = { 17 | // silent:true, 18 | // } 19 | // options={stdio:['inherit','inherit','pipe','ipc']} 20 | // options={stdio:['pi']} 21 | options={} 22 | // var options = { 23 | // stdio:['pipe','pipe','pipe','ipc'], 24 | // execPath:'rap' 25 | // } 26 | // process.stdout['clearLine'] = function (dir) { 27 | // require('readline').clearLine(this, dir); 28 | // } 29 | var child = childProcess.fork(__dirname+'/clear1.js',options); 30 | // child.stdout = process.stdout; 31 | // child.stdout['clearLine'] = function (dir) { 32 | // require('readline').clearLine(this, dir); 33 | // } 34 | 35 | child.on('close',()=>{ 36 | console.log('close') 37 | }) 38 | child.on('error',()=>{ 39 | console.log('error') 40 | }) 41 | child.on('owner',()=>{ 42 | console.log('owner') 43 | }) 44 | var pid = child.pid; 45 | child.on('internalMessage',()=>{ 46 | console.log('internalMessage') 47 | }) 48 | console.log('child.pid:',pid); 49 | console.log('process.pid:',process.pid); 50 | 51 | 52 | 53 | // console.log('child`:',child); 54 | 55 | child.stdout.on('data', function (data) { 56 | var result = data.toString('utf8'); 57 | console.log('data:',result); 58 | }) 59 | child.stdout.on('end', function (data) { 60 | console.log("stdout.end:", data); 61 | }) 62 | // child.stderr.on('data', function (data) { 63 | // // console.log('outabbb:',child.stdout.clearLine) 64 | // var result = data.toString('utf8'); 65 | // console.log("stderr:", result); 66 | // }); 67 | child.on('message', function (data) { 68 | console.log('stdout.message:', data) 69 | }); 70 | child.on('exit', function (code, signal) { 71 | console.log('stdout.exit:', code, signal) 72 | }); 73 | child.on('error', function (error) { 74 | console.log('error:', error) 75 | }); -------------------------------------------------------------------------------- /psd/clear/demo1/fork2.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('--------fork2--------') 3 | var cluster = require ('cluster'); 4 | require('./cluster-logger'); 5 | var childProcess = require('child_process'); 6 | // cluster.fork(); 7 | if ( cluster . isMaster ) { 8 | // console.log(1232,cluster.fork) 9 | // __dirname+'/clear1.js' 10 | cluster.fork() 11 | cluster.on('listening' , function ( worker , address) { 12 | console.log('listening: worker ' + worker.process.pid); 13 | }); 14 | cluster.on('exit' , function ( worker , code , signal ) { 15 | console.log('worker'+worker.process.id+'died'); 16 | }) 17 | }else{ 18 | cluster.on('message', ()=>{ 19 | // console.log(888) 20 | }) 21 | console.log('isNotMaster',12) 22 | console.log(111) 23 | // var child = childProcess.fork(__dirname+'/clear1.js'); 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /psd/clear/demo1/forkrap.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------fork-------') 3 | var childProcess = require('child_process'); 4 | 5 | var options = { 6 | execPath:'rap' 7 | } 8 | 9 | // options={} 10 | // var child = childProcess.fork(['uninstall','hjhjh'],options); 11 | var child = childProcess.fork(['uninstall'],options); 12 | // child.stdout['clearLine'] = function (dir) { 13 | // require('readline').clearLine(this, dir); 14 | // } 15 | child.on('close',(value)=>{ 16 | console.log('close2:',value) 17 | }) 18 | child.on('error',()=>{ 19 | console.log('error2') 20 | }) 21 | var pid = child.pid; 22 | 23 | console.log('child.pid:',pid); 24 | console.log('process.pid:',process.pid); 25 | // console.log('child`:',child); 26 | 27 | // child.stdout.on('data', function (data) { 28 | // var result = data.toString('utf8'); 29 | // console.log('data:',result); 30 | // }) 31 | // child.stdout.on('end', function (data) { 32 | // console.log("stdout.end:", data); 33 | // }) 34 | // child.stderr.on('data', function (data) { 35 | // // console.log('outabbb:',child.stdout.clearLine) 36 | // var result = data.toString('utf8'); 37 | // console.log("stderr:", result); 38 | // }); 39 | // child.on('message', function (data) { 40 | // console.log('stdout.message:', data) 41 | // }); 42 | // child.on('exit', function (code, signal) { 43 | // console.log('stdout.exit:', code, signal) 44 | // }); 45 | // child.on('error', function (error) { 46 | // console.log('error:', error) 47 | // }); -------------------------------------------------------------------------------- /psd/clear/demo1/listen1.js: -------------------------------------------------------------------------------- 1 | var spawn = require('child_process').spawnSync; 2 | var child = spawn('node',['clear1.js']) 3 | console.log('child',child.output[1].toString()) 4 | console.log('child2',child.output[2].toString()) -------------------------------------------------------------------------------- /psd/clear/demo1/listen2.js: -------------------------------------------------------------------------------- 1 | var childProcess = require('child_process'); 2 | // console.log(99,childProcess.spawn) 3 | var spawn = childProcess.spawn; 4 | // var options = { 5 | // execArgv: process.execArgv 6 | // } 7 | var child = spawn('node',['clear1.js']) 8 | // console.log(88,child) 9 | // console.log('process.execArgv:',process.execArgv) 10 | // console.log('child.pid:',child.stdout.clearLine);\ 11 | child.stdout.on('data', function (data) { 12 | var result = data.toString('utf8'); 13 | console.log('data:',result); 14 | }) 15 | child.stdout.on('end', function (data) { 16 | console.log("stdout.end:", data); 17 | }) 18 | child.stderr.on('data', function (data) { 19 | // console.log('outabbb:',child.stdout.clearLine) 20 | var result = data.toString('utf8'); 21 | console.log("stderr:", result); 22 | }); 23 | child.on('message', function (data) { 24 | console.log('stdout.message:', data) 25 | }); 26 | child.on('exit', function (code, signal) { 27 | console.log('stdout.exit:', code, signal) 28 | }); 29 | child.on('error', function (error) { 30 | console.log('error:', error) 31 | }); -------------------------------------------------------------------------------- /psd/clear/demo1/listen3.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------listen3-------') 3 | var options={ 4 | stdio:['pipe','pipe','pipe'], 5 | pty:true 6 | 7 | } 8 | var tty = require('tty'); 9 | // console.log('tty:',tty) 10 | 11 | // console.log('process:',process.stdout.clearLine) 12 | 13 | var spawn = require('child_process').spawn; 14 | var child = spawn('node',['clear1.js']) 15 | console.log('process.pid:',process.pid); 16 | console.log('child.pid:',child.pid); 17 | // var stream = require('stream'); 18 | // var rawStdout= child.stdout;//先拿到原来的stdout 19 | // var newStdout=new stream.PassThrough();//创建一个passthrough流,这是一种特殊的Transform流,会直接把写入的数据吐出来 20 | // rawStdout.clearLine = function (dir) { 21 | // require('readline').clearLine(this, dir); 22 | // } 23 | 24 | // newStdout.clearLine = function (dir) { 25 | // require('readline').clearLine(this, dir); 26 | // } 27 | // child.__defineGetter__('stdout',function(){//重新定义process.stdout的Getter 28 | // return newStdout;//返回我们的passthrough流 29 | // }); 30 | 31 | // var newStdout2=new stream.PassThrough();//创建一个passthrough流,这是一种特殊的Transform流,会直接把写入的数据吐出来 32 | // newStdout2.clearLine = function (dir) { 33 | // require('readline').clearLine(this, dir); 34 | // } 35 | // process.__defineGetter__('stdout',function(){//重新定义process.stdout的Getter 36 | // return newStdout2;//返回我们的passthrough流 37 | // }); 38 | child.stdout.pipe(process.stdout); 39 | child.stderr.pipe(process.stderr); 40 | // newStdout.pipe(rawStdout);//内容输出到控制台 41 | 42 | console.log('stdout:',child.stdout.clearLine) 43 | child.stdout.on('data', function (data) { 44 | var result = data.toString('utf8'); 45 | console.log('data:',result); 46 | // process.pi 47 | // console.log(999,child.out) 48 | }) 49 | child.stdout.on('end', function (data) { 50 | console.log("stdout.end:", data); 51 | }) 52 | child.stderr.on('data', function (data) { 53 | // console.log('outabbb:',child.stdout.clearLine) 54 | var result = data.toString('utf8'); 55 | console.log("stderr:", result); 56 | }); 57 | child.on('message', function (data) { 58 | console.log('stdout.message:', data) 59 | }); 60 | child.on('exit', function (code, signal) { 61 | console.log('stdout.exit:', code, signal) 62 | }); 63 | child.on('error', function (error) { 64 | console.log('error:', error) 65 | }); -------------------------------------------------------------------------------- /psd/clear/demo1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "clear1.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "buffered-spawn": "^3.3.2", 13 | "bunyan": "^1.8.5", 14 | "bunyan-fork": "^0.1.1", 15 | "cfork": "^1.6.0", 16 | "child-process-promise": "^2.2.0", 17 | "cross-spawn": "^5.0.1", 18 | "execa": "^0.6.0", 19 | "execspawn": "^1.0.1", 20 | "intercept-stdout": "^0.1.2", 21 | "proc-tools": "^1.0.0", 22 | "ps-node": "^0.1.4", 23 | "respawn": "^2.4.1" 24 | }, 25 | "ruff": { 26 | "dependencies": {}, 27 | "devDependencies": {} 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /psd/clear/demo1/spawn.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------spawn-------') 3 | 4 | var spawn = require('child_process').spawn; 5 | var options = { 6 | stdio:[null,null,null] 7 | } 8 | options={} 9 | var child = spawn('node',['clear1.js'],options) 10 | console.log('child.pid:',child.pid) 11 | process.stdout.clearLine = 12 | child.stdout['clearLine'] = function (dir) { 13 | require('readline').clearLine(this, dir); 14 | } 15 | // child.__defineGetter__('stdout',function(){//重新定义process.stdout的Getter 16 | // return process.stdout; 17 | // }); 18 | 19 | // child.stdout.clearLine = function(stream, dir) { 20 | // if (stream === null || stream === undefined) 21 | // return; 22 | 23 | // if (dir < 0) { 24 | // // to the beginning 25 | // stream.write('\x1b[1K'); 26 | // } else if (dir > 0) { 27 | // // to the end 28 | // stream.write('\x1b[0K'); 29 | // } else { 30 | // // entire line 31 | // stream.write('\x1b[2K'); 32 | // } 33 | // } 34 | child.stdout.on('data', function (data) { 35 | var result = data.toString('utf8'); 36 | console.log('data:',result); 37 | // console.log('tdd1:',child.stdout.tdd); 38 | }) 39 | child.stdout.on('end', function (data) { 40 | console.log("stdout.end:", data); 41 | }) 42 | child.stderr.on('data', function (data) { 43 | // console.log('outabbb:',child.stdout.clearLine) 44 | var result = data.toString('utf8'); 45 | console.log("stderr:", result); 46 | }); 47 | child.on('message', function (data) { 48 | console.log('stdout.message:', data) 49 | }); 50 | child.on('exit', function (code, signal) { 51 | console.log('stdout.exit:', code, signal) 52 | }); 53 | child.on('error', function (error) { 54 | console.log('error:', error) 55 | }); -------------------------------------------------------------------------------- /psd/clear/demo1/spawn2.js: -------------------------------------------------------------------------------- 1 | 2 | console.log('-------spawn2-------') 3 | var spawn = require('respawn'); 4 | // var spawn = require('child_process').spawn; 5 | var options = { 6 | stdio:[null,null,null] 7 | } 8 | options={} 9 | var child = spawn(['node','clear1.js'],options) 10 | child.start(); -------------------------------------------------------------------------------- /psd/css.css: -------------------------------------------------------------------------------- 1 | /* Rap 命令: */ 2 | font-family: Helvetica; 3 | font-size: 14px; 4 | color: #000000; 5 | 6 | /* Rectangle: */ 7 | background: #FFFFFF; 8 | border-radius: 3px; 9 | 10 | /* rap scan 文字: */ 11 | font-family: Helvetica; 12 | font-size: 12px; 13 | color: #57C2FC; 14 | 15 | -------------------------------------------------------------------------------- /psd/icon_128.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/icon_128.psd -------------------------------------------------------------------------------- /psd/icon_256.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/icon_256.psd -------------------------------------------------------------------------------- /psd/icon_48.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/icon_48.psd -------------------------------------------------------------------------------- /psd/icon_64.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/icon_64.psd -------------------------------------------------------------------------------- /psd/newui.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/newui.sketch -------------------------------------------------------------------------------- /psd/t1.js: -------------------------------------------------------------------------------- 1 | var t1 = '1.6.2\n[?25h' 2 | 3 | console.log('result2:',decode(t1)) 4 | 5 | function decode(result) { 6 | result = result.replace(/\[[?a-z]*[0-9]{1,4}[a-z,A-Z]*/g, ""); 7 | if (result.indexOf('\n') == 0) { 8 | // console.log('清除掉开头的换行'); 9 | result = result.replace(/\n/, ""); 10 | } 11 | result = result.replace(/\n\n|\n$/, "");//去掉最后一个\n 12 | 13 | result = result.replace(/\[K/g, ""); 14 | return result; 15 | } 16 | var t2 = '1.6.2\n\n[?25h' 17 | console.log('result2:',decode(t2)) 18 | 19 | 20 | var version = '0.2.1'; 21 | var reg = /\d+(\.\d+){0,2}/;//匹配 0.1 或者 0.1.0 22 | var result = version.match(reg); 23 | console.log('result:',result) 24 | 25 | var version2 = 'a.2.1'; 26 | var result2 = version2.match(reg); 27 | console.log('result2:',result2) 28 | 29 | 30 | float 父DVI没有高度,最后加一个 clear:'both' 31 | 垂直居中 -------------------------------------------------------------------------------- /psd/test1.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/test1.sketch -------------------------------------------------------------------------------- /psd/test1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Egret 7 | 8 | 9 | 10 | 11 | 12 | 13 | 24 | 25 | 26 | 27 |
dsafasd
28 |
dd
29 |
测试1223123到底
30 |
dd
31 |
测试1223123到底
32 |
dd
33 |
测试1223123到底
34 |
dd
35 |
测试1223123到底
36 |
dd
37 |
测试1223123到底
38 |
dd
39 |
测试1223123到底
40 |
dd
41 |
测试1223123到底
42 | 43 | 44 | -------------------------------------------------------------------------------- /psd/ui2.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runinspring/ruffhelper/781d3f3330cbd434d5ba7c676836d703ace5b685/psd/ui2.psd -------------------------------------------------------------------------------- /psd/配色.txt: -------------------------------------------------------------------------------- 1 | 蓝色 337EE3 2 | 紫色 824DFF -------------------------------------------------------------------------------- /script/remove-use-strict.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wander on 15/11/13. 3 | */ 4 | var fs = require('fs'); 5 | var file_path = "app/public/app.js" 6 | var content = fs.readFileSync(file_path,"utf-8"); 7 | content = content.replace(/use strict/gi,""); 8 | fs.writeFileSync(file_path,content,"utf-8"); 9 | -------------------------------------------------------------------------------- /script/webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var fs = require('fs'); 3 | 4 | var path = require('path'); 5 | var urlProject = fs.realpathSync('./'); 6 | var node_modules = path.resolve(urlProject, 'node_modules'); 7 | //console.log(111,__dirname); 8 | //console.log(222,urlProject); 9 | config = { 10 | target: 'electron', 11 | entry: [ 12 | "webpack-dev-server/client?http://0.0.0.0:8080", 13 | 'webpack/hot/dev-server', 14 | path.resolve(urlProject, 'src/Main.jsx') 15 | ], 16 | // 'webpack/hot/dev-server', 17 | resolve: { 18 | extensions: ['', '.js', '.jsx', '.ts', '.tsx', '.json'] 19 | }, 20 | devtool: 'source-map', 21 | externals: { 22 | "electron": "require('electron')", 23 | "remote": "require('electron').remote", 24 | "fs": "require('fs')" 25 | }, 26 | output: { 27 | path: path.resolve(urlProject, 'app'), 28 | filename: 'bundle.js' 29 | }, 30 | module: { 31 | loaders: [ 32 | { 33 | test: /\.tsx?$/, 34 | loader: 'ts-loader' 35 | }, 36 | { 37 | test: /\.jsx?$/, 38 | loaders: ['react-hot', 'babel?presets[]=es2015,presets[]=stage-0,presets[]=react'], 39 | include: /src/, 40 | exclude: /node_modules/, 41 | }, 42 | {test: /\.json$/, loader: "json-loader"}, 43 | {test: /\.css$/, loader: "style!css"}, 44 | {test: /\.scss$/, loader: "style!css!sass"}, 45 | { 46 | test: /css(\\|\/)[^\.]+\.(png|jpg)/, 47 | loader: 'url-loader?limit=8192' 48 | } 49 | ] 50 | }, 51 | plugins: [ 52 | new webpack.HotModuleReplacementPlugin() 53 | //new webpack.HotModuleReplacementPlugin() 54 | ] 55 | }; 56 | 57 | module.exports = config; 58 | // { 59 | // test: /\.jsx?$/, loader: 'babel', 60 | // include: /src/, 61 | // exclude: /node_modules/, 62 | // query: { 63 | // presets: ['es2015','stage-0','react'] 64 | // } 65 | // }, -------------------------------------------------------------------------------- /script/webpack.config_not_hot_loader.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var fs = require('fs'); 3 | 4 | var path = require('path'); 5 | var urlProject = fs.realpathSync('./'); 6 | var node_modules = path.resolve(urlProject, 'node_modules'); 7 | //console.log(111,__dirname); 8 | //console.log(222,urlProject); 9 | config = { 10 | target: 'electron', 11 | entry: [ 12 | 'webpack/hot/dev-server', 13 | path.resolve(urlProject, 'src/Main.jsx') 14 | ], 15 | // 'webpack/hot/dev-server', 16 | resolve: { 17 | extensions: ['', '.js', '.jsx', '.ts', '.tsx', '.json'] 18 | }, 19 | devtool: 'source-map', 20 | externals: { 21 | "electron": "require('electron')", 22 | "remote": "require('electron').remote", 23 | "fs": "require('fs')" 24 | }, 25 | output: { 26 | path: path.resolve(urlProject, 'app'), 27 | filename: 'bundle.js' 28 | }, 29 | module: { 30 | loaders: [ 31 | { 32 | test: /\.tsx?$/, 33 | loader: 'ts-loader' 34 | }, 35 | { 36 | test: /\.jsx?$/, loader: 'babel', 37 | include: /src/, 38 | exclude: /node_modules/, 39 | query: { 40 | presets: ['es2015','stage-0','react'] 41 | } 42 | }, 43 | {test: /\.json$/, loader: "json-loader"}, 44 | {test: /\.css$/, loader: "style!css"}, 45 | {test: /\.scss$/, loader: "style!css!sass"}, 46 | { 47 | test: /css(\\|\/)[^\.]+\.(png|jpg)/, 48 | loader: 'url-loader?limit=8192' 49 | } 50 | ] 51 | }, 52 | plugins: [ 53 | new webpack.HotModuleReplacementPlugin() 54 | //new webpack.HotModuleReplacementPlugin() 55 | ] 56 | }; 57 | 58 | module.exports = config; 59 | -------------------------------------------------------------------------------- /script/webpack.production.config.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | var path = require('path'); 4 | var webpack = require("webpack"); 5 | var urlProject = fs.realpathSync('./'); 6 | //console.log("urlProject:",urlProject); 7 | var node_modules = path.resolve(urlProject, 'node_modules'); 8 | 9 | config = { 10 | entry: { 11 | app: path.resolve(urlProject, 'src/Main.jsx'), 12 | vendors: ['react'] 13 | }, 14 | resolve: { 15 | extensions: ['', '.js', '.ts', '.tsx'] 16 | }, 17 | externals:{ 18 | "remote": "require('electron').remote", 19 | "electron": "require('electron')", 20 | "child_process": "require('child_process')", 21 | "fs": "require('fs')", 22 | "os": "require('os')", 23 | "net": "require('net')" 24 | }, 25 | output: { 26 | path: path.resolve(urlProject, 'app/public'), 27 | filename: 'app.js' 28 | }, 29 | module: { 30 | loaders: [ 31 | { 32 | test: /\.tsx?$/, 33 | loader: 'ts-loader' 34 | }, 35 | { test: /\.jsx?$/, loader: "babel", 36 | include: /src/, 37 | exclude: [node_modules], 38 | query: { 39 | presets: ['es2015','stage-0','react'] 40 | } 41 | }, 42 | { 43 | test: /\.json$/, 44 | loader: "json" 45 | }, 46 | { test: /\.css$/, loader: "style!css"}, 47 | { test: /\.scss$/, loader: "style!css!sass"}, 48 | { 49 | test: /css(\\|\/)[^\.]+\.(png|jpg)/, 50 | loader: 'url-loader?limit=8192' 51 | } 52 | ] 53 | }, 54 | plugins: [ 55 | new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js') 56 | ] 57 | }; 58 | 59 | module.exports = config; 60 | -------------------------------------------------------------------------------- /src/Main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import appreducer from './reducers/Reducers.jsx'; 4 | import {createStore} from 'redux'; 5 | import {Provider} from 'react-redux' 6 | // import {AppRouter} from './Router.jsx'; 7 | let store = createStore(appreducer); 8 | import MainShell from './component/MainShell.jsx'; 9 | import Loading from './component/Loading.jsx'; 10 | class Main extends React.Component { 11 | constructor(props) { 12 | super(props); 13 | this.state = { 14 | loadEnd: false, 15 | showLoading: true 16 | } 17 | //testing 18 | } 19 | /**主场景*/ 20 | onLoadEnd() { 21 | // console.log('loadEnd',this) 22 | this.setState({loadEnd: true}) 23 | setTimeout(()=>{ 24 | this.setState({showLoading:false}) 25 | },1100) 26 | } 27 | 28 | render() { 29 | var self = this; 30 | //console.log('main.render:',this.props); 31 | var hei = document.documentElement.clientHeight; 32 | 33 | var getLoading = function () { 34 | if (self.state.showLoading) { 35 | return 36 | } else { 37 | return
38 | } 39 | } 40 | return ( 41 |
42 | 43 |
44 | {/**/} 45 | 46 | {getLoading()} 47 |
48 |
49 |
50 | ) 51 | } 52 | } 53 | ReactDOM.render(
, document.getElementById('app')); 54 | 55 | // 56 | -------------------------------------------------------------------------------- /src/Router.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Router, Route, IndexRoute, browserHistory, hashHistory} from 'react-router'; 3 | import MainShell from './component/MainShell.jsx'; 4 | import Loading from './component/Loading.jsx'; 5 | import TestUI from './component/TestUI.jsx'; 6 | //import createHashHistory from 'history/lib/createHashHistory'; 7 | //import createBrowserHistory from 'history/lib/createBrowserHistory'; 8 | //var history = createBrowserHistory(); 9 | //window.appHistory = history; 10 | export class AppRouter extends React.Component { 11 | constructor(props) { 12 | super(props); 13 | //console.log('AppRouter'); 14 | window.location.href = '#/'; 15 | } 16 | render() { 17 | return ( 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ) 26 | } 27 | } 28 | 29 | class App extends React.Component { 30 | render() { 31 | return ( 32 |
33 | {this.props.children} 34 |
35 | ) 36 | } 37 | } 38 | class About extends React.Component { 39 | render() { 40 | return (
Coming soon
) 41 | } 42 | } -------------------------------------------------------------------------------- /src/actions/AppActions.jsx: -------------------------------------------------------------------------------- 1 | /*初始化*/ 2 | export const INIT = "init"; 3 | /*改变左侧每个栏目的开启状态,0关闭 1打开 2关闭中*/ 4 | export const LEFT_CHANGE_CLUMTYPE = 'left_change_clumtype'; 5 | /*改变配置文件*/ 6 | export const CHANGE_CONFIG = 'change_config'; 7 | /*打开ruff项目*/ 8 | export const OPEN_RUFF_PROJECT = 'open_ruff_project'; 9 | /*移除历史记录里的项目*/ 10 | export const REMOVE_RUFF_PROJECT = 'remove_ruff_project'; 11 | /*增加log信息*/ 12 | export const LOG_ADD = 'log_add'; 13 | /*清除log信息*/ 14 | export const LOG_CLEAN = 'log_clean'; 15 | /*绿色为提示信息*/ 16 | export const COLOR_GREEN = 'color_green'; 17 | /*红色为警告信息*/ 18 | export const COLOR_RED = 'color_red'; 19 | /**显示弹出面板*/ 20 | export const SHOW_ALERT = 'show_alert'; 21 | /**移除弹出面板*/ 22 | export const CLOSE_ALERT = 'colse_alert'; 23 | import {sendCommands} from '../lib/RapCommand'; 24 | import {tr} from '../lib/Utils'; 25 | var dispatch = null; 26 | /**初始化,保存dispatch */ 27 | exports.init = function (_dispatch, data) { 28 | dispatch = _dispatch; 29 | command(INIT, data); 30 | } 31 | /**通用的命令*/ 32 | exports.command = command; 33 | function command(command, data) { 34 | var obj = {type: command, data: data} 35 | // console.log('command:',obj) 36 | dispatch(obj); 37 | } 38 | /**增加log信息*/ 39 | exports.addLog = addLog; 40 | function addLog(data, color) { 41 | var arr = data.split('\n'); 42 | // console.log('arr:', arr) 43 | for (var i = 0, len = arr.length; i < len; i++) { 44 | if (!arr[i]) { 45 | return; 46 | } 47 | var obj = { 48 | color: 'white', 49 | value: arr[i] 50 | } 51 | if (color) { 52 | switch (color) { 53 | case COLOR_GREEN://绿色为提示信息 54 | obj.color = '#5EFDFF'; 55 | break; 56 | case COLOR_RED://红色为警告信息 57 | // obj.color = 'red'; 58 | obj.color = '#ffccff'; 59 | break; 60 | default://默认为白色的通用信息 61 | obj.color = color; 62 | break; 63 | } 64 | } 65 | command(LOG_ADD, obj); 66 | } 67 | 68 | } 69 | /** 70 | * 发送rap命令 71 | * @param cmd string 发送的命令 72 | * @param callback 回调方法 73 | */ 74 | exports.rapCommand = rapCommand; 75 | function rapCommand(cmd, parentDir = null, callback = null, inputObj = null, showCommand = true) { 76 | console.log('cmd:', cmd) 77 | if (showCommand) {//是否显示这个命令行 78 | addLog(tr(200, cmd), COLOR_GREEN)//200 执行命令:xxxx 79 | } 80 | sendCommands(cmd, parentDir, (value)=> { 81 | if (showCommand) addLog(value); 82 | if (cmd == 'rap --version') { 83 | var reg = /\d+(\.\d+){0,2}/;//匹配 0.1 或者 0.1.0 84 | var result = value.match(reg); 85 | if (result && result.index == 0) { 86 | var obj = {type: CHANGE_CONFIG, data: {rapVersion: value}} 87 | dispatch(obj); 88 | }else{ 89 | if(showCommand){ 90 | addLog(tr(24), COLOR_RED);//24 系统中未安装 rap, 请前往 https://ruff.io/zh-cn/ 下载安装 91 | } 92 | } 93 | } 94 | }, ()=> { 95 | if (cmd != 'rap log' && showCommand) { 96 | addLog(tr(213), COLOR_GREEN); 97 | } 98 | if (callback) callback(); 99 | }, inputObj); 100 | } 101 | -------------------------------------------------------------------------------- /src/component/Alerts.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import SaveLog from './alerts/SaveLog'; 4 | 5 | /**保存log日志*/ 6 | export const PanelSaveLog = 'PanelSaveLog'; 7 | class Alerts extends React.Component { 8 | constructor(props) { 9 | super(props); 10 | // console.log(1222,PanelSaveLog) 11 | } 12 | 13 | render() { 14 | // console.log('alert:', this.props.alerts) 15 | if (this.props.alerts.panels.length < 1) { 16 | return
17 | } 18 | var getPanels = this.props.alerts.panels.map(function (item, index) { 19 | switch (item.type) { 20 | case PanelSaveLog: 21 | return 22 | default: 23 | return
empty
24 | } 25 | }) 26 | return ( 27 |
28 |
29 |
30 | {getPanels} 31 |
32 |
33 | ) 34 | } 35 | } 36 | // 37 | 38 | function select(state) { 39 | return { 40 | alerts: state.alerts 41 | } 42 | } 43 | export default connect(select)(Alerts); -------------------------------------------------------------------------------- /src/component/LeftArea.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import RapCommand from './left/C1_RapCommand'; 4 | import OpenProject from './left/C2_OpenProject'; 5 | import NewProject from './left/C3_NewProject'; 6 | import LeftContainer from './left/LeftContainer'; 7 | import {tr} from '../lib/Utils'; 8 | class LeftArea extends React.Component { 9 | constructor(props) { 10 | super(props) 11 | // this.state={ 12 | // clum1:false,//每个栏目是否展开 13 | // clum2:false, 14 | // clum3:false 15 | // } 16 | } 17 | 18 | render() { 19 | // console.log('LeftArea.render') 20 | return ( 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |
35 | 36 | ) 37 | } 38 | } 39 | function select(state) { 40 | return { 41 | config: state.config 42 | } 43 | } 44 | export default connect(select)(LeftArea); 45 | -------------------------------------------------------------------------------- /src/component/MainShell.jsx: -------------------------------------------------------------------------------- 1 | import React, {PropTypes} from 'react'; 2 | import {connect} from 'react-redux'; 3 | import LeftArea from './LeftArea.jsx'; 4 | import Alerts from './Alerts.jsx'; 5 | import RightArea from './RightArea.jsx'; 6 | import Test from './TestUI.jsx' 7 | 8 | class MainShell extends React.Component { 9 | constructor(props) { 10 | super(props) 11 | } 12 | 13 | // render() { 14 | // return ( 15 | //
16 | // 17 | // 18 | //
19 | // ) 20 | // } 21 | render() { 22 | if (!this.props.loadEnd) { 23 | return
24 | } else { 25 | return ( 26 |
27 | 34 | {/*
*/} 35 | 36 | 37 | 38 |
39 | ) 40 | } 41 | } 42 | } 43 | function select(state) { 44 | return { 45 | config: state.config 46 | } 47 | } 48 | MainShell.propTypes = { 49 | loadEnd: PropTypes.bool.isRequired,//是否加载结束了 50 | } 51 | export default connect(select)(MainShell); 52 | -------------------------------------------------------------------------------- /src/component/RightArea.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import LogContent from './right/LogContent'; 4 | import InfoArea from './right/InfoArea'; 5 | class RightArea extends React.Component { 6 | constructor(props) { 7 | super(props) 8 | } 9 | componentDidUpdate() { 10 | this.setPositionAtBottom(); 11 | } 12 | /**定位到最下面一行*/ 13 | setPositionAtBottom() { 14 | // console.log(this.refs.logArea) 15 | // if (!this.state.autoLog) return; 16 | // var logArea = this.refs.logArea; 17 | // if(this.props.config.autoS) 18 | if(this.props.autoRapLog){ 19 | var logArea = document.getElementById("logArea"); 20 | logArea.scrollTop = logArea.scrollHeight; 21 | } 22 | 23 | // console.log(111,logArea.scrollHeight) 24 | // var ex = document.getElementById("rapLogArea");//定位到最下面一行 25 | // ex.scrollTop = ex.scrollHeight; 26 | } 27 | 28 | getLogContent(){ 29 | return this.props.logContent.map((item,index)=>{ 30 | return 31 | }) 32 | } 33 | 34 | render() { 35 | return ( 36 |
37 | 38 |
39 | {this.getLogContent()} 40 |
41 |
42 | ) 43 | } 44 | } 45 | 46 | function select(state) { 47 | return { 48 | autoRapLog:state.config.autoRapLog, 49 | // config: state.config, 50 | logContent:state.logContent 51 | } 52 | } 53 | export default connect(select)(RightArea); 54 | -------------------------------------------------------------------------------- /src/component/Template.jsx: -------------------------------------------------------------------------------- 1 | import React, {PropTypes} from 'react'; 2 | import {connect} from 'react-redux'; 3 | class Template extends React.Component { 4 | constructor(props) { 5 | super(props) 6 | } 7 | componentDidMount(){ 8 | //初始化渲染执行之后立刻调用 9 | } 10 | componentDidUpdate(prevProps){ 11 | //在组件的更新已经同步到 DOM 中之后立刻被调用 12 | } 13 | render() { 14 | return( 15 |
16 | 17 |
18 | ) 19 | } 20 | } 21 | function select(state) { 22 | return { 23 | osType: state.config.osType 24 | } 25 | } 26 | export default connect(select)(Template); -------------------------------------------------------------------------------- /src/component/TestUI.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { connect } from 'react-redux'; 3 | import OpenProject from './left/C2_OpenProject'; 4 | import RapCommand from './left/C1_RapCommand'; 5 | import LeftContainer from './left/LeftContainer'; 6 | import NewProject from './left/C3_NewProject'; 7 | import { tr } from '../lib/Utils'; 8 | class TestUI extends React.Component { 9 | constructor(props) { 10 | super(props); 11 | 12 | } 13 | // 14 | render() { 15 | return ( 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | ) 25 | } 26 | } 27 | 28 | function select(state) { 29 | return { 30 | config: state.config 31 | } 32 | } 33 | export default connect(select)(TestUI); 34 | -------------------------------------------------------------------------------- /src/component/_alerts/InputPanel.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import {tr} from '../../lib/Utils'; 4 | import {closeAlert} from '../../actions/AppActions.jsx'; 5 | import {Input} from 'antd'; 6 | class InputPanel extends React.Component { 7 | constructor(props) { 8 | super(props) 9 | this.state = { 10 | inputValue:'' 11 | } 12 | } 13 | 14 | 15 | render() { 16 | var self = this; 17 | //tr 12确定 13取消 18 | return ( 19 |
20 |
21 |
{this.props.item.data}
22 | {self.setState({inputValue:e.target.value})}}/> 23 |
24 | 29 | 31 |
32 |
33 |
34 | ) 35 | } 36 | } 37 | 38 | //style={{animation:'loadIn 3s'}} 39 | function select(state) { 40 | return { 41 | osType: state.config.osType 42 | } 43 | } 44 | InputPanel.propTypes = { 45 | index: React.PropTypes.number.isRequired, 46 | item: React.PropTypes.object.isRequired, 47 | } 48 | export default connect(select)(InputPanel); -------------------------------------------------------------------------------- /src/component/_alerts/SDKSelecter.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import {tr} from '../../lib/Utils'; 4 | import LocationSelector from './../left/cp/FolderSelector.jsx'; 5 | import {existRapSDK} from '../../lib/~Files'; 6 | import {setRuffSDKLocation,closeAlert} from '../../actions/AppActions.jsx'; 7 | var fs = require('fs'); 8 | class SDKSelecter extends React.Component { 9 | constructor(props) { 10 | super(props) 11 | this.state = { 12 | // sdkExist: true, 13 | ruffSDKLocation: '', 14 | info: '' 15 | } 16 | } 17 | getSDKPath(value) { 18 | if (value == this.state.ruffSDKLocation) { 19 | return; 20 | } 21 | this.setState({ruffSDKLocation: value}); 22 | // console.log(1231,value) 23 | var sdkPath = existRapSDK(value, this.props.osType); 24 | // console.log('path:',path) 25 | if (sdkPath == null) {//211 不是有效的 Ruff SDK 26 | this.setState({info: tr(211)}) 27 | } else { 28 | // this.setState({sdkExist: true}) 29 | setRuffSDKLocation(sdkPath); 30 | closeAlert(this.props.index); 31 | } 32 | } 33 | 34 | render() { 35 | var self = this; 36 | // console.log('this.state.sdkExist:',this.state.sdkExist) 37 | // if (this.state.sdkExist) { 38 | // return (
) 39 | // } 40 | //tr 55 请选择 Ruff SDK 的路径 41 | return ( 42 |
43 |
44 |
{tr(55)}
45 | {self.getSDKPath(value)}}/> 47 |
{this.state.info}
48 |
49 |
50 | ) 51 | } 52 | } 53 | 54 | //style={{animation:'loadIn 3s'}} 55 | function select(state) { 56 | return { 57 | ruffSDKLocation: state.config.ruffSDKLocation, 58 | osType: state.config.osType 59 | } 60 | } 61 | SDKSelecter.propTypes = { 62 | index: React.PropTypes.number.isRequired 63 | } 64 | export default connect(select)(SDKSelecter); -------------------------------------------------------------------------------- /src/component/_alerts/Selecter.jsx: -------------------------------------------------------------------------------- 1 | /**选择器*/ 2 | import React from 'react'; 3 | // import {connect} from 'react-redux'; 4 | import {Radio} from 'antd'; 5 | import {tr} from '../../lib/Utils'; 6 | import {closeAlert} from '../../actions/AppActions.jsx'; 7 | const RadioGroup = Radio.Group; 8 | export default class Selecter extends React.Component { 9 | constructor(props) { 10 | super(props); 11 | this.state = { 12 | select:0, 13 | value:"" 14 | 15 | } 16 | } 17 | componentDidMount(){ 18 | this.setState({value:document.getElementById("select0").innerHTML}) 19 | } 20 | componentDidUpdate(next){ 21 | 22 | } 23 | getSelecters(){ 24 | // marginRight:"20px", 25 | const radioStyle = { display: 'block', height: '30px', lineHeight: '30px' }; 26 | const wordStyle = { position: "absolute", top: '0px', left: '15px',width:"305px", 27 | overflow:"hidden",textOverflow:"ellipsis" } 28 | // console.log("this.props.item.data.items.map",this.props.item.data.items) 29 | return this.props.item.data.items.map(function (item,index) { 30 | // return
{item}
31 | return
{item}
32 | }); 33 | } 34 | render() { 35 | var self = this; 36 | var datas = this.props.item.data; 37 | // console.log("select:",this.state) 38 | //tr 12确定 13取消 39 | return( 40 |
41 |
42 | {datas.title} 43 |
44 | { 45 | var id = e.target.value; 46 | self.setState({select:id,value:document.getElementById("select"+id).innerHTML}) 47 | }}> 48 | {self.getSelecters()} 49 | 50 |
51 | 56 |
57 |
58 | ) 59 | } 60 | } 61 | // style={{padding:"0 20px 0 0"}} 62 | // style={{margin:"0 0 20px 0"}} 63 | //item 的数据结构为 {title:'标题',items:[选择的数组]} 64 | Selecter.propTypes = { 65 | index: React.PropTypes.number.isRequired, 66 | item: React.PropTypes.object.isRequired, 67 | } -------------------------------------------------------------------------------- /src/component/_alerts/SystemUpgrade.jsx: -------------------------------------------------------------------------------- 1 | /**系统更新面板*/ 2 | import React from 'react'; 3 | import {tr} from '../../lib/Utils'; 4 | import {Input,Checkbox} from 'antd'; 5 | import LocationSelector from './../left/cp/FolderSelector.jsx'; 6 | import {closeAlert} from '../../actions/AppActions.jsx'; 7 | var fs = require('fs'); 8 | export default class SystemUpgrade extends React.Component { 9 | constructor(props) { 10 | super(props); 11 | this.state ={ 12 | ip:'', 13 | firmware:"", 14 | checked:false, 15 | createDisabled:true,//默认 确定 按钮禁止按下 16 | warn:'',//警告信息 17 | } 18 | } 19 | componentDidMount(){ 20 | this.getWarn(); 21 | } 22 | componentDidUpdate(next){ 23 | this.getWarn(); 24 | // console.log('componentDidUpdate',next) 25 | } 26 | getFirmwarePath(value){ 27 | if (value == this.state.firmware) { 28 | return; 29 | } 30 | this.setState({firmware:value}) 31 | } 32 | getWarn(){ 33 | var warn; 34 | var createDisabled = true; 35 | if(!this.state.ip){ 36 | warn = tr(56);//请输入开发板的 IP 地址 37 | }else if(!this.state.firmware){ 38 | warn = tr(58);//请选择固件的存放地址 39 | }else if(!fs.existsSync(this.state.firmware)){ 40 | warn = tr(59);//59 固件路径错误 41 | }else if(!this.state.checked){ 42 | warn = tr(43);//请确保电源线已经牢固的连接了 43 | }else{ 44 | warn=""; 45 | createDisabled = false; 46 | } 47 | if(warn != this.state.warn){ 48 | this.setState({warn:warn,createDisabled:createDisabled}); 49 | document.getElementById("warnMessage").innerHTML = `${warn}`; 50 | } 51 | } 52 | render() { 53 | var self = this; 54 | //43 请确保电源线已经牢固的连接了 55 | // tr(56) = '请输入开发板的 IP 地址'; 56 | // tr(57) = '相关信息可以通过 rap scan 命令获得'; 57 | // tr(58) = '请选择固件的存放地址'; 58 | //80 固件更新 59 | // console.log('state:',this.state) 60 | return( 61 |
62 |
63 |
{tr(80)}
64 |
-----------------------
65 |
66 | {`${tr(56)},${tr(57)}`} 67 | {self.setState({ip:e.target.value})}}/> 68 | {tr(58)} 69 |
70 | {self.getFirmwarePath(value)}}/> 72 |
73 | {self.setState({checked:e.target.checked})}}/>{tr(43)} 74 |
75 |
76 |
77 | 82 | 84 |
85 |
86 |
87 | ) 88 | } 89 | } -------------------------------------------------------------------------------- /src/component/_alerts/WifiPanel.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {tr} from '../../lib/Utils'; 3 | import {closeAlert} from '../../actions/AppActions.jsx'; 4 | import {Input} from 'antd'; 5 | export default class WifiPanel extends React.Component { 6 | constructor(props) { 7 | super(props) 8 | this.state = { 9 | ssid:'', 10 | password:'' 11 | } 12 | console.log('WifiPanel') 13 | } 14 | 15 | 16 | render() { 17 | var self = this; 18 | //tr 12确定 13取消 81:设置 WiFi'; 19 | var createDisabled = true;//默认禁止创建项目 20 | if(this.state.ssid && this.state.password){ 21 | createDisabled = false; 22 | } 23 | return ( 24 |
25 |
26 |
{tr(81)}
27 |
28 |
SSID
29 | {self.setState({ssid:e.target.value})}}/> 30 |
password
31 | {self.setState({password:e.target.value})}}/> 32 |
33 |
34 | 39 | 41 |
42 |
43 |
44 | ) 45 | } 46 | } 47 | WifiPanel.propTypes = { 48 | index: React.PropTypes.number.isRequired, 49 | item: React.PropTypes.object.isRequired, 50 | } -------------------------------------------------------------------------------- /src/component/_left/RuffSDK.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import {addOutputCooked, setRuffSDKLocation,getVersion} from '../../actions/AppActions.jsx' 4 | import LocationSelector from './cp/LocationSelector.jsx'; 5 | import {tr} from '../../lib/Utils' 6 | import {existRapSDK} from '../../lib/~Files'; 7 | import {escapePath} from '../../lib/FileUtil' 8 | var fs = require('fs'); 9 | var path = require('path'); 10 | class RuffSDK extends React.Component { 11 | constructor(props) { 12 | super(props) 13 | this.state = { 14 | ruffSDKLocation: '' 15 | } 16 | } 17 | 18 | componentDidMount() { 19 | if(this.props.ruffSDKLocation){ 20 | this.setState({ruffSDKLocation: this.props.ruffSDKLocation}) 21 | //getVersion(); 22 | } 23 | } 24 | componentWillReceiveProps(props){ 25 | if(props.ruffSDKLocation){ 26 | this.setState({ruffSDKLocation: props.ruffSDKLocation}) 27 | addOutputCooked(tr(212), true);//'获得 Ruff SDK 路径'; 28 | getVersion(); 29 | } 30 | //console.log('componentWillReceiveProps',props) 31 | } 32 | 33 | getSDKPath(value) { 34 | if (!value) { 35 | return; 36 | } 37 | this.setState({ruffSDKLocation: value}) 38 | var sdkPath = existRapSDK(value,this.props.osType); 39 | if(sdkPath == null){ 40 | addOutputCooked(tr(211), true);//不是有效的ruff SDK 41 | }else{ 42 | //this.setState({ruffSDKLocation: sdkPath}) 43 | setRuffSDKLocation(sdkPath); 44 | } 45 | } 46 | 47 | render() { 48 | var self = this; 49 | var styleItem = {margin: '0 0 2px 0'} 50 | //tr 10-Ruff SDK 位置 51 | return ( 52 |
53 |
54 |
55 | {self.getSDKPath(value)}}/> 57 |
58 |
59 |
60 | ) 61 | } 62 | } 63 | function select(state) { 64 | return { 65 | ruffSDKLocation: state.config.ruffSDKLocation, 66 | osType: state.config.osType, 67 | } 68 | } 69 | export default connect(select)(RuffSDK); 70 | -------------------------------------------------------------------------------- /src/component/_left/cp/LocationSelector.jsx: -------------------------------------------------------------------------------- 1 | //import React from 'react'; 2 | import React,{Component,PropTypes} from 'react'; 3 | //var PropTypes = React.PropTypes 4 | import {connect} from 'react-redux'; 5 | import {Icon, Row, Col,Input} from 'antd'; 6 | import {dialog} from 'remote'; 7 | //var cp_exec = require('child_process').exec; 8 | 9 | /**文件夹位置选择器*/ 10 | export default class LocationSelector extends Component{ 11 | constructor(props) { 12 | super(props); 13 | } 14 | /**使用该类的时候必须要写入的方法,可以通过 this.props 调用*/ 15 | 16 | 17 | //defaultPath:PropTypes.string.isRequired, 18 | onOpenFolder() { 19 | dialog.showOpenDialog({properties: ['openDirectory','openFile']}, this.onOpenFolderEnd.bind(this)); 20 | } 21 | onOpenFolderEnd(paths){ 22 | console.log('打开文件夹的路径:', paths); 23 | if(paths){ 24 | this.props.onChangeValue(paths[0]); 25 | } 26 | } 27 | render(){ 28 | var self = this; 29 | return( 30 | 31 | 32 | {self.props.onChangeValue(e.target.value)}}/> 33 | 34 | 35 | 38 | 39 | 40 | ) 41 | } 42 | } 43 | LocationSelector.propTypes={ 44 | inputValue: PropTypes.string.isRequired, 45 | placeholder: PropTypes.string.isRequired, 46 | onChangeValue:PropTypes.func.isRequired 47 | } -------------------------------------------------------------------------------- /src/component/_rights/ExtraButton.jsx: -------------------------------------------------------------------------------- 1 | import React, {Component, PropTypes} from 'react'; 2 | import {Icon, Button} from 'antd'; 3 | import {tr} from '../../lib/Utils' 4 | export default class ExtraButton extends Component { 5 | static propTypes = { 6 | iconName: PropTypes.string.isRequired, 7 | onClick: PropTypes.func.isRequired, 8 | tr: PropTypes.number.isRequired 9 | } 10 | 11 | constructor(props) { 12 | super(props) 13 | // this.idxInterval = 0; 14 | } 15 | 16 | componentDidMount() { 17 | //初始化渲染执行之后立刻调用 18 | // console.log(232) 19 | } 20 | 21 | showInfo(e) { 22 | // console.log('show',this.idxInterval) 23 | // clearInterval(this.idxInterval) 24 | var trid = this.props.tr; 25 | var tip = document.getElementById('tip' + trid); 26 | tip.className = 'info-show'; 27 | // tip.style.left = '160px'; 28 | var rect = e.target.getBoundingClientRect(); 29 | // console.log('rect',rect); 30 | // var top = rect.top+'px'; 31 | // var left = rect.left+'px'; 32 | // console.log('top:', e.target.getBoundingClientRect().top) 33 | tip.style.top = rect.bottom + 10 + 'px'; 34 | // tip.style.top = '-8px'; 35 | tip.style.left = rect.left-tip.getBoundingClientRect().width+44+'px'; 36 | // tip.style.left = rect.left-tip.offsetWidth+rect.width+'px'; 37 | // console.log('left:',rect.left,tip.offsetWidth) 38 | // console.log(12312,tip.offsetWidth,tip) 39 | // var id = e.target.id; 40 | // console.log('showInfo',id,this.arrInfos[id],tr(this.arrInfos[id])) 41 | // document.getElementById('tipContent'+this.props.tr).innerHTML = tr(trid); 42 | } 43 | 44 | hideInfo() { 45 | // this.idxInterval = setTimeout(()=> { 46 | // clearInterval(this.idxInterval); 47 | // // console.log('hide',this.idxInterval) 48 | // var tip = document.getElementById('tip'+this.props.tr); 49 | // 50 | // }, 100); 51 | var tip = document.getElementById('tip' + this.props.tr); 52 | if (tip) { 53 | tip.className = 'info-hide'; 54 | } 55 | 56 | } 57 | 58 | render() { 59 | var trid = this.props.tr; 60 | return ( 61 |
62 |
63 |
64 |
{tr(trid)}
65 |
66 | 69 |
70 | ) 71 | } 72 | } -------------------------------------------------------------------------------- /src/component/_rights/ExtraQrCode.jsx: -------------------------------------------------------------------------------- 1 | /**模板文件*/ 2 | import React, {Component, PropTypes} from 'react'; 3 | import {Icon, Button} from 'antd'; 4 | import {connect} from 'react-redux'; 5 | import {tr} from '../../lib/Utils'; 6 | import QRCode from 'qrcode.react'; 7 | class ExtraQrCode extends Component { 8 | static propTypes = { 9 | url: PropTypes.string.isRequired 10 | } 11 | constructor(props) { 12 | super(props) 13 | } 14 | componentDidMount() { 15 | //初始化渲染执行之后立刻调用 16 | } 17 | componentDidUpdate(prevProps) { 18 | //在组件的更新已经同步到 DOM 中之后立刻被调用 19 | } 20 | showInfo(e) { 21 | // console.log('showInfo'); 22 | var tip = document.getElementById('tipQrcode'); 23 | tip.className = 'info-show'; 24 | var rect = e.target.getBoundingClientRect(); 25 | tip.style.top = rect.bottom + 10 + 'px'; 26 | tip.style.left = rect.left - tip.getBoundingClientRect().width + 44 + 'px'; 27 | 28 | } 29 | hideInfo() { 30 | // console.log('hideInfo'); 31 | var tip = document.getElementById('tipQrcode'); 32 | if (tip) { 33 | tip.className = 'info-hide'; 34 | } 35 | } 36 | // bgColor="#2db7f5" 37 | render() { 38 | // tr 18 扫码后在手机上查看日志信息 39 | return ( 40 |
41 |
42 |
43 |
44 |
45 | 46 |
47 |
48 |
{tr(18) }
49 |
50 | 53 |
54 | ) 55 | } 56 | } 57 | //
{'Check the rap log on you cellphone after scan the qrcode'}
58 | function select(state) { 59 | return { 60 | osType: state.config.osType 61 | } 62 | } 63 | export default connect(select)(ExtraQrCode); -------------------------------------------------------------------------------- /src/component/_test/Test1.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | export default class Test1 extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | console.log('Test1') 7 | } 8 | render() { 9 | return ( 10 |
11 | test111 12 |
13 | ) 14 | } 15 | } -------------------------------------------------------------------------------- /src/component/backup/Alerts_1.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import SDKSelecter from './alerts/SDKSelecter.jsx'; 4 | import InputPanel from './alerts/InputPanel.jsx'; 5 | import Selecter from './alerts/Selecter.jsx'; 6 | import WifiPanel from './alerts/WifiPanel.jsx'; 7 | import SystemUpgrade from './alerts/SystemUpgrade.jsx' 8 | import SaveLog from './alerts/SaveLog.jsx'; 9 | 10 | // import {showAlert} from '../actions/AppActions.jsx'; 11 | // import cfg from '../config'; 12 | const PanelSDKSelector = 'panelsdkselector'; 13 | exports.PanelSDKSelector = PanelSDKSelector; 14 | const PanelInput = 'panelinput'; 15 | exports.PanelInput = PanelInput; 16 | const PanelSelecter = 'panelselector'; 17 | exports.PanelSelecter = PanelSelecter; 18 | const PanelSystemUpgrade = 'panelsystemupgrade'; 19 | exports.PanelSystemUpgrade = PanelSystemUpgrade; 20 | const PanelWiFi = 'panelwifi'; 21 | exports.PanelWiFi = PanelWiFi; 22 | const PanelSaveLog = 'panelSaveLog';//保存log日志 23 | exports.PanelSaveLog = PanelSaveLog; 24 | 25 | class Alerts extends React.Component { 26 | constructor(props) { 27 | super(props); 28 | } 29 | 30 | render() { 31 | var self = this; 32 | // console.log('alerts:', this.props.alerts.panels); 33 | // console.log('SDKSelecter.SDKSelector',PanelSDKSelector) 34 | var getAlerts = this.props.alerts.panels.map(function (item, index) { 35 | switch (item.type) { 36 | case PanelSDKSelector: 37 | return ; 38 | case PanelInput: 39 | return ; 40 | case PanelSelecter: 41 | return ; 42 | case PanelSystemUpgrade: 43 | return ; 44 | case PanelWiFi: 45 | return ; 46 | case PanelSaveLog: 47 | return 48 | default : 49 | return
50 | } 51 | }) 52 | //
2222
53 | // 54 | if (this.props.alerts.panels.length < 1) { 55 | return
56 | } else { 57 | return ( 58 |
59 |
60 |
61 | {getAlerts} 62 |
63 |
64 | ) 65 | } 66 | } 67 | } 68 | // 69 | 70 | function select(state) { 71 | return { 72 | alerts: state.alerts 73 | } 74 | } 75 | export default connect(select)(Alerts); -------------------------------------------------------------------------------- /src/component/backup/LeftArea_1.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {connect} from 'react-redux'; 3 | import RapCommand from './left/RapCommand.jsx'; 4 | import OpenProject from './left/OpenProject.jsx'; 5 | import NewProject from './left/NewProject.jsx'; 6 | // import RuffSDK from './left/RuffSDK.jsx'; 7 | import {tr} from '../lib/Utils' 8 | import { Collapse } from 'antd'; 9 | import config from '../config'; 10 | const Panel = Collapse.Panel; 11 | class LeftArea extends React.Component { 12 | constructor(props){ 13 | super(props) 14 | } 15 | callback(key) { 16 | console.log(key); 17 | } 18 | 19 | 20 | render(){ 21 | //console.log(121321,) 22 | //console.log(123,this.props.config) 23 | //0--Rap 命令 ; 1--选择项目 ; 2--新建项目 10--ruff sdk 24 | //默认是打开 1 2 3 25 | //console.log('public:',config.isPublic) 26 | //if(!config.isPublic){ 27 | // return (
28 | //
29 | //
30 | //
31 | // 32 | // 33 | // 34 | // 35 | // 36 | //
37 | //
38 | //
) 39 | //} 40 | return( 41 |
42 |
43 |
44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
58 |
59 |
60 | ) 61 | } 62 | } 63 | // 64 | // 65 | // 66 | function select(state) { 67 | return{ 68 | config:state.config 69 | } 70 | } 71 | export default connect(select)(LeftArea); 72 | -------------------------------------------------------------------------------- /src/component/backup/RightArea_1.jsx: -------------------------------------------------------------------------------- 1 | 2 | import React from 'react'; 3 | import {connect} from 'react-redux'; 4 | import { Tabs, Icon,Button } from 'antd'; 5 | const TabPane = Tabs.TabPane; 6 | import CommandsArea from './rights/CommandsArea.jsx'; 7 | import LogsArea from './rights/LogsArea.jsx'; 8 | // import CommandArea from './right/CommandArea.jsx'; 9 | // import LogArea from './right/LogArea.jsx'; 10 | class RightArea extends React.Component { 11 | constructor(props) { 12 | super(props) 13 | this.state = { 14 | tabKey: "1", 15 | "extra1": '', 16 | "extra2": '' 17 | } 18 | } 19 | changeTab(e) { 20 | // console.log(e,this) 21 | this.setState({ tabKey: e }); 22 | } 23 | /**获取扩展的按钮*/ 24 | getOperations() { 25 | if (this.state.tabKey == "1") { 26 | return this.state.extra1; 27 | } else if (this.state.tabKey == "2") { 28 | return this.state.extra2; 29 | } 30 | } 31 | getExtraContent(key, data) { 32 | this.setState({[key]: data }) 33 | } 34 | render() { 35 | // console.log('rightArea') 36 | // console.log('this.state.tabKey',this.state.tabKey) 37 | return ( 38 |
39 | 40 | Rap 命令} key="1"> 41 | 42 | 43 | Rap Log} key="2"> 44 | 45 | 46 | 47 |
48 | ) 49 | } 50 | } 51 | function select(state) { 52 | return{ 53 | config:state.config 54 | } 55 | } 56 | export default connect(select)(RightArea); -------------------------------------------------------------------------------- /src/component/left/LeftContainer.jsx: -------------------------------------------------------------------------------- 1 | /**左侧每个栏目的容器*/ 2 | import React, {PropTypes} from 'react'; 3 | import {connect} from 'react-redux'; 4 | import {LEFT_CHANGE_CLUMTYPE, command} from '../../actions/AppActions' 5 | // import {command} 6 | class LeftContainer extends React.Component { 7 | 8 | constructor(props) { 9 | super(props) 10 | this.state = { 11 | children: this.props.children 12 | } 13 | } 14 | /**显示子元素的逻辑 */ 15 | // showChildren() { 16 | // // console.log('clum:'+this.props.clumId,this.props.left) 17 | // //0关闭 1打开 2关闭中 18 | // var typeId = this.props.left['clum' + this.props.clumId]; 19 | // if (typeId == 0) { 20 | // return
21 | // } else { 22 | // return this.state.children; 23 | // } 24 | // 25 | // } 26 | /**点击header显示子对象*/ 27 | clickHeader() { 28 | 29 | var clumId = this.props.clumId; 30 | //typeId 0关闭 1打开 2关闭中 31 | var typeId = this.props.left['clum' + clumId]; 32 | // console.log('clumID:',clumId,"typeId:",typeId) 33 | if (typeId == 0) {//关闭的时候打开 34 | command(LEFT_CHANGE_CLUMTYPE, { key: clumId, value: 1 }); 35 | } else if (typeId == 1) {//rap command会有一个延时效果,不再这里关闭 36 | command(LEFT_CHANGE_CLUMTYPE, { key: clumId, value: 2 }); 37 | }else {//打开的时候进入关闭中状态 38 | command(LEFT_CHANGE_CLUMTYPE, { key: clumId, value: 0 }); 39 | } 40 | 41 | } 42 | render() { 43 | return ( 44 |
45 |
{this.props.header}
46 |
47 | {this.state.children } 48 |
49 |
50 | ) 51 | } 52 | } 53 | function select(state) { 54 | return { 55 | left: state.left 56 | } 57 | } 58 | export default connect(select)(LeftContainer); 59 | LeftContainer.propTypes = { 60 | header: PropTypes.string.isRequired,//顶部的文字 61 | clumId: PropTypes.number.isRequired//栏目的id 62 | // show: PropTypes.bool.isRequired,//是否显示 63 | // changeType:PropTypes.func.isRequired,//改变状态的回调 64 | 65 | } -------------------------------------------------------------------------------- /src/component/left/openproject/Item.jsx: -------------------------------------------------------------------------------- 1 | import React, {PropTypes} from 'react'; 2 | import { 3 | addLog, 4 | command, 5 | REMOVE_RUFF_PROJECT, 6 | COLOR_GREEN 7 | } from '../../../actions/AppActions'; 8 | import {tr, cutCharByLength} from '../../../lib/Utils'; 9 | export default class Item extends React.Component { 10 | constructor(props) { 11 | super(props) 12 | var index = this.props.index; 13 | this.aniShow = `widthShow 0.4s ease ${index * 0.1}s both`; 14 | this.isFirst = false; 15 | // console.log(this.aniShow) 16 | } 17 | 18 | componentDidMount() { 19 | 20 | var item = this.refs.hisItem; 21 | item.addEventListener('animationend', ()=> { 22 | // console.log('animationend',this.props.aniType) 23 | if (this.props.aniType == 1) {//只有打开状态才不断的重复 24 | item.style.width = '100%'; 25 | item.style.animation = ''; 26 | } 27 | 28 | }) 29 | } 30 | 31 | componentDidUpdate() { 32 | // console.log('componentDidUpdate') 33 | if (this.props.aniType == 1) { 34 | this.refs.hisItem.style.animation = this.aniShow; 35 | this.refs.hisItem.style.animationPlayState = "running"; 36 | } 37 | } 38 | 39 | render() { 40 | // console.log(123123) 41 | var item = this.props.item; 42 | var index = this.props.index; 43 | if (this.props.aniType == 1) { 44 | var aniStyle = { 45 | width: '0px', 46 | animation: `widthShow 0.4s ease ${index * 0.1}s`, 47 | animationFillMode: 'both' 48 | }; 49 | } else { 50 | aniStyle = { 51 | width: '100%', 52 | animation: `widthClose 0.2s ease ${index * 0.1}s`, 53 | animationFillMode: 'forwards' 54 | }; 55 | } 56 | aniStyle.position = 'relative' 57 | // console.log('aniStyle:',aniStyle) 58 | return ( 59 |
60 |
{ 61 | this.props.clickCallBack(item.path) 62 | }}> 63 |

{ 65 | e.preventDefault(); 66 | e.stopPropagation(); 67 | command(REMOVE_RUFF_PROJECT, {path: item.path}) 68 | addLog(tr(211, item.name), COLOR_GREEN); 69 | }}>X

70 | {`+ ${cutCharByLength(item.name, 16)}`} 71 |
72 |
73 |
74 | ) 75 | } 76 | } 77 | // style={{position:'relative'} 78 | Item.propTypes = { 79 | item: PropTypes.object.isRequired,//路径的对象 80 | aniType: PropTypes.number.isRequired,//动画的类型, 1出现 2关闭 81 | index: PropTypes.number.isRequired, 82 | clickCallBack: PropTypes.func.isRequired,//点击后的回调 83 | } -------------------------------------------------------------------------------- /src/component/right/ExtraButton.jsx: -------------------------------------------------------------------------------- 1 | import React, {PropTypes} from 'react'; 2 | import Button from '../ui/Button'; 3 | import ToggleSwitch from '../ui/ToggleSwitch'; 4 | import {tr} from '../../lib/Utils'; 5 | 6 | export default class ExtraButton extends React.Component { 7 | constructor(props) { 8 | super(props) 9 | this.datas = [ 10 | {iconName: 'icon-folder', doc: tr(11)}, 11 | {iconName: 'icon-save', doc: tr(17)}, 12 | {iconName: 'icon-delete', doc: tr(16)}, 13 | {iconName: '', doc: tr(23)} 14 | ]; 15 | 16 | } 17 | 18 | componentDidMount() { 19 | //初始化渲染执行之后立刻调用 20 | } 21 | 22 | componentDidUpdate(prevProps) { 23 | //在组件的更新已经同步到 DOM 中之后立刻被调用 24 | } 25 | 26 | showInfo(e) { 27 | // console.log('showInfo') 28 | var tip = this.refs.tip; 29 | tip.className = 'infoShow'; 30 | // console.log(777,e.getBoundingClientRect) 31 | var rect = e.getBoundingClientRect(); 32 | // console.log('rect:',rect); 33 | 34 | tip.style.top = rect.bottom + 9 + 'px'; 35 | tip.style.left = rect.left - tip.getBoundingClientRect().width + 36 + 'px'; 36 | // console.log('tip:', rect); 37 | } 38 | 39 | hideInfo() { 40 | var tip = this.refs.tip; 41 | tip.className = 'infoHide'; 42 | } 43 | 44 | render() { 45 | var self = this; 46 | var id = this.props.id; 47 | var iconName = this.datas[id].iconName; 48 | var buttonStyle = {width: '26px', height: '16px', margin: '1px 0 1px 0'}; 49 | buttonStyle = Object.assign(buttonStyle, this.props.buttonStyle); 50 | var content = this.datas[id].doc; 51 | // console.log('style:',buttonStyle); 52 | 53 | var getButton = ()=> { 54 | if (this.props.id != 3) { 55 | return 53 | ) 54 | } 55 | } 56 | //
57 | // 58 | //
59 | //
60 | // {this.props.value} 61 | //
62 | //
63 | // {getIcon()} 64 | Button.propTypes = { 65 | className: PropTypes.string,//样式的名字 66 | style: PropTypes.object,//样式 67 | iconName: PropTypes.string,//图标的名称 68 | value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),//要显示的值 69 | onClick: PropTypes.func, 70 | disabled: PropTypes.bool, 71 | onMouseOver: PropTypes.func, 72 | onMouseOut: PropTypes.func, 73 | } -------------------------------------------------------------------------------- /src/component/ui/FolderSelector.jsx: -------------------------------------------------------------------------------- 1 | import React, {PropTypes} from 'react'; 2 | import {dialog} from 'remote'; 3 | import Buttom from './Button'; 4 | export default class FolderSelector extends React.Component { 5 | constructor(props) { 6 | super(props) 7 | this.isOpen = false;//是否打开了`打开文件夹`的对话框 8 | // this.state.value = this.props.defaultValue || ''; 9 | } 10 | 11 | onOpenFolder() { 12 | // console.log('onOpenFolder',this.isOpen) 13 | if (!this.isOpen) { 14 | this.isOpen = true; 15 | } else { 16 | return; 17 | } 18 | dialog.showOpenDialog({properties: ['openDirectory']}, this.onOpenFolderEnd.bind(this)); 19 | } 20 | 21 | onOpenFolderEnd(paths) { 22 | this.isOpen = false; 23 | if (paths && paths.length > 0) { 24 | this.props.openFolderCallBack(paths[0]); 25 | } 26 | // console.log('path:',paths) 27 | } 28 | 29 | render() { 30 | // var style = {} 31 | // if (this.props.style) { 32 | // style = this.props.style; 33 | // } 34 | // style.display = 'flex'; 35 | // style.textAlign = 'center' 36 | // var self = this; 37 | // var getIcon = function () { 38 | // var className =''; 39 | // if (!self.props.iconName) { 40 | // className= '' 41 | // } else { 42 | // className = `mousePointer iconfont ${self.props.iconName}` 43 | // } 44 | // return
45 | // } 46 | // {background:`url(${self.props.iconSVGUrl})` 47 | // style={{backgroundSize:'contain', 48 | // width:self.props.style.width, height:self.props.style.height}} 49 | return ( 50 | 51 | ) 52 | // return ( 53 | //
54 | //
55 | // {getIcon()} 56 | //
57 | // {this.props.defaultValue} 58 | //
59 | //
60 | //
) 61 | } 62 | } 63 | FolderSelector.propTypes = { 64 | defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),//要显示的值 65 | // onChange: PropTypes.func,//input 内容改变的回调方法 66 | style: PropTypes.object,//样式 67 | iconName: PropTypes.string,//图标的名称 68 | // padding: PropTypes.string, 69 | // margin: PropTypes.string, 70 | openFolderCallBack: PropTypes.func.isRequired, 71 | } -------------------------------------------------------------------------------- /src/component/ui/Input.jsx: -------------------------------------------------------------------------------- 1 | import React, {PropTypes} from 'react'; 2 | export default class Input extends React.Component { 3 | constructor(props) { 4 | super(props) 5 | // this.state = { 6 | // value:'' 7 | // } 8 | // this.state.value = this.props.defaultValue || ''; 9 | } 10 | componentDidMount(){ 11 | //初始化渲染执行之后立刻调用 12 | } 13 | componentDidUpdate(prevProps){ 14 | //在组件的更新已经同步到 DOM 中之后立刻被调用 15 | this.setRight(); 16 | } 17 | /**把光标移动到最右边*/ 18 | setRight(){ 19 | setTimeout(()=>{ 20 | var input = this.refs.input; 21 | input.scrollLeft = input.scrollWidth; 22 | // console.log('setRight') 23 | // console.log('scrollLeft:',input.scrollLeft) 24 | },1) 25 | 26 | } 27 | onChange(e){ 28 | var value = e.target.value; 29 | // this.setState({value:value}); 30 | if(this.props.onChange){ 31 | this.props.onChange(value) 32 | } 33 | 34 | // style.width = this.props.width 35 | // console.log(12312,this.props.onChange) 36 | } 37 | render() { 38 | var style={} 39 | if(this.props.style){ 40 | style = this.props.style; 41 | } 42 | // console.log('input.value:',this.props.value) 43 | return( 44 | 48 | ) 49 | } 50 | } 51 | Input.propTypes = { 52 | value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,//要显示的值 53 | placeholer:PropTypes.oneOfType([PropTypes.string,PropTypes.number]),//默认值 54 | onChange:PropTypes.func,//input 内容改变的回调方法 55 | style:PropTypes.object, 56 | } -------------------------------------------------------------------------------- /src/component/ui/ToggleSwitch.jsx: -------------------------------------------------------------------------------- 1 | /**开关*/ 2 | import React, {PropTypes} from 'react'; 3 | export default class ToggleSwitch extends React.Component { 4 | constructor(props) { 5 | super(props) 6 | } 7 | 8 | componentDidMount() { 9 | //初始化渲染执行之后立刻调用 10 | } 11 | 12 | componentDidUpdate(prevProps) { 13 | //在组件的更新已经同步到 DOM 中之后立刻被调用 14 | } 15 | onMouseOver() { 16 | if (this.props.onMouseOver) { 17 | this.props.onMouseOver(this.refs.button); 18 | } 19 | 20 | } 21 | 22 | onMouseOut() { 23 | if (this.props.onMouseOut) { 24 | this.props.onMouseOut(this.refs.button); 25 | } 26 | 27 | } 28 | 29 | render() { 30 | 31 | // var toggleClass = this.props.toggle?'on':'off'; 32 | // var className = `JUI JToggleSwitch ${toggleClass}`; 33 | var text = this.props.toggle?this.props.valueOn:this.props.valueOff; 34 | var bgClass = this.props.toggle?'on':'off'; 35 | // var bgAlpha = this.props.toggle? 0.7:0.3; 36 | // var style = this.props.style; 37 | // style.background = `rgba(76, 193, 253, ${bgAlpha})`; 38 | // console.log('switchClass:',className) 39 | return ( 40 |
45 |
46 | {text} 47 |
48 | 49 |
50 | ) 51 | } 52 | } 53 | //
54 | // 55 | //
56 | //
57 | // {this.props.value} 58 | //
59 | //
60 | // {getIcon()} 61 | ToggleSwitch.propTypes = { 62 | className: PropTypes.string,//样式的名字 63 | style: PropTypes.object,//样式 64 | toggle:PropTypes.bool, 65 | padding:PropTypes.string, 66 | valueOn: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),//开启状态要显示的值 67 | valueOff: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),//关闭状态要显示的值 68 | onClick: PropTypes.func, 69 | onMouseOver: PropTypes.func, 70 | onMouseOut: PropTypes.func, 71 | 72 | } -------------------------------------------------------------------------------- /src/config.js: -------------------------------------------------------------------------------- 1 | exports.saveData = {//要保存的数据 2 | histrory: [] 3 | }; 4 | exports.platform = '';//系统类型 Windows Mac 5 | exports.configPath = '';//配置文件的位置 6 | exports.fork = null;//本地服务器的子进程,发送rap log用 7 | exports.saveLogPath = '';//保存日志的路径 8 | // exports.isPublic = false;//测试 9 | exports.isPublic = true;//正版本 -------------------------------------------------------------------------------- /src/lib/Utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 全局多语言翻译函数 3 | * @param code 要查询的字符串代码 4 | * @param args 替换字符串中{0}标志的参数列表 5 | * @returns 返回拼接后的字符串 6 | */ 7 | exports.tr = function tr(code, args) { 8 | var text = global['$locale_strings'][code]; 9 | text = format(text, args); 10 | return text; 11 | } 12 | function format(text, args) { 13 | if (!args) { 14 | return text; 15 | } else if (typeof(args) == 'string') { 16 | args = [args]; 17 | } 18 | var length = args.length; 19 | for (var i = 0; i < length || i < 5; i++) { 20 | text = text.replace(new RegExp("\\{" + i + "\\}", "ig"), args[i] || ""); 21 | } 22 | return text; 23 | } 24 | /** 25 | * 从两边向中间取值 26 | * @param str 原始的字符串 27 | * @param num 要取的字符数,一个中文算2个 28 | * @constructor 29 | */ 30 | exports.cutCharToCenter = function (str, num) { 31 | var arr = str.split(""); 32 | //console.log("str:", str) 33 | var strFront = ""; 34 | var strBack = ""; 35 | var w = 0; 36 | var isBreak = false; 37 | while (arr.length > 0) { 38 | var str = arr.shift(); 39 | strFront += str; 40 | w += countCharCode(str); 41 | if (w < num) { 42 | if (arr.length > 0) { 43 | str = arr.pop(); 44 | strBack = str + strBack; 45 | w += countCharCode(str); 46 | if (w >= num) { 47 | isBreak = true; 48 | break; 49 | } 50 | } 51 | } else { 52 | isBreak = true; 53 | break; 54 | } 55 | } 56 | //console.log("arr:", arr) 57 | //console.log("arrFront:", strFront); 58 | //console.log("arrBack:", strBack); 59 | if (isBreak) { 60 | strFront += "....../"; 61 | } 62 | return strFront + strBack; 63 | } 64 | /** 65 | * 截取字符串 66 | * @param str 原始的字符串 67 | * @param num 要取的字符数,一个中文算2个 68 | * @constructor 69 | */ 70 | exports.cutCharByLength = function (str, num) { 71 | var arr = str.split(""); 72 | var w = 0; 73 | var strEnd = ''; 74 | while (arr.length > 0) { 75 | var str = arr.shift(); 76 | w += countCharCode(str); 77 | if (w > num) { 78 | strEnd += '...' 79 | break; 80 | }else { 81 | strEnd += str; 82 | } 83 | } 84 | return strEnd; 85 | } 86 | function countCharCode(str) { 87 | var c = str.charCodeAt(0); 88 | if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {//单字节 89 | return 1; 90 | } else {//双字节 91 | return 2; 92 | } 93 | } 94 | exports.format = format; 95 | -------------------------------------------------------------------------------- /src/lib/locales/zh_CN.js: -------------------------------------------------------------------------------- 1 | global['$locale_strings'] = global['$locale_strings'] || {}; 2 | var locale_strings = global['$locale_strings']; 3 | //0-200 菜单,ui命令 4 | locale_strings[0] = 'Rap 命令'; 5 | locale_strings[1] = '选择 Ruff 项目'; 6 | locale_strings[2] = '新建项目'; 7 | locale_strings[3] = '打开'; 8 | locale_strings[4] = 'Ruff 项目位置'; 9 | locale_strings[5] = '创建项目'; 10 | locale_strings[6] = 'Ruff 项目名称'; 11 | locale_strings[7] = '项目版本'; 12 | locale_strings[8] = '项目描述'; 13 | locale_strings[9] = '项目作者'; 14 | locale_strings[10] = '选择 Ruff SDK '; 15 | locale_strings[11] = '打开项目文件夹'; 16 | locale_strings[12] = '确定'; 17 | locale_strings[13] = '取消'; 18 | locale_strings[14] = '显示调试日志'; 19 | locale_strings[15] = '停止显示调试日志'; 20 | locale_strings[16] = '清除调试日志'; 21 | locale_strings[17] = '保存日志'; 22 | locale_strings[18] = '扫码后在手机上查看日志信息'; 23 | locale_strings[19] = '保存日志到本地'; 24 | locale_strings[20] = '选择要保存的位置'; 25 | locale_strings[21] = '保存日志的文件名'; 26 | locale_strings[22] = '日志保存成功'; 27 | locale_strings[23] = '日志自动滚屏'; 28 | locale_strings[24] = '系统中未安装 rap, 请前往 https://ruff.io/zh-cn/ 下载安装'; 29 | 30 | 31 | locale_strings[43] = '请确保电源线已经牢固的连接了'; 32 | locale_strings[44] = '请使用 rap scan 命令连接设备'; 33 | locale_strings[45] = '给当前开发板设定一个名称'; 34 | locale_strings[46] = '请确认 Ruff 开发板的密码'; 35 | locale_strings[47] = '请设置 Ruff 开发板的密码'; 36 | locale_strings[48] = '请选择一块 Ruff 开发板'; 37 | locale_strings[49] = '请输入 Ruff 开发板的密码'; 38 | locale_strings[50] = '-- 执行命令 --'; 39 | locale_strings[51] = 'rap version:'; 40 | locale_strings[52] = '-- rap log 日志 --'; 41 | locale_strings[53] = '请选择 Ruff SDK'; 42 | locale_strings[54] = '请先选择 Ruff 项目'; 43 | locale_strings[55] = '请选择 Ruff SDK 的路径'; 44 | locale_strings[56] = '请输入开发板的 IP 地址'; 45 | locale_strings[57] = '相关信息可以通过 rap scan 命令获得'; 46 | locale_strings[58] = '请选择固件的存放地址'; 47 | locale_strings[59] = '固件路径错误'; 48 | locale_strings[60] = '请输入要添加的外设的ID'; 49 | locale_strings[61] = '请输入要移除的外设的ID'; 50 | locale_strings[62] = '请输入要更新的外设的ID'; 51 | 52 | locale_strings[70] = '部署应用后自动启动'; 53 | // locale_strings[71] = 'The debug log'; 54 | locale_strings[72] = '图形化显示硬件布局信息'; 55 | locale_strings[73] = '显示 rap 版本信息'; 56 | locale_strings[74] = '显示已连接的设备信息'; 57 | locale_strings[75] = '显示硬件布局信息'; 58 | locale_strings[76] = '应用启动'; 59 | locale_strings[77] = '停止应用'; 60 | locale_strings[78] = '部署应用'; 61 | locale_strings[79] = '扫描并选择要使用的 Ruff 开发板'; 62 | locale_strings[80] = '固件更新'; 63 | locale_strings[81] = '设置 WiFi'; 64 | locale_strings[82] = '添加设备'; 65 | locale_strings[83] = '移除设备'; 66 | locale_strings[84] = '更新设备'; 67 | 68 | //200-400 命令行 69 | locale_strings[200] = "执行命令:{0}"; 70 | locale_strings[201] = "项目:'{0}' 创建完成!"; 71 | locale_strings[202] = '{0}'; 72 | locale_strings[203] = '不是有效的 Ruff 项目'; 73 | locale_strings[204] = "切换至项目: [ {0} ]"; 74 | locale_strings[205] = '路径不存在:{0}'; 75 | locale_strings[206] = '该项目已存在:[{0}]'; 76 | locale_strings[207] = '无效的版本号:[{0}]'; 77 | locale_strings[208] = '创建项目失败:[{0}]'; 78 | locale_strings[209] = '创建文件夹:[{0}]'; 79 | locale_strings[210] = '请先打开 Ruff 项目'; 80 | locale_strings[211] = '从历史纪录中移除项目:[{0}]'; 81 | locale_strings[212] = '获得 Ruff SDK 路径'; 82 | locale_strings[213] = '命令执行结束'; 83 | locale_strings[214] = '项目名称只能是小写的英文字母'; 84 | locale_strings[215] = '文件名不存在'; 85 | -------------------------------------------------------------------------------- /src/lib/~Files.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var fileUtil = require('./FileUtil');// './Utils'; 4 | var os = require('os'); 5 | var net = require('net'); 6 | /** rap SDK 是否存在 不存在返回 null 存在返回路径*/ 7 | exports.existRapSDK = function (value, osType) { 8 | var sdkPath = fileUtil.escapePath(value); 9 | var rapPath = sdkPath + '/bin/' + 'rap'; 10 | if (osType == 'Windows') { 11 | rapPath += '.exe' 12 | } 13 | // console.log('rapPath:',rapPath) 14 | if (fs.existsSync(rapPath)) {//SDK路径是存在的 15 | return sdkPath; 16 | } else {//可能还包含一层路径 17 | var baseName = path.basename(sdkPath); 18 | //sdkPath = `${sdkPath}/${baseName}`; 19 | sdkPath = sdkPath + '/' + baseName;//zip解压可能多包含一层路径 20 | var rapPath2 = sdkPath + '/bin/' + 'rap'; 21 | //console.log('sdk2:',rapPath2) 22 | if (osType == 'Windows') { 23 | rapPath2 += '.exe' 24 | } 25 | //console.log('rapPath2:',rapPath2) 26 | if (fs.existsSync(rapPath2)) { 27 | return sdkPath; 28 | } else { 29 | return null; 30 | } 31 | } 32 | } 33 | /**获取本机 ip 地址 */ 34 | exports.getIpAddress = function () { 35 | var ifaces = os.networkInterfaces(); 36 | var ipAddress; 37 | // console.log(777) 38 | Object.keys(ifaces).forEach(function (ifname) { 39 | ifaces[ifname].forEach(function (iface) { 40 | if ('IPv4' !== iface.family || iface.internal !== false) { 41 | // skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses 42 | return; 43 | } 44 | ipAddress = iface.address; 45 | }) 46 | }) 47 | return ipAddress; 48 | } 49 | /**获取可用端口 callback(port)*/ 50 | exports.getAvailablePort = function (callback) { 51 | var port = 0; 52 | function getPort() { 53 | var server = net.createServer(); 54 | server.on('listening', function () { 55 | port = server.address().port 56 | // console.log("Server running at port:", port); 57 | server.close(); 58 | 59 | }) 60 | server.on('close', function () { 61 | // console.log('callback') 62 | callback(port) 63 | }) 64 | server.on('error', function (err) { 65 | port++; 66 | getPort(); 67 | }) 68 | server.listen(port, '0.0.0.0') 69 | } 70 | getPort(); 71 | } --------------------------------------------------------------------------------