Skip to content

Commit 22e1e46

Browse files
author
Rafael Grigorian
committed
Fixed #55
1 parent 8475cf3 commit 22e1e46

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

Block/Adminhtml/Template.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Magento\Framework\View\Element\Template as BaseTemplate;
66
use Magento\Framework\View\Element\Template\Context;
77
use Magento\Framework\App\DeploymentConfig;
8+
use Magento\Framework\App\ProductMetadataInterface;
89
use JetRails\Varnish\Helper\Data as Helper;
910

1011
/**
@@ -23,11 +24,13 @@ public function __construct (
2324
Context $context,
2425
Helper $helper,
2526
DeploymentConfig $config,
27+
ProductMetadataInterface $metadata,
2628
array $data = []
2729
) {
2830
parent::__construct ( $context, $data );
2931
$this->helper = $helper;
3032
$this->config = $config;
33+
$this->metadata = $metadata;
3134
}
3235

3336
}

view/adminhtml/templates/configuration.phtml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,23 @@
115115
<table>
116116
<tr>
117117
<th width="33.33%" >Varnish Server</th>
118-
<th width="33.33%" >Magento Version</th>
119-
<th width="33.33%" >Module Version</th>
118+
<th width="33.33%" >Generated VCL With Magento Version</th>
119+
<th width="33.33%" >Generated VCL With Module Version</th>
120+
<th width="33.33%" >Update Needed</th>
120121
</tr>
121122
<?php if ( $edited ): ?>
122123
<?php foreach ( $servers as $index => $server ): ?>
123124
<tr>
124125
<td><?= $server->host . ":" . $server->port ?></td>
125-
<td><?= $server->magento ?></td>
126-
<td><?= $server->version ?></td>
126+
<td><span class="tag <?= $server->magento == $block->metadata->getVersion () ? "match" : "no-match" ?>" ><?= $server->magento ?></span></td>
127+
<td><span class="tag <?= $server->version == $block->helper->getModuleVersion () ? "match" : "no-match" ?>" ><?= $server->version ?></span></td>
128+
<td>
129+
<?=
130+
$server->magento == $block->metadata->getVersion () &&
131+
$server->version == $block->helper->getModuleVersion ()
132+
? "No" : "Yes"
133+
?>
134+
</td>
127135
</tr>
128136
<?php endforeach; ?>
129137
<?php else: ?>

view/adminhtml/web/css/styles.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,24 @@ section.varnish .card .method-container .tray img {
241241
border: solid 1px #E6E6E6;
242242
}
243243

244+
section.varnish .tag {
245+
background-color: #F3F2F1;
246+
border-radius: 3px;
247+
padding: 1px 4px;
248+
position: relative;
249+
}
250+
251+
section.varnish .tag.no-match::after {
252+
position: absolute;
253+
top: -2px;
254+
right: -5px;
255+
height: 8px;
256+
width: 8px;
257+
content: "";
258+
background-color: #DC5549;
259+
border-radius: 5px;
260+
}
261+
244262
section.varnish table {
245263
width: 100%;
246264
}

0 commit comments

Comments
 (0)