Browse Source

显示相对路径

master
xyiege 5 months ago
parent
commit
64b0d31e16
  1. 2
      scagent/core/JsonRpc.go
  2. 61
      vue/afvue/src/views/Flist.vue

2
scagent/core/JsonRpc.go

@ -128,7 +128,7 @@ func scanFileUnderPath(rootDir string, scope string, logger *zap.Logger, replay
}
// 加入到列表
hash := util.CalacHash(realpath)
flplist.Flist = append(flplist.Flist, FloopJson{Path: filepath.Join(rootDir, file.Name()), Size: fsize, Hash: hash})
flplist.Flist = append(flplist.Flist, FloopJson{Path: file.Name(), Size: fsize, Hash: hash})
// allFiles = append(allFiles, filepath.Join(rootDir, file.Name()))
}

61
vue/afvue/src/views/Flist.vue

@ -1,9 +1,10 @@
<template>
<div>
<h1>文件浏览器</h1>
<div id="fexeplore">
<div class="wfbox">
<div class="wftit">
<input type="text" placeholder="请输入文件路径">
<div class="wfso">
<input class="wfinput" type="text" placeholder="请输入文件路径" v-model="srcpath">
<button class="wfbtn">GO</button>
</div>
<div class="fbox">
<div class="ftit">
@ -19,6 +20,13 @@
<span class="fcline">{{ item.hash }}</span>
</div>
</div>
<!-- 说明 -->
<div class="wdesc">
<p>说明默认监视目录为/www/wwwroot/</p>
<p>文件名称文件的名称包括文件的路径和文件名</p>
<p>文件大小文件的大小单位为字节B千字节KB兆字节MB</p>
<p>文件哈希文件的哈希值用于唯一标识文件的内容</p>
</div>
</div>
</div>
</template>
@ -56,6 +64,37 @@ export default {
h1 {
color: #333;
}
.wfbox{
padding:12px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.wfso{
padding-left: 20px;
}
.wfso .wfinput{
padding-left: 12px;
width: 90%;
height: 40px;
line-height: 40px;
border-bottom: 1px solid #ccc;
border-top: none;
border-left: none;
border-right: none;
}
.wfso .wfinput:focus{
/* border: none; */
outline: none;
}
.wfso .wfbtn{
width: 8%;
/* padding-left: 2%; */
height: 40px;
line-height: 40px;
border: none;
background-color: #007bff;
color: #fff;
}
.fbox{
width: 100%;
margin-top: 20px;
@ -75,13 +114,13 @@ export default {
}
.fbox span:first-child{
width: 40%;
width: 42%;
}
.fbox span:nth-child(2){
width: 20%;
}
.fbox span:nth-child(3){
width: 40%;
width: 38%;
/* background-color: #f6f6f6; */
font-size: 12px;
}
@ -94,4 +133,14 @@ export default {
border-bottom: 1px solid #ccc;
float: left;
}
.fcon:hover{
background-color: #c4bcbc;
cursor: default;
}
.wdesc{
padding-left: 12px;
margin-top: 20px;
color: #ccc;
font-size: 12px;
}
</style>
Loading…
Cancel
Save