mirror of
https://github.com/veops/oneterm.git
synced 2026-09-03 07:25:15 +08:00
Merge branch 'main' of github.com:veops/oneterm
This commit is contained in:
@@ -149,7 +149,7 @@ import { TARGET_SELECT_TYPE } from './constants.js'
|
||||
import { PERMISSION_TYPE_NAME, PERMISSION_TYPE } from '@/modules/oneterm/views/systemSettings/accessControl/constants.js'
|
||||
|
||||
import AuthDrawer from './authDrawer/index.vue'
|
||||
import EnabledStatus from '@/modules/oneterm/components/enabledStatus/index.vue'
|
||||
import EnabledStatus from '@/components/EnabledStatus/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'AccessAuth',
|
||||
|
||||
@@ -122,7 +122,7 @@ import { COMMAND_CATEGORY, COMMAND_CATEGORY_NAME, COMMAND_RISK_NAME } from '../c
|
||||
|
||||
import CommandModal from './commandModal.vue'
|
||||
import RiskDisplay from './riskDisplay.vue'
|
||||
import EnabledStatus from '@/modules/oneterm/components/enabledStatus/index.vue'
|
||||
import EnabledStatus from '@/components/EnabledStatus/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'CommandManagement',
|
||||
|
||||
@@ -112,7 +112,7 @@ import { getTimeTemplateList, deleteTimeTemplateById, putTimeTemplateById } from
|
||||
import { TIME_TEMPLATE_CATEGORY, TIME_TEMPLATE_CATEGORY_NAME } from './constants.js'
|
||||
|
||||
import TimeTemplateModal from './timeTemplateModal.vue'
|
||||
import EnabledStatus from '@/modules/oneterm/components/enabledStatus/index.vue'
|
||||
import EnabledStatus from '@/components/EnabledStatus/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'TimeTemplate',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div
|
||||
:class="[
|
||||
'oneterm-terminal-container',
|
||||
isFullScreen ? 'oneterm-terminal-full' : 'oneterm-terminal-panel'
|
||||
mode === 'FullScreen' ? 'oneterm-terminal-full' : 'oneterm-terminal-panel'
|
||||
]"
|
||||
:style="{
|
||||
backgroundColor: terminalBackground
|
||||
@@ -49,6 +49,10 @@ export default {
|
||||
FileManagementDrawer
|
||||
},
|
||||
props: {
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'FullScreen' // FullScreen | Asset | WebSSH
|
||||
},
|
||||
assetId: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
@@ -61,10 +65,6 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
isFullScreen: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
shareId: {
|
||||
type: String,
|
||||
default: ''
|
||||
@@ -192,7 +192,9 @@ export default {
|
||||
this.term.loadAddon(this.fitAddon)
|
||||
this.term.open(this.$refs.onetermTerminalRef)
|
||||
|
||||
this.term.writeln('\x1b[1;1;32mwelcome to oneterm!\x1b[0m')
|
||||
if (this.mode !== 'WebSSH') {
|
||||
this.term.writeln('\x1b[1;1;32mwelcome to oneterm!\x1b[0m')
|
||||
}
|
||||
|
||||
if (this?.initMessage?.length) {
|
||||
this.initMessage.map((msg) => {
|
||||
@@ -252,8 +254,10 @@ export default {
|
||||
const protocol = document.location.protocol.startsWith('https') ? 'wss' : 'ws'
|
||||
|
||||
let socketLink = ''
|
||||
if (this.mode === 'WebSSH') {
|
||||
socketLink = `${protocol}://${document.location.host}/api/oneterm/v1/connect/webssh`
|
||||
// audit page (online session, offline session)
|
||||
if (isMonitor) {
|
||||
} else if (isMonitor) {
|
||||
socketLink = `${protocol}://${document.location.host}/api/oneterm/v1/connect/monitor/${sessionId}?w=${this.term.cols}&h=${this.term.rows}`
|
||||
// share page (temporary link)
|
||||
} else if (this.shareId) {
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<div class="asset-list-sidebar-title-text">
|
||||
{{ $t('oneterm.assetList.assetTree') }}
|
||||
</div>
|
||||
|
||||
<a @click="openWebSSH">
|
||||
<ops-icon class="asset-list-sidebar-ssh" type="a-oneterm-ssh2"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a-input
|
||||
@@ -228,6 +232,10 @@ export default {
|
||||
|
||||
openRecentSession() {
|
||||
this.$emit('openRecentSession')
|
||||
},
|
||||
|
||||
openWebSSH() {
|
||||
this.$emit('openWebSSH')
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -262,6 +270,10 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
&-ssh {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&-search {
|
||||
margin-top: 18px;
|
||||
height: 26px;
|
||||
|
||||
@@ -3,6 +3,7 @@ export const WORKSTATION_TAB_TYPE = {
|
||||
TERMINAL: 'terminal',
|
||||
GUACAMOLE: 'guacamole',
|
||||
WEB: 'web',
|
||||
WEB_SSH: 'webSSH',
|
||||
DISPLAY_SETTING: 'displaySetting',
|
||||
THEME_SETTING: 'themeSetting',
|
||||
BATCH_EXECUTION: 'batchExecution'
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:userStat="userStat"
|
||||
:selectedKeys="selectedKeys"
|
||||
@updateSelectedKeys="updateSelectedKeys"
|
||||
@openWebSSH="openWebSSH"
|
||||
>
|
||||
<div
|
||||
:class="[
|
||||
@@ -91,16 +92,15 @@
|
||||
<TerminalPanel
|
||||
v-else-if="item.type === WORKSTATION_TAB_TYPE.TERMINAL"
|
||||
class="oneterm-workstation-panel"
|
||||
mode="asset"
|
||||
:ref="'workStationPanelRef' + item.id"
|
||||
:assetId="item.assetId"
|
||||
:accountId="item.accountId"
|
||||
:protocol="item.protocol"
|
||||
:assetPermissions="item.permissions"
|
||||
:isFullScreen="false"
|
||||
:preferenceSetting="preferenceSetting"
|
||||
@close="handleTerminalSocketStatus(item, SOCKET_STATUS.ERROR)"
|
||||
@open="handleTerminalSocketStatus(item, SOCKET_STATUS.SUCCESS)"
|
||||
@openSystemSetting="openSystemSetting"
|
||||
/>
|
||||
|
||||
<GuacamolePanel
|
||||
@@ -117,6 +117,16 @@
|
||||
@open="handleTerminalSocketStatus(item, SOCKET_STATUS.SUCCESS)"
|
||||
@updatePreferenceSetting="getPreference"
|
||||
/>
|
||||
|
||||
<TerminalPanel
|
||||
v-else-if="item.type === WORKSTATION_TAB_TYPE.WEB_SSH"
|
||||
class="oneterm-workstation-panel"
|
||||
mode="WebSSH"
|
||||
:ref="'workStationPanelRef' + item.id"
|
||||
:preferenceSetting="preferenceSetting"
|
||||
@close="handleTerminalSocketStatus(item, SOCKET_STATUS.ERROR)"
|
||||
@open="handleTerminalSocketStatus(item, SOCKET_STATUS.SUCCESS)"
|
||||
/>
|
||||
</a-tab-pane>
|
||||
</template>
|
||||
|
||||
@@ -494,6 +504,18 @@ export default {
|
||||
}).catch((error) => {
|
||||
this.$message.error(error?.response?.data?.error || this.$t('requestError'))
|
||||
})
|
||||
},
|
||||
|
||||
openWebSSH() {
|
||||
const id = uuidv4()
|
||||
|
||||
this.terminalList.push({
|
||||
socketStatus: SOCKET_STATUS.LOADING,
|
||||
id,
|
||||
name: 'WebSSH',
|
||||
type: WORKSTATION_TAB_TYPE.WEB_SSH
|
||||
})
|
||||
this.tabActiveKey = id
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user