Skip to content

Commit 4af25c3

Browse files
committed
fix #92 live logs
1 parent 36c3366 commit 4af25c3

File tree

6 files changed

+38
-36
lines changed

6 files changed

+38
-36
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ install-sylius:
7272
${CONSOLE} sylius:fixtures:load default -n
7373
${YARN} install
7474
${YARN} build
75+
${CONSOLE} assets:install -n
7576
${CONSOLE} cache:clear
7677

7778
phpunit-configure:

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@
6868
cp -R vendor/synolia/sylius-scheduler-command-plugin/install/Application/config/packages/* config/packages/
6969
cp -R vendor/synolia/sylius-scheduler-command-plugin/install/Application/config/routes/* config/routes/
7070

71+
6. Installing assets (JS and CSS) fot the plugin
72+
73+
bin/console assets:install
74+
7175
## Usage
7276

7377
* Log into admin panel

src/Resources/public/column/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function fireLog(e) {
22
e.preventDefault();
33
var url = $(e.currentTarget).data('href');
44
$.get(url, function (data) {
5-
$('#log-modal .description').html($(data).find('#content'));
5+
$('#log-content').html($(data));
66
}).done(function () {
77
$('#log-modal').modal('show');
88
})

src/Resources/public/controller/index.css

+14-10
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,15 @@ pre {
88

99
#results {
1010
border: solid 1px;
11-
padding: 5px;
11+
padding: 10px;
1212
overflow-y: scroll;
13-
height: calc(100% - 150px);
13+
height: calc(100% - 80px);
1414
}
1515

1616
#log-modal {
17-
width: calc(100% - 100px);
18-
height: calc(100% - 100px);
19-
}
20-
21-
#log-modal .description,
22-
#log-modal > .content,
23-
#log-modal #content {
24-
height: 100%;
17+
width: calc(100% - 120px);
18+
height: calc(100% - 120px);
19+
overflow-y: hidden;
2520
}
2621

2722
#results .loader:before {
@@ -31,3 +26,12 @@ pre {
3126
#results .loader:after {
3227
border-color: #767676 transparent transparent;
3328
}
29+
30+
#log-content {
31+
padding: 10px;
32+
height: calc(100% - 20px);
33+
}
34+
35+
#log-results {
36+
height: calc(100% - 20px);
37+
}

src/Resources/views/Controller/modal.html.twig

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<i class="close icon"></i>
55
</a>
66
</div>
7-
<div class="content">
8-
<div class="description"></div>
7+
<div id="log-content">
98
</div>
109
</div>
+17-23
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
1-
{% extends '@SyliusAdmin/layout.html.twig' %}
2-
3-
{% import '@SyliusUi/Macro/headers.html.twig' as headers %}
4-
5-
{% block title %}{{ 'synolia.ui.live_view_of_scheduled_command'|trans({'%scheduledCommandName%': scheduledCommand.name|e}) }} {{ parent() }}{% endblock %}
6-
7-
{% block content %}
8-
{{ headers.default('synolia.ui.live_view_of_scheduled_command'|trans({'%scheduledCommandName%': scheduledCommand.name|e}), 'cogs') }}
9-
10-
<div class="ui input">
11-
<input id="grep" type="text" placeholder="Search...">
12-
</div>
1+
<div class="ui icon input">
2+
<input id="grep" type="text" placeholder="Search...">
3+
<i class="search icon"></i>
4+
</div>
135

6+
<div id="log-results">
147
<pre id="results">
158
<div class="ui active centered inline loader"></div>
169
</pre>
10+
</div>
11+
12+
{{ sylius_template_event('synolia.admin.command.logs.stylesheets') }}
1713

18-
{{ sylius_template_event('synolia.admin.command.logs.stylesheets') }}
14+
<script type="text/javascript">
15+
{% autoescape 'js' %}
16+
/* <![CDATA[ */
17+
var sy_updateTime = {{ updateTime }};
18+
var sy_route = "{{ route }}";
19+
/* ]]> */
20+
{% endautoescape %}
21+
</script>
1922

20-
<script type="text/javascript">
21-
{% autoescape 'js' %}
22-
/* <![CDATA[ */
23-
var sy_updateTime = {{ updateTime }};
24-
var sy_route = "{{ route }}";
25-
/* ]]> */
26-
{% endautoescape %}
27-
</script>
23+
{{ sylius_template_event('synolia.admin.command.logs.javascripts') }}
2824

29-
{{ sylius_template_event('synolia.admin.command.logs.javascripts') }}
30-
{% endblock %}

0 commit comments

Comments
 (0)