Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nodenogg-duplicate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adam Procter
nodenogg-duplicate
Commits
1a49b0a0
Commit
1a49b0a0
authored
4 years ago
by
Adam Procter
Browse files
Options
Downloads
Patches
Plain Diff
added simple support if you are offline
Need to check regards to starting offline but this will work if you go offline...
parent
65453a4f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/components/OffLine.vue
+39
-30
39 additions, 30 deletions
app/src/components/OffLine.vue
app/src/views/Home.vue
+62
-34
62 additions, 34 deletions
app/src/views/Home.vue
with
101 additions
and
64 deletions
app/src/components/OffLine.vue
+
39
−
30
View file @
1a49b0a0
...
...
@@ -2,51 +2,60 @@
<
template
>
<div
class=
"yourdata"
name=
"anchorName"
>
<h2>
Offline
</h2>
<p>
nodenogg.in appears to be offline, which means you cant see other data at
this stage, as it maybe out of date. Once you reconnect. Your data will
sync and the main views will reappear. This maybe down to you or maybe us.
If you think it us click Support at the top, and let us know
</p>
<h3>
List - Your Data
</h3>
<ul
class=
"data"
>
<!-- tips -->
<!-- : is short for v-bind -->
<!-- v-if="note.content_type != 'device'" -->
<li
v-for=
"(note, index) in notes"
:key=
"index"
>
<p
v-if=
"note.content_type != 'device'"
>
{{
note
.
text
}}
</p>
</li>
</ul>
<div
v-for=
"value in myNodes"
v-bind:key=
"value.node_id"
>
<textarea
v-if=
"nodeid == value.node_id"
@
focus=
"editTrue(true)"
@
blur=
"editTrue(false)"
autofocus
@
input=
"editNode"
v-model=
"value.node_text"
:id=
"nodeid"
class=
"drag-cancel"
ref=
"nodetext"
placeholder=
"Idea goes here!"
></textarea>
</div>
<div
class=
"btn-row"
>
<BaseButton
buttonClass=
"danger"
@
click=
"deleteFlag()"
>
Delete
</BaseButton>
</div>
</div>
</
template
>
<
script
>
import
{
mapState
}
from
'
vuex
'
import
{
shortcuts
}
from
'
./mixins/shortcuts.js
'
export
default
{
name
:
'
YourData
'
,
mixins
:
[
shortcuts
],
name
:
'
OffLine
'
,
computed
:
mapState
({
shortcutsstate
:
(
state
)
=>
state
.
shortcutsstate
,
notes
:
(
state
)
=>
state
.
notes
,
myNodes
:
(
state
)
=>
state
.
myNodes
,
}),
created
()
{
if
(
typeof
window
!==
'
undefined
'
)
{
document
.
addEventListener
(
'
keydown
'
,
this
.
handleKeyPress
)
}
},
beforeDestroy
()
{
if
(
typeof
window
!==
'
undefined
'
)
{
document
.
removeEventListener
(
'
keydown
'
,
this
.
handleKeyPress
)
}
props
:
{
nodeid
:
String
,
},
methods
:
{
addDoc
()
{
this
.
$store
.
dispatch
(
'
addDoc
'
)
this
.
$emit
(
'
editMode
'
)
},
editTrue
(
e
)
{
this
.
$emit
(
'
editTrue
'
,
e
)
//console.log(e)
},
editNode
(
e
)
{
var
nodeid
=
e
.
target
.
id
var
nodetext
=
e
.
target
.
value
this
.
$store
.
dispatch
(
'
editNode
'
,
{
nodeid
,
nodetext
})
},
deleteFlag
(
e
)
{
e
=
this
.
nodeid
this
.
$store
.
dispatch
(
'
deleteFlag
'
,
{
e
})
},
},
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
app/src/views/Home.vue
+
62
−
34
View file @
1a49b0a0
<
template
>
<div
ref=
"container"
class=
"wrapper"
v-bind:style=
"modeContainerStyle"
>
<ConnectionsLayer
v-bind:width=
"width"
v-bind:height=
"height"
v-bind:connections=
"connections"
/>
<PanZoomContainer
v-bind:width=
"width"
v-bind:height=
"height"
v-bind:scale=
"scale"
v-bind:translation=
"translation"
>
<div
v-if=
"clientset"
>
<OtherNodeslayer
v-for=
"value in otherNodes"
v-bind:key=
"value.node_id"
v-bind:nodeid=
"value.node_id"
v-bind:nodetext=
"value.node_text"
/>
<NodesLayer
@
editTrue=
"(e) => editTrue(e)"
<div>
<div
class=
"offline"
v-if=
"clientset && offline"
>
<div
ref=
"container"
class=
"wrapper"
v-bind:style=
"modeContainerStyle"
>
<h2>
Offline
</h2>
<p>
nodenogg.in appears to be offline, which means you cant see other data
at this stage, as it maybe out of date. Once you reconnect. Your data
will sync and the main views will reappear. This maybe down to you or
maybe us. If you think it's us let us know.
</p>
<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)"
/>
<ModeToolbar
@
offlineTriggered=
"offlineTriggered()"
@
onlineTriggered=
"onlineTriggered()"
/>
<ViewToolbar
/>
<!--
<OnBoard
v-else
@
clientAdded=
"clientAdded()"
/>
-->
</div>
</div>
<div
class=
"online"
v-else
>
<div
ref=
"container"
class=
"wrapper"
v-bind:style=
"modeContainerStyle"
>
<ConnectionsLayer
v-bind:width=
"width"
v-bind:height=
"height"
v-bind:connections=
"connections"
/>
<PanZoomContainer
v-bind:width=
"width"
v-bind:height=
"height"
v-bind:scale=
"scale"
v-bind:translation=
"translation"
>
<div
v-if=
"clientset"
>
<OtherNodeslayer
v-for=
"value in otherNodes"
v-bind:key=
"value.node_id"
v-bind:nodeid=
"value.node_id"
v-bind:nodetext=
"value.node_text"
/>
<NodesLayer
@
editTrue=
"(e) => editTrue(e)"
v-for=
"value in myNodes"
v-bind:key=
"value.node_id"
v-bind:nodeid=
"value.node_id"
v-bind:nodetext=
"value.node_text"
/>
</div>
<OnBoard
v-else
@
clientAdded=
"clientAdded()"
/>
</PanZoomContainer>
<ModeToolbar
@
offlineTriggered=
"offlineTriggered()"
@
onlineTriggered=
"onlineTriggered()"
/>
<ViewToolbar
/>
</div>
<OnBoard
v-else
@
clientAdded=
"clientAdded()"
/>
</PanZoomContainer>
<!--
<SelectionLayer
v-if=
"domContainerReady"
v-bind:shape=
"interaction.shape"
v-bind:width=
"elementWidth"
v-bind:height=
"elementHeight"
/>
-->
<ModeToolbar
@
offlineTriggered=
"offlineTriggered()"
@
onlineTriggered=
"onlineTriggered()"
/>
<ViewToolbar
/>
</div>
</div>
</
template
>
...
...
@@ -46,6 +72,7 @@
import
PanZoomContainer
from
'
@/experimental/PanZoomContainer
'
import
ConnectionsLayer
from
'
@/experimental/layers/ConnectionsLayer
'
import
NodesLayer
from
'
@/components/NodesLayer
'
import
OffLine
from
'
@/components/OffLine
'
import
OtherNodeslayer
from
'
@/components/OtherNodeslayer.vue
'
import
OnBoard
from
'
@/components/OnBoard.vue
'
import
ModeToolbar
from
'
@/experimental/ModeToolbar
'
...
...
@@ -142,6 +169,7 @@ export default {
OtherNodeslayer
,
ConnectionsLayer
,
OnBoard
,
OffLine
,
},
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment