Skip to content

Commit 086557f

Browse files
committed
feat: add selectCloudWatchLogGroup and selectCloudWatchLogStream
1 parent f74a676 commit 086557f

9 files changed

Lines changed: 590 additions & 71 deletions

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
},
6262
"dependencies": {
6363
"@aws-sdk/client-ec2": "^3.499.0",
64+
"@aws-sdk/client-cloudwatch-logs": "^3.499.0",
6465
"@babel/runtime": "^7.18.6",
6566
"async-autocomplete-cli": "^1.0.0",
6667
"chalk": "^4.0.0",

pnpm-lock.yaml

Lines changed: 147 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/column.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import stripAnsi from 'strip-ansi'
2+
3+
export function column(
4+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5+
value: any,
6+
length: number
7+
): string {
8+
value = String(value ?? '').padEnd(length)
9+
return stripAnsi(value).length > length
10+
? `${value.substring(0, length - 3)}...`
11+
: value
12+
}

src/formatDate.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function datePart(part: number, length = 2): string {
2+
return String(part).padStart(length, '0')
3+
}
4+
5+
export function formatDate(date: Date | null | undefined): string {
6+
if (!date) return ''
7+
const y = date.getFullYear()
8+
const M = date.getMonth() + 1
9+
const d = date.getDate()
10+
const h = date.getHours()
11+
const m = date.getMinutes()
12+
return `${datePart(y)}/${datePart(M)}/${datePart(d)} ${datePart(
13+
h
14+
)}:${datePart(m)}`
15+
}

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
export { default as selectEC2Instance } from './selectEC2Instance'
22
export { default as selectEBSSnapshot } from './selectEBSSnapshot'
3+
export { default as selectCloudWatchLogGroup } from './selectCloudWatchLogGroup'
4+
export { default as selectCloudWatchLogStream } from './selectCloudWatchLogStream'

0 commit comments

Comments
 (0)