Parcourir la source

add elapsed column

David il y a 10 ans
Parent
commit
92e72d0b50
4 fichiers modifiés avec 17 ajouts et 3 suppressions
  1. BIN
      front/.index.html.swp
  2. 8 1
      front/index.html
  3. BIN
      front/js/.app.js.swp
  4. 9 2
      front/js/app.js

BIN
front/.index.html.swp


+ 8 - 1
front/index.html

@@ -12,6 +12,7 @@
 				<th>Type</th>
 				<th>Query</th>
 				<th>Status</th>
+				<th>Elapsed</th>
 				<th>Output</th>
 			</tr>
 			<tr ng-repeat="l in list track by l.ID">
@@ -19,9 +20,15 @@
 				<td> {{l.TYPE}} </td>
 				<td> {{l.QUERY}} </td>
 				<td> {{l.STATUS}} </td>
+				<td> <p ng-if="l.STATUS!='DISCONNECTED'">{{l.ELAPSED}}</p> </td>
 				<td> 
 					<div ng-repeat="o in l.OUT">
-						<a ng-click="download(o)"> {{o }}</a>
+						<div ng-if="l.TYPE=='SEARCH'">
+							<a ng-click="download(o)"> {{o }}</a>
+						</div>
+						<div ng-if="l.TYPE=='BOOK'">
+							<a ng-href="/test/{{o}}" target="_blank">Download {{o }}</a>
+						</div>
 					</div>
 				</td>
 			</tr>

BIN
front/js/.app.js.swp


+ 9 - 2
front/js/app.js

@@ -8,6 +8,13 @@ app.controller('main', function($scope,$http) {
 	$scope.getList = function() {
 		$http.get("/test/").then(
 		function(data) {
+			/*
+			data.data=data.data.map(function(el) {
+				if (el.STATUS!="DISCONNECTED")
+					el.STATUS=el.STATUS+" "+el.ELAPSED;
+				return el;
+			});
+			*/
 			$scope.list=data.data;
 		},
 		function(data){
@@ -27,11 +34,11 @@ app.controller('main', function($scope,$http) {
 			console.log(data);
 		});
 	};
-	$scope.searchbook = function(book,extension){
+	$scope.searchBook = function(book,extension){
 		$http.post("/test/?ewqewqewq", {"type":"search","book":book,"extension":extension}).then(
 		function(data) {
 			console.log("success");
-			$scope.getlist();
+			$scope.getList();
 		},
 		function(data){
 			console.log("err");