Skip to content

Commit c9069f4

Browse files
Merge pull request #4 from yunxilyf/main
Added export specified environment
2 parents 1c3feb7 + e86d02d commit c9069f4

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

server/src/lang/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default {
3737
},
3838
browser: {
3939
add: 'Create Browser',
40+
batchStart: 'Batch start',
4041
name: 'Name',
4142
search: 'Search',
4243
import: {

server/src/lang/zh.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default {
3636
},
3737
browser: {
3838
add: '创建浏览器',
39+
batchStart: '批量启动',
3940
name: '名称',
4041
search: '搜索',
4142
import: {

server/src/views/browser/index.vue

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
>
1111
{{ $t("browser.add") }}
1212
</el-button>
13+
<el-button
14+
class="filter-item"
15+
type="primary"
16+
@click="handleBatchStart">
17+
{{ $t("browser.batchStart") }}
18+
</el-button>
1319
</div>
1420
<div style="display: flex">
1521
<!-- <el-input
@@ -45,7 +51,13 @@
4551
fit
4652
highlight-current-row
4753
style="width: 100%"
54+
@selection-change="handleSelectionChange"
4855
>
56+
<el-table-column
57+
type="selection"
58+
width="60"
59+
align="center">
60+
</el-table-column>
4961
<el-table-column
5062
:label="$t('browser.id')"
5163
prop="id"
@@ -834,6 +846,7 @@ export default {
834846
callback()
835847
}
836848
return {
849+
selectedRows: [],
837850
tableKey: 0,
838851
list: null,
839852
listLoading: true,
@@ -1105,6 +1118,20 @@ export default {
11051118
this.listQuery.page = 1
11061119
this.getList()
11071120
},
1121+
handleSelectionChange(selection) {
1122+
this.selectedRows = selection;
1123+
},
1124+
handleBatchStart() {
1125+
for (let i = 0; i < this.selectedRows.length; i++) {
1126+
const row = this.selectedRows[i];
1127+
this.launchEnvironment(row, i * 2000);
1128+
}
1129+
},
1130+
launchEnvironment(row, delay) {
1131+
setTimeout(() => {
1132+
this.handleLaunch(row);
1133+
}, delay);
1134+
},
11081135
resetForm() {
11091136
const ipGeoTimeZone = IPGeo.time_zone?.name
11101137
@@ -1440,7 +1467,7 @@ export default {
14401467
reader.readAsText(file)
14411468
},
14421469
onExport() {
1443-
var blob = new Blob([JSON.stringify(this.list, null, 2)], {
1470+
var blob = new Blob([JSON.stringify(this.selectedRows, null, 2)], {
14441471
type: 'application/json;charset=utf-8',
14451472
})
14461473
saveAs(blob, 'Virtual-Browser.json')

0 commit comments

Comments
 (0)