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
b40680d0
Commit
b40680d0
authored
Mar 08, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work only on a single view event
parent
0154eeef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
60 deletions
+58
-60
debomatic-webui/app.js
debomatic-webui/app.js
+1
-6
debomatic-webui/send.js
debomatic-webui/send.js
+49
-34
debomatic-webui/views/layout.ejs
debomatic-webui/views/layout.ejs
+8
-20
No files found.
debomatic-webui/app.js
View file @
b40680d0
...
...
@@ -40,12 +40,7 @@ app.get('/', routes.index);
io
.
sockets
.
on
(
'
connection
'
,
function
(
socket
)
{
send
.
distributions
(
socket
);
socket
.
on
(
'
get-view
'
,
function
(
data
)
{
if
(
!
data
.
package
)
{
send
.
packages_list
(
socket
,
data
);
}
else
{
send
.
package
(
socket
,
data
);
}
send
.
view
(
socket
,
data
);
});
});
...
...
debomatic-webui/send.js
View file @
b40680d0
...
...
@@ -28,6 +28,34 @@ function get_files_list(dir, onlyDirectories, callback) {
});
}
function
get_files_list_from_pacakge
(
package_path
,
callback
)
{
package_info
=
{}
get_files_list
(
package_path
,
false
,
function
(
files
)
{
package_info
.
files
=
[]
package_info
.
debs
=
[]
package_info
.
archives
=
[]
files
.
forEach
(
function
(
f
)
{
extension
=
f
.
split
(
'
.
'
).
pop
();
if
(
extension
==
"
deb
"
||
extension
==
"
ddeb
"
)
package_info
.
debs
.
push
(
f
);
else
if
(
f
.
indexOf
(
'
.tar
'
)
>=
0
)
{
archive
=
{}
archive
.
name
=
f
archive
.
path
=
path
.
join
(
package_path
,
f
)
package_info
.
archives
.
push
(
archive
)
}
else
{
file
=
{}
file
.
name
=
f
file
.
path
=
path
.
join
(
package_path
,
f
)
file
.
label
=
extension
package_info
.
files
.
push
(
file
)
}
});
callback
(
package_info
);
});
}
debomatic_sender
=
{
distributions
:
function
(
socket
)
{
...
...
@@ -36,48 +64,35 @@ debomatic_sender = {
});
},
packages_list
:
function
(
socket
,
data
)
{
distro_path
=
path
.
join
(
BASE_DIR
,
data
.
distribution
,
'
pool
'
);
view
:
function
(
socket
,
data
)
{
distro_path
=
path
.
join
(
BASE_DIR
,
data
.
distribution
.
name
,
'
pool
'
);
get_files_list
(
distro_path
,
true
,
function
(
packages
)
{
result
=
{}
result
.
distribution
=
data
.
distribution
;
result
.
packages
=
[]
data
.
distribution
.
packages
=
[]
packages
.
forEach
(
function
(
p
)
{
pack
=
{}
info
=
p
.
split
(
'
_
'
)
pack
.
name
=
info
[
0
]
pack
.
version
=
info
[
1
]
result
.
packages
.
push
(
pack
)
});
socket
.
emit
(
'
packages
'
,
result
);
});
},
package
:
function
(
socket
,
package_info
)
{
package_path
=
path
.
join
(
BASE_DIR
,
package_info
.
distribution
,
'
pool
'
,
package_info
.
package
+
"
_
"
+
package_info
.
version
);
get_files_list
(
package_path
,
false
,
function
(
files
)
{
package_info
.
files
=
[]
package_info
.
debs
=
[]
package_info
.
archives
=
[]
files
.
forEach
(
function
(
f
)
{
extension
=
f
.
split
(
'
.
'
).
pop
();
if
(
extension
==
"
deb
"
||
extension
==
"
ddeb
"
)
package_info
.
debs
.
push
(
f
);
else
if
(
f
.
indexOf
(
'
.tar
'
)
>=
0
)
{
archive
=
{}
archive
.
name
=
f
archive
.
path
=
path
.
join
(
package_path
,
f
)
package_info
.
archives
.
push
(
archive
)
}
else
{
file
=
{}
file
.
name
=
f
file
.
path
=
path
.
join
(
package_path
,
f
)
file
.
label
=
extension
package_info
.
files
.
push
(
file
)
if
(
data
.
package
&&
pack
.
name
==
data
.
package
.
name
&&
pack
.
version
==
data
.
package
.
version
)
{
pack
.
selected
=
true
;
}
data
.
distribution
.
packages
.
push
(
pack
)
});
socket
.
emit
(
'
package-files
'
,
package_info
);
if
(
data
.
package
)
{
p
=
data
.
package
.
name
+
"
_
"
+
data
.
package
.
version
package_path
=
path
.
join
(
distro_path
,
p
)
get_files_list_from_pacakge
(
package_path
,
function
(
package_files
){
data
.
package
.
files
=
package_files
.
files
data
.
package
.
debs
=
package_files
.
debs
data
.
package
.
archives
=
package_files
.
archives
socket
.
emit
(
'
view
'
,
data
)
});
}
else
{
socket
.
emit
(
data
)
}
});
}
}
...
...
debomatic-webui/views/layout.ejs
View file @
b40680d0
...
...
@@ -10,11 +10,13 @@
info
=
path
.
split
(
'
/
'
);
data
=
{}
if
(
info
.
length
>=
1
)
{
data
.
distribution
=
info
[
0
];
data
.
distribution
=
{}
data
.
distribution
.
name
=
info
[
0
];
}
if
(
info
.
length
>=
3
){
data
.
package
=
info
[
1
];
data
.
version
=
info
[
2
];
data
.
package
=
{}
data
.
package
.
name
=
info
[
1
];
data
.
package
.
version
=
info
[
2
];
}
socket
.
emit
(
'
get-view
'
,
data
);
}
...
...
@@ -26,23 +28,9 @@
$
(
'
#distributions
'
).
append
(
'
<li><a href="#
'
+
name
+
'
">
'
+
name
+
'
</li>
'
);
});
});
socket
.
on
(
'
packages
'
,
function
(
data
)
{
$
(
'
#packages
'
).
html
(
''
);
distro
=
data
.
distribution
data
.
packages
.
forEach
(
function
(
p
){
$
(
'
#packages
'
).
append
(
'
<li><a href="#
'
+
distro
+
"
/
"
+
p
.
name
+
"
/
"
+
p
.
version
+
'
">
'
+
p
.
name
+
"
[
"
+
p
.
version
+
"
]
"
+
'
</li>
'
);
});
});
socket
.
on
(
'
package-files
'
,
function
(
data
)
{
$
(
'
#files
'
).
html
(
''
);
distro
=
data
.
distribution
package
=
data
.
package
version
=
data
.
version
data
.
files
.
forEach
(
function
(
f
){
$
(
'
#files
'
).
append
(
'
<li><a href="#
'
+
distro
+
"
/
"
+
package
+
"
/
"
+
version
+
'
/
'
+
f
.
name
+
'
">
'
+
f
.
label
+
'
</li>
'
);
});
socket
.
on
(
'
view
'
,
function
(
data
){
console
.
log
(
data
)
});
socket
.
on
(
'
error
'
,
function
()
{
console
.
error
(
arguments
)
});
...
...
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