Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
KubePi
Commits
64ecc0c0
Commit
64ecc0c0
authored
3 years ago
by
wangzhengkun
Browse files
Options
Download
Email Patches
Plain Diff
feat: 修改 ls 命令
parent
2669bdf6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
pkg/util/podtool/file.go
+1
-0
pkg/util/podtool/file.go
pkg/util/podtool/ls.go
+5
-10
pkg/util/podtool/ls.go
web/dashboard/src/business/workloads/pods/podfilebrowser/index.vue
+8
-1
...oard/src/business/workloads/pods/podfilebrowser/index.vue
web/dashboard/src/i18n/lang/en-US.js
+1
-1
web/dashboard/src/i18n/lang/en-US.js
web/dashboard/src/i18n/lang/zh-CN.js
+1
-1
web/dashboard/src/i18n/lang/zh-CN.js
with
16 additions
and
13 deletions
+16
-13
pkg/util/podtool/file.go
+
1
-
0
View file @
64ecc0c0
...
...
@@ -9,4 +9,5 @@ type File struct {
User
string
`json:"user"`
UserGroup
string
`json:"group"`
Link
string
`json:"link"`
Path
string
`json:"path"`
}
This diff is collapsed.
Click to expand it.
pkg/util/podtool/ls.go
+
5
-
10
View file @
64ecc0c0
...
...
@@ -4,7 +4,7 @@ import "strings"
func
(
p
*
PodTool
)
ListFiles
(
path
string
)
([]
File
,
error
)
{
var
files
[]
File
commands
:=
[]
string
{
"ls"
,
"-l
F
"
,
"--full-time"
,
path
}
commands
:=
[]
string
{
"ls"
,
"-l"
,
"--full-time"
,
path
}
res
,
err
:=
p
.
ExecCommand
(
commands
)
if
err
!=
nil
{
...
...
@@ -28,18 +28,13 @@ func (p *PodTool) ListFiles(path string) ([]File, error) {
UserGroup
:
fArray
[
3
],
}
name
:=
fArray
[
8
]
if
strings
.
HasPrefix
(
fArray
[
0
],
"l"
)
&&
len
(
fArray
)
>
10
{
f
.
IsDir
=
strings
.
HasSuffix
(
fArray
[
10
],
"/"
)
f
.
Link
=
strings
.
Replace
(
fArray
[
10
],
"/"
,
""
,
1
)
if
strings
.
HasPrefix
(
f
.
Mode
,
"l"
)
&&
len
(
fArray
)
>
10
{
f
.
Link
=
fArray
[
10
]
}
if
strings
.
Has
Suf
fix
(
nam
e
,
"
/
"
)
{
if
strings
.
Has
Pre
fix
(
f
.
Mod
e
,
"
d
"
)
{
f
.
IsDir
=
true
name
=
strings
.
Replace
(
name
,
"/"
,
""
,
1
)
}
if
strings
.
HasSuffix
(
name
,
"*"
)
{
name
=
strings
.
Replace
(
name
,
"*"
,
""
,
1
)
}
f
.
Name
=
name
files
=
append
(
files
,
f
)
}
...
...
This diff is collapsed.
Click to expand it.
web/dashboard/src/business/workloads/pods/podfilebrowser/index.vue
+
8
-
1
View file @
64ecc0c0
...
...
@@ -197,7 +197,7 @@ export default {
handleClick
(
btn
,
row
)
{
switch
(
btn
)
{
case
"
edit
"
:
this
.
ile
(
row
)
this
.
catF
ile
(
row
)
break
case
"
delete
"
:
this
.
folderDelete
(
row
.
name
)
...
...
@@ -303,6 +303,13 @@ export default {
return
this
.
folder
+
"
/
"
+
name
}
},
getLinkPath
(
row
){
if
(
row
.
link
!==
""
)
{
return
row
.
path
}
else
{
return
this
.
getPath
(
row
.
name
)
}
},
folderCreate
()
{
this
.
$refs
[
"
folderForm
"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
...
...
This diff is collapsed.
Click to expand it.
web/dashboard/src/i18n/lang/en-US.js
+
1
-
1
View file @
64ecc0c0
...
...
@@ -109,7 +109,7 @@ const message = {
create_failed
:
"
Created failed
"
,
sync_success
:
"
Sync successfully
"
,
upload_success
:
"
Upload successfully
"
,
change_to_download
:
"
The file is over 1
0
M. Opening it directly will cause browser lag. Should I download it?
"
,
change_to_download
:
"
The file is over 1M. Opening it directly will cause browser lag. Should I download it?
"
,
},
confirm_message
:
{
delete
:
"
This operation cannot be undone, do you want to continue?
"
,
...
...
This diff is collapsed.
Click to expand it.
web/dashboard/src/i18n/lang/zh-CN.js
+
1
-
1
View file @
64ecc0c0
...
...
@@ -116,7 +116,7 @@ const message = {
back_form
:
"
返回表单编辑不会保留对 YAML 做出的所有更改
"
,
open_yaml
:
"
,仍要打开 YAML 编辑?
"
,
rollback
:
"
此操作将回滚当前 deployment 到改版本,是否继续?
"
,
change_to_download
:
"
该文件超过 1
0
M,直接打开将导致浏览器卡顿,是否下载?
"
,
change_to_download
:
"
该文件超过 1M,直接打开将导致浏览器卡顿,是否下载?
"
,
},
login
:
{
username
:
"
用户名
"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment