| 1 |
(function ($) { |
| 2 |
|
| 3 |
var $fcgiButton = $('#fastcgi-settings-button'), |
| 4 |
$fcgiClose = $('#fastcgi-settings-close'), |
| 5 |
$fcgiSettings = $('#fastcgi-settings'); |
| 6 |
|
| 7 |
// show/hide page cache settings |
| 8 |
$fcgiButton.on('click', function (e) { |
| 9 |
$(this).toggleClass('active'); |
| 10 |
|
| 11 |
if ($(this).hasClass('active')) { |
| 12 |
$fcgiSettings.slideDown('fast'); |
| 13 |
} else { |
| 14 |
$fcgiSettings.slideUp('fast'); |
| 15 |
} |
| 16 |
}); |
| 17 |
|
| 18 |
// close page cache settings |
| 19 |
$fcgiClose.on('click', function (e) { |
| 20 |
$fcgiButton.removeClass('active'); |
| 21 |
$fcgiSettings.slideUp('fast'); |
| 22 |
}); |
| 23 |
|
| 24 |
// Remove page cache notice after 2 seconds |
| 25 |
if ($('#fly-page-cache-notice').length) { |
| 26 |
setTimeout(function () { |
| 27 |
$('#fly-page-cache-notice').fadeOut('slow'); |
| 28 |
}, 2000); |
| 29 |
} |
| 30 |
|
| 31 |
var colors = ['#F87171', '#16a34a', '#FBBF24',]; |
| 32 |
var opcacheMemory = $('#opcache-memory'), |
| 33 |
opcacheKeys = $('#opcache-keys'), |
| 34 |
opcacheHits = $('#opcache-hits'); |
| 35 |
|
| 36 |
new Chart(opcacheMemory, { |
| 37 |
type: 'doughnut', |
| 38 |
data: { |
| 39 |
labels: ['Used', 'Free', 'Wasted'], |
| 40 |
datasets: [{ |
| 41 |
data: [80, 15, 5], |
| 42 |
backgroundColor: colors, |
| 43 |
}], |
| 44 |
hoverOffset: 10 |
| 45 |
}, |
| 46 |
}); |
| 47 |
|
| 48 |
new Chart(opcacheKeys, { |
| 49 |
type: 'doughnut', |
| 50 |
data: { |
| 51 |
labels: ['Used', 'Free', 'Wasted'], |
| 52 |
datasets: [{ |
| 53 |
data: [80, 15, 5], |
| 54 |
backgroundColor: colors, |
| 55 |
}], |
| 56 |
hoverOffset: 10 |
| 57 |
}, |
| 58 |
}); |
| 59 |
|
| 60 |
new Chart(opcacheHits, { |
| 61 |
type: 'doughnut', |
| 62 |
data: { |
| 63 |
labels: ['Used', 'Free', 'Wasted'], |
| 64 |
datasets: [{ |
| 65 |
data: [80, 15, 5], |
| 66 |
backgroundColor: colors, |
| 67 |
}], |
| 68 |
hoverOffset: 10 |
| 69 |
}, |
| 70 |
}); |
| 71 |
|
| 72 |
})(jQuery); |
| 73 |
|