mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 12:34:47 -04:00
Add tests to the info page.
This commit is contained in:
parent
82d3b5040e
commit
30993e40f6
3 changed files with 22 additions and 3 deletions
|
@ -134,7 +134,7 @@ body#h5ai-info {
|
||||||
margin: 4px 0 12px 12px;
|
margin: 4px 0 12px 12px;
|
||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
width: 380px;
|
width: 460px;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,21 @@ modulejs.define('info', ['$', 'config'], function ($, config) {
|
||||||
|
|
||||||
$(testsTemp).appendTo('body');
|
$(testsTemp).appendTo('body');
|
||||||
|
|
||||||
|
addTest(
|
||||||
|
'Index file found', 'Add <code>' + setup.INDEX_HREF + '</code> to your index file list',
|
||||||
|
setup.INDEX_HREF
|
||||||
|
);
|
||||||
|
|
||||||
|
addTest(
|
||||||
|
'Options parsable', 'File <code>options.json</code> is readable and syntax seams to be correct',
|
||||||
|
config.options !== null
|
||||||
|
);
|
||||||
|
|
||||||
|
addTest(
|
||||||
|
'Types parsable', 'File <code>types.json</code> is readable and syntax seams to be correct',
|
||||||
|
config.types !== null
|
||||||
|
);
|
||||||
|
|
||||||
addTest(
|
addTest(
|
||||||
'Server software', 'Server is one of apache, lighttpd, nginx or cherokee',
|
'Server software', 'Server is one of apache, lighttpd, nginx or cherokee',
|
||||||
setup.HAS_SERVER, setup.SERVER_NAME + ' ' + setup.SERVER_VERSION
|
setup.HAS_SERVER, setup.SERVER_NAME + ' ' + setup.SERVER_VERSION
|
||||||
|
|
|
@ -72,9 +72,13 @@ function setup() {
|
||||||
define("CURRENT_HREF", $current_href);
|
define("CURRENT_HREF", $current_href);
|
||||||
define("CURRENT_PATH", $current_path);
|
define("CURRENT_PATH", $current_path);
|
||||||
|
|
||||||
define("INDEX_HREF", normalize_path(APP_HREF . "server/php/index.php", false));
|
$index_href = null;
|
||||||
|
if (@is_readable(normalize_path(APP_PATH . "/server/php/index.php", false))) {
|
||||||
|
$index_href = normalize_path(APP_HREF . "/server/php/index.php", false);
|
||||||
|
}
|
||||||
|
define("INDEX_HREF", $index_href);
|
||||||
|
|
||||||
define("CACHE_HREF", normalize_path(APP_HREF . "cache", true));
|
define("CACHE_HREF", normalize_path(APP_HREF . "/cache", true));
|
||||||
define("CACHE_PATH", normalize_path(APP_PATH . "/cache", false));
|
define("CACHE_PATH", normalize_path(APP_PATH . "/cache", false));
|
||||||
define("HAS_WRITABLE_CACHE", @is_writable(CACHE_PATH));
|
define("HAS_WRITABLE_CACHE", @is_writable(CACHE_PATH));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue