Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bc
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vaclab
bc
Commits
15dca8c3
Commit
15dca8c3
authored
8 years ago
by
wactbprot
Browse files
Options
Downloads
Patches
Plain Diff
nice content fo pd box
parent
a072a589
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf.js
+5
-0
5 additions, 0 deletions
conf.js
index.js
+35
-1
35 additions, 1 deletion
index.js
with
40 additions
and
1 deletion
conf.js
+
5
−
0
View file @
15dca8c3
...
...
@@ -22,4 +22,9 @@ conf.items = [
,
{
"
display
"
:
"
1000mbar CDG
"
,
"
exchange
"
:{
"
Value
"
:
1000
,
"
Unit
"
:
"
mbar
"
}}
]
conf
.
basestr_pd
=
"
{center}pump down{/center}
"
;
conf
.
ctrlstr
=
{
"
running
"
:
"
{center}{yellow-fg}running ...{/yellow-fg}{/center}
"
,
"
ready
"
:
"
{center}{green-fg}ready{/green-fg}{/center}
"
};
module
.
exports
=
conf
;
This diff is collapsed.
Click to expand it.
index.js
+
35
−
1
View file @
15dca8c3
...
...
@@ -82,7 +82,7 @@ var box_pd = blessed.box({
left
:
0
,
width
:
wb
,
height
:
hb
,
content
:
'
{center}pump down{/center}
'
,
content
:
conf
.
basestr_pd
,
tags
:
true
,
border
:
{
type
:
'
line
'
...
...
@@ -114,6 +114,34 @@ box_pd.on("click", function(data){
});
setInterval
(
function
(){
var
url
=
"
http://
"
+
conf
.
mp
.
server
+
"
:
"
+
conf
.
mp
.
port
+
"
/
"
+
conf
.
mp
.
mpid
+
"
/0/ctrl
"
;
http
.
get
(
url
,
function
(
res
)
{
var
body
=
""
;
res
.
on
(
"
data
"
,
function
(
data
){
body
+=
data
;
});
res
.
on
(
"
end
"
,
function
()
{
var
nd
=
(
new
Date
()).
toTimeString
().
split
(
"
"
)[
0
]
,
res
=
JSON
.
parse
(
body
).
result
;
var
midstr
=
conf
.
ctrlstr
[
res
]
?
conf
.
ctrlstr
[
res
]
:
"
{center}changing ...{/center}
"
;
box_pd
.
setContent
(
conf
.
basestr_pd
+
"
\n
"
+
midstr
+
"
\n
"
+
"
{center}update:
"
+
nd
+
"
{/center}
"
);
});
});
screen
.
render
();
},
800
);
var
box_av
=
blessed
.
box
({
top
:
hl
,
left
:
wb
,
...
...
@@ -159,6 +187,12 @@ server.get("/pressure_max", function(req, res, next){
next
();
});
server
.
listen
(
conf
.
api
.
port
,
function
()
{
screen
.
title
=
pj
.
name
...
...
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