Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
af1fb704
Commit
af1fb704
authored
5 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
removed apps/model-server-query
parent
e2eb1bf2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/apps/model-server-query/index.html
+0
-12
0 additions, 12 deletions
src/apps/model-server-query/index.html
src/apps/model-server-query/index.tsx
+0
-134
0 additions, 134 deletions
src/apps/model-server-query/index.tsx
webpack.config.js
+0
-3
0 additions, 3 deletions
webpack.config.js
with
0 additions
and
149 deletions
src/apps/model-server-query/index.html
deleted
100644 → 0
+
0
−
12
View file @
e2eb1bf2
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<title>
Mol* ModelServer Query Builder
</title>
</head>
<body>
<div
id=
"app"
></div>
<script
type=
"text/javascript"
src=
"./index.js"
></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/apps/model-server-query/index.tsx
deleted
100644 → 0
+
0
−
134
View file @
e2eb1bf2
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import
*
as
React
from
'
react
'
import
*
as
ReactDOM
from
'
react-dom
'
import
*
as
Rx
from
'
rxjs
'
import
{
QueryDefinition
,
QueryList
}
from
'
../../servers/model/server/api
'
import
'
./index.html
'
interface
State
{
query
:
Rx
.
BehaviorSubject
<
QueryDefinition
>
,
id
:
Rx
.
BehaviorSubject
<
string
>
,
params
:
Rx
.
BehaviorSubject
<
any
>
,
isBinary
:
Rx
.
BehaviorSubject
<
boolean
>
,
models
:
Rx
.
BehaviorSubject
<
number
[]
>
,
url
:
Rx
.
Subject
<
string
>
}
class
Root
extends
React
.
Component
<
{
state
:
State
},
{
}
>
{
render
()
{
return
<
div
>
<
div
>
Query:
<
QuerySelect
state
=
{
this
.
props
.
state
}
/>
</
div
>
<
div
>
ID:
<
input
type
=
'text'
onChange
=
{
t
=>
this
.
props
.
state
.
id
.
next
(
t
.
currentTarget
.
value
)
}
/>
</
div
>
<
div
>
Params:
<
br
/>
<
QueryParams
state
=
{
this
.
props
.
state
}
/>
</
div
>
<
div
>
Model numbers (empty for all):
<
ModelNums
state
=
{
this
.
props
.
state
}
/>
</
div
>
<
div
>
<
input
type
=
'checkbox'
onChange
=
{
t
=>
this
.
props
.
state
.
isBinary
.
next
(
!!
t
.
currentTarget
.
checked
)
}
/>
Binary
</
div
>
<
div
>
Query string:
<
QueryUrl
state
=
{
this
.
props
.
state
}
/>
</
div
>
</
div
>
}
}
class
QuerySelect
extends
React
.
Component
<
{
state
:
State
}
>
{
render
()
{
return
<
select
onChange
=
{
s
=>
this
.
props
.
state
.
query
.
next
(
QueryList
[
+
s
.
currentTarget
.
value
].
definition
)
}
>
{
QueryList
.
map
((
q
,
i
)
=>
<
option
value
=
{
i
}
key
=
{
i
}
selected
=
{
i
===
1
}
>
{
q
.
definition
.
niceName
}
</
option
>)
}
</
select
>
}
}
class
QueryParams
extends
React
.
Component
<
{
state
:
State
},
{
prms
:
string
}
>
{
state
=
{
prms
:
''
};
parseParams
(
str
:
string
)
{
this
.
setState
({
prms
:
str
});
try
{
const
params
=
JSON
.
parse
(
str
);
this
.
props
.
state
.
params
.
next
(
params
);
}
catch
{
this
.
props
.
state
.
params
.
next
({});
}
}
componentDidMount
()
{
this
.
props
.
state
.
query
.
subscribe
(
q
=>
this
.
setState
({
prms
:
formatParams
(
q
)
}))
}
render
()
{
return
<
textarea
style
=
{
{
height
:
'
300px
'
}
}
value
=
{
this
.
state
.
prms
}
cols
=
{
80
}
onChange
=
{
t
=>
this
.
parseParams
(
t
.
currentTarget
.
value
)
}
/>;
}
}
class
QueryUrl
extends
React
.
Component
<
{
state
:
State
},
{
queryString
:
string
}
>
{
state
=
{
queryString
:
''
};
componentDidMount
()
{
this
.
props
.
state
.
url
.
subscribe
(
url
=>
this
.
setState
({
queryString
:
url
}))
}
render
()
{
return
<
input
type
=
'text'
value
=
{
this
.
state
.
queryString
}
style
=
{
{
width
:
'
800px
'
}
}
/>
}
}
class
ModelNums
extends
React
.
Component
<
{
state
:
State
}
>
{
render
()
{
return
<
input
type
=
'text'
defaultValue
=
'1'
style
=
{
{
width
:
'
300px
'
}
}
onChange
=
{
t
=>
this
.
props
.
state
.
models
.
next
(
t
.
currentTarget
.
value
.
split
(
'
,
'
)
.
map
(
v
=>
v
.
trim
())
.
filter
(
v
=>
!!
v
)
.
map
(
v
=>
+
v
)
)
}
/>
}
}
const
state
:
State
=
{
query
:
new
Rx
.
BehaviorSubject
(
QueryList
[
1
].
definition
),
id
:
new
Rx
.
BehaviorSubject
(
'
1cbs
'
),
params
:
new
Rx
.
BehaviorSubject
({
}),
isBinary
:
new
Rx
.
BehaviorSubject
<
boolean
>
(
false
),
models
:
new
Rx
.
BehaviorSubject
<
number
[]
>
([]),
url
:
new
Rx
.
Subject
()
}
function
formatParams
(
def
:
QueryDefinition
)
{
const
prms
=
Object
.
create
(
null
);
for
(
const
p
of
def
.
jsonParams
)
{
prms
[
p
.
name
]
=
p
.
exampleValues
?
p
.
exampleValues
[
0
]
:
void
0
;
}
return
JSON
.
stringify
(
prms
,
void
0
,
2
);
}
function
formatUrl
()
{
const
json
=
JSON
.
stringify
({
name
:
state
.
query
.
value
.
name
,
id
:
state
.
id
.
value
,
modelNums
:
state
.
models
.
value
.
length
?
state
.
models
.
value
:
void
0
,
binary
:
state
.
isBinary
.
value
,
params
:
state
.
params
.
value
});
state
.
url
.
next
(
encodeURIComponent
(
json
));
}
Rx
.
merge
(
state
.
query
,
state
.
id
,
state
.
params
,
state
.
isBinary
,
state
.
models
).
subscribe
(
s
=>
formatUrl
());
ReactDOM
.
render
(<
Root
state
=
{
state
}
/>,
document
.
getElementById
(
'
app
'
));
This diff is collapsed.
Click to expand it.
webpack.config.js
+
0
−
3
View file @
af1fb704
...
...
@@ -2,15 +2,12 @@ const common = require('./webpack.config.common.js');
const
createApp
=
common
.
createApp
;
const
createEntry
=
common
.
createEntry
;
const
createBrowserTest
=
common
.
createBrowserTest
;
const
createNodeApp
=
common
.
createNodeApp
;
module
.
exports
=
[
createApp
(
'
viewer
'
),
createApp
(
'
basic-wrapper
'
),
createEntry
(
'
examples/proteopedia-wrapper/index
'
,
'
examples/proteopedia-wrapper
'
,
'
index
'
),
createEntry
(
'
apps/demos/lighting/index
'
,
'
demos/lighting
'
,
'
index
'
),
createNodeApp
(
'
state-docs
'
),
createApp
(
'
model-server-query
'
),
createBrowserTest
(
'
font-atlas
'
),
createBrowserTest
(
'
marching-cubes
'
),
...
...
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