Просмотр исходного кода

2526 [Bug] nginx cache template, the purge cache buttom does not appear (#2530)

* Show the Purge cache button for caching-xxx templates
Jaap Marcus 3 лет назад
Родитель
Сommit
9e26023634
2 измененных файлов с 7 добавлено и 2 удалено
  1. 6 1
      web/js/pages/edit_web.js
  2. 1 1
      web/templates/pages/edit_web.html

+ 6 - 1
web/js/pages/edit_web.js

@@ -254,7 +254,12 @@ $(function() {
         var select = $(evt.target);
 
         if(select.val() != 'caching'){
-            $('#v-clear-cache').hide();
+            const re = new RegExp('caching-');
+            if(re.test(select.val())){
+                $('#v-clear-cache').show();
+            }else{
+                $('#v-clear-cache').hide();
+            }
         } else {
             $('#v-clear-cache').show();
         }

+ 1 - 1
web/templates/pages/edit_web.html

@@ -5,7 +5,7 @@
 			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/web/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
 		</div>
 		<div class="l-unit-toolbar__buttonstrip float-right">
-			<a href="/delete/web/cache/?domain=<?=htmlentities($v_domain);?>&token=<?=$_SESSION['token'];?>" class="ui-button cancel <?php if ( $v_nginx_cache == 'yes' || ($v_proxy_template == 'caching' && $_SESSION['PROXY_SYSTEM'] == 'nginx')) { echo "block"; } else{ echo "hidden"; }?>" id="v-clear-cache">
+			<a href="/delete/web/cache/?domain=<?=htmlentities($v_domain);?>&token=<?=$_SESSION['token'];?>" class="ui-button cancel <?php if ( $v_nginx_cache == 'yes' || (($v_proxy_template == 'caching' || is_int(strpos($v_proxy_template, 'caching-'))) && $_SESSION['PROXY_SYSTEM'] == 'nginx')) { echo "block"; } else{ echo "hidden"; }?>" id="v-clear-cache">
 				<i class="fas fa-trash status-icon red"></i><?=_('Purge Nginx Cache');?>
 			</a>
 			<?php if ($_SESSION['PLUGIN_APP_INSTALLER'] !== 'false') {?>