Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter Datapod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
nodes
Duniter Datapod
Commits
d38683e1
Commit
d38683e1
authored
1 year ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
wip import c+ to AMT
parent
f7b891da
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+4
-1
4 additions, 1 deletion
README.md
src/cesium-plus.ts
+1
-1
1 addition, 1 deletion
src/cesium-plus.ts
src/views/CplusView.vue
+26
-20
26 additions, 20 deletions
src/views/CplusView.vue
with
31 additions
and
22 deletions
README.md
+
4
−
1
View file @
d38683e1
...
@@ -12,6 +12,7 @@ pnpm dev
...
@@ -12,6 +12,7 @@ pnpm dev
After exporting the data to json files with the Rust script from
`v2s-datapod`
.
After exporting the data to json files with the Rust script from
`v2s-datapod`
.
```
sh
```
sh
# takes about 200 seconds (4 minutes)
time
npx tsx src/scripts/cesium-plus-import.ts
time
npx tsx src/scripts/cesium-plus-import.ts
```
```
...
@@ -20,3 +21,5 @@ You can then manually pin the cid according to the command output.
...
@@ -20,3 +21,5 @@ You can then manually pin the cid according to the command output.
```
sh
```
sh
ipfs pin add
-r
bafyreie74jtf23zzz2tdgsz7axfrm4pidje43ypqn25v4gkdtfjbcj62km
ipfs pin add
-r
bafyreie74jtf23zzz2tdgsz7axfrm4pidje43ypqn25v4gkdtfjbcj62km
```
```
This will make easier to insert this data in any AMT or other data structure.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/cesium-plus.ts
+
1
−
1
View file @
d38683e1
...
@@ -4,7 +4,7 @@ import { Buffer } from 'buffer'
...
@@ -4,7 +4,7 @@ import { Buffer } from 'buffer'
// for reference see
// for reference see
// https://doc.e-is.pro/cesium-plus-pod/REST_API.html
// https://doc.e-is.pro/cesium-plus-pod/REST_API.html
interface
CplusProfile
{
export
interface
CplusProfile
{
version
:
number
version
:
number
title
:
string
title
:
string
description
:
string
description
:
string
...
...
This diff is collapsed.
Click to expand it.
src/views/CplusView.vue
+
26
−
20
View file @
d38683e1
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
type
Ref
}
from
'
vue
'
import
{
ref
,
type
Ref
,
computed
}
from
'
vue
'
import
{
processCesiumPlusImport
}
from
'
../cesium-plus
'
import
{
processCesiumPlusProfile
,
type
CplusProfile
}
from
'
../cesium-plus
'
import
type
{
CID
}
from
'
kubo-rpc-client
'
const
file
:
Ref
<
File
|
null
>
=
ref
(
null
)
const
file
:
Ref
<
File
|
null
>
=
ref
(
null
)
const
sample
=
ref
(
''
)
const
sample
=
ref
(
''
)
const
importResult
:
Ref
<
CID
|
null
>
=
ref
(
null
)
const
cidlist
=
ref
(
''
)
const
MAX
=
20
async
function
setfile
(
input
:
any
)
{
function
setfile
(
input
:
any
)
{
file
.
value
=
input
.
target
.
files
[
0
]
file
.
value
=
input
.
target
.
files
[
0
]
}
}
async
function
importCplus
()
{
function
importCplus
()
{
cidlist
.
value
=
''
if
(
file
.
value
)
{
if
(
file
.
value
)
{
console
.
log
(
file
.
value
)
console
.
log
(
file
.
value
)
const
reader
=
new
FileReader
()
const
reader
=
new
FileReader
()
reader
.
onload
=
function
(
event
)
{
reader
.
onload
=
function
(
event
)
{
const
obj
=
JSON
.
parse
(
event
.
target
!
.
result
as
string
)
const
obj
=
JSON
.
parse
(
event
.
target
!
.
result
as
string
)
console
.
log
(
obj
)
console
.
log
(
obj
)
sample
.
value
=
JSON
.
stringify
(
obj
[
0
],
undefined
,
4
)
sample
.
value
=
JSON
.
stringify
(
obj
[
0
],
undefined
,
4
)
processCesiumPlusImport
(
obj
.
slice
(
0
,
10
)).
then
((
cid
)
=>
(
importResult
.
value
=
cid
))
obj
.
slice
(
0
,
MAX
)
.
map
((
e
:
CplusProfile
)
=>
processCesiumPlusProfile
(
e
).
then
((
c
)
=>
(
cidlist
.
value
+=
c
.
toString
()
+
'
\n
'
)))
}
}
reader
.
readAsText
(
file
.
value
)
reader
.
readAsText
(
file
.
value
)
}
}
...
@@ -28,19 +30,23 @@ async function importCplus() {
...
@@ -28,19 +30,23 @@ async function importCplus() {
</
script
>
</
script
>
<
template
>
<
template
>
<main>
<h1>
Cesium Plus
</h1>
<h1>
Cesium Plus
</h1>
<h2>
Import
</h2>
<h2>
Import
from file
</h2>
<p>
Import data from Cesium+
</p>
<p>
Import data from Cesium+
</p>
<p>
<p>
json input file:
json input file:
<input
type=
"file"
@
change=
"setfile"
/>
<input
type=
"file"
@
change=
"setfile"
/>
<button
v-on:click=
"importCplus"
>
Import
</button>
<button
v-on:click=
"importCplus"
>
Import
</button>
(max
{{
MAX
}}
)
</p>
</p>
<p>
sample:
</p>
<details>
<summary>
sample:
</summary>
<pre>
{{
sample
}}
</pre>
<pre>
{{
sample
}}
</pre>
<p>
root node for import:
{{
importResult
}}
</p>
</details>
</main>
<p>
list of imported cids:
</p>
<pre>
{{
cidlist
}}
</pre>
<h2>
Import from root cid
</h2>
<p>
Choose a root CID from Cesium import and the root CID of the target AMT
</p>
</
template
>
</
template
>
<
style
scoped
></
style
>
<
style
scoped
></
style
>
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