Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pony
rework_ui
Commits
978b52249bdc
Commit
b9b5971d
authored
Dec 19, 2018
by
Aurélien Campéas
Browse files
monitors table: show the start time of workers
parent
fce85523c9f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
rework_ui/blueprint.py
View file @
978b5224
...
...
@@ -219,7 +219,8 @@ def reworkui(engine,
def
list_workers
():
# workers
sql
=
select
([
worker
.
c
.
id
,
worker
.
c
.
host
,
worker
.
c
.
domain
,
worker
.
c
.
pid
,
worker
.
c
.
mem
,
worker
.
c
.
shutdown
,
worker
.
c
.
kill
,
worker
.
c
.
debugport
]
worker
.
c
.
mem
,
worker
.
c
.
shutdown
,
worker
.
c
.
kill
,
worker
.
c
.
debugport
,
worker
.
c
.
started
]
).
order_by
(
worker
.
c
.
id
).
where
(
worker
.
c
.
running
==
True
)
domain
=
uiargsdict
(
request
.
args
).
domain
...
...
@@ -269,14 +270,18 @@ def reworkui(engine,
r
.
th
(
'domain'
)
r
.
th
(
'memory (Mb)'
)
r
.
th
(
'debug port'
)
r
.
th
(
'started'
)
r
.
th
(
'action'
)
for
wid
,
host
,
domain
,
pid
,
mem
,
shutdown
,
kill
,
debugport
in
workers
:
for
wid
,
host
,
domain
,
pid
,
mem
,
shutdown
,
kill
,
debugport
,
started
in
workers
:
with
t
.
tr
()
as
r
:
r
.
th
(
str
(
wid
),
scope
=
'row'
)
r
.
td
(
'{}@{}'
.
format
(
pid
,
host
))
r
.
td
(
domain
)
r
.
td
(
str
(
mem
))
r
.
td
(
debugport
and
str
(
debugport
)
or
''
)
if
started
:
started
=
started
.
astimezone
(
TZ
).
strftime
(
'%Y-%m-%d %H:%M:%S%z'
)
r
.
td
(
started
or
''
)
with
r
.
td
()
as
col
:
with
col
.
button
()
as
b
:
if
shutdown
:
...
...
tests/data/monitors-table-1-task.html
View file @
978b5224
...
...
@@ -23,6 +23,7 @@
<th>
domain
</th>
<th>
memory (Mb)
</th>
<th>
debug port
</th>
<th>
started
</th>
<th>
action
</th>
</tr></thead>
<tr>
...
...
@@ -31,6 +32,7 @@
<td>
default
</td>
<td><x></x></td>
<td></td>
<td><x>
-
<x>
-
<x>
<x>
:
<x>
:
<x>
+
<x></x></x></x></x></x></x></x></td>
<td>
<button
type=
"button"
class=
"btn btn-warning btn-sm"
onclick=
"shutdown_worker(<X>)"
>
shutdown
</button><span>
</span><button
type=
"button"
class=
"btn btn-danger btn-sm"
onclick=
"kill_worker(<X>)"
>
kill
</button>
</td>
...
...
tests/data/monitors-table.html
View file @
978b5224
...
...
@@ -23,6 +23,7 @@
<th>
domain
</th>
<th>
memory (Mb)
</th>
<th>
debug port
</th>
<th>
started
</th>
<th>
action
</th>
</tr></thead>
<tr>
...
...
@@ -31,6 +32,7 @@
<td>
default
</td>
<td><x></x></td>
<td></td>
<td><x>
-
<x>
-
<x>
<x>
:
<x>
:
<x>
+
<x></x></x></x></x></x></x></x></td>
<td>
<button
type=
"button"
class=
"btn btn-warning btn-sm"
onclick=
"shutdown_worker(<X>)"
>
shutdown
</button><span>
</span><button
type=
"button"
class=
"btn btn-danger btn-sm"
onclick=
"kill_worker(<X>)"
>
kill
</button>
</td>
...
...
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