-
@@ -31,7 +34,7 @@
@@ -85,7 +88,15 @@ export default {
variables: {
name: 'Variables',
show: true,
- data: this.wrapper.customVarList
+ data: this.wrapper.vars.custom,
+ showBar: true
+ },
+
+ builtInVars: {
+ name: 'Built In Variables',
+ show: true,
+ data: this.wrapper.vars.builtIn,
+ showBar: true
}
}
}
@@ -206,4 +217,10 @@ export default {
vertical-align: middle;
background-color: #E0E0E0;
}
+
+.vertical-bar {
+ display: flex;
+ height: 20px;
+ border-left: 1px solid #c6c6cb;
+}
From fccdd812010a7fe38658e5a5763b2be3cd063447 Mon Sep 17 00:00:00 2001
From: gy2006 <32008001@qq.com>
Date: Fri, 10 Dec 2021 20:44:00 +0100
Subject: [PATCH 27/48] skip _TYPE_ for job context
---
src/util/jobs.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/util/jobs.js b/src/util/jobs.js
index 54366670..540ec9f4 100644
--- a/src/util/jobs.js
+++ b/src/util/jobs.js
@@ -32,6 +32,10 @@ export class JobWrapper {
Object.keys(this.context).forEach(key => {
let value = this.context[key]
+ if (key === '_TYPE_') {
+ return
+ }
+
if (value === '') {
return
}
From 383eba0d24991224e39857e308c81d1bfbd649cc Mon Sep 17 00:00:00 2001
From: gy2006 <32008001@qq.com>
Date: Fri, 10 Dec 2021 21:09:05 +0100
Subject: [PATCH 28/48] fix branch var is missing on manual job start
---
src/util/vars.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/util/vars.js b/src/util/vars.js
index 034af12b..6b6153a4 100644
--- a/src/util/vars.js
+++ b/src/util/vars.js
@@ -27,6 +27,7 @@ export default {
git: {
url: 'FLOWCI_GIT_URL',
credential: 'FLOWCI_GIT_CREDENTIAL',
+ branch: 'FLOWCI_GIT_BRANCH',
source: 'FLOWCI_GIT_SOURCE',
event: 'FLOWCI_GIT_EVENT',
From 1841a0174654ed9a0fb8bac5c9a4d163ea36d883 Mon Sep 17 00:00:00 2001
From: gy2006 <32008001@qq.com>
Date: Mon, 13 Dec 2021 20:48:19 +0100
Subject: [PATCH 29/48] show icon,title and desc for template
---
src/components/Icons/Android.vue | 21 ++++
src/components/Icons/DotnetCore.vue | 45 +++++++
src/components/Icons/Golang.vue | 47 +++++++
src/components/Icons/ImgIcon.vue | 14 +++
src/components/Icons/Maven.vue | 148 ++++++++++++++++++++++
src/components/Icons/Npm.vue | 19 +++
src/components/Icons/Php.vue | 130 +++++++++++++++++++
src/components/Icons/Python.vue | 31 +++++
src/components/Icons/Ruby.vue | 166 +++++++++++++++++++++++++
src/i18n/cn.js | 5 +-
src/i18n/en.js | 5 +-
src/main.js | 35 ++++++
src/store/module/flows.js | 4 +-
src/view/Flow/CreateDialog.vue | 4 +-
src/view/Flow/CreateSelectTemplate.vue | 77 ++++++++++--
src/view/Job/DetailTabContext.vue | 2 +-
16 files changed, 733 insertions(+), 20 deletions(-)
create mode 100644 src/components/Icons/Android.vue
create mode 100644 src/components/Icons/DotnetCore.vue
create mode 100644 src/components/Icons/Golang.vue
create mode 100644 src/components/Icons/ImgIcon.vue
create mode 100644 src/components/Icons/Maven.vue
create mode 100644 src/components/Icons/Npm.vue
create mode 100644 src/components/Icons/Php.vue
create mode 100644 src/components/Icons/Python.vue
create mode 100644 src/components/Icons/Ruby.vue
diff --git a/src/components/Icons/Android.vue b/src/components/Icons/Android.vue
new file mode 100644
index 00000000..d52514b3
--- /dev/null
+++ b/src/components/Icons/Android.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/DotnetCore.vue b/src/components/Icons/DotnetCore.vue
new file mode 100644
index 00000000..8da31e36
--- /dev/null
+++ b/src/components/Icons/DotnetCore.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/Golang.vue b/src/components/Icons/Golang.vue
new file mode 100644
index 00000000..8803e812
--- /dev/null
+++ b/src/components/Icons/Golang.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/ImgIcon.vue b/src/components/Icons/ImgIcon.vue
new file mode 100644
index 00000000..a118dc76
--- /dev/null
+++ b/src/components/Icons/ImgIcon.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/Maven.vue b/src/components/Icons/Maven.vue
new file mode 100644
index 00000000..c5646235
--- /dev/null
+++ b/src/components/Icons/Maven.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/Npm.vue b/src/components/Icons/Npm.vue
new file mode 100644
index 00000000..65318a86
--- /dev/null
+++ b/src/components/Icons/Npm.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/Php.vue b/src/components/Icons/Php.vue
new file mode 100644
index 00000000..834b1895
--- /dev/null
+++ b/src/components/Icons/Php.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/Python.vue b/src/components/Icons/Python.vue
new file mode 100644
index 00000000..45ce7182
--- /dev/null
+++ b/src/components/Icons/Python.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Icons/Ruby.vue b/src/components/Icons/Ruby.vue
new file mode 100644
index 00000000..bc6d11b0
--- /dev/null
+++ b/src/components/Icons/Ruby.vue
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/i18n/cn.js b/src/i18n/cn.js
index 9768ab35..92aa5af4 100644
--- a/src/i18n/cn.js
+++ b/src/i18n/cn.js
@@ -42,7 +42,7 @@ export default {
flow: {
name: '工作流',
- create: '创建工作流',
+ create: '创建一个工作流',
search: '输入关键词搜索',
settings: '设置',
statistic: '统计',
@@ -60,7 +60,8 @@ export default {
create_title_yml: '配置 YML',
create_btn_finish: '完成创建',
create_git_hint: '提示: Git 仓库可已在创建完成后配置',
- create_blank_template: '不选择 (可稍后在 工作流 -> 设置 中配置)',
+ create_blank_template_title: '不使用模版',
+ create_blank_template_desc: '只创建一个 Flow, YAML 配置可稍后在 "工作流 -> 设置" 中配置',
delete_btn: '删除当前 Flow',
delete_desc: '删除当前 Flow 后无法恢复,请谨慎操作',
diff --git a/src/i18n/en.js b/src/i18n/en.js
index c52e231e..8b606e9a 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -42,7 +42,7 @@ export default {
flow: {
name: 'flow',
- create: 'Create Flow',
+ create: 'Create a Flow',
search: 'Search by key words',
settings: 'Settings',
statistic: 'Statistic',
@@ -60,7 +60,8 @@ export default {
create_title_yml: 'Config YML',
create_btn_finish: 'Finish',
create_git_hint: 'hint: Git repo url and webhook can be configured afterward',
- create_blank_template: 'blank (updated at Flows -> Settings later)',
+ create_blank_template_title: 'Do not use template',
+ create_blank_template_desc: 'Create a flow only, the YAML configuration could be defined from "flow -> settings" later',
delete_btn: 'Delete This Flow',
delete_desc: 'Once you delete a repository, there is no going back. Please be certain.',
diff --git a/src/main.js b/src/main.js
index fd3ac9d9..7ddf0f9f 100644
--- a/src/main.js
+++ b/src/main.js
@@ -21,6 +21,15 @@ import './assets/styles/style.scss'
import 'xterm/css/xterm.css'
import G6 from "@antv/g6"
+import AndroidIcon from '@/components/Icons/Android'
+import DotnetCoreIcon from '@/components/Icons/DotnetCore'
+import GolangIcon from '@/components/Icons/Golang'
+import MavenIcon from '@/components/Icons/Maven'
+import NpmIcon from '@/components/Icons/Npm'
+import PhpIcon from '@/components/Icons/Php'
+import RubyIcon from '@/components/Icons/Ruby'
+import PythonIcon from '@/components/Icons/Python'
+
Vue.config.productionTip = false
VueClipboard.config.autoSetContainer = true
@@ -163,6 +172,32 @@ new Vue({
vuetify: new Vuetify({
icons: {
iconfont: 'mdi',
+ values: {
+ android: {
+ component: AndroidIcon
+ },
+ dotnetcore: {
+ component: DotnetCoreIcon
+ },
+ golang: {
+ component: GolangIcon
+ },
+ maven: {
+ component: MavenIcon
+ },
+ npm: {
+ component: NpmIcon
+ },
+ php: {
+ component: PhpIcon
+ },
+ ruby: {
+ component: RubyIcon
+ },
+ python: {
+ component: PythonIcon
+ }
+ }
},
}),
router,
diff --git a/src/store/module/flows.js b/src/store/module/flows.js
index e23be7e1..0c6a38b6 100644
--- a/src/store/module/flows.js
+++ b/src/store/module/flows.js
@@ -190,7 +190,7 @@ const actions = {
})
},
- async confirm ({commit}, {wrapper, desc}) {
+ async confirm ({commit}, {wrapper, title}) {
let gitSettings = {
gitUrl: wrapper.gitUrl,
secret: wrapper.secret
@@ -203,7 +203,7 @@ const actions = {
console.log('[DONE]: confirmed')
commit('add', new FlowWrapper(flow))
},
- {desc}
+ {title}
)
}
diff --git a/src/view/Flow/CreateDialog.vue b/src/view/Flow/CreateDialog.vue
index 64c75593..2ec708d7 100644
--- a/src/view/Flow/CreateDialog.vue
+++ b/src/view/Flow/CreateDialog.vue
@@ -114,10 +114,10 @@
},
// step 2
- 2: (desc) => {
+ 2: (title) => {
// send confirm
this.loading = true
- let payload = {wrapper: this.flow, desc}
+ let payload = {wrapper: this.flow, title}
this.$store.dispatch(actions.flows.confirm, payload)
.then(() => {
this.onCancelClick()
diff --git a/src/view/Flow/CreateSelectTemplate.vue b/src/view/Flow/CreateSelectTemplate.vue
index 4b5fe100..bd49ea65 100644
--- a/src/view/Flow/CreateSelectTemplate.vue
+++ b/src/view/Flow/CreateSelectTemplate.vue
@@ -4,11 +4,44 @@
{{ $t('flow.create_git_hint') }}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ getIcon() }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ getIcon(tmp) }}
+
+
+
+
+
+
+
+
+
+
+
0) {
+ title = this.templates[this.selected - 1].title
}
- this.onNextClick(desc)
+ this.onNextClick(title)
}
}
}
diff --git a/src/view/Job/DetailTabContext.vue b/src/view/Job/DetailTabContext.vue
index 4cdc87a6..eb610420 100644
--- a/src/view/Job/DetailTabContext.vue
+++ b/src/view/Job/DetailTabContext.vue
@@ -34,7 +34,7 @@
From 84f211ec62f50c3e789a2acc844ec0a12e23325f Mon Sep 17 00:00:00 2001
From: gy2006 <32008001@qq.com>
Date: Wed, 15 Dec 2021 20:44:03 +0100
Subject: [PATCH 30/48] load related jobs
---
src/store/actions.js | 1 +
src/store/module/jobs.js | 14 +++++++++++-
src/util/jobs.js | 4 ++++
src/view/Common/AgentMenu.vue | 10 +--------
src/view/Job/Detail.vue | 1 +
src/view/Job/DetailTabContext.vue | 36 +++++++++++++++++++++++++++----
6 files changed, 52 insertions(+), 14 deletions(-)
diff --git a/src/store/actions.js b/src/store/actions.js
index 48d27060..597be591 100644
--- a/src/store/actions.js
+++ b/src/store/actions.js
@@ -48,6 +48,7 @@ export default {
rerun: 'jobs/rerun',
cancel: 'jobs/cancel',
list: 'jobs/list',
+ related: 'jobs/related',
statusUpdate: 'jobs/statusUpdate',
select: 'jobs/select',
getYml: 'jobs/getYml',
diff --git a/src/store/module/jobs.js b/src/store/module/jobs.js
index 613aa87e..bbe0af4f 100644
--- a/src/store/module/jobs.js
+++ b/src/store/module/jobs.js
@@ -18,7 +18,8 @@ const state = {
latest: [], // latest job object array
reports: [],
reportUrlPath: '',
- artifacts: []
+ artifacts: [],
+ relatedJobs: [],
}
const mutations = {
@@ -43,6 +44,10 @@ const mutations = {
state.pagination.total = page.totalElements
},
+ related(state, jobs) {
+ state.relatedJobs = jobs
+ },
+
setLatest(state, job) {
const latestList = state.latest
@@ -121,6 +126,7 @@ const actions = {
const url = `jobs/${jobId}/desc`
return http.get(url, onCallback)
},
+
/**
* Start a new job
*/
@@ -166,6 +172,12 @@ const actions = {
)
},
+ related({commit, state}, {flow, buildNumber}) {
+ return http.get(`jobs/${flow}/${buildNumber}/related`, (jobs) => {
+ commit('related', jobs)
+ })
+ },
+
/**
* Update job status
*/
diff --git a/src/util/jobs.js b/src/util/jobs.js
index 540ec9f4..4405b613 100644
--- a/src/util/jobs.js
+++ b/src/util/jobs.js
@@ -49,6 +49,10 @@ export class JobWrapper {
})
}
+ get id() {
+ return this.job.id
+ }
+
get context() {
return this.job.context || {}
}
diff --git a/src/view/Common/AgentMenu.vue b/src/view/Common/AgentMenu.vue
index 18427335..794b77e8 100644
--- a/src/view/Common/AgentMenu.vue
+++ b/src/view/Common/AgentMenu.vue
@@ -164,15 +164,7 @@ export default {
loadFlowNameAndBuildNumber(wrapper) {
const callback = (obj) => {
- let desc = '-'
-
- // find flow name since name could be change..
- for (let flow of this.flows) {
- if (flow.id === obj.flowId) {
- desc = `${flow.name}/#${obj.buildNumber}`
- break
- }
- }
+ let desc = `${obj.flowName}/#${obj.buildNumber}`
// update item list
for (let item of this.items) {
diff --git a/src/view/Job/Detail.vue b/src/view/Job/Detail.vue
index 7a69dce7..632074a6 100644
--- a/src/view/Job/Detail.vue
+++ b/src/view/Job/Detail.vue
@@ -165,6 +165,7 @@
load() {
let payload = {flow: this.flow, buildNumber: this.number}
this.$store.dispatch(actions.jobs.select, payload).then()
+ this.$store.dispatch(actions.jobs.related, payload).then()
this.$store.dispatch(actions.jobs.steps.get, payload).then()
this.$store.dispatch(actions.jobs.reports.list, payload).then()
},
diff --git a/src/view/Job/DetailTabContext.vue b/src/view/Job/DetailTabContext.vue
index eb610420..6e2eba04 100644
--- a/src/view/Job/DetailTabContext.vue
+++ b/src/view/Job/DetailTabContext.vue
@@ -19,8 +19,10 @@
- {{ item.key }}
+ {{ item.key }}
+ {{ item.key }}
+
@@ -33,8 +35,8 @@
@@ -47,6 +49,8 @@
+
+
\ No newline at end of file
diff --git a/src/view/Settings/Git/Index.vue b/src/view/Settings/Git/Index.vue
new file mode 100644
index 00000000..237e3bc4
--- /dev/null
+++ b/src/view/Settings/Git/Index.vue
@@ -0,0 +1,69 @@
+
+
+
+
+ |
+ {{ sources[item.source].icon}}
+ {{ sources[item.source].name }}
+ |
+ {{ item.secret }} |
+ {{ timeFormatInMins(item.updatedAt) }} |
+ {{ item.createdBy }} |
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/view/Settings/Git/New.vue b/src/view/Settings/Git/New.vue
new file mode 100644
index 00000000..209a68b2
--- /dev/null
+++ b/src/view/Settings/Git/New.vue
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Error: {{ error }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 9300fcf8b0b5bf07cee9039922aa3ff7edc4a1d9 Mon Sep 17 00:00:00 2001
From: gy2006 <32008001@qq.com>
Date: Tue, 1 Mar 2022 15:34:18 +0100
Subject: [PATCH 44/48] delete git setting
---
src/router/index.js | 3 +-
src/store/actions.js | 3 +-
src/store/module/git.js | 15 ++++
src/view/Settings/Git/Edit.vue | 125 +++++++++++++++++++++++++++++++-
src/view/Settings/Git/Index.vue | 20 ++++-
src/view/Settings/Git/New.vue | 1 -
src/view/Settings/Home.vue | 9 ++-
7 files changed, 168 insertions(+), 8 deletions(-)
diff --git a/src/router/index.js b/src/router/index.js
index 95728b56..ec5c4661 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -233,7 +233,8 @@ export default new Router({
{
path: 'git/edit',
name: 'SettingsGitEdit',
- component: SettingsGitEdit
+ component: SettingsGitEdit,
+ props: true
},
// system settings
diff --git a/src/store/actions.js b/src/store/actions.js
index 390eb81a..321f943d 100644
--- a/src/store/actions.js
+++ b/src/store/actions.js
@@ -160,6 +160,7 @@ export default {
git: {
list: 'git/list',
- save: 'git/save'
+ save: 'git/save',
+ delete: 'git/delete'
}
}
diff --git a/src/store/module/git.js b/src/store/module/git.js
index 7bc2ed45..a701101a 100644
--- a/src/store/module/git.js
+++ b/src/store/module/git.js
@@ -13,6 +13,15 @@ const mutations = {
add(state, git) {
state.items.push(git)
},
+
+ delete(state, source) {
+ for (let i = 0; i < state.items.length; i++) {
+ if (state.items[i].source === source) {
+ state.items.splice(i, 1)
+ return
+ }
+ }
+ }
}
const actions = {
@@ -26,6 +35,12 @@ const actions = {
await http.post(`gitconfig`, (item) => {
commit('add', item)
}, payload)
+ },
+
+ async delete({commit}, source) {
+ await http.delete(`gitconfig/${source}`, () => {
+ commit('delete', source)
+ })
}
}
diff --git a/src/view/Settings/Git/Edit.vue b/src/view/Settings/Git/Edit.vue
index 85fe139c..4414ce52 100644
--- a/src/view/Settings/Git/Edit.vue
+++ b/src/view/Settings/Git/Edit.vue
@@ -1,12 +1,133 @@
- edit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Error: {{ error }}
+
+
+
+
+
+
+
+
+
+ Revoke git setting for {{ gitObj.source }}?
+
+
+
+
+
+
diff --git a/src/view/Settings/Git/Index.vue b/src/view/Settings/Git/Index.vue
index 237e3bc4..03fb5b2f 100644
--- a/src/view/Settings/Git/Index.vue
+++ b/src/view/Settings/Git/Index.vue
@@ -12,7 +12,12 @@
|
{{ item.secret }} |
{{ timeFormatInMins(item.updatedAt) }} |
- {{ item.createdBy }} |
+ {{ item.updatedBy }} |
+
+
+ mdi-pencil
+
+ |
@@ -41,11 +46,13 @@ export default {
return {
timeFormatInMins,
sources: GitSources,
+ loading: false,
headers: [
{text: 'Git Source', sortable: true, value: 'name'},
{text: 'Secret', value: 'secret'},
{text: 'Updated At', value: 'updatedAt'},
- {text: 'By', value: 'updatedBy'},
+ {text: 'Updated By', value: 'updatedBy'},
+ {text: '', align: 'right'}
],
}
},
@@ -60,6 +67,15 @@ export default {
name: 'SettingsGitNew'
})
},
+
+ onEditClick(item) {
+ this.$router.push({
+ name: 'SettingsGitEdit',
+ params: {
+ gitObj: item
+ }
+ })
+ }
}
}
diff --git a/src/view/Settings/Git/New.vue b/src/view/Settings/Git/New.vue
index 209a68b2..766573e5 100644
--- a/src/view/Settings/Git/New.vue
+++ b/src/view/Settings/Git/New.vue
@@ -78,7 +78,6 @@ export default {
},
methods: {
onGitSourceChange() {
- console.log(this.selected.source)
},
onBackClick() {
diff --git a/src/view/Settings/Home.vue b/src/view/Settings/Home.vue
index 7436019e..c3e0d21a 100644
--- a/src/view/Settings/Home.vue
+++ b/src/view/Settings/Home.vue
@@ -20,7 +20,7 @@
mdi-plus-box
@@ -59,6 +59,13 @@
onConfigNav (val) {
this.navs = val.navs
this.showAddBtn = val.showAddBtn
+ },
+
+ onAddBtnClick() {
+ const func = this.$refs.childView.onAddBtnClick
+ if (func) {
+ func()
+ }
}
}
}
From 922bab87b68523f2e52c50fde87a76754d13dd00 Mon Sep 17 00:00:00 2001
From: gy2006 <32008001@qq.com>
Date: Wed, 16 Mar 2022 20:56:50 +0100
Subject: [PATCH 45/48] support host on git config
---
src/view/Settings/Git/New.vue | 36 +++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/src/view/Settings/Git/New.vue b/src/view/Settings/Git/New.vue
index 766573e5..a9b47ca6 100644
--- a/src/view/Settings/Git/New.vue
+++ b/src/view/Settings/Git/New.vue
@@ -11,6 +11,13 @@
+
+
+
+
Date: Fri, 18 Mar 2022 22:26:30 +0100
Subject: [PATCH 46/48] edit git config with host
---
src/components/Jobs/ListItem.vue | 2 +-
src/view/Settings/Git/Edit.vue | 67 +++++++++++++++++++++++-------
src/view/Settings/Git/New.vue | 71 ++++++++++++++++++--------------
3 files changed, 94 insertions(+), 46 deletions(-)
diff --git a/src/components/Jobs/ListItem.vue b/src/components/Jobs/ListItem.vue
index 88a54f40..1ca5d321 100644
--- a/src/components/Jobs/ListItem.vue
+++ b/src/components/Jobs/ListItem.vue
@@ -80,7 +80,7 @@
{{ wrapper.patchSet.ref }}
→
- |
+ /
{{ wrapper.patchSet.branch }}
diff --git a/src/view/Settings/Git/Edit.vue b/src/view/Settings/Git/Edit.vue
index 4414ce52..d2e1b9fb 100644
--- a/src/view/Settings/Git/Edit.vue
+++ b/src/view/Settings/Git/Edit.vue
@@ -10,14 +10,25 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -50,10 +61,13 @@ import SaveBtn from '@/components/Settings/SaveBtn'
import BackBtn from '@/components/Settings/BackBtn'
import ConfirmBtn from '@/components/Common/ConfirmBtn'
import TextSelect from '@/components/Common/TextSelect'
-import {GIT_SOURCE_GITHUB, GitSourceSelection} from "@/util/git";
+import TextBox from '@/components/Common/TextBox'
+import {GIT_SOURCE_GERRIT, GIT_SOURCE_GITHUB, GitSourceSelection} from "@/util/git";
import {mapState} from "vuex";
import actions from "@/store/actions";
-import {CATEGORY_TOKEN} from "@/util/secrets";
+import {CATEGORY_AUTH, CATEGORY_TOKEN} from "@/util/secrets";
+import {GitSources} from "@/util/git";
+import {httpUrl} from "@/util/rules"
export default {
name: "SettingsGitEdit",
@@ -67,22 +81,38 @@ export default {
ConfirmBtn,
SaveBtn,
BackBtn,
- TextSelect
+ TextSelect,
+ TextBox
},
data() {
return {
+ GitSources,
+ GIT_SOURCE_GERRIT,
gitSourceList: GitSourceSelection,
- error: null
+ error: null,
+ httpUrl: httpUrl("invalid url"),
}
},
mounted() {
- this.loadRelatedSecret()
+ this.$emit('onConfigNav', {
+ navs: this.navs,
+ showAddBtn: false
+ })
+
+ this.loadRelatedSecret(this.gitObj.source)
},
computed: {
...mapState({
secrets: state => state.secrets.items
}),
+ navs() {
+ return [
+ {text: this.$t('settings.li.git'), href: '#/settings/git'},
+ {text: this.GitSources[this.gitObj.source].name}
+ ]
+ },
+
secretNameList() {
const nameList = []
for (let c of this.secrets) {
@@ -122,13 +152,20 @@ export default {
})
},
- loadRelatedSecret() {
- if (this.gitObj.source === GIT_SOURCE_GITHUB) {
+ loadRelatedSecret(source) {
+ if (source === GIT_SOURCE_GITHUB) {
this.$store.dispatch(actions.secrets.listNameOnly, CATEGORY_TOKEN).then()
+ return
+ }
+
+ if (source === GIT_SOURCE_GERRIT) {
+ this.$store.dispatch(actions.secrets.listNameOnly, CATEGORY_AUTH).then()
}
}
}
}
+
+