├── .eslintignore
├── dist
├── web
│ └── .gitkeep
└── electron
│ └── .gitkeep
├── static
├── .gitkeep
├── send.svg
├── sendfailed.svg
└── receive.svg
├── src
├── renderer
│ ├── assets
│ │ ├── .gitkeep
│ │ └── logo.png
│ ├── lang
│ │ ├── index.js
│ │ └── locale
│ │ │ ├── ko.js
│ │ │ ├── en.js
│ │ │ └── tr.js
│ ├── store
│ │ ├── index.js
│ │ └── modules
│ │ │ ├── index.js
│ │ │ └── Counter.js
│ ├── components
│ │ ├── WalletMain.vue
│ │ ├── LandingPage
│ │ │ └── SystemInformation.vue
│ │ ├── WalletPage.vue
│ │ ├── HistoryPage.vue
│ │ ├── LandingPage.vue
│ │ ├── NavigationBar.vue
│ │ ├── StartPage.vue
│ │ └── SendPage.vue
│ ├── App.vue
│ ├── router
│ │ └── index.js
│ └── main.js
├── index.ejs
└── main
│ ├── index.dev.js
│ └── index.js
├── images
├── icon.png
├── image_0.png
└── image_1.png
├── .gitignore
├── .babelrc
├── appveyor.yml
├── .eslintrc.js
├── .travis.yml
├── .electron-vue
├── dev-client.js
├── webpack.main.config.js
├── build.js
├── webpack.web.config.js
├── dev-runner.js
└── webpack.renderer.config.js
├── README.md
└── package.json
/.eslintignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dist/web/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dist/electron/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/renderer/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devjin0617/ripplectron/HEAD/images/icon.png
--------------------------------------------------------------------------------
/images/image_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devjin0617/ripplectron/HEAD/images/image_0.png
--------------------------------------------------------------------------------
/images/image_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devjin0617/ripplectron/HEAD/images/image_1.png
--------------------------------------------------------------------------------
/src/renderer/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devjin0617/ripplectron/HEAD/src/renderer/assets/logo.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | dist/electron/*
3 | dist/web/*
4 | build/*
5 | !build/icons
6 | node_modules/
7 | npm-debug.log
8 | npm-debug.log.*
9 | thumbs.db
10 | !.gitkeep
11 |
--------------------------------------------------------------------------------
/src/renderer/lang/index.js:
--------------------------------------------------------------------------------
1 | import en from './locale/en'
2 | import ko from './locale/ko'
3 | import tr from './locale/tr'
4 |
5 | export default {
6 | en: en,
7 | ko: ko,
8 | tr: tr
9 | }
10 |
--------------------------------------------------------------------------------
/src/renderer/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 |
4 | import modules from './modules'
5 |
6 | Vue.use(Vuex)
7 |
8 | export default new Vuex.Store({
9 | modules,
10 | strict: process.env.NODE_ENV !== 'production'
11 | })
12 |
--------------------------------------------------------------------------------
/src/renderer/store/modules/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * The file enables `@/store/index.js` to import all vuex modules
3 | * in a one-shot manner. There should not be any reason to edit this file.
4 | */
5 |
6 | const files = require.context('.', false, /\.js$/)
7 | const modules = {}
8 |
9 | files.keys().forEach(key => {
10 | if (key === './index.js') return
11 | modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
12 | })
13 |
14 | export default modules
15 |
--------------------------------------------------------------------------------
/src/renderer/components/WalletMain.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
20 |
21 |
27 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "comments": false,
3 | "env": {
4 | "main": {
5 | "presets": [
6 | ["env", {
7 | "targets": { "node": 7 }
8 | }],
9 | "stage-0"
10 | ]
11 | },
12 | "renderer": {
13 | "presets": [
14 | ["env", {
15 | "modules": false
16 | }],
17 | "stage-0"
18 | ]
19 | },
20 | "web": {
21 | "presets": [
22 | ["env", {
23 | "modules": false
24 | }],
25 | "stage-0"
26 | ]
27 | }
28 | },
29 | "plugins": ["transform-runtime"]
30 | }
31 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 0.1.{build}
2 |
3 | branches:
4 | only:
5 | - master
6 |
7 | image: Visual Studio 2017
8 | platform:
9 | - x64
10 |
11 | cache:
12 | - node_modules
13 | - '%APPDATA%\npm-cache'
14 | - '%USERPROFILE%\.electron'
15 | - '%USERPROFILE%\AppData\Local\Yarn\cache'
16 |
17 | init:
18 | - git config --global core.autocrlf input
19 |
20 | install:
21 | - ps: Install-Product node 8 x64
22 | - choco install yarn --ignore-dependencies
23 | - git reset --hard HEAD
24 | - yarn
25 | - node --version
26 |
27 | build_script:
28 | - yarn build
29 |
30 | test: off
31 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: 'babel-eslint',
4 | parserOptions: {
5 | sourceType: 'module'
6 | },
7 | env: {
8 | browser: true,
9 | node: true
10 | },
11 | extends: 'standard',
12 | globals: {
13 | __static: true
14 | },
15 | plugins: [
16 | 'html'
17 | ],
18 | 'rules': {
19 | // allow paren-less arrow functions
20 | 'arrow-parens': 0,
21 | // allow async-await
22 | 'generator-star-spacing': 0,
23 | // allow debugger during development
24 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ripplectron
6 | <% if (htmlWebpackPlugin.options.nodeModules) { %>
7 |
8 |
11 | <% } %>
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/main/index.dev.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is used specifically and only for development. It installs
3 | * `electron-debug` & `vue-devtools`. There shouldn't be any need to
4 | * modify this file, but it can be used to extend your development
5 | * environment.
6 | */
7 |
8 | /* eslint-disable */
9 |
10 | // Set environment for development
11 | process.env.NODE_ENV = 'development'
12 |
13 | // Install `electron-debug` with `devtron`
14 | require('electron-debug')({ showDevTools: true })
15 |
16 | // Install `vue-devtools`
17 | require('electron').app.on('ready', () => {
18 | let installExtension = require('electron-devtools-installer')
19 | installExtension.default(installExtension.VUEJS_DEVTOOLS)
20 | .then(() => {})
21 | .catch(err => {
22 | console.log('Unable to install `vue-devtools`: \n', err)
23 | })
24 | })
25 |
26 | // Require `main` process to boot app
27 | require('./index')
28 |
--------------------------------------------------------------------------------
/src/renderer/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
58 |
--------------------------------------------------------------------------------
/src/renderer/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 |
4 | Vue.use(Router)
5 |
6 | export default new Router({
7 | routes: [
8 | {
9 | path: '/',
10 | name: 'start-page',
11 | component: require('@/components/StartPage')
12 | },
13 | {
14 | path: '/wallet',
15 | component: require('@/components/WalletMain'),
16 | children: [
17 | {
18 | path: '',
19 | name: 'wallet-main',
20 | component: require('@/components/WalletPage')
21 | },
22 | {
23 | path: 'send',
24 | name: 'send-page',
25 | component: require('@/components/SendPage')
26 | },
27 | {
28 | path: 'history',
29 | name: 'history-page',
30 | component: require('@/components/HistoryPage')
31 | }
32 | ]
33 | },
34 | {
35 | path: '*',
36 | redirect: '/'
37 | }
38 | ]
39 | })
40 |
--------------------------------------------------------------------------------
/static/send.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | ]>
6 |
10 |
11 |
12 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | osx_image: xcode8.3
2 | sudo: required
3 | dist: trusty
4 | language: c
5 | matrix:
6 | include:
7 | - os: osx
8 | - os: linux
9 | env: CC=clang CXX=clang++ npm_config_clang=1
10 | compiler: clang
11 | cache:
12 | directories:
13 | - node_modules
14 | - "$HOME/.electron"
15 | - "$HOME/.cache"
16 | addons:
17 | apt:
18 | packages:
19 | - libgnome-keyring-dev
20 | - icnsutils
21 | before_install:
22 | - mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
23 | "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
24 | | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
25 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
26 | install:
27 | - nvm install 7
28 | - curl -o- -L https://yarnpkg.com/install.sh | bash
29 | - source ~/.bashrc
30 | - npm install -g xvfb-maybe
31 | - yarn
32 | script:
33 | - yarn run build
34 | branches:
35 | only:
36 | - master
37 |
--------------------------------------------------------------------------------
/static/sendfailed.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | ]>
6 |
10 |
11 |
12 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/.electron-vue/dev-client.js:
--------------------------------------------------------------------------------
1 | const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
2 |
3 | hotClient.subscribe(event => {
4 | /**
5 | * Reload browser when HTMLWebpackPlugin emits a new index.html
6 | */
7 | if (event.action === 'reload') {
8 | window.location.reload()
9 | }
10 |
11 | /**
12 | * Notify `mainWindow` when `main` process is compiling,
13 | * giving notice for an expected reload of the `electron` process
14 | */
15 | if (event.action === 'compiling') {
16 | document.body.innerHTML += `
17 |
30 |
31 |
32 | Compiling Main Process...
33 |
34 | `
35 | }
36 | })
37 |
--------------------------------------------------------------------------------
/src/renderer/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import axios from 'axios'
3 |
4 | import App from './App'
5 | import router from './router'
6 | import store from './store'
7 |
8 | import VueI18n from 'vue-i18n'
9 | import messages from './lang'
10 |
11 | import ElementUI from 'element-ui'
12 | import 'element-ui/lib/theme-default/index.css'
13 |
14 | import { RippleAPI } from 'ripple-lib'
15 |
16 | const api = new RippleAPI({ server: 'wss://s1.ripple.com:443' })
17 |
18 | Vue.prototype.$ripple = api
19 |
20 | let loadingData = null
21 | Vue.prototype.Loading = (isLoading) => {
22 | if (isLoading) {
23 | loadingData = ElementUI.Loading.service({
24 | fullscreen: true
25 | })
26 | } else {
27 | if (loadingData) {
28 | loadingData.close()
29 | }
30 | }
31 | }
32 | Vue.use(VueI18n)
33 | Vue.use(ElementUI)
34 | const i18n = new VueI18n({
35 | locale: 'ko',
36 | messages
37 | })
38 |
39 | if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
40 | Vue.http = Vue.prototype.$http = axios
41 | Vue.config.productionTip = false
42 |
43 | store.dispatch('fetchWallet')
44 |
45 | /* eslint-disable no-new */
46 | new Vue({
47 | components: { App },
48 | router,
49 | store,
50 | i18n,
51 | template: ' '
52 | }).$mount('#app')
53 |
--------------------------------------------------------------------------------
/static/receive.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | ]>
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/renderer/store/modules/Counter.js:
--------------------------------------------------------------------------------
1 | import Store from 'electron-store'
2 | const store = new Store()
3 |
4 | const state = {
5 | main: 0,
6 | wallet: {
7 | address: '',
8 | secret: ''
9 | }
10 | }
11 |
12 | const mutations = {
13 | DECREMENT_MAIN_COUNTER (state) {
14 | state.main--
15 | },
16 | INCREMENT_MAIN_COUNTER (state) {
17 | state.main++
18 | },
19 | RESET (state) {
20 | state.wallet.address = ''
21 | state.wallet.secret = ''
22 | store.delete('address')
23 | store.delete('secret')
24 | },
25 | SET_WALLET (state, params) {
26 | state.wallet.address = params.address
27 | store.set('address', params.address)
28 | if (params.secret) {
29 | state.wallet.secret = params.secret
30 | store.set('secret', params.secret)
31 | }
32 | },
33 | FETCH_WALLET (state) {
34 | state.wallet.address = store.get('address')
35 | state.wallet.secret = store.get('secret')
36 | }
37 | }
38 |
39 | const actions = {
40 | someAsyncTask ({ commit }) {
41 | // do something async
42 | commit('INCREMENT_MAIN_COUNTER')
43 | },
44 | reset ({ commit }) {
45 | commit('RESET')
46 | },
47 | setWallet ({ commit }, params) {
48 | commit('SET_WALLET', params)
49 | },
50 | fetchWallet ({ commit }) {
51 | commit('FETCH_WALLET')
52 | }
53 | }
54 |
55 | const getters = {
56 | getWallet: state => {
57 | return state.wallet
58 | }
59 | }
60 |
61 | export default {
62 | state,
63 | mutations,
64 | actions,
65 | getters
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | import { app, BrowserWindow } from 'electron'
4 |
5 | /**
6 | * Set `__static` path to static files in production
7 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
8 | */
9 | if (process.env.NODE_ENV !== 'development') {
10 | global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
11 | }
12 |
13 | let mainWindow
14 | const winURL = process.env.NODE_ENV === 'development'
15 | ? `http://localhost:9080`
16 | : `file://${__dirname}/index.html`
17 |
18 | function createWindow () {
19 | /**
20 | * Initial window options
21 | */
22 | mainWindow = new BrowserWindow({
23 | height: 540,
24 | useContentSize: true,
25 | width: 680,
26 | resizable: false
27 | })
28 |
29 | mainWindow.loadURL(winURL)
30 |
31 | mainWindow.on('closed', () => {
32 | mainWindow = null
33 | })
34 | }
35 |
36 | app.on('ready', createWindow)
37 |
38 | app.on('window-all-closed', () => {
39 | if (process.platform !== 'darwin') {
40 | app.quit()
41 | }
42 | })
43 |
44 | app.on('activate', () => {
45 | if (mainWindow === null) {
46 | createWindow()
47 | }
48 | })
49 |
50 | /**
51 | * Auto Updater
52 | *
53 | * Uncomment the following code below and install `electron-updater` to
54 | * support auto updating. Code Signing with a valid certificate is required.
55 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating
56 | */
57 |
58 | /*
59 | import { autoUpdater } from 'electron-updater'
60 |
61 | autoUpdater.on('update-downloaded', () => {
62 | autoUpdater.quitAndInstall()
63 | })
64 |
65 | app.on('ready', () => {
66 | if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()
67 | })
68 | */
69 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ripplectron
2 |
3 | > Ripple(Blockchain coin) Wallet Desktop client for vue-electron
4 |
5 | # How to save wallet key
6 |
7 | ```
8 | C = User Crypto key (one-time input → send coin, check secret, load wallet)
9 | S = Ripple Wallet Secret
10 |
11 | HashValue = SHA256(C)
12 | Encryption = AES256.encode(secret:S, key:HashValue)
13 | DecodeValue = AES256.decode(value:Encryption, key:HashValue)
14 | ```
15 |
16 | # Develop RoadMap
17 |
18 | - [x] Create Wallet
19 | - [x] get Balance
20 | - [x] Send Coin (with Destination Tag)
21 | - [x] get History
22 | - [ ] Auto Update
23 | - [ ] Donate Button
24 | - [ ] Ripple Game
25 | - [ ] Mac Version
26 | - [x] Test Version
27 | - [ ] Production
28 | - [ ] Windows Version
29 | - [ ] Test Version
30 | - [ ] Production
31 | - [ ] Linux Version
32 | - [ ] Test Version
33 | - [ ] Production
34 | - [ ] Android Version
35 | - [ ] iOS Version
36 |
37 | 
38 | 
39 | 
40 |
41 | #### Build Setup
42 |
43 | ``` bash
44 | # install dependencies
45 | npm install
46 |
47 | # serve with hot reload at localhost:9080
48 | npm run dev
49 |
50 | # build electron application for production
51 | npm run build
52 |
53 |
54 | # lint all JS/Vue component files in `src/`
55 | npm run lint
56 |
57 | ```
58 |
59 | ---
60 |
61 | This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).
62 |
--------------------------------------------------------------------------------
/src/renderer/components/LandingPage/SystemInformation.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Information
4 |
5 |
6 |
Path:
7 |
{{ path }}
8 |
9 |
10 |
Route Name:
11 |
{{ name }}
12 |
13 |
14 |
Vue.js:
15 |
{{ vue }}
16 |
17 |
18 |
Electron:
19 |
{{ electron }}
20 |
21 |
22 |
Node:
23 |
{{ node }}
24 |
25 |
26 |
Platform:
27 |
{{ platform }}
28 |
29 |
30 |
31 |
32 |
33 |
47 |
48 |
74 |
--------------------------------------------------------------------------------
/.electron-vue/webpack.main.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.BABEL_ENV = 'main'
4 |
5 | const path = require('path')
6 | const { dependencies } = require('../package.json')
7 | const webpack = require('webpack')
8 |
9 | const BabiliWebpackPlugin = require('babili-webpack-plugin')
10 |
11 | let mainConfig = {
12 | entry: {
13 | main: path.join(__dirname, '../src/main/index.js')
14 | },
15 | externals: [
16 | ...Object.keys(dependencies || {})
17 | ],
18 | module: {
19 | rules: [
20 | {
21 | test: /\.(js)$/,
22 | enforce: 'pre',
23 | exclude: /node_modules/,
24 | use: {
25 | loader: 'eslint-loader',
26 | options: {
27 | formatter: require('eslint-friendly-formatter')
28 | }
29 | }
30 | },
31 | {
32 | test: /\.js$/,
33 | use: 'babel-loader',
34 | exclude: /node_modules/
35 | },
36 | {
37 | test: /\.node$/,
38 | use: 'node-loader'
39 | }
40 | ]
41 | },
42 | node: {
43 | __dirname: process.env.NODE_ENV !== 'production',
44 | __filename: process.env.NODE_ENV !== 'production'
45 | },
46 | output: {
47 | filename: '[name].js',
48 | libraryTarget: 'commonjs2',
49 | path: path.join(__dirname, '../dist/electron')
50 | },
51 | plugins: [
52 | new webpack.NoEmitOnErrorsPlugin()
53 | ],
54 | resolve: {
55 | extensions: ['.js', '.json', '.node']
56 | },
57 | target: 'electron-main'
58 | }
59 |
60 | /**
61 | * Adjust mainConfig for development settings
62 | */
63 | if (process.env.NODE_ENV !== 'production') {
64 | mainConfig.plugins.push(
65 | new webpack.DefinePlugin({
66 | '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
67 | })
68 | )
69 | }
70 |
71 | /**
72 | * Adjust mainConfig for production settings
73 | */
74 | if (process.env.NODE_ENV === 'production') {
75 | mainConfig.plugins.push(
76 | new BabiliWebpackPlugin({
77 | removeConsole: true,
78 | removeDebugger: true
79 | }),
80 | new webpack.DefinePlugin({
81 | 'process.env.NODE_ENV': '"production"'
82 | })
83 | )
84 | }
85 |
86 | module.exports = mainConfig
87 |
--------------------------------------------------------------------------------
/src/renderer/lang/locale/ko.js:
--------------------------------------------------------------------------------
1 | export default {
2 | COMMON: {
3 | OK: '확인',
4 | CANCEL: '취소',
5 | PUBLIC_ADDRESS: '공개 주소',
6 | WALLET: '지갑',
7 | SECRET: '비밀키',
8 | CRYPTO_KEY: '암호화 키',
9 | BALANCE: '잔액',
10 | SEND: '전송',
11 | GET_SECRET: '비밀키 확인',
12 | HISTORY: '내역',
13 | REMOVE_WALLET: '지갑 삭제',
14 | REMOVE: '삭제',
15 | INFO: '정보',
16 | APP_INFO: '앱 정보',
17 | DONATE: '기부',
18 | SOURCE_CODE: '소스코드',
19 | VALUE: '금액',
20 | DATE: '날짜',
21 | ADDRESS: '주소',
22 | MESSAGE: {
23 | REMOVED: '삭제되었습니다!',
24 | SUCCESS: '완료했습니다!'
25 | },
26 | ALERT: {
27 | CREATE_SUCCESS: {
28 | TITLE: '완료!',
29 | DESCRIPTION: '지갑이 생성되었습니다.'
30 | }
31 | },
32 | CONFIRM: {
33 | CREATE_WALLET: {
34 | TITLE: '지갑 생성',
35 | DESCRIPTION: '지갑을 생성하시겠습니까?'
36 | },
37 | INPUT_PUBLIC_ADDRESS: {
38 | TITLE: '지갑 가져오기',
39 | DESCRIPTION: '리플 공개 주소를 입력창에 입력해주세요.'
40 | },
41 | INPUT_SECRET: {
42 | TITLE: '지갑 가져오기',
43 | DESCRIPTION: '리플 비밀키를 입력창에 입력해주세요.'
44 | },
45 | INPUT_CRYPTO_KEY: {
46 | TITLE: '암호화',
47 | DESCRIPTION: '리플지갑 암호화 키를 입력하세요. (리플 비밀키가 아닙니다)',
48 | VALIDATION: {
49 | TEXT: '숫자나 문자열을 입력하세요. (6~32자 사이로 이루어져야 합니다.)'
50 | }
51 | },
52 | REMOVE_WALLET: {
53 | TITLE: '경고',
54 | DESCRIPTION: [
55 | '현재 저장되어 있는 리플지갑을 삭제하시겠습니까?',
56 | '(나중에 필요할 때 언제든지 다시 불러올 수 있습니다.)'
57 | ]
58 | },
59 | SEND_COIN: {
60 | TITLE: 'Send',
61 | DESCRIPTION: 'Ready to XRP send?'
62 | }
63 | }
64 | },
65 | START_PAGE: {
66 | TITLE: 'Repplectron (리플 지갑)',
67 | BUTTON: {
68 | CREATE: '지갑 생성',
69 | OPEN: '지갑 가져오기'
70 | }
71 | },
72 | WALLET_PAGE: {
73 | RELOAD_BALANCE: '잔액 갱신'
74 | },
75 | SEND_PAGE: {
76 | DESTINATION_ADDRESS: '상대방 XRP 공개 주소',
77 | IS_TAG_TEXT: 'destination 태그사용',
78 | DESTINATION_TAG: 'destination 태그',
79 | MONEY: '돈',
80 | VALIDATION: {
81 | EMPTY_INPUT: '공개 주소를 다시 확인해주세요.',
82 | CHECK_ADDRESS: '리플 공개 주소를 입력해주세요.',
83 | CHECK_XRP: '전송할 XRP를 입력해주세요.',
84 | CHECK_MONEY: '금액을 확인해주세요.'
85 | }
86 | },
87 | HISTORY_PAGE: {
88 | EMPTY_LIST: '거래내역이 없습니다.'
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/renderer/lang/locale/en.js:
--------------------------------------------------------------------------------
1 | export default {
2 | COMMON: {
3 | OK: 'OK',
4 | CANCEL: 'Cancel',
5 | PUBLIC_ADDRESS: 'Public address',
6 | WALLET: 'Wallet',
7 | SECRET: 'secret',
8 | CRYPTO_KEY: 'Crypto key',
9 | BALANCE: 'Balance',
10 | SEND: 'Send',
11 | GET_SECRET: 'Get Secret',
12 | HISTORY: 'History',
13 | REMOVE_WALLET: 'Remove Wallet',
14 | REMOVE: 'Remove',
15 | INFO: 'Info',
16 | APP_INFO: 'App Info',
17 | DONATE: 'Donate',
18 | SOURCE_CODE: 'Source Code',
19 | VALUE: 'value',
20 | DATE: 'date',
21 | ADDRESS: 'address',
22 | MESSAGE: {
23 | REMOVED: 'Removed!',
24 | SUCCESS: 'Success!'
25 | },
26 | ALERT: {
27 | CREATE_SUCCESS: {
28 | TITLE: 'Success!',
29 | DESCRIPTION: 'Wallet Created'
30 | }
31 | },
32 | CONFIRM: {
33 | CREATE_WALLET: {
34 | TITLE: 'Create Wallet',
35 | DESCRIPTION: 'Would you like to make a wallet?'
36 | },
37 | INPUT_PUBLIC_ADDRESS: {
38 | TITLE: 'Get Wallet',
39 | DESCRIPTION: 'Please input your Ripple Public Address'
40 | },
41 | INPUT_SECRET: {
42 | TITLE: 'Get Wallet',
43 | DESCRIPTION: 'Please input your Ripple Secret'
44 | },
45 | INPUT_CRYPTO_KEY: {
46 | TITLE: 'Encryption',
47 | DESCRIPTION: 'Please input your Crypto key (not Secret key)',
48 | VALIDATION: {
49 | TEXT: 'Number or String (Enter more than 6-32 characters)'
50 | }
51 | },
52 | REMOVE_WALLET: {
53 | TITLE: 'Warning',
54 | DESCRIPTION: [
55 | 'Are you sure you want to delete your wallet?',
56 | '(You can recover it even after deleting it.)'
57 | ]
58 | },
59 | SEND_COIN: {
60 | TITLE: 'Send',
61 | DESCRIPTION: 'Ready to XRP send?'
62 | }
63 | }
64 | },
65 | START_PAGE: {
66 | TITLE: 'Repplectron (Ripple Wallet)',
67 | BUTTON: {
68 | CREATE: 'Create Wallet',
69 | OPEN: 'Get the Wallet'
70 | }
71 | },
72 | WALLET_PAGE: {
73 | RELOAD_BALANCE: 'Reload Balance'
74 | },
75 | SEND_PAGE: {
76 | DESTINATION_ADDRESS: 'Receive XRP Address',
77 | IS_TAG_TEXT: 'using destination tag',
78 | DESTINATION_TAG: 'destination tag',
79 | MONEY: 'Money',
80 | VALIDATION: {
81 | EMPTY_INPUT: 'Please input a valid address',
82 | CHECK_ADDRESS: 'Please input Ripple Address',
83 | CHECK_XRP: 'Please input XRP',
84 | CHECK_MONEY: 'Please input money'
85 | }
86 | },
87 | HISTORY_PAGE: {
88 | EMPTY_LIST: 'No transaction history.'
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/renderer/lang/locale/tr.js:
--------------------------------------------------------------------------------
1 | export default {
2 | COMMON: {
3 | OK: 'Tamam',
4 | CANCEL: 'İptal',
5 | PUBLIC_ADDRESS: 'Cüzdan Adresi',
6 | WALLET: 'Cüzdan',
7 | SECRET: 'Kurtarma Anahtarı',
8 | CRYPTO_KEY: 'Gizli Kelime',
9 | BALANCE: 'Hesabım',
10 | SEND: 'Gönder',
11 | GET_SECRET: 'Kurtarma Anahtarı',
12 | HISTORY: 'Geçmiş',
13 | REMOVE_WALLET: 'Cüzdanı Sil',
14 | REMOVE: 'Sil',
15 | INFO: 'Hakkında',
16 | APP_INFO: 'Uygulama hakkında',
17 | DONATE: 'Bağış',
18 | SOURCE_CODE: 'Kaynak kodu',
19 | VALUE: 'Miktar',
20 | DATE: 'Tarih',
21 | ADDRESS: 'Adres',
22 | MESSAGE: {
23 | REMOVED: 'Silindi!',
24 | SUCCESS: 'Tamamlandı!'
25 | },
26 | ALERT: {
27 | CREATE_SUCCESS: {
28 | TITLE: 'Tamamlandı!',
29 | DESCRIPTION: 'Cüzdan oluşturuldu'
30 | }
31 | },
32 | CONFIRM: {
33 | CREATE_WALLET: {
34 | TITLE: 'Cüzdan oluştur',
35 | DESCRIPTION: 'Cüzdan oluşturmak istiyor musunuz?'
36 | },
37 | INPUT_PUBLIC_ADDRESS: {
38 | TITLE: 'Cüzdan ekle',
39 | DESCRIPTION: 'Lütfen cüzdan adresini giriniz'
40 | },
41 | INPUT_SECRET: {
42 | TITLE: 'Cüzdan ekle',
43 | DESCRIPTION: 'Lütfen cüzdan kurtarma anahtarını giriniz'
44 | },
45 | INPUT_CRYPTO_KEY: {
46 | TITLE: 'Şifreleme',
47 | DESCRIPTION: 'Lütfen gizli kelimenizi giriniz (Kurtarma anahtarını girmeyiniz)',
48 | VALIDATION: {
49 | TEXT: 'Rakam veya harf (6 ile 32 karakter arasında)'
50 | }
51 | },
52 | REMOVE_WALLET: {
53 | TITLE: 'Uyarı',
54 | DESCRIPTION: [
55 | 'Cüzdanı silmek istediğinizden emin misiniz?',
56 | '(Sildikten sonra geri kurtarabilirsiniz)'
57 | ]
58 | },
59 | SEND_COIN: {
60 | TITLE: 'Gönder',
61 | DESCRIPTION: 'Göndermek istediğinizden emin misiniz?'
62 | }
63 | }
64 | },
65 | START_PAGE: {
66 | TITLE: 'Repplectron (Ripple Wallet)',
67 | BUTTON: {
68 | CREATE: 'Cüzdan oluştur',
69 | OPEN: 'Cüzdan ekle'
70 | }
71 | },
72 | WALLET_PAGE: {
73 | RELOAD_BALANCE: 'Bakiyeyi yenile'
74 | },
75 | SEND_PAGE: {
76 | DESTINATION_ADDRESS: 'Alıcı Ripple adresi',
77 | IS_TAG_TEXT: 'Destinasyon etiketi kullan',
78 | DESTINATION_TAG: 'Destinasyon Etiketi',
79 | MONEY: 'Tutar',
80 | VALIDATION: {
81 | EMPTY_INPUT: 'Lütfen geçerli bir adres giriniz',
82 | CHECK_ADDRESS: 'Lütfen Ripple adresi giriniz',
83 | CHECK_XRP: 'Lütfen XRP miktarını giriniz.',
84 | CHECK_MONEY: 'Lütfen tutarı giriniz.'
85 | }
86 | },
87 | HISTORY_PAGE: {
88 | EMPTY_LIST: 'İşlem geçmişi bulunmamakta.'
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/renderer/components/WalletPage.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
{{ $t('COMMON.BALANCE') }}
6 |
7 |
{{ balance }} XRP
8 |
9 |
10 | {{ $t('WALLET_PAGE.RELOAD_BALANCE') }}
11 |
12 |
13 |
14 | {{ $t('COMMON.PUBLIC_ADDRESS') }}: {{ getWallet.address }}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
83 |
84 |
120 |
--------------------------------------------------------------------------------
/src/renderer/components/HistoryPage.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
25 |
26 |
29 |
30 | {{ scope.row.tx.Account }}
31 | {{ scope.row.tx.Destination }}
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
88 |
89 |
104 |
--------------------------------------------------------------------------------
/src/renderer/components/LandingPage.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Welcome to your new project!
8 |
9 |
10 |
11 |
12 |
13 |
14 |
Getting Started
15 |
16 | electron-vue comes packed with detailed documentation that covers everything from
17 | internal configurations, using the project structure, building your application,
18 | and so much more.
19 |
20 |
Read the Docs
21 |
22 |
23 |
Other Documentation
24 |
Electron
25 |
Vue.js
26 |
27 |
28 |
29 |
30 |
31 |
32 |
45 |
46 |
129 |
--------------------------------------------------------------------------------
/.electron-vue/build.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.NODE_ENV = 'production'
4 |
5 | const { say } = require('cfonts')
6 | const chalk = require('chalk')
7 | const del = require('del')
8 | const { spawn } = require('child_process')
9 | const webpack = require('webpack')
10 | const Multispinner = require('multispinner')
11 |
12 |
13 | const mainConfig = require('./webpack.main.config')
14 | const rendererConfig = require('./webpack.renderer.config')
15 | const webConfig = require('./webpack.web.config')
16 |
17 | const doneLog = chalk.bgGreen.white(' DONE ') + ' '
18 | const errorLog = chalk.bgRed.white(' ERROR ') + ' '
19 | const okayLog = chalk.bgBlue.white(' OKAY ') + ' '
20 | const isCI = process.env.CI || false
21 |
22 | if (process.env.BUILD_TARGET === 'clean') clean()
23 | else if (process.env.BUILD_TARGET === 'web') web()
24 | else build()
25 |
26 | function clean () {
27 | del.sync(['build/*', '!build/icons', '!build/icons/icon.*'])
28 | console.log(`\n${doneLog}\n`)
29 | process.exit()
30 | }
31 |
32 | function build () {
33 | greeting()
34 |
35 | del.sync(['dist/electron/*', '!.gitkeep'])
36 |
37 | const tasks = ['main', 'renderer']
38 | const m = new Multispinner(tasks, {
39 | preText: 'building',
40 | postText: 'process'
41 | })
42 |
43 | let results = ''
44 |
45 | m.on('success', () => {
46 | process.stdout.write('\x1B[2J\x1B[0f')
47 | console.log(`\n\n${results}`)
48 | console.log(`${okayLog}take it away ${chalk.yellow('`electron-builder`')}\n`)
49 | process.exit()
50 | })
51 |
52 | pack(mainConfig).then(result => {
53 | results += result + '\n\n'
54 | m.success('main')
55 | }).catch(err => {
56 | m.error('main')
57 | console.log(`\n ${errorLog}failed to build main process`)
58 | console.error(`\n${err}\n`)
59 | process.exit(1)
60 | })
61 |
62 | pack(rendererConfig).then(result => {
63 | results += result + '\n\n'
64 | m.success('renderer')
65 | }).catch(err => {
66 | m.error('renderer')
67 | console.log(`\n ${errorLog}failed to build renderer process`)
68 | console.error(`\n${err}\n`)
69 | process.exit(1)
70 | })
71 | }
72 |
73 | function pack (config) {
74 | return new Promise((resolve, reject) => {
75 | webpack(config, (err, stats) => {
76 | if (err) reject(err.stack || err)
77 | else if (stats.hasErrors()) {
78 | let err = ''
79 |
80 | stats.toString({
81 | chunks: false,
82 | colors: true
83 | })
84 | .split(/\r?\n/)
85 | .forEach(line => {
86 | err += ` ${line}\n`
87 | })
88 |
89 | reject(err)
90 | } else {
91 | resolve(stats.toString({
92 | chunks: false,
93 | colors: true
94 | }))
95 | }
96 | })
97 | })
98 | }
99 |
100 | function web () {
101 | del.sync(['dist/web/*', '!.gitkeep'])
102 | webpack(webConfig, (err, stats) => {
103 | if (err || stats.hasErrors()) console.log(err)
104 |
105 | console.log(stats.toString({
106 | chunks: false,
107 | colors: true
108 | }))
109 |
110 | process.exit()
111 | })
112 | }
113 |
114 | function greeting () {
115 | const cols = process.stdout.columns
116 | let text = ''
117 |
118 | if (cols > 85) text = 'lets-build'
119 | else if (cols > 60) text = 'lets-|build'
120 | else text = false
121 |
122 | if (text && !isCI) {
123 | say(text, {
124 | colors: ['yellow'],
125 | font: 'simple3d',
126 | space: false
127 | })
128 | } else console.log(chalk.yellow.bold('\n lets-build'))
129 | console.log()
130 | }
131 |
--------------------------------------------------------------------------------
/.electron-vue/webpack.web.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.BABEL_ENV = 'web'
4 |
5 | const path = require('path')
6 | const webpack = require('webpack')
7 |
8 | const BabiliWebpackPlugin = require('babili-webpack-plugin')
9 | const CopyWebpackPlugin = require('copy-webpack-plugin')
10 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | const HtmlWebpackPlugin = require('html-webpack-plugin')
12 |
13 | let webConfig = {
14 | devtool: '#cheap-module-eval-source-map',
15 | entry: {
16 | web: path.join(__dirname, '../src/renderer/main.js')
17 | },
18 | module: {
19 | rules: [
20 | {
21 | test: /\.(js|vue)$/,
22 | enforce: 'pre',
23 | exclude: /node_modules/,
24 | use: {
25 | loader: 'eslint-loader',
26 | options: {
27 | formatter: require('eslint-friendly-formatter')
28 | }
29 | }
30 | },
31 | {
32 | test: /\.css$/,
33 | use: ExtractTextPlugin.extract({
34 | fallback: 'style-loader',
35 | use: 'css-loader'
36 | })
37 | },
38 | {
39 | test: /\.html$/,
40 | use: 'vue-html-loader'
41 | },
42 | {
43 | test: /\.js$/,
44 | use: 'babel-loader',
45 | include: [ path.resolve(__dirname, '../src/renderer') ],
46 | exclude: /node_modules/
47 | },
48 | {
49 | test: /\.vue$/,
50 | use: {
51 | loader: 'vue-loader',
52 | options: {
53 | extractCSS: true,
54 | loaders: {
55 | sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
56 | scss: 'vue-style-loader!css-loader!sass-loader'
57 | }
58 | }
59 | }
60 | },
61 | {
62 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
63 | use: {
64 | loader: 'url-loader',
65 | query: {
66 | limit: 10000,
67 | name: 'imgs/[name].[ext]'
68 | }
69 | }
70 | },
71 | {
72 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
73 | use: {
74 | loader: 'url-loader',
75 | query: {
76 | limit: 10000,
77 | name: 'fonts/[name].[ext]'
78 | }
79 | }
80 | }
81 | ]
82 | },
83 | plugins: [
84 | new ExtractTextPlugin('styles.css'),
85 | new HtmlWebpackPlugin({
86 | filename: 'index.html',
87 | template: path.resolve(__dirname, '../src/index.ejs'),
88 | minify: {
89 | collapseWhitespace: true,
90 | removeAttributeQuotes: true,
91 | removeComments: true
92 | },
93 | nodeModules: false
94 | }),
95 | new webpack.DefinePlugin({
96 | 'process.env.IS_WEB': 'true'
97 | }),
98 | new webpack.HotModuleReplacementPlugin(),
99 | new webpack.NoEmitOnErrorsPlugin()
100 | ],
101 | output: {
102 | filename: '[name].js',
103 | path: path.join(__dirname, '../dist/web')
104 | },
105 | resolve: {
106 | alias: {
107 | '@': path.join(__dirname, '../src/renderer'),
108 | 'vue$': 'vue/dist/vue.esm.js'
109 | },
110 | extensions: ['.js', '.vue', '.json', '.css']
111 | },
112 | target: 'web'
113 | }
114 |
115 | /**
116 | * Adjust webConfig for production settings
117 | */
118 | if (process.env.NODE_ENV === 'production') {
119 | webConfig.devtool = ''
120 |
121 | webConfig.plugins.push(
122 | new BabiliWebpackPlugin({
123 | removeConsole: true,
124 | removeDebugger: true
125 | }),
126 | new CopyWebpackPlugin([
127 | {
128 | from: path.join(__dirname, '../static'),
129 | to: path.join(__dirname, '../dist/web/static'),
130 | ignore: ['.*']
131 | }
132 | ]),
133 | new webpack.DefinePlugin({
134 | 'process.env.NODE_ENV': '"production"'
135 | }),
136 | new webpack.LoaderOptionsPlugin({
137 | minimize: true
138 | })
139 | )
140 | }
141 |
142 | module.exports = webConfig
143 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ripplectron",
3 | "version": "0.0.3",
4 | "author": "devjin0617 ",
5 | "description": "An electron-vue project",
6 | "license": null,
7 | "main": "./dist/electron/main.js",
8 | "scripts": {
9 | "build": "node .electron-vue/build.js && electron-builder",
10 | "build:dir": "node .electron-vue/build.js && electron-builder --dir",
11 | "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
12 | "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
13 | "dev": "node .electron-vue/dev-runner.js",
14 | "lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src",
15 | "lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
16 | "pack": "npm run pack:main && npm run pack:renderer",
17 | "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
18 | "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
19 | "postinstall": "npm run lint:fix"
20 | },
21 | "build": {
22 | "productName": "ripplectron",
23 | "appId": "org.simulatedgreg.electron-vue",
24 | "directories": {
25 | "output": "build"
26 | },
27 | "files": [
28 | "dist/electron/**/*"
29 | ],
30 | "dmg": {
31 | "contents": [
32 | {
33 | "x": 410,
34 | "y": 150,
35 | "type": "link",
36 | "path": "/Applications"
37 | },
38 | {
39 | "x": 130,
40 | "y": 150,
41 | "type": "file"
42 | }
43 | ]
44 | },
45 | "mac": {
46 | "icon": "build/icons/icon.icns"
47 | },
48 | "win": {
49 | "icon": "build/icons/icon.ico"
50 | },
51 | "linux": {
52 | "icon": "build/icons"
53 | }
54 | },
55 | "dependencies": {
56 | "aes256": "^1.0.2",
57 | "axios": "^0.16.1",
58 | "electron-store": "^1.2.0",
59 | "element-ui": "^1.4.1",
60 | "moment": "^2.18.1",
61 | "node-sass": "^4.5.3",
62 | "ripple-lib": "^0.17.7",
63 | "sass-loader": "^6.0.6",
64 | "sha256": "^0.2.0",
65 | "vue": "^2.4.2",
66 | "vue-electron": "^1.0.6",
67 | "vue-i18n": "^7.0.5",
68 | "vue-router": "^2.5.3",
69 | "vuex": "^2.3.1"
70 | },
71 | "devDependencies": {
72 | "babel-core": "^6.22.1",
73 | "babel-loader": "^7.0.0",
74 | "babel-plugin-transform-runtime": "^6.22.0",
75 | "babel-preset-env": "^1.3.3",
76 | "babel-preset-stage-0": "^6.5.0",
77 | "babel-register": "^6.2.0",
78 | "babili-webpack-plugin": "^0.1.1",
79 | "cfonts": "^1.1.3",
80 | "chalk": "^1.1.3",
81 | "copy-webpack-plugin": "^4.0.1",
82 | "cross-env": "^5.0.0",
83 | "css-loader": "^0.28.4",
84 | "del": "^2.2.1",
85 | "devtron": "^1.1.0",
86 | "electron": "^1.7.2",
87 | "electron-debug": "^1.1.0",
88 | "electron-devtools-installer": "^2.0.1",
89 | "electron-builder": "^19.10.0",
90 | "babel-eslint": "^7.0.0",
91 | "eslint": "^3.13.1",
92 | "eslint-friendly-formatter": "^3.0.0",
93 | "eslint-loader": "^1.3.0",
94 | "eslint-plugin-html": "^2.0.0",
95 | "eslint-config-standard": "^10.2.1",
96 | "eslint-plugin-import": "^2.3.0",
97 | "eslint-plugin-node": "^4.2.2",
98 | "eslint-plugin-promise": "^3.4.0",
99 | "eslint-plugin-standard": "^3.0.1",
100 | "extract-text-webpack-plugin": "^2.0.0-beta.4",
101 | "file-loader": "^0.11.1",
102 | "html-webpack-plugin": "^2.16.1",
103 | "json-loader": "^0.5.4",
104 | "multispinner": "^0.2.1",
105 | "style-loader": "^0.18.1",
106 | "url-loader": "^0.5.7",
107 | "vue-html-loader": "^1.2.2",
108 | "vue-loader": "^12.2.1",
109 | "vue-style-loader": "^3.0.1",
110 | "vue-template-compiler": "^2.3.3",
111 | "webpack": "^2.2.1",
112 | "webpack-dev-server": "^2.3.0",
113 | "webpack-hot-middleware": "^2.18.0"
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/src/renderer/components/NavigationBar.vue:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
126 |
127 |
137 |
--------------------------------------------------------------------------------
/.electron-vue/dev-runner.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const chalk = require('chalk')
4 | const electron = require('electron')
5 | const path = require('path')
6 | const { say } = require('cfonts')
7 | const { spawn } = require('child_process')
8 | const webpack = require('webpack')
9 | const WebpackDevServer = require('webpack-dev-server')
10 | const webpackHotMiddleware = require('webpack-hot-middleware')
11 |
12 | const mainConfig = require('./webpack.main.config')
13 | const rendererConfig = require('./webpack.renderer.config')
14 |
15 | let electronProcess = null
16 | let manualRestart = false
17 | let hotMiddleware
18 |
19 | function logStats (proc, data) {
20 | let log = ''
21 |
22 | log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`)
23 | log += '\n\n'
24 |
25 | if (typeof data === 'object') {
26 | data.toString({
27 | colors: true,
28 | chunks: false
29 | }).split(/\r?\n/).forEach(line => {
30 | log += ' ' + line + '\n'
31 | })
32 | } else {
33 | log += ` ${data}\n`
34 | }
35 |
36 | log += '\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\n'
37 |
38 | console.log(log)
39 | }
40 |
41 | function startRenderer () {
42 | return new Promise((resolve, reject) => {
43 | rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer)
44 |
45 | const compiler = webpack(rendererConfig)
46 | hotMiddleware = webpackHotMiddleware(compiler, {
47 | log: false,
48 | heartbeat: 2500
49 | })
50 |
51 | compiler.plugin('compilation', compilation => {
52 | compilation.plugin('html-webpack-plugin-after-emit', (data, cb) => {
53 | hotMiddleware.publish({ action: 'reload' })
54 | cb()
55 | })
56 | })
57 |
58 | compiler.plugin('done', stats => {
59 | logStats('Renderer', stats)
60 | })
61 |
62 | const server = new WebpackDevServer(
63 | compiler,
64 | {
65 | contentBase: path.join(__dirname, '../'),
66 | quiet: true,
67 | setup (app, ctx) {
68 | app.use(hotMiddleware)
69 | ctx.middleware.waitUntilValid(() => {
70 | resolve()
71 | })
72 | }
73 | }
74 | )
75 |
76 | server.listen(9080)
77 | })
78 | }
79 |
80 | function startMain () {
81 | return new Promise((resolve, reject) => {
82 | mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)
83 |
84 | const compiler = webpack(mainConfig)
85 |
86 | compiler.plugin('watch-run', (compilation, done) => {
87 | logStats('Main', chalk.white.bold('compiling...'))
88 | hotMiddleware.publish({ action: 'compiling' })
89 | done()
90 | })
91 |
92 | compiler.watch({}, (err, stats) => {
93 | if (err) {
94 | console.log(err)
95 | return
96 | }
97 |
98 | logStats('Main', stats)
99 |
100 | if (electronProcess && electronProcess.kill) {
101 | manualRestart = true
102 | process.kill(electronProcess.pid)
103 | electronProcess = null
104 | startElectron()
105 |
106 | setTimeout(() => {
107 | manualRestart = false
108 | }, 5000)
109 | }
110 |
111 | resolve()
112 | })
113 | })
114 | }
115 |
116 | function startElectron () {
117 | electronProcess = spawn(electron, ['--inspect=5858', path.join(__dirname, '../dist/electron/main.js')])
118 |
119 | electronProcess.stdout.on('data', data => {
120 | electronLog(data, 'blue')
121 | })
122 | electronProcess.stderr.on('data', data => {
123 | electronLog(data, 'red')
124 | })
125 |
126 | electronProcess.on('close', () => {
127 | if (!manualRestart) process.exit()
128 | })
129 | }
130 |
131 | function electronLog (data, color) {
132 | let log = ''
133 | data = data.toString().split(/\r?\n/)
134 | data.forEach(line => {
135 | log += ` ${line}\n`
136 | })
137 | if (/[0-9A-z]+/.test(log)) {
138 | console.log(
139 | chalk[color].bold('┏ Electron -------------------') +
140 | '\n\n' +
141 | log +
142 | chalk[color].bold('┗ ----------------------------') +
143 | '\n'
144 | )
145 | }
146 | }
147 |
148 | function greeting () {
149 | const cols = process.stdout.columns
150 | let text = ''
151 |
152 | if (cols > 104) text = 'electron-vue'
153 | else if (cols > 76) text = 'electron-|vue'
154 | else text = false
155 |
156 | if (text) {
157 | say(text, {
158 | colors: ['yellow'],
159 | font: 'simple3d',
160 | space: false
161 | })
162 | } else console.log(chalk.yellow.bold('\n electron-vue'))
163 | console.log(chalk.blue(' getting ready...') + '\n')
164 | }
165 |
166 | function init () {
167 | greeting()
168 |
169 | Promise.all([startRenderer(), startMain()])
170 | .then(() => {
171 | startElectron()
172 | })
173 | .catch(err => {
174 | console.error(err)
175 | })
176 | }
177 |
178 | init()
179 |
--------------------------------------------------------------------------------
/src/renderer/components/StartPage.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ $t('START_PAGE.TITLE') }}
6 |
7 |
8 | {{ $t('START_PAGE.BUTTON.CREATE') }}
9 | {{ $t('START_PAGE.BUTTON.OPEN') }}
10 |
11 |
12 |
13 |
14 |
15 |
122 |
123 |
137 |
--------------------------------------------------------------------------------
/.electron-vue/webpack.renderer.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.BABEL_ENV = 'renderer'
4 |
5 | const path = require('path')
6 | const { dependencies } = require('../package.json')
7 | const webpack = require('webpack')
8 |
9 | const BabiliWebpackPlugin = require('babili-webpack-plugin')
10 | const CopyWebpackPlugin = require('copy-webpack-plugin')
11 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
12 | const HtmlWebpackPlugin = require('html-webpack-plugin')
13 |
14 | /**
15 | * List of node_modules to include in webpack bundle
16 | *
17 | * Required for specific packages like Vue UI libraries
18 | * that provide pure *.vue files that need compiling
19 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals
20 | */
21 | let whiteListedModules = ['vue']
22 |
23 | let rendererConfig = {
24 | devtool: '#cheap-module-eval-source-map',
25 | entry: {
26 | renderer: path.join(__dirname, '../src/renderer/main.js')
27 | },
28 | externals: [
29 | ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d))
30 | ],
31 | module: {
32 | rules: [
33 | {
34 | test: /\.(js|vue)$/,
35 | enforce: 'pre',
36 | exclude: /node_modules/,
37 | use: {
38 | loader: 'eslint-loader',
39 | options: {
40 | formatter: require('eslint-friendly-formatter')
41 | }
42 | }
43 | },
44 | {
45 | test: /\.css$/,
46 | use: ExtractTextPlugin.extract({
47 | fallback: 'style-loader',
48 | use: 'css-loader'
49 | })
50 | },
51 | {
52 | test: /\.html$/,
53 | use: 'vue-html-loader'
54 | },
55 | {
56 | test: /\.js$/,
57 | use: 'babel-loader',
58 | exclude: /node_modules/
59 | },
60 | {
61 | test: /\.node$/,
62 | use: 'node-loader'
63 | },
64 | {
65 | test: /\.vue$/,
66 | use: {
67 | loader: 'vue-loader',
68 | options: {
69 | extractCSS: process.env.NODE_ENV === 'production',
70 | loaders: {
71 | sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
72 | scss: 'vue-style-loader!css-loader!sass-loader'
73 | }
74 | }
75 | }
76 | },
77 | {
78 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
79 | use: {
80 | loader: 'url-loader',
81 | query: {
82 | limit: 10000,
83 | name: 'imgs/[name].[ext]'
84 | }
85 | }
86 | },
87 | {
88 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
89 | use: {
90 | loader: 'url-loader',
91 | query: {
92 | limit: 10000,
93 | name: 'fonts/[name].[ext]'
94 | }
95 | }
96 | }
97 | ]
98 | },
99 | node: {
100 | __dirname: process.env.NODE_ENV !== 'production',
101 | __filename: process.env.NODE_ENV !== 'production'
102 | },
103 | plugins: [
104 | new ExtractTextPlugin('styles.css'),
105 | new HtmlWebpackPlugin({
106 | filename: 'index.html',
107 | template: path.resolve(__dirname, '../src/index.ejs'),
108 | minify: {
109 | collapseWhitespace: true,
110 | removeAttributeQuotes: true,
111 | removeComments: true
112 | },
113 | nodeModules: process.env.NODE_ENV !== 'production'
114 | ? path.resolve(__dirname, '../node_modules')
115 | : false
116 | }),
117 | new webpack.HotModuleReplacementPlugin(),
118 | new webpack.NoEmitOnErrorsPlugin()
119 | ],
120 | output: {
121 | filename: '[name].js',
122 | libraryTarget: 'commonjs2',
123 | path: path.join(__dirname, '../dist/electron')
124 | },
125 | resolve: {
126 | alias: {
127 | '@': path.join(__dirname, '../src/renderer'),
128 | 'vue$': 'vue/dist/vue.esm.js'
129 | },
130 | extensions: ['.js', '.vue', '.json', '.css', '.node']
131 | },
132 | target: 'electron-renderer'
133 | }
134 |
135 | /**
136 | * Adjust rendererConfig for development settings
137 | */
138 | if (process.env.NODE_ENV !== 'production') {
139 | rendererConfig.plugins.push(
140 | new webpack.DefinePlugin({
141 | '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
142 | })
143 | )
144 | }
145 |
146 | /**
147 | * Adjust rendererConfig for production settings
148 | */
149 | if (process.env.NODE_ENV === 'production') {
150 | rendererConfig.devtool = ''
151 |
152 | rendererConfig.plugins.push(
153 | new BabiliWebpackPlugin({
154 | removeConsole: true,
155 | removeDebugger: true
156 | }),
157 | new CopyWebpackPlugin([
158 | {
159 | from: path.join(__dirname, '../static'),
160 | to: path.join(__dirname, '../dist/electron/static'),
161 | ignore: ['.*']
162 | }
163 | ]),
164 | new webpack.DefinePlugin({
165 | 'process.env.NODE_ENV': '"production"'
166 | }),
167 | new webpack.LoaderOptionsPlugin({
168 | minimize: true
169 | })
170 | )
171 | }
172 |
173 | module.exports = rendererConfig
174 |
--------------------------------------------------------------------------------
/src/renderer/components/SendPage.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {{ $t('COMMON.SEND') }}
27 |
28 |
29 |
30 |
31 |
32 |
170 |
171 |
233 |
--------------------------------------------------------------------------------