mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-04 00:58:38 -04:00
Refactored and lots of modification. See README.md.
This commit is contained in:
parent
859a680e19
commit
71ed41fa69
85 changed files with 3191 additions and 2969 deletions
49
src/_h5ai/js/inc/h5ai-info.js
Normal file
49
src/_h5ai/js/inc/h5ai-info.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
|
||||
module.define('h5ai-info', [jQuery, 'core/resource'], function ($, resource) {
|
||||
|
||||
var setCheckResult = function (id, result) {
|
||||
|
||||
var $ele = $(id).find('.test-result');
|
||||
|
||||
if (result) {
|
||||
$ele.addClass('test-passed').text('yes');
|
||||
} else {
|
||||
$ele.addClass('test-failed').text('no');
|
||||
}
|
||||
},
|
||||
|
||||
handleChecksResponse = function (response) {
|
||||
|
||||
_.each(['php', 'cache', 'thumbs', 'temp', 'zips'], function (test) {
|
||||
|
||||
setCheckResult('#test-' + test, response && response[test]);
|
||||
})
|
||||
},
|
||||
|
||||
checks = function () {
|
||||
|
||||
$.ajax({
|
||||
url: resource.api(),
|
||||
data: {
|
||||
action: 'checks'
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
|
||||
handleChecksResponse(response);
|
||||
},
|
||||
error: function () {
|
||||
|
||||
handleChecksResponse();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
checks();
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue