Skip to content

Commit 60cc1b9

Browse files
committed
view initial commit
post two methods
1 parent 884321d commit 60cc1b9

File tree

10 files changed

+472
-0
lines changed

10 files changed

+472
-0
lines changed

front/index.csp

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<html>
2+
<head>
3+
4+
<!-- Put your page Title here -->
5+
<title> Cache Server Page </title>
6+
7+
<script src=".\libs\js\jquery-3.1.1.min.js"></script>
8+
<script src=".\libs\js\angular.min.js"></script>
9+
<!-- Latest compiled and minified CSS -->
10+
<link rel="stylesheet" href=".\libs\css\bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
11+
12+
<!-- Optional theme -->
13+
<link rel="stylesheet" href=".\libs\css\bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
14+
15+
<!-- Latest compiled and minified JavaScript -->
16+
<script src=".\libs\js\bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
17+
18+
<link rel="stylesheet" href=".\src\css\main.css">
19+
<script src=".\src\js\myApp.js"></script>
20+
</head>
21+
22+
<body ng-app="myApp" ng-controller="myCtrl">
23+
24+
<nav class="navbar navbar-inverse">
25+
<div class="container">
26+
<div class="navbar-header">
27+
<a class="navbar-brand" href="#">SQLKPI</a>
28+
</div>
29+
</div>
30+
</nav>
31+
<div class="row">
32+
<div class="col-sm-2"></div>
33+
34+
<div class="col-sm-8">
35+
<div class="row">
36+
<h3>ExecuteSQL</h3>
37+
<div class="form-group">
38+
<label >SQL:</label>
39+
<input type="text" class="form-control" ng-model="execute.sql">
40+
41+
<button type="button" class="btn btn-primary pull-right" ng-click="executeSQL(execute.sql)">Execute SQL</button>
42+
</div>
43+
</div>
44+
<div class="row">
45+
<h3>GenerateKPI</h3>
46+
<div class="form-group">
47+
<label>SQL:</label>
48+
<input type="text" class="form-control" ng-model="generate.sql">
49+
50+
<label>Name:</label>
51+
<input type="text" class="form-control" ng-model="generate.name">
52+
53+
<label>Class:</label>
54+
<input type="text" class="form-control" ng-model="generate.className">
55+
<button type="button" class="btn btn-primary pull-right" ng-click="generateKPI(generate.sql, generate.name, generate.className)">Generate KPI</button>
56+
</div>
57+
</div>
58+
</div>
59+
60+
<div class="col-sm-2"></div>
61+
</div>
62+
63+
64+
65+
</body>
66+
</html>
67+

front/libs/css/bootstrap-theme.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/libs/css/bootstrap-theme.min.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/libs/css/bootstrap.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/libs/css/bootstrap.min.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/libs/js/angular.min.js

Lines changed: 323 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/libs/js/bootstrap.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/libs/js/jquery-3.1.1.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/src/css/main.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.mainApp {
2+
padding: 50px 30px 50px 80px;
3+
background-color: pink;
4+
}
5+
6+
.btn {
7+
margin-top: 8px;
8+
}

front/src/js/myApp.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
var app = angular.module('myApp', []);
2+
3+
4+
app.controller('myCtrl', function($scope, $http) {
5+
window.s = $scope
6+
7+
var baseURL = "http://localhost:57772/rest/sqlkpi";
8+
9+
$scope.executeSQL = function (sql) {
10+
console.log("Executing SQL: Start.");
11+
executeSQLPOST(sql);
12+
13+
}
14+
$scope.generateKPI = function (sql, name, className) {
15+
console.log("Executing SQL: Start.");
16+
console.log(sql);
17+
generateKPIPOST(sql, name, className);
18+
19+
}
20+
21+
getTest = function () {
22+
$http.get(baseURL + '/test').
23+
then(function (response) {
24+
console.log(response);
25+
}, function myError(response){
26+
console.log("error " + response);
27+
});
28+
};
29+
30+
executeSQLPOST = function (sql) {
31+
var params = {SQL: sql};
32+
$http.post(baseURL + '/sql', params).
33+
then(function (response) {
34+
console.log(response);
35+
}, function myError(response){
36+
console.log(response);
37+
});
38+
};
39+
40+
generateKPIPOST = function (sql, name, className) {
41+
var params = {SQL: qwe, Name: name, Class: className};
42+
$http.post(baseURL + '/generateKPI', params).
43+
then(function (response) {
44+
console.log(response);
45+
}, function myError(response){
46+
console.log(response);
47+
});
48+
};
49+
});

0 commit comments

Comments
 (0)