imagesend.vue 19 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
<template>
   <div class="innnerBox">
    <div class="imagebox">
      <div class="stepbox">
        <el-col :span="20" :offset="2">
          <el-steps :active="active" finish-status="success">
            <el-step title="镜像准备"></el-step>
            <el-step title="下发配置"></el-step>
            <el-step title="流程检查"></el-step>
            <el-step title="下发进度"></el-step>
          </el-steps>
        </el-col>
      </div>
      <div class="settingbox">
        <div class="" v-show="active == 1">
          <el-table :data="tableData" tooltip-effect="dark" border ref="imagetable" style="width: 90%;margin:10px auto"  @select="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center">
            </el-table-column>
            <el-table-column prop="filename" align="center" label="镜像名称">
            </el-table-column>
            <el-table-column prop="type" align="center" label="应用类型">
            </el-table-column>
            <el-table-column prop="cname" align="center" label="发布厂家">
            </el-table-column>
            <el-table-column prop="version" align="center" label="版本号">
            </el-table-column>
            <el-table-column prop="create_dt" align="center" label="创建时间">
            </el-table-column>
          </el-table>
          <el-button style="margin: 12px 70px  0 0;float:right" @click="next" align="right">下一步</el-button>
        </div>
        <div class="" v-show="active == 2">
          <div class="sendboxtale">
            <el-tabs v-model="activeName">
              <el-tab-pane label="通用参数" name="first">
                <div class="thead">
                  <el-col :span="5" class="td"><span>参数名称</span></el-col>
                  <el-col :span="5" class="td"><span>参数类型</span></el-col>
                  <el-col :span="8" class="td"><span>参数值</span></el-col>
                  <el-col :span="6" class="td"><span>说明</span></el-col>
                </div>
                <div class="tbody">
                  <div class="trow">
                      <el-col :span="5" class="td"><span>LANGUAGE</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="language"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>英语/中文</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>appid</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="appid"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>应用ID</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>appname</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="appname"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>应用名称</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>apptype</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="apptype"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>应用类型</span></el-col>
                  </div>
                   <div class="trow">
                      <el-col :span="5" class="td"><span>appversion</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="appversion"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>应用版本</span></el-col>
                  </div>
                </div>
              </el-tab-pane>
              <el-tab-pane label="网络参数" name="second">
                <div class="thead">
                  <el-col :span="5" class="td"><span>参数名称</span></el-col>
                  <el-col :span="5" class="td"><span>参数类型</span></el-col>
                  <el-col :span="8" class="td"><span>参数值</span></el-col>
                  <el-col :span="6" class="td"><span>说明</span></el-col>
                </div>
                <div class="tbody">
                  <div class="trow">
                      <el-col :span="5" class="td"><span>Outer_Service_Vlanid</span></el-col>
                      <el-col :span="5" class="td"><span>整数</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="out_vid"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>Outer_Service_Vlanid</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>Outer_Service_IP</span></el-col>
                      <el-col :span="5" class="td"><span>IPV4</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="out_ip"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>Outer_Service_IP</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>Outer_Service_IPPool_Mask</span></el-col>
                      <el-col :span="5" class="td"><span>IPV4</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="out_ip_mask"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>Outer_Service_IPPool_Mask</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>Outer_Service_IPPool_Gateway</span></el-col>
                      <el-col :span="5" class="td"><span>IPV4</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="out_getway"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>Outer_Service_IPPool_Gateway</span></el-col>
                  </div>
                </div>
              </el-tab-pane>
              <el-tab-pane label="实例参数" name="third">
                <div class="thead">
                  <el-col :span="5" class="td"><span>参数名称</span></el-col>
                  <el-col :span="5" class="td"><span>参数类型</span></el-col>
                  <el-col :span="8" class="td"><span>参数值</span></el-col>
                  <el-col :span="6" class="td"><span>说明</span></el-col>
                </div>
                <div class="tbody">
                  <div class="trow">
                      <el-col :span="5" class="td"><span>VideoInsight_NUMBER</span></el-col>
                      <el-col :span="5" class="td"><span>整数</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="dockernumber" placeholder="最小值"></el-input></span>~<span><el-input v-model="dockernumbermax" placeholder="最大值"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>VideoInsight容器数量</span></el-col>
                  </div>
                </div>
              </el-tab-pane>
              <el-tab-pane label="VI 应用参数" name="fourth">
                        <div class="thead">
                  <el-col :span="5" class="td"><span>参数名称</span></el-col>
                  <el-col :span="5" class="td"><span>参数类型</span></el-col>
                  <el-col :span="8" class="td"><span>参数值</span></el-col>
                  <el-col :span="6" class="td"><span>说明</span></el-col>
                </div>
                <div class="tbody">
                  <div class="trow">
                      <el-col :span="5" class="td"><span>sysPassword</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="syspwd"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>系统密码</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>sysPassword1</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="syspwd1"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>系统密码确认</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>userPassword</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="userpwd"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>用户密码</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>userPassword1</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="userpwd1"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>用户密码确认</span></el-col>
                  </div>
                   <div class="trow">
                      <el-col :span="5" class="td"><span>tname</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="tname"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>tname</span></el-col>
                  </div>
                   <div class="trow">
                      <el-col :span="5" class="td"><span>tValidityPeriod</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="tValidityPeriod"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>tValidityPeriod</span></el-col>
                  </div>
                  <div class="trow">
                      <el-col :span="5" class="td"><span>certificatePassword</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="certificatePassword"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>证书密码</span></el-col>
                  </div>
                   <div class="trow">
                      <el-col :span="5" class="td"><span>keyLentgth</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="keyLentgth"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>keyLentgth</span></el-col>
                  </div>
                   <div class="trow">
                      <el-col :span="5" class="td"><span>vi_language</span></el-col>
                      <el-col :span="5" class="td"><span>字符串</span></el-col>
                      <el-col :span="8" class="td"><span><el-input v-model="vi_language"></el-input></span></el-col>
                      <el-col :span="6" class="td"><span>VI应用语言:0-英语,1-中文</span></el-col>
                  </div>
                </div>
              </el-tab-pane>
            </el-tabs>
          </div>
          <!-- <el-table :data="sendtable" tooltip-effect="dark" border ref="multipleTable" style="width: 90%;margin:10px auto" >
            <el-table-column prop="name" align="center" label="参数名称">
            </el-table-column>
            <el-table-column align="center" label="参数值">
              <template slot-scope="scope">
               <div v-if="scope.$index == 0">
                 <el-input v-model="dockernumber"></el-input>
               </div>
               <div v-if="scope.$index == 1">
                 <el-input v-model="dockername"></el-input>
               </div>
               <div v-if="scope.$index == 2">
                 <el-slider v-model="ziyuan"></el-slider>
               </div>
               <div v-if="scope.$index == 3"></div>
              </template>
            </el-table-column>
            <el-table-column prop="info" align="center" label="说明">
            </el-table-column>
          </el-table> -->
            <el-button style="margin: 12px 70px  0 0;float:right" @click="next" align="right">下一步</el-button>
            <el-button style="margin: 12px 10px 0 0;float:right" @click="prev" align="right">上一步</el-button>
        </div>
        <div class="" v-show="active == 3"  v-loading="loading" element-loading-text="流程检查中"  element-loading-background="rgba(0, 0, 0, 0.8)"  element-loading-spinner="el-icon-loading">
          <el-table :data="liuchengtable" tooltip-effect="dark" border ref="multipleTable" style="width: 90%;margin:10px auto" >
            <el-table-column type="index" align="center" label="序号">
            </el-table-column>
            <el-table-column prop="name" align="center" label="检查项">
            </el-table-column>
            <el-table-column  prop="status" align="center" label="状态">
              <template slot-scope="scope">
                <div>
                  <i v-if="scope.row.status == '1'" class="el-icon-warning warningcolor"></i> <i v-if="scope.row.status !== '1'" class="el-icon-warning successcolor" ></i>{{scope.row.status == '1'?"待检测":"通过"}}
                </div>
              </template>
            </el-table-column>
          </el-table>
          <el-button style="margin: 12px 70px  0 0;float:right" @click="next" align="right">下一步</el-button>
          <el-button style="margin: 12px 10px 0 0;float:right" @click="prev" align="right">上一步</el-button>
        </div>
        <div class="" v-show="active == 4">
         <el-table :data="jindutable" tooltip-effect="dark" border ref="multipleTable" style="width: 90%;margin:10px auto" >
            <el-table-column type="index" align="center" label="#">
            </el-table-column>
            <el-table-column prop="name" align="center" label="容器名称">
            </el-table-column>
            <el-table-column prop="info" align="center" label="进度">
              <template slot-scope="scope">
                <div>
                  <el-progress :percentage="scope.row.jindu" status="success"></el-progress>
                </div>
              </template>
            </el-table-column>
          </el-table>
          <el-button style="margin: 12px 70px;float:right" @click="saveImage" align="right">完成</el-button>
        </div>
        
      </div>
    </div>

  </div>
</template>
<script>
  export default {
    data() {
      return {
        active: 1,
        dockernumber:1,
        activeName:"first",
        dockername:"自动",
        dockernumbermax:"",
        loading:false,
        ziyuan:50,
        selectImage:[],
        sendtable:[{
          name:"创建数据量",
          info:"创建容器个数"
        },{
          name:"容器名称",
          info:"容器名称"
        },{
          name:"资源配置",
          info:"指定容器实际分配的硬件资源"
        },{
          name:"时间计划",
          info:"容器自动启停的时间计划"
        }],
        liuchengtable:[{
          name:"配置参数检查",
          status:"1"
        },{
          name:"容器镜像检查",
          status:"1",
        },{
          name:"网络检查",
          status:"1"
        },{
          name:"节点资源检查",
          status:"1"
        }],
        jindutable:[],
      };
    },

    methods: {
      next() {
        debugger
         if(this.selectImage.length < 1){
          this.$message({
            message: '请选择一个镜像',
            type: 'warning'
          });
           return false;
         } 
          if (this.active == 3){
            this.loading = true;
            setTimeout(()=>{
              this.loading = false;
              if(this.active == 3){
                if(this.dockernumber > 0) {
                  for(let i = 0; i < this.dockernumber; i++) {
                    let data = {
                      name:`GPU${this.$moment().format('HHmmss')}`,
                      ziyuan:`${this.ziyuan}%`,
                      jindu:80
                    }
                    // this.liuchengtable.push(data)
                    this.jindutable.push(data)
                  
                  }
                  this.selectImage.map(ele => {
                      ele.dockers =  this.jindutable;
                  })
                }
                this.active++
              }
            },2000)
            return false
          } 
          if (this.active++ > 3) this.active = 1;
      
      },
      prev(){
       if(this.active-- < 2) {
         this.active = 1
       } 
      },
      getImageData(){
         var tData = localStorage.getItem("imageData")?localStorage.getItem("imageData"):[];
         this.tableData = JSON.parse(tData)
      },
     handleSelectionChange(val){
       this.selectImage = val;
     },
     saveImage(){
       this.active = 1;
       this.tableData.map(ele => {
         this.selectImage.map(sel => {
           if (ele.filename == sel.filename) {
             ele = sel
           }
         })
       })
      let storeData = JSON.stringify( this.tableData);
      localStorage.setItem("imageData",storeData)
     },
    },
    mounted(){
      this.getImageData();
    }
  }
</script>

<style lang="stylus" scoped>
.imagebox{
  overflow hidden
}
.stepbox{
  width 100%
  overflow hidden
  margin-top 5vh
}
.settingbox{
  width 90%;
  margin 5vh auto;
  min-height 70vh
}
.sendboxtale{
  width 90%
  margin 0 auto;
  .thead{
    color #666
    border 1px solid #c0c0c0
    height 35px
    line-height 35px
    text-align:center
    span{
      display inline-block;
      width 100%
    }
    .td{
      border-right:1px solid #c0c0c0;
    }
    .td:last-child{
       border-right:0;
    }
  }
  .tbody .td{
    text-align:center
  }
 .tbody .td{
    border-right:1px solid #c0c0c0;
 }
  .tbody .td:last-child{
    border-right:0
  }
 .tbody span{
    display inline-block;
    height 35px
    line-height 35px
    color #666
 }
.tbody span:nth-child(2){
      padding 0 20px
    }
 .tbody {
     border 1px solid #c0c0c0
     overflow hidden
     border-top 0
 }
 .trow{
   border-bottom 1px solid #c0c0c0
   overflow hidden
 }
 .trow:last-child{
   border 0
 }
 .warningcolor{
   color #e6a23c!important
 }
 .successcolor{
   color #5c887a!important
 }
}
</style>