Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
4ea3c67b
Commit
4ea3c67b
authored
Jun 12, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented debomatic status
parent
ee4d988d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
10 deletions
+67
-10
debomatic-webui/debomatic-webui
debomatic-webui/debomatic-webui
+1
-0
debomatic-webui/lib/broadcaster.js
debomatic-webui/lib/broadcaster.js
+17
-0
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+8
-0
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+8
-1
debomatic-webui/public/javascripts/page_generic.js
debomatic-webui/public/javascripts/page_generic.js
+25
-7
debomatic-webui/public/stylesheets/style.css
debomatic-webui/public/stylesheets/style.css
+4
-0
debomatic-webui/views/footer.ejs
debomatic-webui/views/footer.ejs
+4
-2
No files found.
debomatic-webui/debomatic-webui
View file @
4ea3c67b
...
@@ -72,6 +72,7 @@ server.listen(config.port, config.host, null, function (err) {
...
@@ -72,6 +72,7 @@ server.listen(config.port, config.host, null, function (err) {
client.start();
client.start();
if (status.length > 0)
if (status.length > 0)
client.send_status(status);
client.send_status(status);
client.send_status_debomatic();
});
});
console.log('Debomatic-webui listening on %s:%d in %s mode', server.address().address, server.address().port, app.settings.env);
console.log('Debomatic-webui listening on %s:%d in %s mode', server.address().address, server.address().port, app.settings.env);
...
...
debomatic-webui/lib/broadcaster.js
View file @
4ea3c67b
...
@@ -63,12 +63,29 @@ function __watch_distributions(socket) {
...
@@ -63,12 +63,29 @@ function __watch_distributions(socket) {
});
});
}
}
function
__watch_pidfile
(
socket
)
{
fs
.
watchFile
(
config
.
debomatic
.
pidfile
,
{
persistent
:
false
,
interval
:
1007
},
function
(
curr
,
prev
)
{
var
status_debomatic
=
{
"
running
"
:
curr
.
ino
!==
0
// if === 0 means pidfile does not exists
};
try
{
socket
.
emit
(
socket
.
emit
(
config
.
events
.
broadcast
.
status_debomatic
,
status_debomatic
));
}
catch
(
err
)
{}
});
}
function
Broadcaster
(
sockets
,
status
)
{
function
Broadcaster
(
sockets
,
status
)
{
__watch_status
(
sockets
,
status
);
__watch_status
(
sockets
,
status
);
__watch_distributions
(
sockets
);
__watch_distributions
(
sockets
);
__watch_pidfile
(
sockets
);
return
{
return
{
};
};
...
...
debomatic-webui/lib/client.js
View file @
4ea3c67b
...
@@ -181,6 +181,14 @@ function Client(socket) {
...
@@ -181,6 +181,14 @@ function Client(socket) {
this
.
send_status
=
function
(
status
)
{
this
.
send_status
=
function
(
status
)
{
socket
.
emit
(
_e
.
status
,
status
);
socket
.
emit
(
_e
.
status
,
status
);
};
};
this
.
send_status_debomatic
=
function
()
{
fs
.
exists
(
config
.
debomatic
.
pidfile
,
function
(
exists
)
{
socket
.
emit
(
config
.
events
.
broadcast
.
status_debomatic
,
{
'
running
'
:
exists
});
});
};
}
}
module
.
exports
=
Client
;
module
.
exports
=
Client
;
debomatic-webui/lib/config.js
View file @
4ea3c67b
...
@@ -67,7 +67,7 @@ config.web.preferences.debug = 0; // debug level - 0 means disabled
...
@@ -67,7 +67,7 @@ config.web.preferences.debug = 0; // debug level - 0 means disabled
// DO NOT TOUCH these ones
// DO NOT TOUCH these ones
config
.
version
=
'
0.
3.1
'
;
config
.
version
=
'
0.
4.0
'
;
// A simple function to quickly have
// A simple function to quickly have
// get and set strings for client events
// get and set strings for client events
...
@@ -78,11 +78,18 @@ function _event_get_set(event_name) {
...
@@ -78,11 +78,18 @@ function _event_get_set(event_name) {
};
};
}
}
config
.
debomatic
.
pidfile
=
"
/var/run/debomatic-
"
+
require
(
'
crypto
'
)
.
createHash
(
'
sha256
'
)
.
update
(
config
.
debomatic
.
path
)
.
digest
(
'
hex
'
);
config
.
events
=
{};
config
.
events
=
{};
config
.
events
.
error
=
'
error
'
;
config
.
events
.
error
=
'
error
'
;
config
.
events
.
broadcast
=
{};
config
.
events
.
broadcast
=
{};
config
.
events
.
broadcast
.
distributions
=
'
distributions
'
;
config
.
events
.
broadcast
.
distributions
=
'
distributions
'
;
config
.
events
.
broadcast
.
status_update
=
'
status_update
'
;
config
.
events
.
broadcast
.
status_update
=
'
status_update
'
;
config
.
events
.
broadcast
.
status_debomatic
=
'
status_debomatic
'
;
config
.
events
.
client
=
{};
config
.
events
.
client
=
{};
config
.
events
.
client
.
distribution_packages
=
_event_get_set
(
'
distribution_packages
'
);
config
.
events
.
client
.
distribution_packages
=
_event_get_set
(
'
distribution_packages
'
);
...
...
debomatic-webui/public/javascripts/page_generic.js
View file @
4ea3c67b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
function
Page_Generic
()
{
function
Page_Generic
()
{
var
_e
=
config
.
events
;
var
_e
=
config
.
events
;
var
status_debomatic
=
{};
function
__get_status_html_id
(
status_data
)
{
function
__get_status_html_id
(
status_data
)
{
var
result
=
'
status-
'
+
status_data
.
status
+
'
-
'
+
status_data
.
distribution
;
var
result
=
'
status-
'
+
status_data
.
status
+
'
-
'
+
status_data
.
distribution
;
...
@@ -73,11 +74,21 @@ function Page_Generic() {
...
@@ -73,11 +74,21 @@ function Page_Generic() {
var
status
=
{
var
status
=
{
set
:
function
(
data_status
)
{
set
:
function
(
data_status
)
{
$
(
'
#status ul
'
).
html
(
''
);
if
(
!
data_status
)
{
if
(
data_status
.
length
>
0
)
{
if
(
status_debomatic
.
running
)
{
data_status
.
forEach
(
function
(
s
)
{
$
(
'
#status .idle
'
).
show
();
status
.
append
(
s
);
$
(
'
#status .norunning
'
).
hide
();
});
}
else
{
$
(
'
#status .idle
'
).
hide
();
$
(
'
#status .norunning
'
).
show
();
}
}
else
{
$
(
'
#status ul
'
).
html
(
''
);
if
(
data_status
.
length
>
0
)
{
data_status
.
forEach
(
function
(
s
)
{
status
.
append
(
s
);
});
}
}
}
},
},
append
:
function
(
status_data
)
{
append
:
function
(
status_data
)
{
...
@@ -107,8 +118,9 @@ function Page_Generic() {
...
@@ -107,8 +118,9 @@ function Page_Generic() {
// and show idle label if necessary.
// and show idle label if necessary.
setTimeout
(
function
()
{
setTimeout
(
function
()
{
li
.
remove
();
li
.
remove
();
if
(
$
(
'
#status li
'
).
length
===
0
)
if
(
$
(
'
#status li
'
).
length
===
0
)
{
$
(
'
#status .idle
'
).
show
();
status
.
set
();
}
},
config
.
status
.
delay
.
remove
+
2000
);
// more delay on remove html
},
config
.
status
.
delay
.
remove
+
2000
);
// more delay on remove html
},
config
.
status
.
delay
.
remove
);
},
config
.
status
.
delay
.
remove
);
}
else
if
(
!
status_data
.
hasOwnProperty
(
'
success
'
))
{
}
else
if
(
!
status_data
.
hasOwnProperty
(
'
success
'
))
{
...
@@ -159,6 +171,12 @@ function Page_Generic() {
...
@@ -159,6 +171,12 @@ function Page_Generic() {
status
.
update
(
package_status
);
status
.
update
(
package_status
);
});
});
socket
.
on
(
_e
.
broadcast
.
status_debomatic
,
function
(
socket_status_debomatic
)
{
debug_socket
(
'
received
'
,
_e
.
broadcast
.
status_debomatic
,
socket_status_debomatic
);
status_debomatic
=
socket_status_debomatic
;
status
.
set
();
});
socket
.
on
(
_e
.
error
,
function
(
error
)
{
socket
.
on
(
_e
.
error
,
function
(
error
)
{
console
.
error
(
'
socket >
'
+
error
);
console
.
error
(
'
socket >
'
+
error
);
});
});
...
...
debomatic-webui/public/stylesheets/style.css
View file @
4ea3c67b
...
@@ -116,6 +116,10 @@ footer {
...
@@ -116,6 +116,10 @@ footer {
margin-right
:
10px
;
margin-right
:
10px
;
}
}
#status
.debomatic
{
display
:
none
;
}
#status
.packages
{
#status
.packages
{
display
:
inline
;
display
:
inline
;
}
}
...
...
debomatic-webui/views/footer.ejs
View file @
4ea3c67b
</div> <!-- #wrapper -->
</div> <!-- #wrapper -->
<footer class="container-fluid">
<footer class="container-fluid">
<small class="copyright pull-right text-muted">
<small class="copyright pull-right text-muted">
Fork me on <a href="https://github.com/LeoIannacone/debomatic-webui">github</a>
Fork me on <a href="https://github.com/LeoIannacone/debomatic-webui">github</a>
</small>
</small>
<div id="status" class="clearfix">
<div id="status" class="clearfix">
<span class="label label-default">status:</span> <span class="idle text-muted">Idle</span>
<span class="label label-default">status:</span>
<span class="debomatic idle text-muted">Idle</span>
<span class="debomatic norunning text-danger">Not running</span>
<ul class="packages list-inline"></ul>
<ul class="packages list-inline"></ul>
</div>
</div>
</footer>
</footer>
...
...
Write
Preview
Markdown
is supported
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