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
873a33b3
Commit
873a33b3
authored
Mar 10, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all events used are now in config
parent
e3912e86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
14 deletions
+31
-14
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+9
-7
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+14
-0
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+8
-7
No files found.
debomatic-webui/lib/client.js
View file @
873a33b3
...
@@ -77,30 +77,32 @@ function __send_file (event_name, socket, data) {
...
@@ -77,30 +77,32 @@ function __send_file (event_name, socket, data) {
function
__handler_get_file
(
socket
,
data
)
{
function
__handler_get_file
(
socket
,
data
)
{
file_path
=
utils
.
get_file_path
(
data
)
file_path
=
utils
.
get_file_path
(
data
)
utils
.
watch_path_onsocket
(
'
file_newcontent
'
,
socket
,
data
,
file_path
,
function
(
event_name
,
socket
,
data
)
{
utils
.
watch_path_onsocket
(
events
.
file_newcontent
,
socket
,
data
,
file_path
,
function
(
event_name
,
socket
,
data
)
{
data
.
file
.
content
=
null
data
.
file
.
content
=
null
socket
.
emit
(
event_name
,
data
)
socket
.
emit
(
event_name
,
data
)
})
})
__send_file
(
'
file
'
,
socket
,
data
)
__send_file
(
events
.
file
.
set
,
socket
,
data
)
}
}
Client
=
function
(
socket
)
{
Client
=
function
(
socket
)
{
socket
.
on
(
'
get_distribution_packages
'
,
function
(
data
)
{
events
=
config
.
events
.
client
socket
.
on
(
events
.
distribution_packages
.
get
,
function
(
data
)
{
if
(
!
utils
.
check_data_distribution
(
data
))
if
(
!
utils
.
check_data_distribution
(
data
))
return
return
distribution_path
=
path
.
join
(
config
.
debomatic
.
path
,
data
.
distribution
.
name
,
'
pool
'
)
distribution_path
=
path
.
join
(
config
.
debomatic
.
path
,
data
.
distribution
.
name
,
'
pool
'
)
utils
.
generic_handler_watcher
(
'
distribution_packages
'
,
socket
,
data
,
distribution_path
,
__send_distribution_packages
)
utils
.
generic_handler_watcher
(
events
.
distribution_packages
.
set
,
socket
,
data
,
distribution_path
,
__send_distribution_packages
)
})
})
socket
.
on
(
'
get_package_files_list
'
,
function
(
data
)
{
socket
.
on
(
events
.
package_files_list
.
get
,
function
(
data
)
{
if
(
!
utils
.
check_data_package
(
data
))
if
(
!
utils
.
check_data_package
(
data
))
return
return
package_path
=
utils
.
get_package_path
(
data
)
package_path
=
utils
.
get_package_path
(
data
)
utils
.
generic_handler_watcher
(
'
package_files_list
'
,
socket
,
data
,
package_path
,
__send_package_files_list
)
utils
.
generic_handler_watcher
(
events
.
package_files_list
.
set
,
socket
,
data
,
package_path
,
__send_package_files_list
)
})
})
socket
.
on
(
'
get_file
'
,
function
(
data
){
socket
.
on
(
events
.
file
.
get
,
function
(
data
){
if
(
!
utils
.
check_data_file
(
data
))
if
(
!
utils
.
check_data_file
(
data
))
return
return
__handler_get_file
(
socket
,
data
)
__handler_get_file
(
socket
,
data
)
...
...
debomatic-webui/lib/config.js
View file @
873a33b3
...
@@ -24,6 +24,20 @@ config.events.broadcast = {}
...
@@ -24,6 +24,20 @@ 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
'
function
__build_get_set
(
event_name
)
{
return
{
set
:
event_name
,
get
:
'
get_
'
+
event_name
}
}
config
.
events
.
client
=
{}
config
.
events
.
client
.
distribution_packages
=
__build_get_set
(
'
distribution_packages
'
)
config
.
events
.
client
.
package_files_list
=
__build_get_set
(
'
package_files_list
'
)
config
.
events
.
client
.
file
=
__build_get_set
(
'
file
'
)
config
.
events
.
client
.
file_newcontent
=
'
file_newcontent
'
config
.
web
.
paths
=
config
.
routes
config
.
web
.
paths
=
config
.
routes
config
.
web
.
events
=
config
.
events
config
.
web
.
events
=
config
.
events
config
.
web
.
hostname
=
config
.
host
+
((
config
.
port
==
80
)
?
null
:
'
:
'
+
config
.
port
)
config
.
web
.
hostname
=
config
.
host
+
((
config
.
port
==
80
)
?
null
:
'
:
'
+
config
.
port
)
...
...
debomatic-webui/public/javascripts/page_distribution.js
View file @
873a33b3
function
Page_Distrubion
()
function
Page_Distrubion
()
{
{
var
socket
var
socket
var
events
=
config
.
events
.
client
var
data
=
Utils
.
from_hash_to_data
()
var
data
=
Utils
.
from_hash_to_data
()
function
__check_hash_makes_sense
()
{
function
__check_hash_makes_sense
()
{
...
@@ -53,7 +54,7 @@ function Page_Distrubion()
...
@@ -53,7 +54,7 @@ function Page_Distrubion()
if
(
Utils
.
check_data_distribution
(
data
))
{
if
(
Utils
.
check_data_distribution
(
data
))
{
var
new_data
=
{}
var
new_data
=
{}
new_data
.
distribution
=
data
.
distribution
new_data
.
distribution
=
data
.
distribution
socket
.
emit
(
"
get_distribution_packages
"
,
new_data
)
socket
.
emit
(
events
.
distribution_packages
.
get
,
new_data
)
}
}
},
},
select
:
function
()
{
select
:
function
()
{
...
@@ -114,7 +115,7 @@ function Page_Distrubion()
...
@@ -114,7 +115,7 @@ function Page_Distrubion()
var
new_data
=
{}
var
new_data
=
{}
new_data
.
distribution
=
data
.
distribution
new_data
.
distribution
=
data
.
distribution
new_data
.
package
=
data
.
package
new_data
.
package
=
data
.
package
socket
.
emit
(
"
get_package_files_list
"
,
new_data
)
socket
.
emit
(
events
.
package_files_list
.
get
,
new_data
)
}
}
},
},
select
:
function
()
{
select
:
function
()
{
...
@@ -152,7 +153,7 @@ function Page_Distrubion()
...
@@ -152,7 +153,7 @@ function Page_Distrubion()
new_data
.
package
=
data
.
package
new_data
.
package
=
data
.
package
new_data
.
file
=
data
.
file
new_data
.
file
=
data
.
file
new_data
.
file
.
content
=
null
new_data
.
file
.
content
=
null
socket
.
emit
(
"
get_file
"
,
new_data
)
socket
.
emit
(
events
.
file
.
get
,
new_data
)
}
}
}
}
}
}
...
@@ -269,19 +270,19 @@ function Page_Distrubion()
...
@@ -269,19 +270,19 @@ function Page_Distrubion()
socket
=
mysocket
socket
=
mysocket
socket
.
on
(
'
distribution_packages
'
,
function
(
socket_data
){
socket
.
on
(
events
.
distribution_packages
.
set
,
function
(
socket_data
){
packages
.
set
(
socket_data
)
packages
.
set
(
socket_data
)
})
})
socket
.
on
(
'
package_files_list
'
,
function
(
socket_data
){
socket
.
on
(
events
.
package_files_list
.
set
,
function
(
socket_data
){
files
.
set
(
socket_data
)
files
.
set
(
socket_data
)
})
})
socket
.
on
(
'
file
'
,
function
(
socket_data
)
{
socket
.
on
(
events
.
file
.
set
,
function
(
socket_data
)
{
file
.
set
(
socket_data
)
file
.
set
(
socket_data
)
})
})
socket
.
on
(
'
file_newcontent
'
,
function
(
socket_data
)
{
socket
.
on
(
events
.
file_newcontent
,
function
(
socket_data
)
{
file
.
append
(
socket_data
)
file
.
append
(
socket_data
)
})
})
...
...
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