mirror of
https://github.com/jumpserver/lina.git
synced 2025-05-04 22:26:40 +00:00
* feat: 资产选择优化 * perf: 修改用户列表显示字段 * perf: 修改 改密 收集账号名字 * perf: 添加AssetTreeTable组件;资产列表、资产选择、资产账号、资产授权使用AssetTreeTable组件 * perf: 修改资产列表 tab * perf: 修改路径 * perf: 修改 tree * perf: 修改 tab icon * fix: 修复资产列表点击创建按钮页面空白问题 * feat: 支持超时时间设置 * perf: 改密去除tab * perf: table column添加属性showFullContent: 折行显示全部内容 * perf: 添加 account push * perf: 修改 asset select padding * perf: 账号收集 * feat: terminal 页面增加padding * perf: account list source * perf: AssetTreeTable配置默认不显示右键菜单 * perf: 修改账号 * fix: 修复用户登录规则动作是审批时没有显示审批人选项 * refactor: 修改列表显示字段1 (#2309) * refactor: 修改列表显示字段(用户组列表) * refactor: 修改列表显示字段(角色列表) * perf: 修改列表显示字段(资产列表); 修改DataTable showOverflowTooltip 参数默认为 true; 优化 ArrayFormatter 组件, 支持传递 delimiter 参数; * perf: 修改列表显示字段(主机列表、网络设备、数据库、云服务、Web) * perf: 修改列表字段显示(云同步,同步实例任务列表,云账号列表) * perf: 修改列表字段显示(网域列表,网关列表) * perf: 修改列表字段显示(平台列表) * perf: 修改列表字段显示(标签列表) * perf: 修改 SyncInstanceTask 组件; 删除 GatheredUserList.vue 页面; Co-authored-by: Bai <baijiangjie@gmail.com> * feat: 修复一些页面上的问题 * fix: 修复资产详情协议修改端口不生效问题 * perf: 用户组详情不显示授权的资产 * fix: 修复账号收集详情key相同控制台报错问题 * fix: 修复显示密码组件样式布局问题 * feat: 增加 terminal 滚动控制和清屏按钮 * feat: 增加 terminal 滚动控制和清屏按钮 * perf: 调整terminal 按钮样式 * feat: 优化detail 字段 * perf: 资产批量更新去掉特权用户 * feat: 修改按钮样式 * fix: 修复节点选择错误的问题 * perf: 修改账号推送 * perf: 优化列表显示字段2 (#2322) * perf: 优化表格字段允许显示 ID 列 * perf: 修改列表字段显示(账号列表) * perf: 修改列表字段显示(账号模版) * perf: 修改列表字段显示(收集账号) * perf: 修改列表字段显示(账号改密) * perf: 修改列表字段显示(账号备份) * perf: 修改列表字段显示(授权列表) * perf: 修改列表字段显示(授权详情页面-用户/用户组,资产/节点,授权账号) * perf: 修改权限位 * perf: 修改账号地址 * feat: 防止xss攻击;可以自定义配置xss * perf: 修改账号 * perf: 修改列表字段显示(资产登录ACL, 命令过滤ACL) * perf: 优化xss过滤规则判断 * fix: 远程应用修改操作选项 * perf: 修改对应权限位 各种 * perf: 修改账号 * perf: 优化TreeTable组件布局 * perf: 远程应用不进入详情页 * perf: 修改列表字段显示(命令过滤, 命令组) * perf: 修改列表字段显示(用户详情, 授权的资产, 资产授权规则, 用户登录规则) * perf: 修改列表字段显示(任务列表,任务执行历史列表) * perf: 上传远程应用接口报错时给出提示 * perf: 修改 applet host * perf: 修改 accounts 添加 * feat: ops增加rbac * perf: 修改 assets 结构 * perf: 修改列表字段显示(会话列表, 在线会话, 历史会话) * perf: 修改列表字段显示(命令列表) * perf: 修改列表字段显示(文件传输) * perf: 修改列表字段显示(登录日志,操作日志,改密日志,作业日志) * perf: 优化PageHeading组件标题对齐 * perf: 修改列表字段显示(工作台,概览,我的资产,作业中心,作业管理,模版管理,执行历史) * perf: 修改翻译 * perf: 修改 tag search * fix: 修复账号改密更新、克隆页面空白问题 * perf: 修改列表字段显示(系统设置,终端列表,命令存储,录像存储,终端端点,终端规则) * perf: 修改列表字段显示(工单管理,我的申请,待我审批,流程设置) * perf: 修改列表字段显示(个人信息,API Key,连接令牌) * perf: 修改列表字段显示(远程应用,应用发布机) * perf: 修改 tableConfig 字段 excludes -> columnsExclude, extraColumns -> columnsExtra * perf: 修改 ConnectionToken 组件 * perf: 修改 AutoDataTable 组件 * perf: 修改 AssetAclCreateUpdate 组件 reviewers 字段 * feat: 修改字段 * perf: 优化table组件表头高度对齐 * fix: 修复资产列表-所有列表不能导入问题 * perf: 我的资产收藏资产添加提示 * feat: 修改列顺序 * perf: automation * merge: v3 * perf: 修改账号自创建 * perf: 快捷命令select组件筛选功能 * perf: select参数兼容 * feat: 修改选择用户样式 * perf: 修改账号自动化路由 * perf: 修改 form json editor * perf: account gather 翻译 * fix: 修复平台列表上传功能 * feat: 支持账号、资产在详情页查看活动(Activities)时间线 * fix: 修复 powershell 不能选择问题 * fix: 修复 powershell 不能选择问题 * perf: 优化云资产同步 * perf: account 翻译 * fix: 修复账号列表导出报错问题 * fix: 修复账号列表测试功能权限位 * fix: 修复角色列表权限位不准确问题 * feat: 增加快捷命令页面刷新后续接功能 * fix: 应用发布机的测试 * fix: 修复账号列表不能批量删除问题 * perf: 修改 form tree * perf: account 翻译 * fix: 修复资产树组件搜索后关闭搜索框无法显示搜索框问题 * perf: 移除发布机和应用的导入导出 * perf: 树组件关闭按钮增加刷新树功能 * fix: 修复资产树显示当前节点资产报错问题 * perf: 优化资产树组件关闭按钮执行事件顺序 * perf: upload applet and reload table list * perf: 优化显示发布机的远程应用 * perf: 修改 settings 组织 * perf: 系统设置-远程应用详情资产不能跳转 * perf: 修改 applet status * perf: 修改 applet status * perf: account * perf: account backup * perf: verify code ttl * perf: 修改菜单 * perf: 修改网关创建 * perf: asset ping api * perf: 再次优化 menu * perf: 优化菜单 * perf: menu 去掉一下 css * perf: 资产创建、更新标签支持自定义输入创建 * perf: 修改 gateway * perf: account change secret * fix: 修复资产详情标签不显示问题 * perf: 修改 accounts 路由 * perf: gateway test perm * fix: 修复账号备份-创建、更新、删除跳转到空白页面问题 * fix: 修复账号收集创建、删除后跳转到空白页面问题 * perf: 修改 choices formattor * fix: 修改资产详情页面字段 spec_info * fix: 修复资产详情-授权用户-查看授权字段显示不全问题 * fix: 修复工作台列表字段显示 * perf: gateways * feat: ops 修改一些交互细节 * feat: 删除模版执行的功能 * perf: 修改 endpoint 端口监听 * perf: gateway ui * perf: 优化字段显示 * feat: 支持资源用户在详情页查看活动(Activities)时间线 * perf: 细化权限 * fix: 修改审计日志列 * Merge remote-tracking branch 'origin/v3' into v3 # Conflicts: # src/views/assets/Domain/DomainDetail/GatewayList.vue * perf: 控制台仪表盘资产类型占比取消hover效果 * perf: gateway * fix: 修改工单详情 type.value 参数 * perf: gateway dialog * perf: 优化ProtoSelector组件逻辑 * fix: 修改 terminal 颜色,修复文字被背景色覆盖的问题 * feat: 增加检测命令长度 * fix: 修复账号收集-执行列表详情报错问题 * fix: 修复资产列表-数据库克隆没有协议问题 * perf: push_account_enabled * fix: 修复资产授权详情用户、资产不能删除问题 * feat: Redis/MongoDB 支持SSL * perf: push account * fix: 修复命令过滤-命令组克隆页面跳转不准确问题 * fix: 修改授权规则列表过滤字段 asset_name,node_name; * fix: 修复测试连接报错问题 * perf: account platform * perf: 调整平台详情展示字段 * perf: account push * fix: 修复detail 详情页面 404 * pref: 修改 assets 布局 * pref: 去掉页面滚动 * pref: 暂时修改 choice left align * perf: account template access_key * perf: 优化activity记录都保存至operatelog中 * perf: 优化页面布局 * perf: asset add account template * fix: 修复table搜索项重复问题 * perf: 账号收集详情 * pref: table - * perf: 创建资产-模版添加列表增加刷新按钮 * fix: 修复任务列表操作内容显示 * perf: 先去掉自动创建 * perf: change secret * perf: 优化账号列表资产树数量按照账号进行计算 * perf: account change secret * pref: 修改 select hover 效果 * pref: 去掉视图 icon * perf: executed amount * pref: 修改 set pre org,避免回到 system * perf: 创建资产-创建账号模版弹窗显示 * perf: account task 修改 * perf: account trigger * perf: user reset password * fix: 修复平台克隆失败问题 * fix: 修复资产授权批量更新报错问题 * perf: 优化账号列表资产树数量按照账号进行计算增加默认值 asset * fix: 修复用户详情-资产授权规则跳转页面报错问题 * perf: 资产树-类型树关闭搜索功能 * fix: 修复执行窗口有空白问题 * fix: 修复账号改密详情权限不准确问题 * fix: 文件传输列表不显示操作 Co-authored-by: Aaron3S <chenyang@fit2cloud.com> Co-authored-by: Bai <baijiangjie@gmail.com> Co-authored-by: feng <1304903146@qq.com> Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com> Co-authored-by: “huailei000” <2280131253@qq.com> Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: Jiangjie.Bai <bugatti_it@163.com> Co-authored-by: jiangweidong <weidong.jiang@fit2cloud.com> Co-authored-by: Eric <xplzv@126.com> Co-authored-by: huailei <31801270+huailei000@users.noreply.github.com>
220 lines
5.2 KiB
Vue
220 lines
5.2 KiB
Vue
<template>
|
||
<div :class="showSetting ? 'show-setting' : 'hide-setting'">
|
||
<div v-for="(item, index) in items" :key="item.name" style="display: flex;margin-top: 8px;">
|
||
<el-input v-model="item.port" :placeholder="portPlaceholder" class="input-with-select" v-bind="$attrs">
|
||
<el-select
|
||
slot="prepend"
|
||
v-model="item.name"
|
||
:disabled="cannotDelete(item)"
|
||
class="prepend"
|
||
@change="handleProtocolChange($event, item)"
|
||
>
|
||
<el-option v-for="p of remainProtocols" :key="p.name" :label="p.name" :value="p.name" />
|
||
</el-select>
|
||
<el-button
|
||
v-if="showSetting(item)"
|
||
slot="append"
|
||
icon="el-icon-setting"
|
||
@click="onSettingClick(item)"
|
||
/>
|
||
</el-input>
|
||
<div class="input-button" style="display: flex; margin-left: 20px">
|
||
<el-button
|
||
:disabled="cannotDelete(item)"
|
||
icon="el-icon-minus"
|
||
size="mini"
|
||
style="flex-shrink: 0;"
|
||
type="danger"
|
||
@click="handleDelete(index)"
|
||
/>
|
||
<el-button
|
||
v-if="index === items.length - 1"
|
||
:disabled="remainProtocols.length === 0 || !item.port"
|
||
icon="el-icon-plus"
|
||
size="mini"
|
||
style="flex-shrink: 0;"
|
||
type="primary"
|
||
@click="handleAdd(index)"
|
||
/>
|
||
</div>
|
||
</div>
|
||
<ProtocolSettingDialog
|
||
v-if="showDialog"
|
||
:disabled="settingReadonly"
|
||
:item="settingItem"
|
||
:visible.sync="showDialog"
|
||
/>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import ProtocolSettingDialog from './ProtocolSettingDialog'
|
||
|
||
export default {
|
||
components: {
|
||
ProtocolSettingDialog
|
||
},
|
||
props: {
|
||
value: {
|
||
type: [Array],
|
||
default: () => []
|
||
},
|
||
title: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
choices: {
|
||
type: Array,
|
||
default: () => ([])
|
||
},
|
||
settingReadonly: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
showSetting: {
|
||
type: Function,
|
||
default: (item) => true
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
name: '',
|
||
items: [],
|
||
settingItem: {},
|
||
showDialog: false
|
||
}
|
||
},
|
||
computed: {
|
||
selectedProtocolNames() {
|
||
return this.items.map(item => item.name)
|
||
},
|
||
remainProtocols() {
|
||
return this.choices.filter(proto => {
|
||
return this.selectedProtocolNames.indexOf(proto.name) === -1
|
||
})
|
||
},
|
||
portPlaceholder() {
|
||
if (this.settingReadonly) {
|
||
return this.$t('applications.port')
|
||
} else {
|
||
return this.$t('assets.DefaultPort')
|
||
}
|
||
},
|
||
iChoices() {
|
||
return this.choices.map(item => {
|
||
delete item?.id
|
||
return item
|
||
})
|
||
}
|
||
},
|
||
watch: {
|
||
iChoices: {
|
||
handler(value) {
|
||
this.setDefaultItems(value)
|
||
}
|
||
},
|
||
items: {
|
||
handler(value) {
|
||
this.$emit('input', value)
|
||
},
|
||
immediate: true,
|
||
deep: true
|
||
}
|
||
},
|
||
mounted() {
|
||
this.setDefaultItems(this.iChoices)
|
||
this.$log.debug('Choices: ', this.choices)
|
||
this.$log.debug('Value: ', this.value)
|
||
},
|
||
methods: {
|
||
handleDelete(index) {
|
||
this.items = this.items.filter((value, i) => {
|
||
return i !== index
|
||
})
|
||
},
|
||
cannotDelete(item) {
|
||
const full = this.iChoices.find(choice => {
|
||
return choice.name === item.name
|
||
})
|
||
return full?.primary || full?.required
|
||
},
|
||
handleAdd(index) {
|
||
this.items.push({ ...this.remainProtocols[0] })
|
||
},
|
||
handleProtocolChange(evt, item) {
|
||
const selected = this.choices.find(item => item.name === evt)
|
||
item.name = selected.name
|
||
item.port = selected.port
|
||
},
|
||
setDefaultItems(choices) {
|
||
if (this.value.length > 0) {
|
||
const protocols = []
|
||
this.value.forEach(item => {
|
||
// 有默认值的情况下,设置为只读或者有id、有setting是平台
|
||
if (!this.settingReadonly || (item?.id && item?.setting)) {
|
||
protocols.push(item)
|
||
} else {
|
||
// 获取资产协议配置
|
||
const assetDefaultItems = this.getAssetDefaultItems(item, choices)
|
||
protocols.push(...assetDefaultItems)
|
||
}
|
||
})
|
||
this.items = protocols
|
||
} else {
|
||
const defaults = choices.filter(item => (item.required || item.primary || item.default))
|
||
this.items = defaults
|
||
}
|
||
},
|
||
getAssetDefaultItems(item, choices) {
|
||
const protocols = []
|
||
const protocol = choices.find(i => i.name === item.name) || item
|
||
if (protocol) {
|
||
protocols.push(protocol)
|
||
}
|
||
return protocols
|
||
},
|
||
onSettingClick(item) {
|
||
this.settingItem = item
|
||
this.showDialog = true
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style lang="less" scoped>
|
||
.el-select .el-input {
|
||
width: 130px;
|
||
}
|
||
|
||
.el-select {
|
||
max-width: 120px;
|
||
}
|
||
|
||
.input-with-select {
|
||
flex-shrink: 1;
|
||
width: calc(100% - 80px) !important;
|
||
}
|
||
|
||
.input-with-select .el-input-group__prepend {
|
||
background-color: #fff;
|
||
}
|
||
|
||
.el-select ::v-deep .el-input__inner {
|
||
width: 110px;
|
||
}
|
||
|
||
.input-button {
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.input-button ::v-deep .el-button.el-button--mini {
|
||
height: 25px;
|
||
padding: 5px;
|
||
}
|
||
|
||
.el-input-group__append .el-button {
|
||
font-size: 14px;
|
||
color: #1a1a1a;
|
||
padding: 9px 20px;
|
||
}
|
||
</style>
|