Pārlūkot izejas kodu

pdate mechanism (incomplete) / 软件更新机制(未完成)

star7th 4 gadi atpakaļ
vecāks
revīzija
b4103f6b2b

+ 23 - 0
server/Application/Api/Controller/AdminUpdateController.class.php

@@ -0,0 +1,23 @@
+<?php
+namespace Api\Controller;
+use Think\Controller;
+class AdminUpdateController extends BaseController {
+
+    // 下载更新代码包
+    // 未完成。此方式下载代码包不行
+    public function dowmload(){
+        return ;
+        set_time_limit(1200);
+        ignore_user_abort(1);
+        $url = 'https://github.com/star7th/showdoc/archive/master.tar.gz';
+        $file = './master.tar.gz';
+
+        $file_content = file_get_contents($url);
+        var_dump($file_content);
+        curl_close($ch);
+        $downloaded_file = fopen($file, 'w');
+        fwrite($downloaded_file, $file_content);
+        fclose($downloaded_file);
+    }
+
+}

+ 14 - 3
web_src/src/components/admin/Index.vue

@@ -33,6 +33,14 @@
               <i class="el-icon-tickets"></i>
               <span slot="title">{{ $t('web_setting') }}</span>
             </el-menu-item>
+            <el-menu-item index="6" v-if="isUpdate">
+              <i class="el-icon-tickets"></i>
+              <span slot="title"
+                ><el-badge value="new"
+                  >{{ $t('system_update') }}
+                </el-badge></span
+              >
+            </el-menu-item>
           </el-menu>
         </el-aside>
         <el-container>
@@ -41,6 +49,7 @@
             <Item v-if="open_menu_index == 2"></Item>
             <Setting v-if="open_menu_index == 3"></Setting>
             <Attachment v-if="open_menu_index == 5"></Attachment>
+            <SystemUpdate v-if="open_menu_index == 6"></SystemUpdate>
           </el-main>
           <el-footer>
             <!-- something -->
@@ -121,18 +130,20 @@ import Item from '@/components/admin/item/Index'
 import User from '@/components/admin/user/Index'
 import Setting from '@/components/admin/setting/Index'
 import Attachment from '@/components/admin/attachment/Index'
-
+import SystemUpdate from '@/components/admin/systemUpdate/Index'
 export default {
   data() {
     return {
-      open_menu_index: 1
+      open_menu_index: 1,
+      isUpdate: false
     }
   },
   components: {
     Item,
     User,
     Setting,
-    Attachment
+    Attachment,
+    SystemUpdate
   },
   methods: {
     select_menu(index, indexPath) {

+ 19 - 0
web_src/src/components/admin/systemUpdate/Index.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="hello"></div>
+</template>
+
+<style scoped></style>
+
+<script>
+import axios from 'axios'
+export default {
+  data() {
+    return {
+      new: false
+    }
+  },
+  methods: {},
+  mounted() {},
+  beforeDestroy() {}
+}
+</script>

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

@@ -425,6 +425,8 @@ exports.default = {
 
   qcloud: 'qcloud',
   binding_item: 'Binding item',
-  addtime: 'addtime'
+  addtime: 'addtime',
+
+  system_update: 'System update'
 
 }

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

@@ -415,5 +415,7 @@ exports.default = {
 
   qcloud: '腾讯云',
   binding_item: '绑定项目',
-  addtime: '添加时间'
+  addtime: '添加时间',
+
+  system_update: '系统更新'
 }