-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhosts.php
More file actions
97 lines (90 loc) · 3.79 KB
/
Copy pathhosts.php
File metadata and controls
97 lines (90 loc) · 3.79 KB
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
<?PHP
include 'header.php';
include 'language.php';
include 'clusters.php';
include 'jsonfunc.php';
$uname=$_SESSION['uname'];
$admin=$_SESSION['admin'];
$hosts=isset($_GET['hosts'])?$_GET['hosts']:'';
$olv=$_SESSION['version'];
$setenvdir = 'export CB_ENVDIR='.$_SESSION['mycluster']['env'].';';
$cmdPrefix = 'source ./env.sh;'.$setenvdir;
?>
<!DOCTYPE html>
<html>
<?php include('header.html');?>
<body class="hold-transition <?PHP echo $skin;?> sidebar-mini">
<div class="wrapper">
<!-- Navigation -->
<?PHP include 'navigation.php';?>
<div class="content-wrapper">
<section class="content-header">
<h1 class="page-header">
<?PHP echo $lang['HOSTS'];?>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-solid">
<div class="box-body">
<table class="table table-condensed table-striped" id="jobDataTables">
<thead>
<tr>
<th><?PHP echo $lang['HOST_NAME'];?></th>
<th><?PHP echo $lang['STATUS'];?></th>
<th><?PHP echo $lang['TOTAL_NUM_JOBS'];?> (<?PHP echo $lang['SLOTS'];?>)</th>
<th><?PHP echo $lang['NUM_RUNNING_JOBS'];?> (<?PHP echo $lang['SLOTS'];?>)</th>
<th><?PHP echo $lang['NUM_SUSP_JOBS'];?> (<?PHP echo $lang['SLOTS'];?>)</th>
<th><?PHP echo $lang['NUM_RESERVED_JOB_SLOTS'];?></th>
<th><?PHP echo $lang['R1M'];?></th>
<th><?PHP echo $lang['UT'];?></th>
<th><?PHP echo $lang['MEM'];?></th>
<th><?PHP echo $lang['NETIO'];?></th>
<th><?PHP echo $lang['GPU'];?></th>
<th><?PHP echo $lang['MAX_JOB_SLOTS'];?></th>
<th><?PHP echo $lang['JOB_SLOT_LIMIT_PER_USER'];?></th>
<th><?PHP echo $lang['DISPATCH_WINDOW'];?></th>
<th><?PHP echo $lang['CPU_FACTOR'];?></th>
</tr>
</thead>
<tbody>
<?PHP
if ($hosts!='')
$hosts=' -g "'.$hosts.'"';
exec($cmdPrefix."cmd/hinfo".$olv.$hosts, $res, $exit_code);
foreach (json_decode($res[0], true) as $row) {
echo '<tr>';
echo '<td><a href="'.$row['HOST_URL'].'">'.$row['HOST'].'</font></a></td>';
echo '<td class="'.$row['CLASS'].'">'.$row['STATUS'].'</td>';
echo '<td><a href="'.$row['JOB_URL'].'">'.$row['TOTAL_NUM_JOBS'].'</font></a></td>';
echo '<td>'.$row['NUM_RUNNING_JOBS'].'</td>';
echo '<td>'.$row['NUM_SUSP_JOBS'].'</td>';
echo '<td>'.$row['NUM_RESERVED_JOBS'].'</td>';
echo '<td>'.$row['R1M'].'</td>';
echo '<td>'.$row['UT'].'</td>';
echo '<td>'.$row['MEM'].'</td>';
echo '<td>'.$row['NETIO'].'</td>';
echo '<td>'.$row['GPU'].'</td>';
echo '<td>'.(array_key_exists('MAX_JOB_SLOTS',$row)?$row['MAX_JOB_SLOTS']:'-').'</td>';
echo '<td>'.(array_key_exists('JOB_SLOT_LIMIT_PER_USER',$row)?$row['JOB_SLOT_LIMIT_PER_USER']:'-').'</td>';
echo '<td>'.(array_key_exists('DISPATCH_WINDOW',$row)?$row['DISPATCH_WINDOW']:'-').'</td>';
echo '<td>'.$row['CPU_FACTOR'].'</td>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<?PHP include('js.html');?>
<?PHP
// datatables Initialization
include 'datatablesInit.php';
?>
</body>
</html>