From dae60f00ff56acd4a57c750ad342a85a7a5d835c Mon Sep 17 00:00:00 2001
From: LeoQi <QibinZheng2014@tongji.edu.cn>
Date: Fri, 20 Jul 2018 02:58:47 +0800
Subject: the environment page in frontend of testing-scheduler

JIRA: BOTTLENECK-238

the environment page provides configuration setting operations.

Change-Id: I79f93bfc0c66c37a3f58d042669cbb61d3bad848
Signed-off-by: Zheng Qibin <QibinZheng2014@tongji.edu.cn>
---
 .../ui/src/components/env_component/api_param.vue  | 63 ++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 testing-scheduler/ui/src/components/env_component/api_param.vue

(limited to 'testing-scheduler/ui/src/components/env_component/api_param.vue')

diff --git a/testing-scheduler/ui/src/components/env_component/api_param.vue b/testing-scheduler/ui/src/components/env_component/api_param.vue
new file mode 100644
index 00000000..300b6a48
--- /dev/null
+++ b/testing-scheduler/ui/src/components/env_component/api_param.vue
@@ -0,0 +1,63 @@
+<template>
+    <div class="row">
+         <div class="form-group">
+            <label class="col-lg-3 control-label">Params</label>
+            <div class="col-lg-2">
+                <button type="button" class="btn btn-primary btn-sm" v-on:click="addNewParam()">New</button>
+            </div>
+         </div>
+         <div class="form-group">
+            <div class="col-lg-offset-2 col-lg-8">
+                <div class="table-responsive">
+                 <table class="table table-bordered text-center">
+                    <thead>
+                        <tr>
+                            <th>name</th>
+                            <th class="text-center">description</th>
+                            <th class="text-center">operation</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr v-for="param in params">
+                            <td><input type="text" class="form-control text-center" style="border: 0px" v-model="param['name']"></td>
+                            <td><input type="text" class="form-control text-center" style="border: 0px" v-bind:title="param['description']" v-model="param['description']"></td>
+                            <td>
+                                <button type="button" class="btn btn-white" v-on:click="deleteParam(param['name'])">
+                                    <i class="fa fa-trash"></i>
+                                </button>
+                            </td>
+                        </tr>
+                    </tbody>
+                 </table>
+                </div>
+             </div>
+          </div>
+     </div>
+</template>
+<script>
+export default {
+    props: ["params"],
+    data: function() {
+        return {
+            paramArr: this.params
+        }
+    },
+    watch: {
+        paramArr: function(){
+            this.$emit("params", this.paramArr);
+        }
+    },
+    methods: {
+        addNewParam: function() {
+            this.params.push({'name': '', 'description': ''});
+        },
+        deleteParam: function(paramName) {
+            for(var i = 0;i < this.params.length; i++) {
+                if(paramName == this.params[i]['name']) {
+                    this.params.splice(i, 1);
+                }
+            }
+        }
+    }
+}
+</script>
\ No newline at end of file
-- 
cgit 1.2.3-korg

