Explorar el Código

Perfect translation / 完善翻译

star7th hace 4 años
padre
commit
3908fb0a46

+ 17 - 9
server/Application/Api/Controller/ItemVariableController.class.php

@@ -15,16 +15,24 @@ class ItemVariableController extends BaseController {
         if(!$this->checkItemPermn($uid , $item_id)){
             $this->sendError(10303);
             return ;
-        } 
-        $data = array() ;
-        $data['var_name'] = $var_name ;
-        $data['uid'] = $uid ;
-        $data['env_id'] = $env_id ;
-        $data['var_value'] = $var_value ;
-        $data['item_id'] = $item_id ;
-        $data['addtime'] = time() ;
+        }
+
+        $id = 0 ;
+        $res = D("ItemVariable")->where(" item_id = '{$item_id}' and env_id = '{$env_id}' and var_name = '%s'   " ,array($var_name) )->find() ;
+        if($res){
+            $id = $res['id'] ;
+            D("ItemVariable")->where(" id = '{$id}' ")->save(array("var_value"=>$var_value));
+        }else{
+            $data = array() ;
+            $data['var_name'] = $var_name ;
+            $data['uid'] = $uid ;
+            $data['var_value'] = $var_value ;
+            $data['item_id'] = $item_id ;
+            $data['env_id'] = $env_id ;
+            $data['addtime'] = time() ;
+            $id = D("ItemVariable")->add($data);
+        }
 
-        $id = D("ItemVariable")->add($data);
 
         if (!$id) {
             $this->sendError(10101);

+ 1 - 2
web_src/src/components/admin/Index.vue

@@ -107,8 +107,7 @@ body > .el-container {
 
 .header_title {
   float: left;
-  padding-right: 35px;
-  padding-left: 25px;
+  width: 150px;
   font-size: 20px;
   background-color: rgb(84, 92, 100);
   color: #fff;

+ 1 - 1
web_src/src/components/admin/attachment/Index.vue

@@ -21,7 +21,7 @@
         <el-button @click="onSubmit">{{ $t('search') }}</el-button>
       </el-form-item>
     </el-form>
-    <P>累计已使用 {{ used }}M 空间</P>
+    <P>{{ $t('used_space') }} {{ used }}M</P>
     <el-table :data="dataList" style="width: 100%">
       <el-table-column prop="file_id" :label="$t('file_id')"></el-table-column>
       <el-table-column

+ 1 - 1
web_src/src/components/admin/user/Index.vue

@@ -2,7 +2,7 @@
   <div class="hello">
     <el-form :inline="true" class="demo-form-inline">
       <el-form-item label>
-        <el-input v-model="username" placeholder="用户名"></el-input>
+        <el-input v-model="username" :placeholder="$t('username')"></el-input>
       </el-form-item>
       <el-form-item>
         <el-button @click="onSubmit">{{ $t('search') }}</el-button>

+ 3 - 1
web_src/static/lang/en.js

@@ -421,6 +421,8 @@ exports.default = {
   copy_or_mv_cat: 'Copy or move catalog',
   copy_to: 'Copy To',
   move_to: 'Move To',
-  remark: 'remark'
+  remark: 'remark',
+
+  used_space: 'Used pace'
 
 }

+ 3 - 1
web_src/static/lang/zh-CN.js

@@ -411,5 +411,7 @@ exports.default = {
   copy_or_mv_cat: '复制或移动目录',
   copy_to: '复制到',
   move_to: '移动到',
-  remark: '备注'
+  remark: '备注',
+
+  used_space: '已使用空间'
 }