Browse Source

调整remote的相关信息

master
xyiege 4 months ago
parent
commit
0cbe4c8c26
  1. 12
      scagent/core/FileRpc.go
  2. 8
      vue/afvue/src/views/Sfilecompare.vue

12
scagent/core/FileRpc.go

@ -36,7 +36,7 @@ type ZipBlock struct {
Basepath string
Curpath string // 当前路径
SelFile []string // 选中的文件
RemoteIp string // 远程主机地址,带端口
RemoteAdr string // 远程主机地址,带端口
RemotePath string // 远程主机的存储路径
}
@ -135,14 +135,16 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error {
rest := <-taskId
// 如果压缩包生成成功以后再执行
if strings.EqualFold(strings.ToLower(rest), "arcok") {
// 返回压缩包名称
*reply = ziprl
// 合并为实际路径
remotePath := path.Join("/www/wwwroot", args.RemotePath, zpFileName)
// 发送文件到远程服务器上
err := clientUploadFile(args.RemoteIp, ziprl, args.RemotePath)
err := clientUploadFile(args.RemoteAdr, ziprl, remotePath)
if err != nil {
logger.Error("Compress", zap.String("msg", "上传文件到远程服务器失败"), zap.Error(err))
return err
return nil
}
// 返回压缩包名称
*reply = ziprl
}
return nil

8
vue/afvue/src/views/Sfilecompare.vue

@ -17,7 +17,7 @@
</div>
<div class="sflist">
<form @submit.prevent="submitForm" method="post" ref="fsform">
<form method="post" ref="fsform">
<ul>
<li v-for="(item, index) in fsclist" :key="item" :data-index="index">
<input type="checkbox" :value="item.path" class="sfchkbox" :name="'fsbox' + index" :ref="'fsbox' + index"/>
@ -86,7 +86,7 @@
<div class="fsend">
<div class="fsendcon">
<!-- 暂未想好放啥 -->
<button class="fbtn">同步选中的文件</button>
<button class="fbtn" @click="submitForm">同步选中的文件</button>
</div>
</div>
@ -329,7 +329,9 @@ export default {
let data = {
sfiles: this.selectedFiles,
serverip: this.$refs.fsip.value,
curpath: curpath
curpath: curpath,
remoteaddr: this.$refs.ssip.value,
remotepath: this.sspath,
}
// build to schema
const pdata = new URLSearchParams(data)

Loading…
Cancel
Save