Websocket
[VSoRC/.git] / src / views / starter.ejs
1 <!DOCTYPE html>
2 <html>
3
4 <head>
5   <title></title>
6   <!-- <link rel="stylesheet" type="text/css" href="/styles/main.css" /> -->
7   <%include ../../partials/head%>
8   <style media="screen">
9     body{
10       display: flex;
11       flex-flow: row wrap;
12     }
13     main{
14       flex-grow: 2;
15     }
16     aside{
17       flex-grow: 1;
18     }
19     footer{
20       position: absolute;
21       top: 100%;
22     }
23
24     input[type="text"]{
25       background-color: rgba(200,200,200,0.5);
26       border: 0;
27       border-bottom: 2px black solid;
28       overflow: hidden;
29       width: 15em;
30     }
31     button{
32       border: 0;
33       border-bottom: 2px black solid;
34       overflow: hidden;
35       width: 15em;
36       background-color: white;
37     }
38   </style>
39 </head>
40 <header>
41   <%include ../../partials/header%>
42 </header>
43 <body>
44
45   <main>
46       <button type="button" name="button" onclick="startcontroller()">Iniciar controlador</button>
47       <button type="button" name="button" onclick="stopcontroller()">Detener controlador</button>
48       <button type="button" name="button" onclick="startvsorc()">Iniciar VsoRc</button>
49     <script type="text/javascript">
50
51     function stopcontroller() {
52       let xhr = new XMLHttpRequest();
53       xhr.open('GET', '/stopcontroller', true);
54       xhr.onload = function() {
55         if (xhr.status == 200) { //can use this.status instead
56           //console.log(xhr.responseText);// para ver en la consola
57           console.log("controller stoped");
58         }
59       }
60       xhr.send();
61     }
62
63     function startcontroller() {
64       let xhr = new XMLHttpRequest();
65       xhr.open('GET', '/startcontroller', true);
66       //console.log(xhr); //para ver en la consola
67       xhr.onload = function() {
68         if (xhr.status == 200) { //can use this.status instead
69
70           console.log("controller started");
71         }
72       }
73       xhr.send();
74     }
75
76       function startvsorc() {
77           let xhr = new XMLHttpRequest();
78           xhr.open('GET', '/startvsorc', true);
79           xhr.onload = function() {
80             if (xhr.status == 200) { //can use this.status instead
81               //console.log(xhr.responseText);// para ver en la consola
82               console.log("vsorc startedd");
83             }
84           }
85           xhr.send();
86         }
87     </script>
88   </main>
89   <aside class="">
90     <div class="statuscontroller">
91
92     </div>
93     <div class="statusproyect">
94
95     </div>
96   </aside>
97 </body>
98 <footer>
99   <%include ../../partials/footer%>
100 </footer>
101
102
103 </html>