Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
9375f88f
Commit
9375f88f
authored
Sep 05, 2020
by
Carsten Rose
Browse files
Merge branch 'master' into 'develop'
Master See merge request
!281
parents
8f9bd35d
ef98e435
Pipeline
#3764
passed with stages
in 4 minutes and 1 second
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Documentation/Report.rst
View file @
9375f88f
...
@@ -496,11 +496,11 @@ The STORE_RECORD will always be merged with previous content. The Level Keys are
...
@@ -496,11 +496,11 @@ The STORE_RECORD will always be merged with previous content. The Level Keys are
.. important::
.. important::
Multiple columns, with the same column name, can't be accessed individually. Only the last column is available.
Multiple columns, with the same column name, can't be accessed individually. Only the last column is available.
.. important::
.. important::
Retrieving the *final* value of :ref:`special-column-names` is possible via '{{
&
<column>
:R}} (there is an '
&
' direct behind '{{')
Retrieving the *final* value of :ref:`special-column-names` is possible via '{{
&
<column>
:R}} (there is an '
&
' direct behind '{{')
Example::
Example::
...
@@ -2201,25 +2201,30 @@ Sending messages via WebSocket and receiving the answer is done via: ::
...
@@ -2201,25 +2201,30 @@ Sending messages via WebSocket and receiving the answer is done via: ::
SELECT
'
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
' AS _websocket
SELECT
'
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
' AS _websocket
Instead of
'
...
AS
_websocket
'
it'
s
also
possible
to
use
'
... AS _link
'
.
Instead of
``
... AS _websocket
``
it'
s
also
possible
to
use
``
...
AS
_link
``
(
same
syntax
)
.
The
answer
is
written
to
output
and
stored
in
the
given
column
(
in
this
case
'websocket'
or
'link'
).
The
answer
from
the
socket
(
if
there
is
something
)
is
written
to
output
and
stored
in
STORE_RECORD
by
given
column
(
in
this
case
'websocket'
or
'link'
).
..
tip
::
..
tip
::
To
suppress
the
direct
output
,
add
'_hide'
to
the
column
name
::
To
suppress
the
direct
output
,
add
``
|
_hide
``
to
the
column
name
.
Example
::
SELECT
'
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
' AS '
_websocket
|
_hide
'
SELECT
'
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
' AS '
_websocket
|
_hide
'
.. tip::
.. tip::
To define a uniq column name (to access it later via STORE_RECORD)::
To define a uniq column name (easy access by column name via STORE_RECORD) add ``|myName`` (replace *myName*).
Example::
SELECT '
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
' AS '
_websocket
|
myName
'
SELECT '
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
' AS '
_websocket
|
myName
'
.. tip::
.. tip::
Get the answer from STORE_RECORD by using
'
{
{&...
'
.
Check
`access-column-values`_.
Get the answer from STORE_RECORD by using
``
{{&...
``
. Check `access-column-values`_.
Example::
Example::
...
@@ -2230,7 +2235,6 @@ Example::
...
@@ -2230,7 +2235,6 @@ Example::
'
{
{
myName
:
R
}
}
' >> '
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
'
'
{
{
myName
:
R
}
}
' >> '
w
:ws
://<
host
>:<
port
>/<
path
>|
t
:<
message
>
'
'
{
{&
myName
:
R
}
}
' >> '
<
received
socket
answer
>
'
'
{
{&
myName
:
R
}
}
' >> '
<
received
socket
answer
>
'
.. _drag_and_drop:
.. _drag_and_drop:
Drag and drop
Drag and drop
...
...
extension/Classes/Core/Report/Link.php
View file @
9375f88f
...
@@ -30,7 +30,6 @@ use IMATHUZH\Qfq\Core\Helper\Support;
...
@@ -30,7 +30,6 @@ use IMATHUZH\Qfq\Core\Helper\Support;
use
IMATHUZH\Qfq\Core\Helper\Token
;
use
IMATHUZH\Qfq\Core\Helper\Token
;
use
IMATHUZH\Qfq\Core\Store\Sip
;
use
IMATHUZH\Qfq\Core\Store\Sip
;
use
IMATHUZH\Qfq\Core\Store\Store
;
use
IMATHUZH\Qfq\Core\Store\Store
;
use
IMATHUZH\Qfq\Core\Report\WebSocket
;
/*
/*
* a:AltText
* a:AltText
...
@@ -538,22 +537,32 @@ class Link {
...
@@ -538,22 +537,32 @@ class Link {
}
}
$urlParts
=
parse_url
(
$param
[
TOKEN_WEBSOCKET
]);
$urlParts
=
parse_url
(
$param
[
TOKEN_WEBSOCKET
]);
if
(
empty
(
$urlParts
[
'host'
])
||
empty
(
$urlParts
[
'port'
])
||
empty
(
$urlParts
[
'path'
]))
{
$urlParts
=
array_merge
([
'scheme'
=>
'ws'
,
'host'
=>
''
,
'port'
=>
80
,
'path'
=>
''
],
$urlParts
);
if
(
empty
(
$urlParts
[
'host'
]))
{
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'Target URL incomplete'
,
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'Target URL incomplete'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
ERROR_MESSAGE_TO_DEVELOPER
=>
'host:'
.
$urlParts
[
'host'
]
.
', '
.
'host:
'
.
$urlParts
[
'host'
]
.
', '
.
'port:'
.
$urlParts
[
'port'
]
.
', '
.
'port:
'
.
$urlParts
[
'port'
]
.
', '
.
'path:'
.
$urlParts
[
'path'
]])
'path:
'
.
$urlParts
[
'path'
]])
,
ERROR_MISSING_VALUE
);
,
ERROR_MISSING_VALUE
);
}
}
// Check for wss >> ssl
if
(
$urlParts
[
'scheme'
]
==
'wss'
)
{
$urlParts
[
'host'
]
=
'ssl://'
.
$urlParts
[
'host'
];
if
(
$urlParts
[
'port'
]
==
0
)
{
$urlParts
[
'port'
]
=
443
;
}
}
// Open Socket
// Open Socket
if
(
false
===
$websocket
->
connect
(
$urlParts
[
'host'
],
$urlParts
[
'port'
],
$urlParts
[
'path'
]))
{
$errorMsg
=
''
;
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'Failed connect websocket'
,
if
(
false
===
$websocket
->
connect
(
$urlParts
[
'host'
],
$urlParts
[
'port'
],
$urlParts
[
'path'
],
''
,
$errorMsg
))
{
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'Failed connect websocket: '
.
$errorMsg
,
ERROR_MESSAGE_TO_DEVELOPER
=>
ERROR_MESSAGE_TO_DEVELOPER
=>
'host:'
.
$urlParts
[
'host'
]
.
', '
.
'host:
'
.
$urlParts
[
'host'
]
.
', '
.
'port:'
.
$urlParts
[
'port'
]
.
', '
.
'port:
'
.
$urlParts
[
'port'
]
.
', '
.
'path:'
.
$urlParts
[
'path'
]])
'path:
'
.
$urlParts
[
'path'
]])
,
ERROR_MISSING_VALUE
);
,
ERROR_MISSING_VALUE
);
}
}
...
...
extension/Classes/Core/Report/WebSocket.php
View file @
9375f88f
...
@@ -62,6 +62,7 @@ class WebSocket {
...
@@ -62,6 +62,7 @@ class WebSocket {
* @return bool
* @return bool
*/
*/
public
function
sendData
(
string
$data
,
string
$type
=
'text'
,
bool
$masked
=
true
)
{
public
function
sendData
(
string
$data
,
string
$type
=
'text'
,
bool
$masked
=
true
)
{
if
(
$this
->
connected
===
false
)
{
if
(
$this
->
connected
===
false
)
{
trigger_error
(
"Not connected"
,
E_USER_WARNING
);
trigger_error
(
"Not connected"
,
E_USER_WARNING
);
return
false
;
return
false
;
...
@@ -142,9 +143,10 @@ class WebSocket {
...
@@ -142,9 +143,10 @@ class WebSocket {
* @param int $port
* @param int $port
* @param string $path
* @param string $path
* @param string $origin
* @param string $origin
* @param string $errorMsg # In case of an error, return error msg.
* @return bool
* @return bool
*/
*/
public
function
connect
(
string
$host
,
int
$port
,
string
$path
,
string
$origin
=
''
)
{
public
function
connect
(
string
$host
,
int
$port
,
string
$path
,
string
$origin
=
''
,
&
$errorMsg
=
''
)
{
$this
->
host
=
$host
;
$this
->
host
=
$host
;
$this
->
port
=
$port
;
$this
->
port
=
$port
;
$this
->
path
=
$path
;
$this
->
path
=
$path
;
...
@@ -170,12 +172,18 @@ class WebSocket {
...
@@ -170,12 +172,18 @@ class WebSocket {
@
fwrite
(
$this
->
socket
,
$header
);
@
fwrite
(
$this
->
socket
,
$header
);
$response
=
@
fread
(
$this
->
socket
,
1500
);
$response
=
@
fread
(
$this
->
socket
,
1500
);
$errorMsg
=
$response
;
$this
->
connected
=
false
;
preg_match
(
'#Sec-WebSocket-Accept:\s(.*)$#mU'
,
$response
,
$matches
);
preg_match
(
'#Sec-WebSocket-Accept:\s(.*)$#mU'
,
$response
,
$matches
);
if
(
$matches
)
{
if
(
$matches
)
{
$keyAccept
=
trim
(
$matches
[
1
]);
$keyAccept
=
trim
(
$matches
[
1
]);
$expectedResponse
=
base64_encode
(
pack
(
'H*'
,
sha1
(
$key
.
'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
)));
$expectedResponse
=
base64_encode
(
pack
(
'H*'
,
sha1
(
$key
.
'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
)));
$this
->
connected
=
(
$keyAccept
===
$expectedResponse
)
?
true
:
false
;
if
(
$keyAccept
===
$expectedResponse
)
{
$this
->
connected
=
true
;
$errorMsg
=
''
;
}
}
}
return
$this
->
connected
;
return
$this
->
connected
;
...
...
less/qfq-bs.css.less
View file @
9375f88f
...
@@ -57,18 +57,21 @@ i.@{spinner_class} {
...
@@ -57,18 +57,21 @@ i.@{spinner_class} {
cursor: pointer;
cursor: pointer;
height: 0;
height: 0;
width: 0;
width: 0;
-moz-appearance: none;
/*Radios don't scale correctly on Firefox with zoom*/
}
}
/* Customize the label (the container) */
/* Customize the label (the container) */
.radio-inline, .radio {
.radio-inline, .radio {
display: inline-block;
display: inline-block;
position: relative;
position: relative;
padding-left:
1.8em
;
padding-left:
25px
;
padding-top: 0 !important;
padding-top: 0 !important;
margin-top: 7px !important;
margin-top: 7px !important;
margin-right: 10px;
margin-right: 10px;
cursor: pointer;
cursor: pointer;
font-size: 1em;
font-size: 1em;
line-height: 20px;
-webkit-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-ms-user-select: none;
...
@@ -84,8 +87,8 @@ i.@{spinner_class} {
...
@@ -84,8 +87,8 @@ i.@{spinner_class} {
position: absolute;
position: absolute;
top: 0;
top: 0;
left: 0;
left: 0;
height:
18
px;
height:
20
px;
width:
18
px;
width:
20
px;
background-color: #fff;
background-color: #fff;
border-radius: 50%;
border-radius: 50%;
border: 2px solid #ccc;
border: 2px solid #ccc;
...
@@ -114,8 +117,8 @@ i.@{spinner_class} {
...
@@ -114,8 +117,8 @@ i.@{spinner_class} {
/* Style the indicator (dot/circle) */
/* Style the indicator (dot/circle) */
.radio-inline .checkmark:after, .radio .checkmark:after {
.radio-inline .checkmark:after, .radio .checkmark:after {
top:
3
px;
top:
4
px;
left:
3
px;
left:
4
px;
width: 8px;
width: 8px;
height: 8px;
height: 8px;
border-radius: 50%;
border-radius: 50%;
...
@@ -124,24 +127,27 @@ i.@{spinner_class} {
...
@@ -124,24 +127,27 @@ i.@{spinner_class} {
/* CUSTOM CHECKBOXES */
/* CUSTOM CHECKBOXES */
/* Hide the browser's default radio */
/* Hide the browser's default radio */
.checkbox-inline>input[type=checkbox] {
.checkbox-inline>input[type=checkbox]
, .checkbox>input[type=checkbox]
{
position: absolute;
position: absolute;
opacity: 0;
opacity: 0;
cursor: pointer;
cursor: pointer;
height: 0;
height: 0;
width: 0;
width: 0;
-moz-appearance: none;
/*Checkboxes don't scale correctly on Firefox with zoom*/
}
}
/* Customize the label (the container) */
/* Customize the label (the container) */
.checkbox-inline, .checkbox {
.checkbox-inline, .checkbox {
display: inline-block;
display: inline-block;
position: relative;
position: relative;
padding-left:
1.8em
;
padding-left:
26px
;
padding-top: 0 !important;
padding-top: 0 !important;
margin-top: 7px !important;
margin-top: 7px !important;
margin-right: 10px;
margin-right: 10px;
cursor: pointer;
cursor: pointer;
font-size: 1em;
font-size: 1em;
line-height: 20px;
-webkit-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-ms-user-select: none;
...
@@ -169,10 +175,10 @@ i.@{spinner_class} {
...
@@ -169,10 +175,10 @@ i.@{spinner_class} {
position: absolute;
position: absolute;
top: 0;
top: 0;
left: 0;
left: 0;
height:
18
px;
height:
20
px;
width:
18
px;
width:
20
px;
background-color: #fff;
background-color: #fff;
border-radius:
4
px;
border-radius:
5
px;
border: 2px solid #ccc;
border: 2px solid #ccc;
}
}
...
@@ -209,9 +215,9 @@ i.@{spinner_class} {
...
@@ -209,9 +215,9 @@ i.@{spinner_class} {
/* Style the indicator (dot/circle) */
/* Style the indicator (dot/circle) */
.checkbox-inline .checkmark:after, .checkbox .checkmark:after {
.checkbox-inline .checkmark:after, .checkbox .checkmark:after {
top: 1px;
top: 1px;
left:
4
px;
left:
5
px;
width: 6px;
width: 6px;
height: 1
0
px;
height: 1
2
px;
border: solid white;
border: solid white;
border-width: 0 3px 3px 0;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment