Skip to content
Snippets Groups Projects
Commit 86e5ea12 authored by Adam Procter's avatar Adam Procter
Browse files

Merge branch 'ipfs-comp'

parents 0cdb74ba da7a1156
No related branches found
No related tags found
No related merge requests found
No preview for this file type
# 0.1.15
_17th June 2020_
This version adds some testing components and these are not part of the future direct but allow testing of features that will be folded in when better understand in terms of tech or awaiting proper implementation.
### Added
- test view for IPFS
- test view for list of your nodes (mobile)
### Changed
- more CSS edits
### Removed
- Hidden previous canvas view from build
# 0.1.14
_8th June 2020_
......
{
"name": "nodenogg.in",
"version": "0.1.14",
"version": "0.1.15",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
......@@ -12,7 +12,7 @@
"core-js": "^3.6.5",
"file-loader": "^6.0.0",
"interactive-shape-recognition": "^1.0.1",
"ipfs": "^0.45.0",
"ipfs": "^0.46.0",
"marked": "^1.1.0",
"pouchdb": "^7.2.1",
"pouchdb-find": "^7.2.1",
......
<template>
<div>
<h1>IPFS View</h1>
<h3>Testing Only</h3>
<h1>{{ status }}</h1>
<h2>ID: {{ id }}</h2>
<h2>Agent version: {{ agentVersion }}</h2>
<h3>Files : {{ fileContents }}</h3>
<form>
<input
class="fileInput"
type="file"
name="fileInput"
ref="fileInput"
@change="onFileSelected"
/>
<!-- <button @click="this.refs.selectedFile.click()">Choose File</button> -->
<button type="button" @click="saveIPFS">Upload</button>
<button type="button" @click="getIPFS">Get IPFS</button>
</form>
</div>
</template>
<script>
import VueIpfs from 'ipfs'
const ipfs = VueIpfs.create()
var node
var file
const fileContents = []
// The below code should create an IPFS node to add files to
export default {
name: 'IpfsInfo',
data: function () {
return {
status: 'Connecting to IPFS...',
id: '',
agentVersion: '',
selectedFile: null,
fileContents: this.fileContents,
}
},
mounted: function () {
// console.log(VueIpfs)
this.getIpfsNodeInfo()
},
methods: {
onFileSelected(event) {
this.selectedFile = event.target.files[0]
},
saveIPFS() {
file = node.files.write('/' + this.selectedFile.name, this.selectedFile, {
create: true,
})
return file
},
// getIPFS() {
// const resultPart = node.files.ls('/')
// fileContents.push(resultPart)
// // console.log(fileContents)
// return fileContents
// },
getIPFS() {
const resultPart = node.files.read('/')
fileContents.push(resultPart)
// console.log(fileContents)
return fileContents
},
async getIpfsNodeInfo() {
try {
// Await for ipfs node instance.
node = await ipfs
//console.log(ipfs)
// Call ipfs `id` method.
// Returns the identity of the Peer.
const { agentVersion, id } = await node.id()
this.agentVersion = agentVersion
this.id = id
// Set successful status text.
this.status = 'Connected to IPFS 😊'
} catch (err) {
// Set error status text.
this.status = `Error: ${err}`
}
},
},
}
</script>
<style lang="css" scoped>
.fileInput {
/* display: none; */
}
h1 {
font-size: 1em;
}
h3 {
color: red;
}
</style>
......@@ -36,7 +36,7 @@
<vue-draggable-resizable
class="innernode"
:w="300"
:h="345"
:h="375"
:x="1100"
:y="50"
:z="0"
......@@ -80,9 +80,9 @@ export default {
localmicrocosm: Router.currentRoute.params.microcosm,
clientid: '',
nodetext:
'## What shall we call you ? 💥 \n First we need to connect this device to your ideas. This name is what allows you to create and edit your nodes and can be anything you like and this name is always anonymous.',
'## 3. What shall we call you ? 💥 \n First we need to connect this device to your ideas. This name is what allows you to create and edit your nodes and can be anything you like and this name is always anonymous.',
nodetext2:
'## Start those engines ! 🏎 \n Now you can create your own microcosm to store your ideas and ask people to join you, either just tell them the name of the microcosm or share the alpha.nodenogg.in URL and add the ending; </br><em><b>/microcosm/nameofyourmicrocosm</b></em>',
'## 5. Start those engines ! 🏎 \n Now you can create your own microcosm to store your ideas and ask people to join you, either just tell them the name of the microcosm or share the alpha.nodenogg.in URL and add the ending; </br><em><b>/microcosm/nameofyourmicrocosm</b></em>',
// parta: true,
// partb: false,
// partc: false,
......
......@@ -97,7 +97,7 @@ export default {
<style scoped>
nav {
position: absolute;
position: fixed;
bottom: 1em;
left: 1em;
......
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Oldhome from '../views/Oldhome'
import List from '../views/List.vue'
// import Oldhome from '../views/Oldhome'
import Test from '../views/Test'
Vue.use(VueRouter)
......@@ -11,11 +13,6 @@ export const routes = [
name: 'Home',
component: Home,
},
{
path: '/oldhome',
name: 'Old Home',
component: Oldhome,
},
{
path: '/about',
name: 'About',
......@@ -25,6 +22,23 @@ export const routes = [
component: () =>
import(/* webpackChunkName: "about" */ '../views/About.vue'),
},
{
path: '/list',
name: 'List Test',
component: List,
},
{
path: '/test',
name: 'IPFS Test',
component: Test,
},
// {
// path: '/oldhome',
// name: 'Old Home',
// component: Oldhome,
// },
// dynamic segement `:microcosm` is added to the path
{
path: '/microcosm/:microcosm',
......
<template>
<div id="listwrapper">
<!-- <div v-for="(posvalue, index) in configPositions" v-bind:key="index"> -->
<h1 class="mobile">Your nodes - list mode</h1>
<h2>Testing Only</h2>
<!-- <OffLine
v-for="value in myNodes"
v-bind:key="value.node_id"
v-bind:nodeid="value.node_id"
v-bind:nodetext="value.node_text"
@editTrue="(e) => editTrue(e)"
/> -->
<form>
<div>
<p id="nodeid" :inner-html.prop="nodetext1 | marked"></p>
<input
type="text"
v-model.trim="clientid"
placeholder="device name"
autocorrect="off"
autocapitalize="none"
ref="objectname"
v-on:keyup.enter="setClient()"
@focus="editTrue(true)"
@blur="editTrue(false)"
/>
<div class="btn-row">
<BaseButton buttonClass="special" @click="setClient()"
>Store</BaseButton
>
</div>
</div>
</form>
<form>
<div>
<p id="nodeid" :inner-html.prop="nodetext2 | marked"></p>
<input
type="text"
v-model.trim="localmicrocosm"
placeholder="microcosm name"
autocorrect="off"
autocapitalize="none"
autofocus
v-on:keyup.enter="createMicrocosm()"
@focus="editTrue(true)"
@blur="editTrue(false)"
/>
<div class="btn-row">
<BaseButton buttonClass="special" @click="createMicrocosm(), letsGo()"
>Create Microcosm</BaseButton
>
</div>
</div>
</form>
<div class="btn-row">
<BaseButton class="new" buttonClass="action" @click="addNode()"
>Create Node</BaseButton
>
</div>
<form>
<!-- <div v-if="posvalue.read_mode == false"> -->
<div
v-for="value in myNodes.slice().reverse()"
v-bind:key="value.node_id"
>
<textarea
@focus="editTrue(true)"
@blur="editTrue(false)"
autofocus
@input="editNode"
v-model="value.node_text"
:id="nodeid"
ref="nodetext"
placeholder="Idea goes here!"
></textarea>
</div>
<!-- </div> -->
<!-- <div v-if="posvalue.read_mode == true">
<p class="read" :id="nodeid" :inner-html.prop="nodetext | marked"></p>
</div> -->
</form>
<ModeToolbar />
</div>
<!-- </div> -->
</template>
<script>
// import OffLine from '@/components/OffLine'
// import OnBoard from '@/components/OnBoard.vue'
import Router from '@/router'
import ModeToolbar from '@/experimental/ModeToolbar'
import { mapState } from 'vuex'
import marked from 'marked'
import { shortcutsMixin } from '@/components/mixins/shortcutsMixin.js'
export default {
name: 'List',
mixins: [shortcutsMixin],
data: function () {
return {
localmicrocosm: Router.currentRoute.params.microcosm,
clientid: '',
clientset: false,
offline: false,
nodetext1:
'## What shall we call you ? 💥 \n First we need to connect this device to your ideas. This name is what allows you to create and edit your nodes and can be anything you like and this name is always anonymous.',
nodetext2:
'## Start those engines ! 🏎 \n Now you can create your own microcosm to store your ideas and ask people to join you, either just tell them the name of the microcosm or share the alpha.nodenogg.in URL and add the ending; </br><em><b>/microcosm/nameofyourmicrocosm</b></em>',
}
},
props: {
nodeid: String,
nodetext: String,
deleted: Boolean,
},
computed: mapState({
myNodes: (state) => state.myNodes,
configPositions: (state) => state.configPositions,
shortcutstate: (state) => state.shortcutstate,
}),
created() {
if (typeof window !== 'undefined') {
document.addEventListener('keydown', this.handleKeyPress)
}
},
beforeDestroy() {
if (typeof window !== 'undefined') {
document.removeEventListener('keydown', this.handleKeyPress)
}
},
mounted() {
if (localStorage.myNNClient && localStorage.mylastMicrocosm) {
this.clientid = localStorage.myNNClient
this.localmicrocosm = localStorage.mylastMicrocosm
this.createMicrocosm()
this.setClient()
this.letsGo()
}
},
components: {
// OnBoard,
// OffLine,
ModeToolbar,
},
filters: {
marked: marked,
},
methods: {
clientAdded() {
this.clientset = !this.clientset
},
createMicrocosm() {
this.$store.dispatch('createMicrocosm', this.localmicrocosm)
localStorage.setItem('mylastMicrocosm', this.localmicrocosm)
},
setClient() {
this.$store.dispatch('setClient', this.clientid),
localStorage.setItem('myNNClient', this.clientid)
},
letsGo() {
this.$emit('clientAdded')
},
addNode() {
this.$store.dispatch('addNode')
},
editTrue(e) {
this.$store.dispatch('shortcutState', e)
},
editNode(e) {
var nodeid = e.target.id
var nodetext = e.target.value
this.$store.dispatch('editNode', { nodeid, nodetext })
},
},
}
</script>
<style lang="css" scoped>
h2 {
color: red;
}
.mobile {
font-size: 1em;
}
#listwrapper {
margin-left: 1em;
margin-bottom: 1em;
}
.new {
margin-bottom: 1em;
}
textarea {
width: 95%;
height: 100px;
margin-left: 1em;
margin-bottom: 1em;
}
</style>
<template>
<div>
<IpfsInfo />
</div>
</template>
<script>
import IpfsInfo from '@/components/IpfsInfo'
export default {
name: 'Test',
components: {
IpfsInfo,
},
}
</script>
<style lang="css" scoped></style>
......@@ -2193,10 +2193,6 @@ binary-extensions@^1.0.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65"
binary-querystring@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/binary-querystring/-/binary-querystring-0.1.2.tgz#84a6f9ac21fcf2752e305f60397d445bb84551e9"
bindings@^1.2.1, bindings@^1.3.0, bindings@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
......@@ -5520,9 +5516,9 @@ ipfs-http-client@^44.0.0:
parse-duration "^0.1.2"
stream-to-it "^0.2.0"
ipfs-http-client@^44.1.1:
version "44.1.1"
resolved "https://registry.yarnpkg.com/ipfs-http-client/-/ipfs-http-client-44.1.1.tgz#d5d72874dcc805fbaaca2e1ac3876cb33f2100a2"
ipfs-http-client@^44.2.0:
version "44.2.0"
resolved "https://registry.yarnpkg.com/ipfs-http-client/-/ipfs-http-client-44.2.0.tgz#d924c46b64689847cd46b5eac3669346ae48f03a"
dependencies:
abort-controller "^3.0.0"
any-signal "^1.1.0"
......@@ -5609,27 +5605,27 @@ ipfs-repo@^3.0.0:
proper-lockfile "^4.0.0"
sort-keys "^4.0.0"
ipfs-unixfs-exporter@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-2.0.1.tgz#b182b759b23ca40683bab97f56c365c60d43333f"
ipfs-unixfs-exporter@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-2.0.2.tgz#ca36488d37e380ec53b49664bdee326622b191db"
dependencies:
buffer "^5.6.0"
cids "^0.8.0"
err-code "^2.0.0"
hamt-sharding "^1.0.0"
ipfs-unixfs "^1.0.2"
ipfs-unixfs "^1.0.3"
it-last "^1.0.1"
multihashing-async "^0.8.0"
ipfs-unixfs-importer@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ipfs-unixfs-importer/-/ipfs-unixfs-importer-2.0.1.tgz#586ce2569afc90733b02a66e4418bfffbb34f67d"
ipfs-unixfs-importer@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/ipfs-unixfs-importer/-/ipfs-unixfs-importer-2.0.2.tgz#1b568d1f23ec902a32ae8017f0a7456810102bd4"
dependencies:
bl "^4.0.0"
buffer "^5.6.0"
err-code "^2.0.0"
hamt-sharding "^1.0.0"
ipfs-unixfs "^1.0.2"
ipfs-unixfs "^1.0.3"
ipld-dag-pb "^0.18.5"
it-all "^1.0.1"
it-batch "^1.0.3"
......@@ -5639,9 +5635,9 @@ ipfs-unixfs-importer@^2.0.1:
multihashing-async "^0.8.0"
rabin-wasm "^0.1.1"
ipfs-unixfs@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/ipfs-unixfs/-/ipfs-unixfs-1.0.2.tgz#205c0f802ffcd141b6bf0a076e2d24ef79cee4d6"
ipfs-unixfs@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/ipfs-unixfs/-/ipfs-unixfs-1.0.3.tgz#59d46ab45b5ec211f93bdaff0b4827595350b8dc"
dependencies:
err-code "^2.0.0"
protons "^1.2.0"
......@@ -5679,9 +5675,9 @@ ipfs-utils@^2.2.0, ipfs-utils@^2.2.2:
node-fetch "^2.6.0"
stream-to-it "^0.2.0"
ipfs@^0.45.0:
version "0.45.0"
resolved "https://registry.yarnpkg.com/ipfs/-/ipfs-0.45.0.tgz#4931a8be8b0a7fdbe6a3fad5cd5cb4e65c9b4091"
ipfs@^0.46.0:
version "0.46.0"
resolved "https://registry.yarnpkg.com/ipfs/-/ipfs-0.46.0.tgz#8d4e2b3a7e0a128dd597b50f340f6e4dbead6475"
dependencies:
"@hapi/ammo" "^3.1.2"
"@hapi/boom" "^7.4.3"
......@@ -5692,7 +5688,6 @@ ipfs@^0.45.0:
any-signal "^1.1.0"
array-shuffle "^1.0.1"
bignumber.js "^9.0.0"
binary-querystring "^0.1.2"
bl "^4.0.2"
bs58 "^4.0.1"
buffer "^5.6.0"
......@@ -5717,12 +5712,12 @@ ipfs@^0.45.0:
ipfs-bitswap "^1.0.0"
ipfs-block-service "^0.17.1"
ipfs-core-utils "^0.2.3"
ipfs-http-client "^44.1.1"
ipfs-http-client "^44.2.0"
ipfs-http-response "^0.5.0"
ipfs-repo "^3.0.0"
ipfs-unixfs "^1.0.2"
ipfs-unixfs-exporter "^2.0.1"
ipfs-unixfs-importer "^2.0.1"
ipfs-unixfs "^1.0.3"
ipfs-unixfs-exporter "^2.0.2"
ipfs-unixfs-importer "^2.0.2"
ipfs-utils "^2.2.2"
ipld "^0.26.2"
ipld-bitcoin "^0.3.0"
......@@ -5755,8 +5750,8 @@ ipfs@^0.45.0:
libp2p-crypto "^0.17.6"
libp2p-delegated-content-routing "^0.4.4"
libp2p-delegated-peer-routing "^0.4.2"
libp2p-floodsub "^0.20.0"
libp2p-gossipsub "^0.3.0"
libp2p-floodsub "^0.20.4"
libp2p-gossipsub "^0.3.1"
libp2p-kad-dht "^0.18.7"
libp2p-keychain "^0.6.0"
libp2p-mdns "^0.13.1"
......@@ -6920,30 +6915,30 @@ libp2p-delegated-peer-routing@^0.4.2:
peer-id "^0.13.11"
peer-info "^0.17.5"
libp2p-floodsub@^0.20.0:
version "0.20.3"
resolved "https://registry.yarnpkg.com/libp2p-floodsub/-/libp2p-floodsub-0.20.3.tgz#5ef3fc3e733b06df216491b9891a7845224db98e"
libp2p-floodsub@^0.20.4:
version "0.20.4"
resolved "https://registry.yarnpkg.com/libp2p-floodsub/-/libp2p-floodsub-0.20.4.tgz#19ced0443f1b098c7406e50ff3d80bea613bf215"
dependencies:
async.nexttick "^0.5.2"
buffer "^5.6.0"
debug "^4.1.1"
it-length-prefixed "^3.0.0"
it-pipe "^1.0.1"
libp2p-pubsub "~0.4.0"
libp2p-pubsub "~0.4.5"
p-map "^3.0.0"
protons "^1.0.1"
time-cache "^0.3.0"
libp2p-gossipsub@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/libp2p-gossipsub/-/libp2p-gossipsub-0.3.0.tgz#d1fb6bce3dc236d7eb8ec2235531f9e6025d6cef"
libp2p-gossipsub@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/libp2p-gossipsub/-/libp2p-gossipsub-0.3.1.tgz#ca5b1ad535f5e0816c0539c9df598e1b191d83a2"
dependencies:
buffer "^5.6.0"
debug "^4.1.1"
err-code "^2.0.0"
it-length-prefixed "^3.0.0"
it-pipe "^1.0.1"
libp2p-pubsub "~0.4.2"
libp2p-pubsub "~0.4.5"
p-map "^4.0.0"
peer-id "~0.13.3"
peer-info "~0.17.0"
......@@ -7044,9 +7039,9 @@ libp2p-mplex@^0.9.3:
it-pushable "^1.3.1"
varint "^5.0.0"
libp2p-pubsub@~0.4.0, libp2p-pubsub@~0.4.2:
version "0.4.4"
resolved "https://registry.yarnpkg.com/libp2p-pubsub/-/libp2p-pubsub-0.4.4.tgz#ca2ee85dc0bd6f2b39ab38df522bf6d3f7a74336"
libp2p-pubsub@~0.4.5:
version "0.4.5"
resolved "https://registry.yarnpkg.com/libp2p-pubsub/-/libp2p-pubsub-0.4.5.tgz#a8c3daf9c92eb1e5b4bc017fe58f3b3a9b066943"
dependencies:
debug "^4.1.1"
err-code "^2.0.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment