提交 fa31ac65 编写于 作者: E Eugene Pankov

sftp - show size and date - fixes #4001

上级 907ebc0f
......@@ -51,6 +51,7 @@
"devDependencies": {
"@types/mz": "2.7.3",
"@types/node": "15.12.1",
"ngx-filesize": "^2.0.16",
"node-abi": "^2.30.0",
"source-map-support": "^0.5.19"
},
......
......@@ -1056,6 +1056,11 @@ file-uri-to-path@1.0.0:
resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz"
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
"filesize@>= 4.0.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/filesize/-/filesize-6.3.0.tgz#dff53cfb3f104c9e422f346d53be8dbcc971bf11"
integrity sha512-ytx0ruGpDHKWVoiui6+BY/QMNngtDQ/pJaFwfBpQif0J63+E8DLdFyqS3NkKQn7vIruUEpoGD9JUJSg7Kp+I0g==
find-npm-prefix@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz#8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf"
......@@ -2100,6 +2105,14 @@ native-process-working-directory@^1.0.2:
dependencies:
node-addon-api "^3.1.0"
ngx-filesize@^2.0.16:
version "2.0.16"
resolved "https://registry.yarnpkg.com/ngx-filesize/-/ngx-filesize-2.0.16.tgz#fdaba04170edb6cfcdf7be932783cf913b03f016"
integrity sha512-VdaCirE7hSyfQh8ZEmhzNEhbddiTYUHF4V6OX+KyTmnQSVx4hp9kmzDX5YlkIlmClI6wI+LZmH9/q7XS3fsMPA==
dependencies:
filesize ">= 4.0.0"
tslib "^2.0.0"
ngx-toastr@^14.0.0:
version "14.0.0"
resolved "https://registry.yarnpkg.com/ngx-toastr/-/ngx-toastr-14.0.0.tgz#20e4737ef330b892a453768cd98b980558aeb286"
......
......@@ -148,6 +148,7 @@ export interface SFTPFile {
isSymlink: boolean
mode: number
size: number
modified: Date
}
export class SFTPFileHandle {
......@@ -223,6 +224,7 @@ export class SFTPSession {
isSymlink: stats.isSymbolicLink(),
mode: stats.mode,
size: stats.size,
modified: new Date(stats.mtime * 1000),
}
}
......@@ -247,6 +249,7 @@ export class SFTPSession {
isSymlink: (entry.attrs.mode & C.S_IFLNK) === C.S_IFLNK,
mode: entry.attrs.mode,
size: entry.attrs.size,
modified: new Date(entry.attrs.mtime * 1000),
}
}
}
......
......@@ -31,4 +31,6 @@
i.fa-fw([class]='getIcon(item)')
div {{item.name}}
.mr-auto
.size(*ngIf='!item.isDirectory') {{item.size|filesize}}
.date {{item.modified|date:'medium'}}
.mode {{getModeString(item)}}
......@@ -32,10 +32,20 @@
font-weight: bold;
}
.mode {
.mode, .size, .date {
font-family: monospace;
opacity: .5;
font-size: 12px;
text-align: right;
margin-left: 20px;
}
.size {
width: 100px;
}
.date {
width: 200px;
}
}
......
......@@ -3,6 +3,7 @@ import { CommonModule } from '@angular/common'
import { FormsModule } from '@angular/forms'
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
import { ToastrModule } from 'ngx-toastr'
import { NgxFilesizeModule } from 'ngx-filesize'
import TerminusCoreModule, { ToolbarButtonProvider, ConfigProvider, TabRecoveryProvider, HotkeyProvider, TabContextMenuItemProvider, CLIHandler } from 'terminus-core'
import { SettingsTabProvider } from 'terminus-settings'
import TerminusTerminalModule from 'terminus-terminal'
......@@ -28,6 +29,7 @@ import { SSHCLIHandler } from './cli'
@NgModule({
imports: [
NgbModule,
NgxFilesizeModule,
CommonModule,
FormsModule,
ToastrModule,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册