Skip to content

Commit 9e26023

Browse files
authored
2526 [Bug] nginx cache template, the purge cache buttom does not appear (hestiacp#2530)
* Show the Purge cache button for caching-xxx templates
1 parent d2ef8f9 commit 9e26023

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

web/js/pages/edit_web.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,12 @@ $(function() {
254254
var select = $(evt.target);
255255

256256
if(select.val() != 'caching'){
257-
$('#v-clear-cache').hide();
257+
const re = new RegExp('caching-');
258+
if(re.test(select.val())){
259+
$('#v-clear-cache').show();
260+
}else{
261+
$('#v-clear-cache').hide();
262+
}
258263
} else {
259264
$('#v-clear-cache').show();
260265
}

web/templates/pages/edit_web.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<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>
66
</div>
77
<div class="l-unit-toolbar__buttonstrip float-right">
8-
<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">
8+
<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">
99
<i class="fas fa-trash status-icon red"></i><?=_('Purge Nginx Cache');?>
1010
</a>
1111
<?php if ($_SESSION['PLUGIN_APP_INSTALLER'] !== 'false') {?>

0 commit comments

Comments
 (0)