Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ESAP GUI
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
ASTRON SDC
ESCAPE WP5
ESAP GUI
Commits
a795a90d
Commit
a795a90d
authored
4 years ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
adding href to http links to make it links
parent
23c95227
No related branches found
No related tags found
1 merge request
!8
Esap gui dev
Pipeline
#7592
passed with warnings
4 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/query/samp/SampGrid.js
+6
-2
6 additions, 2 deletions
src/components/query/samp/SampGrid.js
src/components/query/samp/SampPage.js
+4
-20
4 additions, 20 deletions
src/components/query/samp/SampPage.js
with
10 additions
and
22 deletions
src/components/query/samp/SampGrid.js
+
6
−
2
View file @
a795a90d
...
...
@@ -3,7 +3,6 @@ import { Table } from "react-bootstrap";
export
default
function
SampResults
(
props
)
{
//alert('SampGrid')
let
fieldnames
=
props
.
fieldnames
let
data
=
props
.
votable_in_json
[
'
data
'
]
...
...
@@ -27,8 +26,13 @@ export default function SampResults(props) {
return
(
<
tr
key
=
{
record
}
>
{
record
.
map
((
col
)
=>
{
let
value
=
col
.
toString
()
if
(
value
.
includes
(
'
http
'
))
{
value
=
<
a
href
=
{
value
}
target
=
"
_blank
"
rel
=
"
noopener noreferrer
"
>
{
value
}
<
/a
>
}
return
(
<
td
key
=
{
col
}
>
{
col
}
<
/td
>
<
td
key
=
{
value
}
>
{
value
}
<
/td
>
)
})}
<
/tr
>
...
...
This diff is collapsed.
Click to expand it.
src/components/query/samp/SampPage.js
+
4
−
20
View file @
a795a90d
...
...
@@ -6,27 +6,16 @@ import SampGrid from './SampGrid'
export
default
function
SampPage
(
props
)
{
const
[
myVOTable
,
setMyVOTable
]
=
useState
([]);
const
pingFunc
=
function
(
my_connection
)
{
my_connection
.
notifyAll
([
new
window
.
samp
.
Message
(
"
samp.app.ping
"
,
{})])
}
// register to existing SAMP hub
const
register
=
()
=>
{
connector
.
register
()
}
// unregister from existing SAMP hub
const
unregister
=
()
=>
{
connector
.
unregister
()
}
const
handlePingClick
=
()
=>
{
connector
.
runWithConnection
(
pingFunc
)
}
const
handlePing
=
(
cc
,
senderId
,
message
,
isCall
)
=>
{
alert
(
'
handle samp.app.ping
'
)
if
(
isCall
)
{
return
{
text
:
"
ping to you,
"
+
cc
.
getName
(
senderId
)};
}
}
const
handleLoadVOTable
=
(
cc
,
senderId
,
message
,
isCall
)
=>
{
// alert('handle table.load.votable')
...
...
@@ -75,10 +64,6 @@ export default function SampPage(props) {
// attach eventhandlers
var
callHandler
=
cc
.
callHandler
;
callHandler
[
"
samp.app.ping
"
]
=
function
(
senderId
,
message
,
isCall
)
{
handlePing
(
cc
,
senderId
,
message
,
isCall
)
};
callHandler
[
"
table.load.votable
"
]
=
function
(
senderId
,
message
,
isCall
)
{
handleLoadVOTable
(
cc
,
senderId
,
message
,
isCall
)
};
...
...
@@ -87,7 +72,7 @@ export default function SampPage(props) {
var
subs
=
cc
.
calculateSubscriptions
();
// initialize the connector
var
connector
=
new
window
.
samp
.
Connector
(
"
astroview
"
,
{
"
samp.name
"
:
"
AstroView
"
},
cc
,
subs
)
var
connector
=
new
window
.
samp
.
Connector
(
"
ESAP
"
,
{
"
samp.name
"
:
"
ESAP
"
},
cc
,
subs
)
// only render when myVOTable has a value
var
renderSampGrid
...
...
@@ -102,7 +87,6 @@ export default function SampPage(props) {
<
h2
>
SAMP
demo
<
/h2
>
<
p
>
Start
a
SAMP
enabled
application
(
like
Topcat
),
register
to
the
hub
and
transmit
data
from
Topcat
.
<
/p
>
<
button
variant
=
"
outline-warning
"
onClick
=
{()
=>
register
()}
>
register
<
/button> 
;
<
button
variant
=
"
outline-success
"
onClick
=
{()
=>
handlePingClick
()}
>
SAMP
Ping
<
/button> 
;
<
button
variant
=
"
outline-warning
"
onClick
=
{()
=>
unregister
()}
>
unregister
<
/button> 
;
{
renderSampGrid
}
...
...
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