Skip to content

Commit 0616a70

Browse files
committed
fix #92 live logs
1 parent 1f28584 commit 0616a70

File tree

6 files changed

+40
-38
lines changed

6 files changed

+40
-38
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ COMPOSER=cd tests/Application && composer
77
YARN=cd tests/Application && yarn
88

99
SYLIUS_VERSION=1.12.0
10-
SYMFONY_VERSION=6.1
11-
PHP_VERSION=8.1
10+
SYMFONY_VERSION=6.4
11+
PHP_VERSION=8.2
1212
PLUGIN_NAME=synolia/sylius-scheduler-command-plugin
1313

1414
###
@@ -71,6 +71,7 @@ install-sylius:
7171
${CONSOLE} sylius:fixtures:load default -n
7272
${YARN} install
7373
${YARN} build
74+
${CONSOLE} assets:install -n
7475
${CONSOLE} cache:clear
7576

7677
configure-sylius:

README.md

Lines changed: 4 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 14 additions & 10 deletions
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

Lines changed: 1 addition & 2 deletions
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>
Lines changed: 17 additions & 23 deletions
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)