-
Notifications
You must be signed in to change notification settings - Fork 0
/
env-check.html
68 lines (68 loc) · 2.32 KB
/
env-check.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="ja" lang="ja" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>check starbug1 environment</title>
<script type="text/javascript" src="./js/prototype.js"></script>
<script type="text/javascript">
Event.observe(window, 'load', function(e){
check('db_initialized', '', function(description, mes) {
var box = $('initialize_check');
if (box.innerHTML == '') {
var h2 = document.createElement('h2');
h2.innerHTML = 'Install problems check.';
box.appendChild(h2);
var ul = document.createElement('ul');
ul.id = 'errors';
box.appendChild(ul);
}
//if not db initialized, execute install check.
check('execute_cgi', 'In this directory, Can execute CGI?', function(description, mes) {
display_result(description, mes);
});
check('able_to_write_db', 'Is database directory writable?', function(description, mes) {
display_result(description, mes);
});
});
});
function display_result(description, mes) {
var li = document.createElement('li');
var message = 'ok';
if (mes != 'ok') {
message = '<span class="error">' + mes + '</span>';
}
li.innerHTML = description + ' ... ' + message;
$('errors').appendChild(li);
}
function check(mode, description, callback) {
new Ajax.Request('check.cgi', {
method: 'get',
parameters: 'm=' + mode,
onSuccess: function(request){
callback(description, 'ok');
},
onFailure: function(request){
callback(description, request.responseText);
}
});
}
</script>
<style>
.error {
font-weight: bold;
color: red;
}
</style>
</head>
<body>
<h2>Starbug1 environment check</h2>
<div id="initialize_check"></div>
<div>
<a href="index.cgi">back to Starbug1.'</a>
</div>
<hr />
<div align="right">
<address>Copyright smeghead 2007 - 2010.</address>
</div>
</body>
</html>