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
7b330b50
Commit
7b330b50
authored
Mar 12, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send status_package when distribution_packages_list is called
parent
f9287622
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+51
-0
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+1
-0
No files found.
debomatic-webui/lib/client.js
View file @
7b330b50
...
@@ -43,6 +43,56 @@ function __send_package_files_list (event_name, socket, data) {
...
@@ -43,6 +43,56 @@ function __send_package_files_list (event_name, socket, data) {
});
});
}
}
function
__send_package_status
(
socket
,
data
,
package_data
)
{
var
event_name
=
config
.
events
.
client
.
distribution_packages
.
status
var
new_data
=
{}
new_data
.
distribution
=
data
.
distribution
new_data
.
package
=
package_data
var
status_data
=
{}
status_data
.
distribution
=
data
.
distribution
.
name
status_data
.
package
=
package_data
.
orig_name
var
package_path
=
utils
.
get_package_path
(
new_data
)
// status policy:
// + successed: exists .dsc
// + building: wc -l .datestamp == 1 (FIX_ME)
// + failed: else
var
base_path
=
path
.
join
(
package_path
,
package_data
.
orig_name
)
console
.
log
(
base_path
)
fs
.
exists
(
base_path
+
'
.dsc
'
,
function
(
changes_exists
){
if
(
changes_exists
)
{
status_data
.
status
=
'
build-successed
'
socket
.
emit
(
event_name
,
status_data
)
}
else
{
// emulate wc -l .datestamp in nodejs
var
count
=
0
var
datestamp
=
base_path
+
'
.datestamp
'
fs
.
exists
(
datestamp
,
function
(
datestamp_exists
){
if
(
datestamp_exists
)
{
// count lines
fs
.
createReadStream
(
datestamp
)
.
on
(
'
data
'
,
function
(
chunk
)
{
for
(
var
i
=
0
;
i
<
chunk
.
length
;
++
i
)
if
(
chunk
[
i
]
==
10
)
count
++
;
})
.
on
(
'
end
'
,
function
()
{
if
(
count
<=
1
)
status_data
.
status
=
'
building
'
else
status_data
.
status
=
'
build-failed
'
socket
.
emit
(
event_name
,
status_data
)
});
}
})
}
})
}
function
__send_distribution_packages
(
event_name
,
socket
,
data
)
{
function
__send_distribution_packages
(
event_name
,
socket
,
data
)
{
distro_path
=
utils
.
get_distribution_pool_path
(
data
)
distro_path
=
utils
.
get_distribution_pool_path
(
data
)
utils
.
get_files_list
(
distro_path
,
true
,
function
(
packages
)
{
utils
.
get_files_list
(
distro_path
,
true
,
function
(
packages
)
{
...
@@ -59,6 +109,7 @@ function __send_distribution_packages (event_name, socket, data) {
...
@@ -59,6 +109,7 @@ function __send_distribution_packages (event_name, socket, data) {
pack
.
selected
=
true
;
pack
.
selected
=
true
;
}
}
data
.
distribution
.
packages
.
push
(
pack
)
data
.
distribution
.
packages
.
push
(
pack
)
__send_package_status
(
socket
,
data
,
pack
)
});
});
socket
.
emit
(
event_name
,
data
)
socket
.
emit
(
event_name
,
data
)
});
});
...
...
debomatic-webui/lib/config.js
View file @
7b330b50
...
@@ -34,6 +34,7 @@ function __build_get_set(event_name) {
...
@@ -34,6 +34,7 @@ function __build_get_set(event_name) {
config
.
events
.
client
=
{}
config
.
events
.
client
=
{}
config
.
events
.
client
.
distribution_packages
=
__build_get_set
(
'
distribution_packages
'
)
config
.
events
.
client
.
distribution_packages
=
__build_get_set
(
'
distribution_packages
'
)
config
.
events
.
client
.
distribution_packages
.
status
=
'
package_status
'
config
.
events
.
client
.
package_files_list
=
__build_get_set
(
'
package_files_list
'
)
config
.
events
.
client
.
package_files_list
=
__build_get_set
(
'
package_files_list
'
)
config
.
events
.
client
.
file
=
__build_get_set
(
'
file
'
)
config
.
events
.
client
.
file
=
__build_get_set
(
'
file
'
)
config
.
events
.
client
.
file_newcontent
=
'
file_newcontent
'
config
.
events
.
client
.
file_newcontent
=
'
file_newcontent
'
...
...
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