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
7595a9a6
Commit
7595a9a6
authored
Jun 13, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not use two events "get" and "set" for the same event name - useless
parent
accf5a4f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
33 deletions
+24
-33
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+7
-7
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+3
-12
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+14
-14
No files found.
debomatic-webui/lib/client.js
View file @
7595a9a6
...
...
@@ -130,9 +130,9 @@ function __handler_get_file(socket, data) {
socket
.
emit
(
event_name
,
data
);
});
if
(
config
.
web
.
file
.
preview
.
indexOf
(
data
.
file
.
name
)
>=
0
&&
!
data
.
file
.
force
)
__send_file
(
_e
.
file
.
set
,
socket
,
data
,
config
.
web
.
file
.
num_lines
);
__send_file
(
_e
.
file
,
socket
,
data
,
config
.
web
.
file
.
num_lines
);
else
__send_file
(
_e
.
file
.
set
,
socket
,
data
);
__send_file
(
_e
.
file
,
socket
,
data
);
}
function
Client
(
socket
)
{
...
...
@@ -142,21 +142,21 @@ function Client(socket) {
utils
.
send_distributions
(
socket
);
// init events
socket
.
on
(
_e
.
distribution_packages
.
get
,
function
(
data
)
{
socket
.
on
(
_e
.
distribution_packages
,
function
(
data
)
{
if
(
!
utils
.
check_data_distribution
(
data
))
return
;
var
distribution_path
=
path
.
join
(
config
.
debomatic
.
path
,
data
.
distribution
.
name
,
'
pool
'
);
utils
.
generic_handler_watcher
(
_e
.
distribution_packages
.
set
,
socket
,
data
,
distribution_path
,
__send_distribution_packages
);
utils
.
generic_handler_watcher
(
_e
.
distribution_packages
,
socket
,
data
,
distribution_path
,
__send_distribution_packages
);
});
socket
.
on
(
_e
.
package_files_list
.
get
,
function
(
data
)
{
socket
.
on
(
_e
.
package_files_list
,
function
(
data
)
{
if
(
!
utils
.
check_data_package
(
data
))
return
;
var
package_path
=
utils
.
get_package_path
(
data
);
utils
.
generic_handler_watcher
(
_e
.
package_files_list
.
set
,
socket
,
data
,
package_path
,
__send_package_files_list
);
utils
.
generic_handler_watcher
(
_e
.
package_files_list
,
socket
,
data
,
package_path
,
__send_package_files_list
);
});
socket
.
on
(
_e
.
file
.
get
,
function
(
data
)
{
socket
.
on
(
_e
.
file
,
function
(
data
)
{
if
(
!
utils
.
check_data_file
(
data
))
return
;
__handler_get_file
(
socket
,
data
);
...
...
debomatic-webui/lib/config.js
View file @
7595a9a6
...
...
@@ -69,15 +69,6 @@ config.web.preferences.debug = 0; // debug level - 0 means disabled
config
.
version
=
'
0.4.1
'
;
// A simple function to quickly have
// get and set strings for client events
function
_event_get_set
(
event_name
)
{
return
{
set
:
event_name
,
get
:
'
get_
'
+
event_name
};
}
config
.
debomatic
.
pidfile
=
"
/var/run/debomatic-
"
+
require
(
'
crypto
'
)
.
createHash
(
'
sha256
'
)
...
...
@@ -92,10 +83,10 @@ config.events.broadcast.status_update = 'status_update';
config
.
events
.
broadcast
.
status_debomatic
=
'
status_debomatic
'
;
config
.
events
.
client
=
{};
config
.
events
.
client
.
distribution_packages
=
_event_get_set
(
'
distribution_packages
'
)
;
config
.
events
.
client
.
distribution_packages
=
'
distribution_packages
'
;
config
.
events
.
client
.
distribution_packages
.
status
=
'
package_status
'
;
config
.
events
.
client
.
package_files_list
=
_event_get_set
(
'
package_files_list
'
)
;
config
.
events
.
client
.
file
=
_event_get_set
(
'
file
'
)
;
config
.
events
.
client
.
package_files_list
=
'
package_files_list
'
;
config
.
events
.
client
.
file
=
'
file
'
;
config
.
events
.
client
.
file_newcontent
=
'
file_newcontent
'
;
config
.
events
.
client
.
status
=
'
status
'
;
...
...
debomatic-webui/public/javascripts/page_distribution.js
View file @
7595a9a6
...
...
@@ -159,8 +159,8 @@ function Page_Distrubion(socket) {
if
(
Utils
.
check_view_distribution
(
view
))
{
var
query_data
=
{};
query_data
.
distribution
=
view
.
distribution
;
debug_socket
(
'
emit
'
,
_e
.
distribution_packages
.
get
,
query_data
);
socket
.
emit
(
_e
.
distribution_packages
.
get
,
query_data
);
debug_socket
(
'
emit
'
,
_e
.
distribution_packages
,
query_data
);
socket
.
emit
(
_e
.
distribution_packages
,
query_data
);
}
},
select
:
function
()
{
...
...
@@ -256,8 +256,8 @@ function Page_Distrubion(socket) {
var
query_data
=
{};
query_data
.
distribution
=
view
.
distribution
;
query_data
.
package
=
view
.
package
;
debug_socket
(
'
emit
'
,
_e
.
package_files_list
.
get
,
query_data
);
socket
.
emit
(
_e
.
package_files_list
.
get
,
query_data
);
debug_socket
(
'
emit
'
,
_e
.
package_files_list
,
query_data
);
socket
.
emit
(
_e
.
package_files_list
,
query_data
);
}
},
select
:
function
()
{
...
...
@@ -331,8 +331,8 @@ function Page_Distrubion(socket) {
// get a feedback to user while downloading file
$
(
'
#file pre
'
).
html
(
'
Downloading file, please wait a while ...
'
);
$
(
'
#file
'
).
show
();
debug_socket
(
'
emit
'
,
_e
.
file
.
get
,
query_data
);
socket
.
emit
(
_e
.
file
.
get
,
query_data
);
debug_socket
(
'
emit
'
,
_e
.
file
,
query_data
);
socket
.
emit
(
_e
.
file
,
query_data
);
}
},
set_preview
:
function
(
preview
)
{
...
...
@@ -584,13 +584,13 @@ function Page_Distrubion(socket) {
welcome
.
set
(
socket_data
);
});
socket
.
on
(
_e
.
distribution_packages
.
set
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
distribution_packages
.
set
,
socket_data
);
socket
.
on
(
_e
.
distribution_packages
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
distribution_packages
,
socket_data
);
packages
.
set
(
socket_data
);
});
socket
.
on
(
_e
.
distribution_packages
.
status
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
distribution_packages
.
set
,
socket_data
);
debug_socket
(
'
received
'
,
_e
.
distribution_packages
,
socket_data
);
packages
.
set_status
(
socket_data
);
sticky
.
set_status
(
socket_data
);
});
...
...
@@ -600,13 +600,13 @@ function Page_Distrubion(socket) {
sticky
.
set_status
(
socket_data
);
});
socket
.
on
(
_e
.
package_files_list
.
set
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
package_files_list
.
set
,
socket_data
);
socket
.
on
(
_e
.
package_files_list
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
package_files_list
,
socket_data
);
files
.
set
(
socket_data
);
});
socket
.
on
(
_e
.
file
.
set
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
file
.
set
,
socket_data
);
socket
.
on
(
_e
.
file
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
file
,
socket_data
);
file
.
set
(
socket_data
);
});
...
...
@@ -648,7 +648,7 @@ function Page_Distrubion(socket) {
// when page is loaded sidebar has offset().top
// equals 0. This is because html is loaded on socket
// events. Sleep a while and call stiky.reset()
setTimeout
(
sticky
.
r
eset
,
500
);
setTimeout
(
sticky
.
r
,
500
);
// WORKAROUND:
// On incoming hundred of lines browser goes crazy.
...
...
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