Skip to content

Commit 615ced1

Browse files
authored
Merge pull request #166 from FlowCI/feature/1600
Feature/1600
2 parents 0bf1c73 + 2699812 commit 615ced1

32 files changed

+1035
-630
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://172.18.29.67:8080" />
11+
<env name="VUE_APP_API_URL" value="http://localhost:8080" />
1212
</envs>
1313
<method v="2" />
1414
</configuration>

package-lock.json

+44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
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/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/OptionGitAccess.vue

+1-6
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,13 @@
5656
<script>
5757
import vars from '@/util/vars'
5858
import GitTestBtn from '@/components/Flow/GitTestBtn'
59-
import { FlowWrapper } from '@/util/flows'
6059
import { gitUrlRules } from '@/util/rules'
6160
import { mapState } from 'vuex'
6261
6362
export default {
6463
name: 'OptionGitAccess',
6564
props: {
66-
flow: {
65+
wrapper: {
6766
required: true,
6867
type: Object
6968
}
@@ -94,10 +93,6 @@ export default {
9493
settings: state => state.settings.instance
9594
}),
9695
97-
wrapper() {
98-
return new FlowWrapper(this.flow)
99-
},
100-
10196
webhook() {
10297
return this.settings.serverUrl + '/webhooks/' + this.wrapper.name
10398
}

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/i18n/cn.js

+2-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: '统计',

src/i18n/en.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ export default {
4141
},
4242

4343
flow: {
44-
name: 'flow',
45-
create: 'Create a Flow',
44+
name: 'flows',
45+
create: 'Create a flow',
46+
create_group: 'Create a group',
4647
search: 'Search by key words',
4748
settings: 'Settings',
4849
statistic: 'Statistic',

src/main.js

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ Vue.mixin({
8787

8888
popCreateFlow(boolVal) {
8989
this.$store.commit(actions.app.popCreateFlow, boolVal)
90+
},
91+
92+
popCreateGroup(boolVal) {
93+
this.$store.commit(actions.app.popCreateGroup, boolVal)
9094
}
9195
}
9296
})

0 commit comments

Comments
 (0)