-
Notifications
You must be signed in to change notification settings - Fork 0
/
com.ejs
120 lines (101 loc) · 4.24 KB
/
com.ejs
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
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/javascript/prototype.js"></script>
<link rel="shortcut icon" type="image/png" href="/img/favicon.png"/>
<style>
body{
background-image: url("img/fondo.jpg");
background-repeat: no-repeat;
}
div.panel {
height: 80%;
width: 900px;
border: 1px solid black;
}
.panel-body {
word-break:break-all
}
.prebody{
height: 80%;
width: 850px;
}
</style>
<script>
function ejecutarComando(){
var valor = document.getElementById("comando").value;
new Ajax.Request('/com', {
method: 'get',
parameters: {com: valor},
onSuccess: topSuccess
});
}
function topSuccess(response){
var container = $('resCom');
var content = response.responseText;
container.update(content);
}
var update = function actualizarHora(){
var container = $('horaActual');
var hoy = new Date();
var dd = hoy.getDate();
var mm = hoy.getMonth()+1; //Enero es el mes 0
var yy = hoy.getFullYear();
var hh = hoy.getHours();
var min = hoy.getMinutes();
if (parseInt(min,10) < 10){
min = '0'+min;
}
var seg = hoy.getSeconds();
var fecha_hora = hh+":"+min+":"+seg+" - "+dd+"/"+mm+"/"+yy;
container.update(fecha_hora);
}
setInterval(update,1000);
</script>
<title><%= title %></title>
</head>
<nav class="navbar navbar-default navbar-static-top" style="background:#829bae">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" style="color:white;">Monitoreo del Linux Yocto / Intel Galileo
</a>
</div>
<div class="collapse navbar-collapse">
<form class="navbar-form navbar-right" action="/topRender" method="get" >
<button type="submit" class="btn btn-inverse">Ejecutar comando top</button>
</form>
<form class="navbar-form navbar-right" action="/whoRender" method="get" >
<button type="submit" class="btn btn-inverse">Ejecutar comando who</button>
</form>
<form class="navbar-form navbar-right" action="/freeRender" method="get" >
<button type="submit" class="btn btn-inverse">Ejecutar comando free</button>
</form>
<form class="navbar-form navbar-right" action="/comRender" method="get" >
<button type="submit" class="btn btn-inverse">Ejecutar comandos</button>
</form>
<label class="navbar-brand" style="color:white;" id="horaActual"></label>
</div>
</div>
</nav>
<div class="container" align="center" >
<div>
<input id="comando" ></input>
<button type="text" class="btn btn-inverse" onclick="ejecutarComando()">Ejecutar</button>
</div>
<br>
<div id="panel" class="panel panel-primary" >
<div class="panel-heading">Comando ejecutado por el usuario</div>
<div class="panel-body">
<pre align="left" id ="resCom" class="prebody"></pre>
</div>
</div>
</div>
<body>
</body>
</html>