Skip to content

Commit

Permalink
Improved Auto Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayee committed Dec 20, 2018
1 parent 2635fe6 commit 5192f7c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<hr>

# Owner Free File System in Javascript
## Status: Rebooting
is a peer-to-peer distributed file system in which all shared files are represented by randomized multi-used data blocks. Instead of anonymizing the network, the data blocks are anonymized and therefore, only data garbage is ever exchanged and stored.
## Purpose
The OFF System is the first P2P system designed to halt copyright infringement by facilitating legal activity. It protects each peers by removing the user's capability of breaking the law. The unique feature of this system is, that it stores all of its internal data in a multi-use randomized block format. In other words: there is not a one to one mapping between a stored block and its use in a retrieved file. Each stored block is simultaneously used as a part of many different files. Individually, however, each block is nothing but arbitrary digital white noise data. This gives files stored redundancy, permanence, privacy, and freedom from censorship through a single simple mathematical means. This creates a universal public storage cloud with the same properties as national public radio or public broadcasting.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-offs",
"version": "0.0.9",
"version": "0.0.91",
"description": "Owner Free File System",
"main": "src/index.js",
"appname": "offs",
Expand All @@ -16,7 +16,8 @@
"build-win": "npm run compile-vue && electron-builder --win",
"build-mac": "npm run compile-vue && electron-builder --mac",
"build-docker": "npm run build && sudo docker build -t offs .",
"publish": "build -p onTag",
"publish": "build -p always",
"release": "build",
"docker": "sudo docker run -a STDERR -a STDOUT -p 23402:23402 -p 8200:8200 --name offsystem offs "
},
"author": "Prometheus <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src/electron/views/export/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14050,7 +14050,7 @@ if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api")
if (!module.hot.data) {
hotAPI.createRecord("data-v-cac42708", __vue__options__)
} else {
hotAPI.reload("data-v-cac42708", __vue__options__)
hotAPI.rerender("data-v-cac42708", __vue__options__)
}
})()}
},{"vue":6,"vue-hot-reload-api":5,"vueify/lib/insert-css":7}]},{},[9]);
27 changes: 24 additions & 3 deletions src/electron/views/update/update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<progressbar :error="error" :percent="percent"></progressbar>
</td>
</tr>
<tr>
<td class="data">
<strong class="total" v-if="total">{{transferred}}/{{total}}</strong>
<strong class="rate" v-if="rate">{{rate}}b/s</strong>
</td>
</tr>
</table>
</div>
</div>
Expand All @@ -34,7 +40,7 @@
min-width: 100px;
height: 100px;
width: 100px;
background-color: #f4d8c0;
background-color: #e1eaf1;
border-radius: 10px;
margin: 5px;
}
Expand Down Expand Up @@ -90,6 +96,16 @@
.error {
color: red;
}
.data {
display: grid;
grid-template-columns: 1fr 1fr;
}
.rate {
justify-self: end;
}
.total {
justify-self: start;
}
</style>
<script>
let progressbar = require('../export/progressbar.vue')
Expand All @@ -101,7 +117,10 @@
percent: 0,
icon: '../../images/off-logo-lettered.svg',
status: null,
updator: null
updator: null,
transferred: 0,
total: 0,
rate: 0
}
},
mounted () {
Expand All @@ -112,11 +131,13 @@
this.status = 'Checking for update'
}
let onUpdateAvailable = (info) => {
console.log(info)
this.status = 'Update Found'
}
let onDownloadProgress = (info) => {
this.percent = info.percent
this.transferred = info.transferred
this.total = info.total
this.rate = info.bytesPerSecond
}
let onUpdateNotAvailable = () =>{
this.status = 'Everything Up To Date'
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const log = require('js-logging')
emergency: 'magenta'
}
})

let win
let node

if (process.env.ELECTRON_RUN_AS_NODE || cmd.terminal) {
node = new Node('OFFSYSTEM')
node.on('error', log.error)
Expand All @@ -39,7 +39,10 @@ if (process.env.ELECTRON_RUN_AS_NODE || cmd.terminal) {
log.notice(`Node ${node.peerInfo.key} is online internally at ${node.peerInfo.intIp} and port ${node.peerInfo.intPort}`)
})
node.on('listening', (port) => log.notice(`HTTP Server is online at ${node.peerInfo.ip} and port ${port}`))
node.start()
autoUpdater.on('update-not-available', () => {
node.start()
})
autoUpdater.checkForUpdatesAndNotify()
} else {
const { app, Menu, MenuItem, Tray, BrowserWindow, clipboard, ipcMain } = require('electron')
require('electron-context-menu')({ showInspectElement: false, showCopyImageAddress: false, showSaveImageAs: false })
Expand Down
8 changes: 2 additions & 6 deletions src/updator.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,27 @@ class mainUpdator extends responder {
this.tell('checking-for-update')
})
autoUpdater.on('update-available', (info) => {
console.log(info)
this.tell('update-available', info)
autoUpdater.downloadUpdate()
})
autoUpdater.on('update-not-available', (info) => {
console.log(info)
this.tell('update-not-available', info)
setTimeout(onComplete, 2000)
})
autoUpdater.on('error', (err) => {
this.tell('error', err)
setTimeout(onComplete, 2000)
})
autoUpdater.on('download-progress', (progressObj) => {
console.log(progressObj)
this.tell('download-progress', progressObj)
})
autoUpdater.on('update-downloaded', (info) => {
console.log(info)
this.tell('update-downloaded', info)
//setTimeout((() => autoUpdater.quitAndInstall()), 6000)
setTimeout((() => autoUpdater.quitAndInstall()), 6000)
})
}
checkForUpdatesAndNotify () {
let autoUpdater = _autoUpdater.get(this)
console.log('checking stuff')
autoUpdater.checkForUpdatesAndNotify()
}
}
Expand Down

0 comments on commit 5192f7c

Please sign in to comment.