-
Notifications
You must be signed in to change notification settings - Fork 8
/
mgadmin.html
150 lines (124 loc) · 6.77 KB
/
mgadmin.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<!-- title and icon -->
<title>MG-RAST</title>
<link rel="icon" href="images/MGRAST_favicon.ico" type="image/x-icon">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', { 'packages': ['geochart','controls', 'corechart','gauge'],'mapsApiKey': 'AIzaSyANEAW8UwDYOcMAoES0GX9OLwlXwAFbRdc' });
</script>
<!-- default js -->
<script src="Retina/js/jquery.min.js"></script>
<script src="Retina/js/stm.js"></script>
<script src="Retina/js/retina.js"></script>
<script src="Retina/js/bootstrap.min.js"></script>
<!-- config -->
<script src="js/config.js"></script>
<!-- bootstrap style -->
<link rel="stylesheet" type="text/css" href="Retina/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="Retina/css/bootstrap-responsive.min.css">
<link rel="stylesheet" type="text/css" href="css/mgrast.css">
<link rel="stylesheet" type="text/css" href="Retina/css/jsoneditor.min.css">
<!-- webapp initialization -->
<script>
jQuery( document ).ready(function(){
stm.init({});
stm.add_repository({ url: stm.Config.mgrast_api, name: "MG-RAST"});
Retina.init({});
var page = Retina.cgiParam("mgpage") || "statistics";
var ico = document.getElementById('icon_'+page);
if (ico) {
ico.className = "icosp icoactivesp";
ico.firstChild.className = "ico icoactive";
}
document.title = page.charAt(0).toUpperCase()+page.substr(1);
changeLocation = function(event, loc) {
event = event || window.event;
if (event.shiftKey) {
window.open(loc);
} else {
window.location = loc;
}
};
Retina.load_widget("admin_"+page).then( function() {
var mgp = Retina.Widget.create('admin_'+page, { "main": document.getElementById("content"),
"sidebar": document.getElementById("sidebar") });
Retina.load_widget({"name": "login", "resource": "Retina/widgets/"}).then( function() {
var loginAction = function (data) {
if (data.action != "logout" && data.result == "success") {
if (stm.user && stm.user.hasOwnProperty("preferences")) {
mgp.display({ "main": document.getElementById("content"),
"sidebar": document.getElementById("sidebar") });
return;
}
stm.user = data.user;
stm.authHeader = { "Authorization": "mgrast "+data.token};
mgp.display({ "main": document.getElementById("content"),
"sidebar": document.getElementById("sidebar") });
} else {
stm.user = null;
stm.authHeader = {};
mgp.display({ "main": document.getElementById("content"),
"sidebar": document.getElementById("sidebar") });
}
};
Retina.Widget.create('login', { "target": document.getElementById("login_space"),
"callback": loginAction,
"registerEnabled": true,
"registerLink": "mgmain.html?mgpage=register",
"helpEnabled": true,
"helpLink": "http://blog.mg-rast.org/howto/",
"forgotEnabled": true,
"forgotLink": "mgmain.html?mgpage=register&forgot=1",
"myDataEnabled": true,
"myDataLink": "mgmain.html?mgpage=mydata" });
});
Retina.load_widget({"name": "session", "resource": "Retina/widgets/"}).then( function() {
Retina.Widget.create('session', {"target": document.getElementById('session_space'), "noInfo": true});
});
});
});
</script>
</head>
<body style="padding: 0px;">
<!-- header bar -->
<div class="header">
<!-- logo and title -->
<div style="width: 235px; float: left; margin-right: 25px;">
<img src="images/MGRAST_logo.png" style="float: left; height: 59px; margin-top: 3px; cursor: pointer;" onclick="window.location='index.html';">
</div>
<!-- navigation icons -->
<div class="icorow">
<div class="icosp" id="icon_statistics"><img src="Retina/images/bars.png" class="ico" title="Statistics" onclick="changeLocation(event, 'mgadmin.html?mgpage=statistics');"><span>Statistics</span></div>
<div class="icosp" id="icon_users"><img src="Retina/images/user.png" class="ico" title="Users" onclick="changeLocation(event, 'mgadmin.html?mgpage=users');"><span>Users</span></div>
<div class="icosp" id="icon_system" onclick="changeLocation(event, 'mgadmin.html?mgpage=system');"><img src="Retina/images/settings3.png" class="ico" title="System Status"><span>System Status</span></div>
<div class="icosp" id="icon_advancedstatistics" onclick="changeLocation(event, 'mgadmin.html?mgpage=advancedstatistics');"><img src="Retina/images/stats.png" class="ico" title="Statistics+"><span>Statistics+</span></div>
<div class="icosp" id="icon_debug" onclick="changeLocation(event, 'mgadmin.html?mgpage=debug');"><img src="Retina/images/bug.png" class="ico" title="Debug"><span>Debug</span></div>
<div class="icosp" id="icon_maps" onclick="changeLocation(event, 'mgadmin.html?mgpage=maps');"><img src="Retina/images/map.png" class="ico" title="Maps"><span>Maps</span></div>
<div class="icosp" id="icon_shock" onclick="changeLocation(event, 'mgadmin.html?mgpage=shock');"><img src="Retina/images/attributes.png" class="ico" title="SHOCK"><span>SHOCK</span></div>
</div>
<div style="float: right;">
<!-- user info / login section -->
<span id="login_space"></span>
<!-- session management -->
<span id="session_space" style="float: right; margin-right: 10px;"></span>
</div>
</div>
<div style="height: 80px;" class="visible-desktop"></div>
<div style="height: 120px;" class="hidden-desktop"></div>
<!--border layout -->
<div class="row-fluid">
<!-- main content -->
<div id="content" class="span7 offset1"></div>
<!-- sidebar content -->
<div class="span3 sidebar">
<span style="float: right; margin-right: 5px; cursor: pointer;" status="on" onclick="if (this.getAttribute('status') == 'on') { this.setAttribute('status', 'off'); document.getElementById('content').className='span10 offset1'; this.parentNode.className='span1'; document.getElementById('sidebar').style.display='none'; this.firstChild.className='icon-plus'; this.style.cssFloat='left'; this.style.styleFloat='left'; } else { this.setAttribute('status', 'on'); document.getElementById('content').className='span7 offset1'; this.parentNode.className='span3 sidebar'; document.getElementById('sidebar').style.display=''; this.firstChild.className='icon-minus'; this.style.cssFloat='right'; this.style.styleFloat='right'; }" id="sidebarResizer"><icon class="icon-minus"></icon></span>
<div id="sidebar"></div>
</div>
</div>
<div style="height: 100px;"></div>
</body>
</html>