<template>
    <div class="app-container">
        <el-form :model="capacityForm"
            ref="capacityForm"
            size="small" :inline="true"
            label-width="100px">

            <el-form-item label="日志容量配置" prop="logCapacity">
                <el-input
                    v-model="capacityForm.logCapacity"
                    placeholder="请输入关键字"
                    clearable
                    style="width: 240px"
                />
                <span style="margin-left: 10px;">GB</span>
            </el-form-item>


            <el-button type="primary" size="mini" style="margin-left: 20px;" @click="submit" v-hasPermi="['logsSet:log:set']">确定</el-button
          >
        </el-form>
    </div>
  </template>

  <script>
  import { getLogSize,updateLogSize } from '@/api/system/log'
  export default {
    data() {
      return {
        capacityForm:{
            logCapacity:1024
        }
      }
    },
    created() {
      this.getSize()
    },
    methods: {
      getSize(){
        getLogSize().then((response) => {
          this.capacityForm.logCapacity = response.data;
        })
      },
      submit(){
        let params={
          capacity: this.capacityForm.logCapacity
        }
       updateLogSize(params).then(response => {
                if(response.code==200){
                  this.$message({
                    showClose: true,
                    message: response.msg,
                    type: 'success',
                    duration: 2000
                  })
                }
              })
      },


    }
  }
  </script>
