Skip to content

Commit f16608c

Browse files
authored
Merge pull request #167 from FlowCI/develop
Develop
2 parents c98c68c + b531afc commit f16608c

40 files changed

+24390
-25308
lines changed

.run/start.run.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<node-interpreter value="project" />
99
<package-manager value="npm" />
1010
<envs>
11-
<env name="VUE_APP_API_URL" value="http://192.168.31.173:8080" />
11+
<env name="VUE_APP_API_URL" value="http://localhost:8080" />
1212
</envs>
1313
<method v="2" />
1414
</configuration>

package-lock.json

+23,311-24,645
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flow-web-x",
3-
"version": "1.22.12",
3+
"version": "1.22.38",
44
"description": "flow.ci web ui",
55
"author": "Yang Guo <[email protected]>",
66
"private": true,
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@antv/g6": "^4.0.3",
15-
"@mdi/js": "^5.9.55",
15+
"@mdi/js": "^7.0.96",
1616
"axios": "^0.21.4",
1717
"babel-polyfill": "^6.26.0",
1818
"blueimp-md5": "^2.11.0",
@@ -27,15 +27,16 @@
2727
"lodash": "^4.17.21",
2828
"marked": "^0.7.0",
2929
"moment": "^2.22.2",
30-
"monaco-editor": "^0.17.0",
31-
"monaco-editor-webpack-plugin": "^1.7.0",
32-
"sockjs-client": "^1.3.0",
30+
"monaco-editor": "^0.30.1",
31+
"monaco-editor-webpack-plugin": "^6.0.0",
32+
"sockjs-client": "^1.6.1",
3333
"stompjs": "^2.3.3",
3434
"url-regex": "^5.0.0",
3535
"vue": "^2.6.10",
3636
"vue-clipboard2": "^0.3.1",
3737
"vue-i18n": "^7.8.0",
3838
"vue-router": "^3.0.3",
39+
"vuedraggable": "^2.24.3",
3940
"vuetify": "^2.3.4",
4041
"vuex": "^3.0.1",
4142
"xterm": "^4.6.0",

src/App.vue

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
<flow-menu></flow-menu>
2323
</v-navigation-drawer>
2424

25+
<!-- global dialogs -->
26+
<create-flow-dialog></create-flow-dialog>
27+
28+
<create-flow-group-dialog></create-flow-group-dialog>
29+
30+
<!-- main app view -->
2531
<v-app-bar app
2632
:clipped-left="$vuetify.breakpoint.lgAndUp"
2733
color="grey lighten-4">
@@ -63,10 +69,14 @@
6369
import actions from '@/store/actions'
6470
import { mapState } from 'vuex'
6571
import { connect, subscribeTopic, unsubscribeTopic } from '@/store/subscribe'
72+
import CreateFlowDialog from "@/view/Flow/CreateDialog";
73+
import CreateFlowGroupDialog from "@/view/Flow/CreateGroupDialog";
6674
6775
export default {
6876
name: 'App',
6977
components: {
78+
CreateFlowGroupDialog,
79+
CreateFlowDialog,
7080
FlowMenu,
7181
AgentMenu,
7282
ProfileMenu,

src/components/Common/Dialog.vue

+57-73
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<v-dialog
44
v-model="show"
55
:width="width"
6+
@click:outside="onCancel"
67
>
78
<v-card>
89
<v-card-title
@@ -20,22 +21,23 @@
2021

2122
<v-card-actions>
2223
<v-spacer></v-spacer>
23-
<v-btn
24-
v-if="this.cancelBtn"
25-
:color="this.cancelBtn.color"
26-
flat
27-
@click="onCancelBtnClick"
28-
>
29-
{{ this.cancelBtn.text }}
24+
25+
<v-btn v-if="this.onCancel"
26+
small
27+
outlined
28+
min-width="70"
29+
color="warning"
30+
@click="onCancel"
31+
>{{ $t('cancel') }}
3032
</v-btn>
3133

32-
<v-btn
33-
v-if="this.confirmBtn"
34-
:color="this.confirmBtn.color"
35-
flat
36-
@click="onConfirmBtnClick"
37-
>
38-
{{ this.confirmBtn.text }}
34+
<v-btn v-if="this.onConfirm"
35+
small
36+
class="ml-6"
37+
min-width="70"
38+
color="primary"
39+
@click="onConfirm"
40+
>{{ $t('confirm') }}
3941
</v-btn>
4042
</v-card-actions>
4143
</v-card>
@@ -44,73 +46,55 @@
4446
</template>
4547

4648
<script>
47-
export default {
48-
name: 'Dialog',
49-
props: {
50-
dialog: {
51-
type: Boolean,
52-
required: true
53-
},
54-
55-
width: {
56-
type: Number,
57-
required: false,
58-
default () {
59-
return 500
60-
}
61-
},
62-
63-
title: {
64-
type: String,
65-
required: false
66-
},
67-
68-
content: {
69-
type: String,
70-
required: true
71-
},
72-
73-
/**
74-
* {
75-
* text: 'xxx',
76-
* action: function
77-
* color: 'xxx'
78-
* }
79-
*/
80-
confirmBtn: {
81-
type: Object,
82-
required: false
83-
},
49+
export default {
50+
name: 'Dialog',
51+
props: {
52+
dialog: {
53+
type: Boolean,
54+
required: true
55+
},
8456
85-
cancelBtn: {
86-
type: Object,
87-
required: false
57+
width: {
58+
type: Number,
59+
required: false,
60+
default() {
61+
return 500
8862
}
8963
},
90-
data () {
91-
return {
92-
show: this.dialog
93-
}
64+
65+
title: {
66+
type: String,
67+
required: false
9468
},
95-
watch: {
96-
dialog (newVal) {
97-
this.show = newVal
98-
}
69+
70+
content: {
71+
type: String,
72+
required: false
9973
},
100-
methods: {
101-
onConfirmBtnClick () {
102-
if (this.confirmBtn.action) {
103-
this.confirmBtn.action()
104-
}
105-
},
10674
107-
onCancelBtnClick () {
108-
if (this.cancelBtn.action) {
109-
this.cancelBtn.action()
110-
}
111-
}
75+
onConfirm: {
76+
type: Function,
77+
required: false
78+
},
79+
80+
onCancel: {
81+
type: Function,
82+
required: false
83+
}
84+
},
85+
data() {
86+
return {
87+
show: this.dialog
88+
}
89+
},
90+
watch: {
91+
dialog(newVal) {
92+
this.show = newVal
11293
}
94+
},
95+
methods: {
11396
}
97+
}
11498
</script>
11599

116100
<style scoped>

src/components/Flow/EditYaml.vue

+7-3
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@
2121
tile
2222
class="action-btn"
2323
@click="onResetClick"
24-
:disabled="!isCodeChange">
24+
:disabled="!isCodeChange"
25+
v-if="hasPermission('Admin')"
26+
>
2527
{{ $t('reset') }}
2628
</v-btn>
2729

2830
<v-btn color="primary"
2931
tile
3032
class="action-btn"
3133
@click="onSaveClick"
32-
:disabled="!isCodeChange">
34+
:disabled="!isCodeChange"
35+
v-if="hasPermission('Admin')"
36+
>
3337
{{ $t('save') }}
3438
</v-btn>
3539

@@ -64,7 +68,7 @@
6468
lineNumbers: 'on',
6569
roundedSelection: false,
6670
scrollBeyondLastLine: false,
67-
readOnly: false,
71+
readOnly: !this.hasPermission('Admin'),
6872
automaticLayout: true,
6973
theme: 'vs-dark'
7074
})

src/components/Flow/GitTestBtn.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
small
66
@click="onTestClick"
77
:loading="loading"
8-
:disabled="loading"
8+
:disabled="loading || disabled"
99
>
1010
{{ $t('test') }}
1111

@@ -41,6 +41,12 @@
4141
default () {
4242
return true
4343
}
44+
},
45+
disabled: {
46+
type: Boolean,
47+
default() {
48+
return false;
49+
}
4450
}
4551
},
4652
data () {

src/components/Flow/OptionDeleteFlow.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
return
7171
}
7272
73-
this.$store.dispatch(actions.flows.delete, this.flow.name).then(() => {
73+
this.$store.dispatch(actions.flows.delete, this.flow).then(() => {
7474
this.onCloseClick()
7575
this.$router.push({path: `/flows`})
7676
})

src/components/Flow/OptionFlowSettings.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@
8989

9090
<v-row>
9191
<v-col>
92-
<v-btn color="success"
92+
<v-btn color="primary"
9393
@click="onUpdateClick"
9494
:loading="loading"
95-
>Update Settings
95+
:disabled="!hasPermission('Admin')"
96+
>{{ $t('flow.update_btn') }}
9697
</v-btn>
9798
</v-col>
9899
</v-row>

src/components/Flow/OptionGitAccess.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343

4444
<v-row>
4545
<v-col cols="11">
46-
<git-test-btn :wrapper="wrapper" :onBeforeTest="onTestClick"></git-test-btn>
46+
<git-test-btn :wrapper="wrapper"
47+
:onBeforeTest="onTestClick"
48+
:disabled="!hasPermission('Admin')"
49+
></git-test-btn>
4750
</v-col>
4851
</v-row>
4952
</v-form>
@@ -53,14 +56,13 @@
5356
<script>
5457
import vars from '@/util/vars'
5558
import GitTestBtn from '@/components/Flow/GitTestBtn'
56-
import { FlowWrapper } from '@/util/flows'
5759
import { gitUrlRules } from '@/util/rules'
5860
import { mapState } from 'vuex'
5961
6062
export default {
6163
name: 'OptionGitAccess',
6264
props: {
63-
flow: {
65+
wrapper: {
6466
required: true,
6567
type: Object
6668
}
@@ -91,10 +93,6 @@ export default {
9193
settings: state => state.settings.instance
9294
}),
9395
94-
wrapper() {
95-
return new FlowWrapper(this.flow)
96-
},
97-
9896
webhook() {
9997
return this.settings.serverUrl + '/webhooks/' + this.wrapper.name
10098
}

src/components/Flow/SummaryCard.vue

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
required: true
5757
}
5858
},
59+
data() {
60+
return {
61+
}
62+
},
5963
methods: {
6064
onTitleClick () {
6165
this.$router.push({path: `/flows/${this.wrapper.name}/jobs`})

src/components/Jobs/ListItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default {
129129

130130
<style lang="scss" scoped>
131131
.job-item {
132-
min-height: 68px;
132+
min-height: 80px;
133133
}
134134
135135
.commit-text {

src/components/Settings/BackBtn.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<v-btn color="orange darken-2" dark @click="onClick" :small="small">
3-
<v-icon dark left small>{{ icon }}</v-icon>{{ $t(text) }}
2+
<v-btn color="grey" class="white--text" @click="onClick" :small="small">
3+
<v-icon left small>{{ icon }}</v-icon>{{ $t(text) }}
44
</v-btn>
55
</template>
66

src/i18n/cn.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export default {
4242

4343
flow: {
4444
name: '工作流',
45-
create: '创建一个工作流',
45+
create: '创建工作流',
46+
create_group: '创建 group',
4647
search: '输入关键词搜索',
4748
settings: '设置',
4849
statistic: '统计',
@@ -63,6 +64,8 @@ export default {
6364
create_blank_template_title: '不使用模版',
6465
create_blank_template_desc: '只创建一个 Flow, YAML 配置可稍后在 "工作流 -> 设置" 中配置',
6566

67+
update_btn: '更新设置',
68+
6669
delete_btn: '删除当前 Flow',
6770
delete_desc: '删除当前 Flow 后无法恢复,请谨慎操作',
6871

0 commit comments

Comments
 (0)