Skip to content

Commit

Permalink
feat: 支持批量执行脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Dec 2, 2023
1 parent be9a73f commit a628151
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion src/apps/machine/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,22 @@ export default class MachineList extends Vue {
})
}
// 选择主机
public selectedRow: MachineItem[] = []
public tableRowChange(ids: (string | number)[]) {
this.selectedRow = []
for (let id of ids) {
const m = this.machineList.find(item => item.Id === id)
m && this.selectedRow.push(m)
}
}
// 表格定义
public tableColumns = [
{ colKey: 'row-select', type: 'multiple', width: "30px" },
{ colKey: 'HostName', title: '主机名', ellipsis: true },
{ colKey: 'IpAddress', title: '公网 IP', ellipsis: true },
{ colKey: 'Region', title: '地域', ellipsis: true },
Expand Down Expand Up @@ -94,7 +107,15 @@ export default class MachineList extends Vue {
<template #subtitle>
记录总数: {{ machineList.length }}
</template>
<t-table :data="machineList" :columns="tableColumns" row-key="Id" hover>
<template #actions>
<t-button theme="danger" :disabled="selectedRow.length == 0" @click="quickModal.open(selectedRow)">
<template #icon>
<t-icon name="caret-right-small" />
</template>
运行
</t-button>
</template>
<t-table :data="machineList" :columns="tableColumns" row-key="Id" hover @select-change="tableRowChange">
<template #Model="{ row }">
<t-tooltip :content="MachineModels[row.Model]">
{{ cache.vendorList[row.VendorId]?.Description || "-" }}
Expand Down
2 changes: 1 addition & 1 deletion src/cloud/worker/fileman.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export default class WorkerFileman extends Vue {
public dateFormat = dateFormat
public loading = true
public editing = false
public path = '/'
public editing = false
public fileList: FileInfo[] = []
@Prop
Expand Down

0 comments on commit a628151

Please sign in to comment.