Skip to content

Commit

Permalink
fix #92 live logs
Browse files Browse the repository at this point in the history
  • Loading branch information
oallain committed Feb 8, 2024
1 parent 1d35dec commit 5b5c91e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 38 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ COMPOSER=cd tests/Application && composer
YARN=cd tests/Application && yarn

SYLIUS_VERSION=1.12.0
SYMFONY_VERSION=6.1
PHP_VERSION=8.1
SYMFONY_VERSION=6.4
PHP_VERSION=8.2
PLUGIN_NAME=synolia/sylius-scheduler-command-plugin

###
Expand Down Expand Up @@ -71,6 +71,7 @@ install-sylius:
${CONSOLE} sylius:fixtures:load default -n
${YARN} install
${YARN} build
${CONSOLE} assets:install -n
${CONSOLE} cache:clear

configure-sylius:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
cp -R vendor/synolia/sylius-scheduler-command-plugin/install/Application/config/packages/* config/packages/
cp -R vendor/synolia/sylius-scheduler-command-plugin/install/Application/config/routes/* config/routes/

6. Installing assets (JS and CSS) fot the plugin

bin/console assets:install

## Usage

* Log into admin panel
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/column/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function fireLog(e) {
e.preventDefault();
var url = $(e.currentTarget).data('href');
$.get(url, function (data) {
$('#log-modal .description').html($(data).find('#content'));
$('#log-content').html($(data));
}).done(function () {
$('#log-modal').modal('show');
})
Expand Down
24 changes: 14 additions & 10 deletions src/Resources/public/controller/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,15 @@ pre {

#results {
border: solid 1px;
padding: 5px;
padding: 10px;
overflow-y: scroll;
height: calc(100% - 150px);
height: calc(100% - 80px);
}

#log-modal {
width: calc(100% - 100px);
height: calc(100% - 100px);
}

#log-modal .description,
#log-modal > .content,
#log-modal #content {
height: 100%;
width: calc(100% - 120px);
height: calc(100% - 120px);
overflow-y: hidden;
}

#results .loader:before {
Expand All @@ -31,3 +26,12 @@ pre {
#results .loader:after {
border-color: #767676 transparent transparent;
}

#log-content {
padding: 10px;
height: calc(100% - 20px);
}

#log-results {
height: calc(100% - 20px);
}
3 changes: 1 addition & 2 deletions src/Resources/views/Controller/modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<i class="close icon"></i>
</a>
</div>
<div class="content">
<div class="description"></div>
<div id="log-content">
</div>
</div>
40 changes: 17 additions & 23 deletions src/Resources/views/Controller/show.html.twig
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
{% extends '@SyliusAdmin/layout.html.twig' %}

{% import '@SyliusUi/Macro/headers.html.twig' as headers %}

{% block title %}{{ 'synolia.ui.live_view_of_scheduled_command'|trans({'%scheduledCommandName%': scheduledCommand.name|e}) }} {{ parent() }}{% endblock %}

{% block content %}
{{ headers.default('synolia.ui.live_view_of_scheduled_command'|trans({'%scheduledCommandName%': scheduledCommand.name|e}), 'cogs') }}

<div class="ui input">
<input id="grep" type="text" placeholder="Search...">
</div>
<div class="ui icon input">
<input id="grep" type="text" placeholder="Search...">
<i class="search icon"></i>
</div>

<div id="log-results">
<pre id="results">
<div class="ui active centered inline loader"></div>
</pre>
</div>

{{ sylius_template_event('synolia.admin.command.logs.stylesheets') }}

{{ sylius_template_event('synolia.admin.command.logs.stylesheets') }}
<script type="text/javascript">
{% autoescape 'js' %}
/* <![CDATA[ */
var sy_updateTime = {{ updateTime }};
var sy_route = "{{ route }}";
/* ]]> */
{% endautoescape %}
</script>

<script type="text/javascript">
{% autoescape 'js' %}
/* <![CDATA[ */
var sy_updateTime = {{ updateTime }};
var sy_route = "{{ route }}";
/* ]]> */
{% endautoescape %}
</script>
{{ sylius_template_event('synolia.admin.command.logs.javascripts') }}

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

0 comments on commit 5b5c91e

Please sign in to comment.