Skip to content

Commit

Permalink
add function for refresh and starup
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Oct 27, 2017
1 parent 6e0572a commit 2e1f388
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
Binary file added assets/img/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 24 additions & 17 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<br />

<div class="float-right">
<a href="/" class="button button-primary"> Refresh </a>
<a id="refresh" class="button button-primary"> Refresh </a>
<a href="/logout" class="button"> Logout </a>
</div>
<h2>
Expand Down Expand Up @@ -53,6 +53,7 @@ <h2>
</a>
</td>
</tr>


</tbody>
</table>
Expand All @@ -63,27 +64,33 @@ <h2>
<br />
</div>
<script type="text/javascript">
function GetData() {
$.get('/getProccess', function (e) {
var newDate = new Date();
vue.processes = e;
vue.now = Math.floor(newDate.getTime());
});
}
var now = 0;
vue = new Vue({
el: '#app',
data: {
processes: [],
now: 0
},
methods: {
timing: function (sec) {
var date = new Date(null);
date.setSeconds(Math.floor(sec / 1000)); // specify value for SECONDS here
return date.toISOString().substr(11, 8);
el: '#app',
data: {
processes: [],
now: 0
},
methods: {
timing: function (sec) {
var date = new Date(null);
date.setSeconds(Math.floor(sec / 1000)); // specify value for SECONDS here
return date.toISOString().substr(11, 8);
}
}
}
});
$(function () {
$.get('/getProccess', function (e) {
var newDate = new Date();
vue.processes = e;
vue.now = Math.floor(newDate.getTime());
});
GetData();
$("#refresh").click(function () {

});
});
</script>
</body>
Expand Down

0 comments on commit 2e1f388

Please sign in to comment.