This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git
commit 850adde4a9e1e5f560c390f64f705b63984c72d2 Author: longchun <longc...@gmail.com> AuthorDate: Tue May 29 15:46:52 2018 +0800 SCB-568 Provide web page for pack Demo --- .../booking/src/main/resources/static/index.html | 87 ++++++++++++++++++++++ .../src/main/resources/static/js/jquery.min.js | 5 ++ 2 files changed, 92 insertions(+) diff --git a/saga-demo/booking/booking/src/main/resources/static/index.html b/saga-demo/booking/booking/src/main/resources/static/index.html new file mode 100644 index 0000000..417f5bd --- /dev/null +++ b/saga-demo/booking/booking/src/main/resources/static/index.html @@ -0,0 +1,87 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to You under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Saga-booking-demo</title> + + <script type="text/javascript" src="js/jquery.min.js"></script> + + <script type="text/javascript"> + function testCase1() { + $.post("http://127.0.0.1:8083/booking/test/2/2", function(data) { + var msg = data; + $("#booking_result_1").html(msg); + }); + } + + function testCase2() { + $.post("http://127.0.0.1:8083/booking/test/3/2", function(data) { + var msg = data; + $("#booking_result_2").html(msg); + }); + } + + function room_booking_result() { + $.get("http://127.0.0.1:8081/bookings", function(data) { + var msg = "<li>" + data + "</li>"; + $("#room_list").html(msg); + }); + } + + function car_booking_result() { + $.get("http://127.0.0.1:8082/bookings", function(data) { + var msg = "<li>" + data + "</li>"; + $("#car_list").html(msg); + }); + } + </script> +</head> +<body> +<p>Test cases of Sage booking demo:</p> +<p>Case 1. <a href="javascript:void(0);" onclick="testCase1();">[Booking 2 rooms and 2 cars, will done successfully]</a> </p> +<p> + Booking result: <span id="booking_result_1">###</span><br> +</p> +<br> +<p>Case 2. <a href="javascript:void(0);" onclick="testCase2();">[Booking 3 rooms and 2 cars, hotel order service will failed.]</a> </p> +<p> + Booking result: <span id="booking_result_2">###</span><br> +</p> +<br> +<p><a href="javascript:void(0);" onclick="room_booking_result();">[Query the room booking result]</a> </p> +<p> + Room booking list:<br> +<ul> + <li id="room_list"> + #Name, Amount, Confirm status, Cancel Status + </li> +</ul> +</p> +<br> +<p><a href="javascript:void(0);" onclick="car_booking_result();">[Query the car booking result]</a> </p> +<p> + Car booking list:<br> +<ul> + <li id="car_list"> + #Name, Amount, Confirm status, Cancel Status + </li> +</ul> +</p> +</body> +</html> diff --git a/saga-demo/booking/booking/src/main/resources/static/js/jquery.min.js b/saga-demo/booking/booking/src/main/resources/static/js/jquery.min.js new file mode 100755 index 0000000..0f60b7b --- /dev/null +++ b/saga-demo/booking/booking/src/main/resources/static/js/jquery.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b [...] + +return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}fu [...] +return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a, [...] -- To stop receiving notification emails like this one, please contact ningji...@apache.org.