Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Redesign #516

Merged
merged 55 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
9212def
add files
hacdias Dec 1, 2017
2aa19c0
space
hacdias Dec 1, 2017
7658afd
remove old fonts
hacdias Dec 1, 2017
8597f71
add new fonts
hacdias Dec 1, 2017
fbd9f14
Remove icons and update pkg.json
hacdias Dec 1, 2017
7c78e20
Remove old files from settings and profile
hacdias Dec 1, 2017
ff1e5a8
Exit on context menu
hacdias Dec 1, 2017
27f61f0
Add context menu Settings and Exit
hacdias Dec 1, 2017
009518c
Show info right
hacdias Dec 1, 2017
d3cbd8b
Add hearbeat
hacdias Dec 2, 2017
0ca2b88
remove unnecessary stuff
hacdias Dec 2, 2017
1faee58
Fix error when installing IPFS for the 1st time
hacdias Dec 2, 2017
a096ff1
Increase menubar size to fit peers
hacdias Dec 2, 2017
78b1b85
More organised css. Overflow hidden file name when it's biig
hacdias Dec 2, 2017
08faf60
Ongoing Welcome Screen Update
hacdias Dec 2, 2017
92078bf
Settings button init
hacdias Dec 2, 2017
7b30691
Search peer by id
hacdias Dec 2, 2017
12f9966
Add more file formats
hacdias Dec 2, 2017
f1e53ae
Settings button
hacdias Dec 3, 2017
9640025
new welcome screen
hacdias Dec 3, 2017
3ff25b4
Simplify files
hacdias Dec 3, 2017
43fa89e
Dropper styles
hacdias Dec 3, 2017
0c0cc73
change big font size
hacdias Dec 4, 2017
aee2b15
remove useless config
hacdias Dec 4, 2017
2b12b62
simplify drag and drop and make + button work
hacdias Dec 4, 2017
2b1c9a6
upload folder utton working
hacdias Dec 4, 2017
e303695
siplify function
hacdias Dec 4, 2017
552af06
fix bug
hacdias Dec 4, 2017
a66c222
key icon
hacdias Dec 4, 2017
25e25aa
update
hacdias Dec 4, 2017
e71c31f
adjust package.json so that when bundling the author remains correct
daviddias Dec 4, 2017
69a4e7a
tiny adjustments
daviddias Dec 4, 2017
cce74cb
remove unuses import
hacdias Dec 4, 2017
dbaf577
Add further requirements to build on macOS
machawk1 Dec 4, 2017
c216d15
Merge pull request #519 from machawk1/patch-1
hacdias Dec 4, 2017
b26a60f
adjustments
hacdias Dec 4, 2017
8ffd479
Update conventions link in CONTRIBUTING
machawk1 Dec 4, 2017
b7e2db6
Merge pull request #520 from machawk1/patch-1
hacdias Dec 4, 2017
d2eb903
fix #521
hacdias Dec 4, 2017
ea17e3e
Merge branch 'redesign' of https://github.com/ipfs-shipyard/station i…
hacdias Dec 4, 2017
dd60b71
Make File History pretttier
hacdias Dec 4, 2017
cceeaa0
Clean JS
hacdias Dec 4, 2017
1de62bc
Clean CSS
hacdias Dec 4, 2017
3be8842
update css
hacdias Dec 4, 2017
26d31c6
eslintignore
hacdias Dec 4, 2017
eb1710d
SHow error dialog and filter errors
hacdias Dec 5, 2017
232ba2d
working icon tray change
hacdias Dec 5, 2017
ed08abb
macos icons
hacdias Dec 5, 2017
12382a0
macos icons
hacdias Dec 5, 2017
d14e41e
macos icons
hacdias Dec 5, 2017
b7248af
fix logos
daviddias Dec 5, 2017
49c13a0
macos icons
hacdias Dec 5, 2017
c9ecea0
macos icons
hacdias Dec 5, 2017
bedb9bc
macos icons
hacdias Dec 5, 2017
6905ed9
Add beautiful GIF
hacdias Dec 5, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/*
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
debug.log
node_modules
build
release
npm-debug.log
app.log
package-lock.json
out
*.log
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $ npm run lint
```

When you are ready to commit please be sure to follow the
[commit convention](https://github.com/ajoslin/conventional-changelog/blob/master/conventions/angular.md).
[commit convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md).

## Available Scripts

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ A Native Application for your OS to run your own IPFS Node. Built with [Electron

## Install

You will need [Node.js](https://nodejs.org/en/) installed. Preferrably a version `>=4.0`. Also you will need [npm](npmjs.org) `>=3.0`. After that you should run
You will need [Node.js](https://nodejs.org/en/) installed, preferrably a version `>=4.0`. On macOS you may also need Xcode command line tools, which can be installed with

```bash
xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools
```

Also you will need [npm](npmjs.org) `>=3.0`. After that you should run

```bash
$ git clone https://github.com/ipfs/station.git
Expand All @@ -28,7 +35,7 @@ $ npm start

This launches the app and runs it in your menu bar. Click the IPFS icon to open a console. For example (in OSX):

![](https://ipfs.io/ipfs/QmaufMhYVWPKwhC1jSb4qHBxgiahrq9ct2hgqk5cZxeE7s)
![](https://ipfs.io/ipfs/QmQjPLSWt54MdFzLAxyEvTdaYPtdTAor7A1d5ugcVcmT87)

## Usage

Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@
"electron-compile": "^6.4.2",
"electron-is-dev": "^0.3.0",
"electron-squirrel-startup": "^1.0.0",
"file-extension": "^4.0.0",
"ipfs-api": "^17.1.3",
"ipfs-geoip": "^2.3.0",
"ipfs-logo": "github:ipfs/logo",
"ipfsd-ctl": "^0.26.0",
"menubar": "^5.2.3",
"moment": "^2.19.2",
"multiaddr": "^3.0.1",
"node-notifier": "^5.1.2",
"normalize.css": "^7.0.0",
"pretty-bytes": "^4.0.2",
"prop-types": "^15.6.0",
"react": "^16.1.1",
"react-dnd": "^2.5.4",
"react-dnd-html5-backend": "^2.5.4",
"react-dom": "^16.1.1",
"react-transition-group": "^2.2.1",
"react-widgets": "^4.1.1",
"winston": "^3.0.0-rc1"
},
"devDependencies": {
Expand Down Expand Up @@ -97,11 +98,12 @@
"url": "https://github.com/ipfs/station"
},
"author": "IPFS",
"authors": [
"contributors": [
"Kristoffer Ström <kristoffer@rymdkoloni.se>",
"David Dias <daviddias@ipfs.io>",
"Juan Benet <juan@ipfs.io>",
"Friedel Ziegelmayer <dignifiedquire@gmail.com>"
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
"Henrique Dias <hacdias@gmail.com>"
],
"license": "MIT",
"bugs": {
Expand Down
67 changes: 47 additions & 20 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,69 @@ import fs from 'fs'
import os from 'os'
import isDev from 'electron-is-dev'
import {app} from 'electron'
import {getLogo, macOsMenuBar} from './utils/logo'
import FileHistory from './utils/file-history'

export const logoIpfsIce = (() => {
const p = path.resolve(path.join(__dirname, 'img'))

if (os.platform() === 'darwin') {
return path.join(p, 'icons/ice.png')
}

return path.join(p, 'ipfs-logo-ice.png')
})()

export const logoIpfsBlack = (() => {
const p = path.resolve(path.join(__dirname, 'img'))

if (os.platform() === 'darwin') {
return path.join(p, 'icons/black.png')
}

return path.join(p, 'ipfs-logo-black.png')
})()

const isProduction = !isDev
const currentURL = (name) => `file://${__dirname}/views/${name}.html`
const ipfsPathFile = path.join(app.getPath('appData'), 'ipfs-electron-app-node-path')
const ipfsAppData = (() => {
const p = path.join(app.getPath('appData'), 'ipfs-station')

if (!fs.existsSync(p)) {
fs.mkdirSync(p)
}

return p
})()

const ipfsPathFile = path.join(ipfsAppData, 'app-node-path')
const ipfsFileHistoryFile = path.join(ipfsAppData, 'file-history.json')

const ipfsPath = (() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should use fs.existsSync instead of trying to catch for errors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done :)

let pathIPFS
try {

if (fs.existsSync(ipfsPathFile)) {
pathIPFS = fs.readFileSync(ipfsPathFile, 'utf-8')
} catch (e) {
} else {
pathIPFS = path.join(process.env.IPFS_PATH ||
(process.env.HOME || process.env.USERPROFILE), '.ipfs')
}

return pathIPFS
})()

export const fileHistory = new FileHistory(ipfsFileHistoryFile)

// Sets up the Logger
export const logger = winston.createLogger({
format: winston.format.json(),
transports: [
new winston.transports.File({
filename: path.join(__dirname, 'app.log'),
filename: 'error.log',
level: 'error',
handleExceptions: false
}),
new winston.transports.File({
filename: 'combined.log',
handleExceptions: false
})
]
Expand All @@ -40,25 +79,13 @@ if (isDev) {
}))
}

// Default settings for new windows
const window = {
icon: getLogo(),
title: 'IPFS Dashboard',
autoHideMenuBar: true,
width: 800,
height: 500,
webPreferences: {
webSecurity: false
}
}

// Configuration for the MenuBar
const menubar = {
dir: __dirname,
width: 300,
width: 850,
height: 400,
index: `file://${__dirname}/views/menubar.html`,
icon: (os.platform() === 'darwin') ? macOsMenuBar : getLogo(),
icon: logoIpfsBlack,
tooltip: 'Your IPFS instance',
alwaysOnTop: true,
preloadWindow: true,
Expand All @@ -74,10 +101,10 @@ export default {
isProduction,
logger,
menubar,
window,
webuiPath: '/webui',
ipfsPath,
ipfsPathFile,
ipfsFileHistoryFile,
urls: {
welcome: currentURL('welcome'),
settings: currentURL('settings')
Expand Down
4 changes: 4 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const PAGES = {
FILES: 'files',
INFO: 'info'
}
67 changes: 0 additions & 67 deletions src/controls/drag-drop.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/controls/open-browser.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/controls/open-console.js

This file was deleted.

13 changes: 13 additions & 0 deletions src/controls/open-file-dialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {dialog} from 'electron'
import uploadFiles from './upload-files'

export default function openFileDialog (window, ipfs, dir = false) {
return (event, callback) => {
dialog.showOpenDialog(window, {
properties: [dir ? 'openDirectory' : 'openFile', 'multiSelections']
}, (files) => {
if (!files || files.length === 0) return
uploadFiles(ipfs, event, files)
})
}
}
10 changes: 0 additions & 10 deletions src/controls/open-settings.js

This file was deleted.

11 changes: 11 additions & 0 deletions src/controls/open-webui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {shell} from 'electron'
import {apiAddrToUrl} from './utils'
import {logger} from '../config'

export default function openWebUI (ipfs, cb) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, always please use callback as the top level callback of a function and cb for internal ones (makes them easier to distinguish)

ipfs().config.get('Addresses.API')
.then((res) => {
shell.openExternal(apiAddrToUrl(res))
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, you can reduce this to just one line: .then((res) => shell.openExternal(apiAddrToUrl(res)))

.catch(logger.error)
}
18 changes: 18 additions & 0 deletions src/controls/upload-files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {logger, fileHistory} from '../config'
import {clipboard} from 'electron'

export default function uploadFiles (ipfs, event, files) {
ipfs()
.add(files, {recursive: true, w: files.length > 1})
.then((res) => {
logger.info('Uploading files', {files})

res.forEach((file) => {
const url = `https://ipfs.io/ipfs/${file.hash}`
clipboard.writeText(url)
logger.info('Uploaded file', {path: file.path})
fileHistory.add(file.path, file.hash)
})
})
.catch(logger.error)
}
Binary file removed src/fonts/dripicons.ttf
Binary file not shown.
Binary file removed src/fonts/maven_pro_bold-webfont.ttf
Binary file not shown.
Binary file removed src/fonts/maven_pro_medium-webfont.ttf
Binary file not shown.
Binary file removed src/fonts/maven_pro_regular-webfont.ttf
Binary file not shown.
Binary file added src/fonts/sf-pro-text-bold.otf
Binary file not shown.
Binary file added src/fonts/sf-pro-text-light.otf
Binary file not shown.
Binary file added src/fonts/sf-pro-text-medium.otf
Binary file not shown.
Binary file added src/fonts/sf-pro-text-regular.otf
Binary file not shown.
Binary file added src/fonts/sf-pro-text-semibold.otf
Binary file not shown.
Binary file added src/fonts/themify.eot
Binary file not shown.
Loading