Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Utilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UNICADO
Utilities
Commits
f543fe93
Commit
f543fe93
authored
8 months ago
by
Duc Bui Tien
Browse files
Options
Downloads
Patches
Plain Diff
replace underscore in labels
bind textfieldvalue
parent
9212f2a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!2
UnicadoGuiBackend
,
!1
New UnicadoGUI Branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/routes/model/+page.svelte
+9
-7
9 additions, 7 deletions
src/routes/model/+page.svelte
with
9 additions
and
7 deletions
src/routes/model/+page.svelte
+
9
−
7
View file @
f543fe93
...
@@ -124,6 +124,7 @@
...
@@ -124,6 +124,7 @@
groups
=
data2
[
"
groups
"
]
groups
=
data2
[
"
groups
"
]
console
.
log
(
data2
)
console
.
log
(
data2
)
})
})
async
function
loadModel
(){
async
function
loadModel
(){
const
res
=
await
fetch
(
"
http://127.0.0.1:8000/convergence
"
);
const
res
=
await
fetch
(
"
http://127.0.0.1:8000/convergence
"
);
const
data
=
await
res
.
json
();
const
data
=
await
res
.
json
();
...
@@ -135,8 +136,8 @@
...
@@ -135,8 +136,8 @@
changed
=
changed
;
changed
=
changed
;
saveAlert
=
false
;
saveAlert
=
false
;
saveAlert
=
saveAlert
;
saveAlert
=
saveAlert
;
}
}
async
function
startModel
(){
async
function
startModel
(){
const
res
=
fetch
(
"
http://127.0.0.1:8000/start/convergenceLoop
"
)
const
res
=
fetch
(
"
http://127.0.0.1:8000/start/convergenceLoop
"
)
}
}
...
@@ -167,9 +168,10 @@
...
@@ -167,9 +168,10 @@
}
}
function
generateHTML
(
json
:
object
){
function
generateHTML
(
json
:
object
){
Object
.
entries
(
json
).
forEach
(([
key
,
value
])
=>
{
Object
.
entries
(
json
).
forEach
(([
key
,
value
])
=>
{
let
string
=
key
.
replaceAll
(
"
_
"
,
"
"
)
if
(
value
.
hasOwnProperty
(
"
value
"
)){
if
(
value
.
hasOwnProperty
(
"
value
"
)){
if
(
value
.
description
&&
value
.
description
.
includes
(
"
Switch
"
)){
if
(
value
.
description
&&
value
.
description
.
includes
(
"
Switch
"
)){
modalModule
.
html
.
push
(
new
SettingsSwitch
(
key
,
value
.
description
,
value
))
modalModule
.
html
.
push
(
new
SettingsSwitch
(
string
,
value
.
description
,
value
))
}
else
if
(
value
.
description
&&
value
.
description
.
includes
(
"
Selector
"
)){
}
else
if
(
value
.
description
&&
value
.
description
.
includes
(
"
Selector
"
)){
let
options
=
[];
let
options
=
[];
for
(
let
i
=
0
;
i
<
4
;
i
++
){
for
(
let
i
=
0
;
i
<
4
;
i
++
){
...
@@ -177,14 +179,14 @@
...
@@ -177,14 +179,14 @@
options
.
push
(
"
mode_
"
+
i
)
options
.
push
(
"
mode_
"
+
i
)
}
}
}
}
modalModule
.
html
.
push
(
new
SettingsSelector
(
key
,
value
.
description
,
value
,
options
))
modalModule
.
html
.
push
(
new
SettingsSelector
(
string
,
value
.
description
,
value
,
options
))
}
else
if
(
value
.
hasOwnProperty
(
"
unit
"
)){
}
else
if
(
value
.
hasOwnProperty
(
"
unit
"
)){
modalModule
.
html
.
push
((
new
SettingsNumberfield
(
key
,
value
.
description
,
value
,
value
.
unit
)))
modalModule
.
html
.
push
((
new
SettingsNumberfield
(
string
,
value
.
description
,
value
,
value
.
unit
)))
}
else
{
}
else
{
modalModule
.
html
.
push
(
new
SettingsTextfield
(
key
,
value
.
description
,
key
,
key
))
modalModule
.
html
.
push
(
new
SettingsTextfield
(
string
,
value
.
description
,
value
,
key
))
}
}
}
else
if
(
typeof
value
===
"
object
"
){
}
else
if
(
typeof
value
===
"
object
"
){
modalModule
.
html
.
push
(
new
SettingsLabel
(
key
))
modalModule
.
html
.
push
(
new
SettingsLabel
(
string
))
generateHTML
(
json
[
key
])
generateHTML
(
json
[
key
])
}
else
{
}
else
{
return
;
return
;
...
@@ -342,7 +344,7 @@
...
@@ -342,7 +344,7 @@
</Tooltip>
</Tooltip>
{
:else
if
element
.
type
==
"
textfield
"
}
{
:else
if
element
.
type
==
"
textfield
"
}
<h7>
{
element
.
label
}
</h7>
<h7>
{
element
.
label
}
</h7>
<Input
id=
{
element
.
label
}
type=
"text"
/>
<Input
id=
{
element
.
label
}
type=
"text"
bind:value=
{
element
.
bind
.
value
}
/>
<Tooltip
target=
{
element
.
label
}
placement=
"left"
>
<Tooltip
target=
{
element
.
label
}
placement=
"left"
>
{
element
.
description
}
{
element
.
description
}
</Tooltip>
</Tooltip>
...
...
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