-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
107 lines (96 loc) · 3.58 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Automated conversion of Excel to PDF using LibreOffice</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
<!-- Bootstrap core CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.7/css/mdb.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm mt-2">
<h1>Automated conversion of Excel to PDF using LibreOffice</h1>
</div>
</div>
<div class="row">
<div class="col-sm mt-2">
<input type="text" id="file_id" placeholder="File ID" class="p-1 rounded border border-success">
</div>
</div>
<div class="row">
<div class="col-sm mt-2">
<input type="text" id="s1" placeholder="String 1" class="p-1 rounded border border-success">
</div>
</div>
<div class="row">
<div class="col-sm mt-2">
<input type="text" id="s2" placeholder="String 2" class="p-1 rounded border border-success">
</div>
</div>
<div class="row">
<div class="col-sm mt-2">
<input type="text" id="n1" placeholder="Number 1" class="p-1 rounded border border-success">
</div>
</div>
<div class="row">
<div class="col-sm mt-2">
<input type="text" id="n2" placeholder="Number 2" class="p-1 rounded border border-success">
</div>
</div>
<div class="row">
<div class="col-sm mt-2">
<input type="button" class="btn btn-success" id="submit_request" value="Submit">
</div>
</div>
<div class="row">
<div class="col-sm mt-2" id="result"></div>
</div>
</div>
</body>
<!-- JQuery -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.7/js/mdb.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io();
socket.on('messageDefault',function(data) {
// Default message
console.log(data);
if(data.status == 'success') {
$('#result').fadeIn();
$('#result').html('<a href="/excel/' + data.file + '">' + data.file + '.xlsx</a> | <a href="/pdf/' + data.file + '">' + data.file + '.pdf</a>');
}
});
$('#submit_request').click(function(){
if(
$('#file_id').val() != undefined && $('#file_id').val() != '' &&
$('#s1').val() != undefined && $('#s1').val() != '' &&
$('#s2').val() != undefined && $('#s2').val() != '' &&
$('#n1').val() != undefined && $('#n1').val() != '' &&
$('#n2').val() != undefined && $('#n2').val() != ''
) {
var data = {
file_id: $('#file_id').val(),
s1: $('#s1').val(),
s2: $('#s2').val(),
n1: $('#n1').val(),
n2: $('#n2').val(),
}
socket.emit('createReport',data);
} else {
$('#result').html('<div class="alert alert-danger">Please enter all values</div>');
}
});
</script>
</html>