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
a5efa1c8
Commit
a5efa1c8
authored
Mar 07, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added get packages list and get files package list
parent
92f731e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
18 deletions
+64
-18
debomatic-webui/app.js
debomatic-webui/app.js
+4
-1
debomatic-webui/send.js
debomatic-webui/send.js
+29
-12
debomatic-webui/views/layout.ejs
debomatic-webui/views/layout.ejs
+31
-5
No files found.
debomatic-webui/app.js
View file @
a5efa1c8
...
@@ -37,9 +37,12 @@ app.get('/', routes.index);
...
@@ -37,9 +37,12 @@ app.get('/', routes.index);
io
.
sockets
.
on
(
'
connection
'
,
function
(
socket
)
{
io
.
sockets
.
on
(
'
connection
'
,
function
(
socket
)
{
send
.
distributions
(
socket
);
send
.
distributions
(
socket
);
socket
.
on
(
'
get-packages
'
,
function
(
distro
)
{
socket
.
on
(
'
get-packages
-list
'
,
function
(
distro
)
{
send
.
packages_list
(
socket
,
distro
);
send
.
packages_list
(
socket
,
distro
);
});
});
socket
.
on
(
'
get-package
'
,
function
(
package_info
)
{
send
.
package
(
socket
,
package_info
);
});
});
});
fs
.
watch
(
config
.
debomatic_path
,
{
persistent
:
true
},
function
(
event
,
fileName
)
{
fs
.
watch
(
config
.
debomatic_path
,
{
persistent
:
true
},
function
(
event
,
fileName
)
{
...
...
debomatic-webui/send.js
View file @
a5efa1c8
...
@@ -8,8 +8,8 @@ function get_files_list(dir, onlyDirectories, callback) {
...
@@ -8,8 +8,8 @@ function get_files_list(dir, onlyDirectories, callback) {
fs
.
readdir
(
dir
,
function
(
err
,
files
){
fs
.
readdir
(
dir
,
function
(
err
,
files
){
result
=
[];
result
=
[];
if
(
err
)
{
if
(
err
)
{
console
.
log
.
error
(
err
);
console
.
error
(
err
);
return
;
return
;
}
}
files
.
forEach
(
function
(
f
)
{
files
.
forEach
(
function
(
f
)
{
complete_path
=
path
.
join
(
dir
,
f
);
complete_path
=
path
.
join
(
dir
,
f
);
...
@@ -28,16 +28,8 @@ function get_files_list(dir, onlyDirectories, callback) {
...
@@ -28,16 +28,8 @@ function get_files_list(dir, onlyDirectories, callback) {
});
});
}
}
function
get_distributions
(
socket
)
{
}
function
get_packages_list
(
socket
,
distro
)
{
var
pool
=
path
.
join
(
BASE_DIR
,
distro
,
'
pool
'
);
return
pool
;
}
debomatic_sender
=
{
debomatic_sender
=
{
distributions
:
function
(
socket
)
{
distributions
:
function
(
socket
)
{
get_files_list
(
BASE_DIR
,
true
,
function
(
distros
){
get_files_list
(
BASE_DIR
,
true
,
function
(
distros
){
socket
.
emit
(
'
distributions
'
,
distros
);
socket
.
emit
(
'
distributions
'
,
distros
);
...
@@ -45,8 +37,33 @@ debomatic_sender = {
...
@@ -45,8 +37,33 @@ debomatic_sender = {
},
},
packages_list
:
function
(
socket
,
distro
)
{
packages_list
:
function
(
socket
,
distro
)
{
socket
.
emit
(
'
packages
'
,
get_packages_list
(
socket
,
distro
));
distro_path
=
path
.
join
(
BASE_DIR
,
distro
,
'
pool
'
);
get_files_list
(
distro_path
,
true
,
function
(
packages
)
{
result
=
{}
result
.
distribution
=
distro
;
result
.
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
)
{
result
=
[]
files
.
forEach
(
function
(
f
)
{
result
.
push
(
f
);
});
package_info
.
files
=
result
;
socket
.
emit
(
'
package-files
'
,
package_info
);
});
}
}
}
module
.
exports
=
debomatic_sender
module
.
exports
=
debomatic_sender
debomatic-webui/views/layout.ejs
View file @
a5efa1c8
...
@@ -8,8 +8,15 @@
...
@@ -8,8 +8,15 @@
<script>
<script>
function
get_path
(
path
)
{
function
get_path
(
path
)
{
info
=
path
.
split
(
'
/
'
);
info
=
path
.
split
(
'
/
'
);
if
(
info
.
length
==
1
)
{
if
(
info
.
length
>=
1
)
{
socket
.
emit
(
"
get-packages
"
,
path
);
socket
.
emit
(
"
get-packages-list
"
,
info
[
0
]);
}
if
(
info
.
length
>=
3
){
data
=
{}
data
.
distribution
=
info
[
0
];
data
.
package
=
info
[
1
];
data
.
version
=
info
[
2
];
socket
.
emit
(
"
get-package
"
,
data
);
}
}
}
}
var
socket
=
io
.
connect
(
'
//localhost:3000
'
);
var
socket
=
io
.
connect
(
'
//localhost:3000
'
);
...
@@ -21,9 +28,22 @@
...
@@ -21,9 +28,22 @@
});
});
});
});
socket
.
on
(
'
packages
'
,
function
(
packages
)
{
socket
.
on
(
'
packages
'
,
function
(
data
)
{
console
.
log
(
"
HHHH
"
);
$
(
'
#packages
'
).
html
(
''
);
console
.
log
(
packages
);
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
+
'
">
'
+
f
+
'
</li>
'
);
});
});
});
socket
.
on
(
'
error
'
,
function
()
{
console
.
error
(
arguments
)
});
socket
.
on
(
'
error
'
,
function
()
{
console
.
error
(
arguments
)
});
...
@@ -31,11 +51,17 @@
...
@@ -31,11 +51,17 @@
$
(
window
).
on
(
'
hashchange
'
,
function
()
{
$
(
window
).
on
(
'
hashchange
'
,
function
()
{
get_path
(
window
.
location
.
hash
.
replace
(
'
#
'
,
''
));
get_path
(
window
.
location
.
hash
.
replace
(
'
#
'
,
''
));
});
});
$
(
window
).
on
(
'
load
'
,
function
(){
get_path
(
window
.
location
.
hash
.
replace
(
'
#
'
,
''
));
});
</script>
</script>
</head>
</head>
<body>
<body>
<ul
id=
'messages'
></ul>
<ul
id=
'messages'
></ul>
<ul
id=
"distributions"
></ul>
<ul
id=
"distributions"
></ul>
<ul
id=
"packages"
></ul>
<ul
id=
"files"
></ul>
<
%
-
body
%
>
<
%
-
body
%
>
</body>
</body>
</html>
</html>
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