Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tv_panel
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
Hermod
tv_panel
Commits
fe48bf23
Commit
fe48bf23
authored
7 years ago
by
Aymeric Bernard
Browse files
Options
Downloads
Patches
Plain Diff
Server config: useDummyAPI and useDummyNFC
parent
eebe5532
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/config.template.js
+2
-0
2 additions, 0 deletions
server/config.template.js
server/socket.js
+7
-5
7 additions, 5 deletions
server/socket.js
with
9 additions
and
5 deletions
server/config.template.js
+
2
−
0
View file @
fe48bf23
...
...
@@ -4,6 +4,8 @@ const path = require('path');
module
.
exports
=
{
port
:
5000
,
secure
:
false
,
useDummyAPI
:
false
,
useDummyNFC
:
false
,
uuid
:
'
UUID A REMPLIR
'
,
api
:
{
url
:
'
http://api.hermod.cs-campus.fr
'
,
...
...
This diff is collapsed.
Click to expand it.
server/socket.js
+
7
−
5
View file @
fe48bf23
...
...
@@ -2,7 +2,7 @@ const fetch = require('node-fetch');
const
path
=
require
(
'
path
'
);
const
{
uuid
,
fontSize
,
rowHeight
,
api
,
uuid
,
fontSize
,
rowHeight
,
api
,
useDummyNFC
,
useDummyAPI
,
}
=
require
(
'
./config
'
);
const
{
spawn
}
=
require
(
'
child_process
'
);
...
...
@@ -11,8 +11,6 @@ const dummyResponse = require('./dummyResponse.json');
const
{
createSignedJWT
,
interval
}
=
require
(
'
./utils
'
);
const
useDummy
=
false
;
let
version
;
const
checkVersion
=
(
newVersion
)
=>
{
...
...
@@ -43,7 +41,7 @@ const doScreenApiRequest = (socket, userid = null) => {
};
const
setChrono
=
(
socket
)
=>
{
if
(
useDummy
)
{
if
(
useDummy
API
)
{
return
interval
(()
=>
socket
.
emit
(
'
panel_data
'
,
dummyResponse
),
10000
);
}
return
interval
(()
=>
doScreenApiRequest
(
socket
),
10000
);
...
...
@@ -64,7 +62,11 @@ module.exports = (socket) => {
chrono
.
stop
();
});
const
badgeChild
=
spawn
(
path
.
resolve
(
__dirname
,
'
../scripts/nfc-poll-wrapper.sh
'
));
const
script
=
(
useDummyNFC
)
?
'
../scripts/nfc-poll-wrapper-dummy.sh
'
:
'
../scripts/nfc-poll-wrapper.sh
'
;
const
badgeChild
=
spawn
(
path
.
resolve
(
__dirname
,
script
));
badgeChild
.
stdout
.
on
(
'
data
'
,
(
data0
)
=>
{
const
userid
=
data0
.
toString
().
trim
();
...
...
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