-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
107 lines (103 loc) · 3.12 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">
<title>Aprori</title>
<script src="/vendor/angular/angular.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
</head>
<body ng-app="app" class="container container-fluid">
<h1>Apriori</h1>
<div ng-controller="contentCtrl">
<table border="solid" class="table">
<tr>
<th>TID</th>
<th>ITMES</th>
</tr>
<tr ng-repeat="item in items">
<td>{{item.tid}}</td>
<td>{{item.items.toString()}}</td>
</tr>
</table>
<hr>
<div class="row">
<div class="col-lg-12">
<div class="input-group">
<input type="text" class="form-control" placeholder="items ', ' seperated" ng-model="inputItems">
<span class="input-group-btn">
<button class="btn btn-default" type="button" ng-click="addNewItem(inputItems)">add new items</button>
</span>
</div>
<!-- /input-group -->
</div>
<!-- /.col-lg-6 -->
</div>
<br>
<div class="row">
<div class="col-lg-6">
<div class="input-group">
<input type="number" class="form-control" placeholder="support" aria-describedby="basic-addon1" ng-model="sup">
<span class="input-group-addon" id="basic-addon1">%</span>
</div>
</div>
<div class="col-lg-6">
<div class="input-group">
<input type="number" class="form-control" placeholder="confidence" aria-describedby="basic-addon1" ng-model="con">
<span class="input-group-addon" id="basic-addon1">%</span>
</div>
</div>
</div>
<br>
<button type="submit" ng-click="send(sup, con)" class="btn btn-success" style="float:right">eval</button>
<br>
<div class="jumbotron" ng-hide="!op">
{{op}}
</div>
</div>
<script>
var app = angular.module("app", []);
app.controller("contentCtrl", function($scope, $http){
var tid = 1;
$scope.op = undefined;
$scope.inputItems;
$scope.msg = "hello world";
$scope.items = [];
$scope.addNewItem = function(inputItems){
let item = {
tid:tid++,
items:inputItems.split(',')
}
$scope.items.push(item);
$scope.inputItems = undefined;
}
$scope.send = function(sup, con){
var data = {
tra:$scope.items,
sup:sup,
con:con
}
$http.post('/aprori', data)
.then(function(res){
$scope.op = res.data;
},function(err){
console.log(err || err.stack)
})
}
})
</script>
<style>
.btn, .input-group{
border-radius:0px;
}
.table>tbody>tr>td,
.table>tbody>tr>th,
.table>tfoot>tr>td,
.table>tfoot>tr>th,
.table>thead>tr>td,
.table>thead>tr>th {
border: 1px solid black;
}
</style>
</body>
</html>