refactor: host

This commit is contained in:
xiaojunnuo
2021-02-07 23:17:44 +08:00
parent 2a07442a85
commit cfb1034450
17 changed files with 400 additions and 385 deletions

View File

@@ -13,7 +13,10 @@ export class HostShellExecute extends AbstractHostPlugin {
label: '执行远程主机脚本命令',
input: {
script: {
label: 'shell脚本命令'
label: 'shell脚本命令',
component: {
name: 'a-textarea'
}
},
accessProvider: {
label: '主机登录配置',
@@ -21,7 +24,7 @@ export class HostShellExecute extends AbstractHostPlugin {
desc: '登录',
component: {
name: 'access-provider-selector',
filter: 'host'
filter: 'ssh'
},
required: true
}

View File

@@ -1,6 +1,7 @@
import ssh2 from 'ssh2'
import logger from '../utils/util.log.js'
import path from 'path'
import { util } from '@certd/api'
const logger = util.logger
export class SshClient {
/**
*

View File

@@ -13,10 +13,10 @@ export class UploadCertToHost extends AbstractHostPlugin {
label: '上传证书到主机',
input: {
crtPath: {
label: '证书路径'
label: '证书保存路径'
},
keyPath: {
label: '私钥路径'
label: '私钥保存路径'
},
accessProvider: {
label: '主机登录配置',
@@ -24,7 +24,7 @@ export class UploadCertToHost extends AbstractHostPlugin {
desc: 'access授权',
component: {
name: 'access-provider-selector',
filter: 'host'
filter: 'ssh'
},
required: true
}

View File

@@ -9,6 +9,10 @@ import { DeployCertToTencentCDN } from './tencent/deploy-to-cdn/index.js'
import { DeployCertToTencentCLB } from './tencent/deploy-to-clb/index.js'
import { DeployCertToTencentTKEIngress } from './tencent/deploy-to-tke-ingress/index.js'
import { UploadCertToHost } from './host/upload-to-host/index.js'
import { HostShellExecute } from './host/host-shell-execute/index.js'
import { pluginRegistry } from '@certd/api'
export const DefaultPlugins = {
@@ -17,7 +21,9 @@ export const DefaultPlugins = {
UploadCertToTencent,
DeployCertToTencentTKEIngress,
DeployCertToTencentCDN,
DeployCertToTencentCLB
DeployCertToTencentCLB,
UploadCertToHost,
HostShellExecute
}
export default {
install () {

View File

@@ -1,4 +1,3 @@
import dayjs from 'dayjs'
import tencentcloud from 'tencentcloud-sdk-nodejs'
import { AbstractTencentPlugin } from '../abstract-tencent.js'