Browse Source

example buttons
Layout fixes

Martin Kunz 5 years ago
parent
commit
abfc393445

+ 1 - 1
pom.xml

@@ -62,7 +62,7 @@
                             <createSourcesJar>false</createSourcesJar>
                             <shadedClassifierName>shaded</shadedClassifierName>
                             <shadedArtifactAttached>true</shadedArtifactAttached>
-                            <minimizeJar>false</minimizeJar>
+                            <minimizeJar>true</minimizeJar>
                         </configuration>
                     </execution>
                 </executions>

+ 5 - 2
src/main/java/com/acdp/transceivr/Transfer.java

@@ -7,7 +7,6 @@ public class Transfer {
 
 
 
-
     public Transfer(int id) {
         this.id = id;
         startTS=System.currentTimeMillis();
@@ -37,7 +36,7 @@ public class Transfer {
     public String cpeeCallbackError;
     public boolean finished;
     public long finishedAT;
-
+    public String toMethod;
     int id;
 
     public JsonObject toJSON() {
@@ -59,6 +58,10 @@ public class Transfer {
         js.add("cpeeCallbackCode", cpeeCallbackCode);
         js.add("cpeeCallbackMessage", cpeeCallbackMessage);
         js.add("cpeeCallbackError", cpeeCallbackError);
+        js.add("finished", finished);
+        js.add("finishedAT", finishedAT);
+
+
 
 
 

+ 1 - 0
src/main/java/com/acdp/transceivr/WebServer.java

@@ -75,6 +75,7 @@ public class WebServer {
                 Transfer t = new Transfer(nextID++);
                 t.from = req.queryParams("from");
                 t.to = req.queryParams("to");
+                t.toMethod="PUT";
                 t.cpeeCallback = req.headers("CPEE-CALLBACK");
                 t.cpeeCallbackId = req.headers("CPEE-CALLBACK-ID");
                 t.cpeeInstanceURL = req.headers("CPEE-INSTANCE-URL");

+ 27 - 16
src/main/resources/webroot/index.html

@@ -14,24 +14,23 @@
 </style>
 <head>
     <meta charset="utf-8">
-    <title>Transloadr</title>
+    <title>Transceivr</title>
     <script src="js/vue.js"></script>
     <script src="js/moment.js"></script>
-
 </head>
 <body>
-
 <div id="app">
-    <input v-model="from" placeholder="from">
-    <input v-model="to" placeholder="to">
+    <input v-model="from" placeholder="from" size="80"><br>
+    <input v-model="to" placeholder="to" size="80"><br>
     <button @click="send">Send</button>
-
+    <a href="#" @click="example1">example1</a>
+    <a href="#" @click="example2">example2</a>
 
     <table>
         <template v-for="(item, index) in transfers">
             <tr>
                 <td> {{ item.id }}</td>
-                <td style="width:200px;">
+                <td style="width:200px;" colspan="2">
                     <div id="myProgress">
                         <div id="myBar" :style="{width: item.progress + '%'}">{{ item.progress }}</div>
                     </div>
@@ -41,17 +40,23 @@
                 </td>
             </tr>
             <tr>
-                <td>    <button @click="cancel(item.id)">cancel</button>
+                <td><button @click="cancel(item.id)">cancel</button>
                 </td>
                 <td>
 <pre>id: {{ item.id}}
 from: {{ item.from}}
-to: {{ item.to}}
+contentLength: {{ item.contentLength }}
 bytesRead: {{ item.bytesRead}}
 uploadError: {{ item.uploadError}}
 uploadCode: {{ item.uploadCode}}
 uploadResponseBody: {{ item.uploadResponseBody}}
 uploadDone: {{ item.uploadDone}}
+finished: {{ item.finished}}
+
+</pre>
+</td>
+<td><pre>rate: {{ item.rate}}k/s
+to: {{ item.to}}
 downloadError: {{ item.downloadError}}
 downloadCode: {{ item.downloadCode}}
 downloadDone: {{ item.downloadDone}}
@@ -59,13 +64,11 @@ cpeeCallbackResult: {{ item.cpeeCallbackResult}}
 cpeeCallbackCode: {{ item.cpeeCallbackCode}}
 cpeeCallbackMessage: {{ item.cpeeCallbackMessage}}
 cpeeCallbackError: {{ item.cpeeCallbackError}}
-rate: {{ item.rate}}k/s
-</pre>
-                </td>
-                <td></td>
-            </tr>
-        </template>
-    </table>
+finishedAT: {{ item.finishedAT}}
+</pre></td>
+</tr>
+</template>
+</table>
 </div>
 
 <script type="application/javascript">
@@ -82,6 +85,14 @@ rate: {{ item.rate}}k/s
         },
         watch: {},
         methods: {
+            example1: function () {
+                this.$data.from='http://localhost:8082/zero?length=1000000';
+                this.$data.to='http://localhost:8082/null';
+            },
+            example2: function () {
+                this.$data.from='http://ftp.debian.org/debian/ls-lR.gz';
+                this.$data.to='http://localhost:8082/null';
+            },
             send: function (ts) {
                 let data = new URLSearchParams();
                 data.append('from', this.from);