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
0abad2f6
Commit
0abad2f6
authored
Mar 11, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update status on socket event
parent
0607b59a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
35 deletions
+63
-35
debomatic-webui/public/javascripts/page_generic.js
debomatic-webui/public/javascripts/page_generic.js
+63
-35
No files found.
debomatic-webui/public/javascripts/page_generic.js
View file @
0abad2f6
function
Page_Generic
()
function
Page_Generic
()
{
{
var
socket
;
var
socket
;
var
c
=
config
.
status
.
classes
var
i
=
config
.
status
.
icons
function
__get_status_icon_and_class
(
status_package
)
{
var
e
=
config
.
events
var
_c
=
config
.
status
.
classes
var
_i
=
config
.
status
.
icons
var
button_class
=
null
var
icon
=
null
var
s
=
status_package
if
(
s
.
status
==
'
building
'
)
{
button_class
=
_c
.
building
icon
=
_i
.
building
}
else
if
(
s
.
status
==
'
build-failed
'
)
{
button_class
=
_c
.
failed
icon
=
_i
.
failed
}
else
{
button_class
=
_c
.
successed
icon
=
_i
.
successed
}
return
{
button_class
:
button_class
,
icon
:
icon
}
}
function
__get_status_html
(
status_package
)
{
function
__get_status_html
(
status_package
)
{
var
s
=
status_package
var
s
=
status_package
...
@@ -14,24 +35,10 @@ function Page_Generic()
...
@@ -14,24 +35,10 @@ function Page_Generic()
button
.
addClass
(
s
.
status
)
button
.
addClass
(
s
.
status
)
button
.
attr
(
'
title
'
,
s
.
status
+
'
:
'
+
s
.
distribution
+
'
>
'
+
s
.
package
)
button
.
attr
(
'
title
'
,
s
.
status
+
'
:
'
+
s
.
distribution
+
'
>
'
+
s
.
package
)
button
.
attr
(
'
href
'
,
config
.
paths
.
distribution
+
'
#
'
+
s
.
distribution
+
'
/
'
+
s
.
package
.
replace
(
'
_
'
,
'
/
'
)
+
'
/datestamp
'
)
button
.
attr
(
'
href
'
,
config
.
paths
.
distribution
+
'
#
'
+
s
.
distribution
+
'
/
'
+
s
.
package
.
replace
(
'
_
'
,
'
/
'
)
+
'
/datestamp
'
)
// button.html(s.package)
button
.
html
(
s
.
package
.
split
(
'
_
'
)[
0
])
button
.
html
(
s
.
package
.
split
(
'
_
'
)[
0
])
var
button_class
=
null
var
info
=
__get_status_icon_and_class
(
s
)
var
icon
=
null
button
.
addClass
(
'
btn-
'
+
info
.
button_class
)
if
(
s
.
status
==
'
building
'
)
{
button
.
html
(
button
.
html
()
+
'
<span class="icon glyphicon glyphicon-
'
+
info
.
icon
+
'
"></span>
'
)
button_class
=
c
.
building
icon
=
i
.
building
}
else
if
(
s
.
status
==
'
build-failed
'
)
{
button_class
=
c
.
failed
icon
=
i
.
failed
}
else
{
button_class
=
c
.
successed
icon
=
i
.
successed
}
button
.
addClass
(
'
btn-
'
+
button_class
)
button
.
html
(
button
.
html
()
+
'
<span class="icon glyphicon glyphicon-
'
+
icon
+
'
"></span>
'
)
li
.
html
(
button
)
li
.
html
(
button
)
var
result
=
$
(
'
<div></div>
'
)
var
result
=
$
(
'
<div></div>
'
)
result
.
html
(
li
)
result
.
html
(
li
)
...
@@ -51,8 +58,30 @@ function Page_Generic()
...
@@ -51,8 +58,30 @@ function Page_Generic()
}
}
}
}
},
},
status
:
function
(
new_package
)
{
status
:
function
(
status_package
)
{
var
delay
=
{}
delay
.
remove
=
10000
// 10 seconds
delay
.
fadeOut
=
2500
var
li
=
$
(
"
#status li[id='status-
"
+
status_package
.
distribution
+
"
-
"
+
status_package
.
package
+
"
']
"
)
if
(
li
.
length
>
0
&&
status_package
.
status
!=
'
building
'
)
{
li
.
html
(
$
(
__get_status_html
(
status_package
)).
children
())
// chain fadeOut and delete
setTimeout
(
function
()
{
li
.
children
().
fadeOut
(
config
.
status
.
delay
.
fadeOut
)
setTimeout
(
function
()
{
li
.
animate
({
width
:
'
toggle
'
})
li
.
attr
(
'
id
'
,
''
)
},
config
.
status
.
delay
.
fadeOut
)
},
config
.
status
.
delay
.
remove
)
}
else
if
(
status_package
.
status
==
'
building
'
)
{
status
.
append
(
status_package
)
}
}
}
}
}
...
@@ -62,34 +91,33 @@ function Page_Generic()
...
@@ -62,34 +91,33 @@ function Page_Generic()
if
(
data_status
.
packages
.
length
>
0
)
{
if
(
data_status
.
packages
.
length
>
0
)
{
$
(
'
#status .idle
'
).
hide
()
$
(
'
#status .idle
'
).
hide
()
data_status
.
packages
.
forEach
(
function
(
p
){
data_status
.
packages
.
forEach
(
function
(
p
){
$
(
"
#status ul
"
).
html
(
$
(
"
#status ul
"
).
html
()
+
"
"
+
__get_status_html
(
p
))
status
.
append
(
p
)
})
})
}
}
},
append
:
function
(
status_package
)
{
$
(
"
#status ul
"
).
html
(
$
(
"
#status ul
"
).
html
()
+
"
"
+
__get_status_html
(
status_package
))
}
}
}
}
this
.
init
=
function
(
mysocket
)
{
this
.
init
=
function
(
mysocket
)
{
var
_e
=
config
.
events
socket
=
mysocket
socket
=
mysocket
// update distributions
// update distributions
socket
.
on
(
e
.
broadcast
.
distributions
,
function
(
distributions
)
{
socket
.
on
(
_
e
.
broadcast
.
distributions
,
function
(
distributions
)
{
update
.
distributions
(
distributions
)
update
.
distributions
(
distributions
)
});
});
socket
.
on
(
'
error
'
,
function
(
data
)
{
console
.
error
(
data
)
});
socket
.
on
(
'
error
'
,
function
(
data
)
{
consol
_
e
.
error
(
data
)
});
socket
.
on
(
e
.
client
.
status
,
function
(
data_statu
s
)
{
socket
.
on
(
_e
.
client
.
status
,
function
(
package
s
)
{
status
.
set
(
data_statu
s
)
status
.
set
(
package
s
)
})
})
socket
.
on
(
e
.
broadcast
.
status_update
,
function
(
data
)
{
socket
.
on
(
_e
.
broadcast
.
status_update
,
function
(
package_status
)
{
// this is how to fadeout and remove
update
.
status
(
package_status
)
// setTimeout(function() {$('#id-status').remove();}, 3500);
// $($("li[id='id-status']")[0]).delay(3200).fadeOut(300)
console
.
log
(
'
status_update
'
)
console
.
log
(
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