@gitee-code/plugin-xtreme 1.0.2 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
1
+ .plugin.defaultBranch {
2
+ display: inline-flex;
3
+ justify-content: center;
4
+ min-width: 80px;
5
+ }
6
+ .plugin.defaultBranch span {
7
+ padding: 1px 8px;
8
+ background-color: var(--yellow-4);
9
+ border-radius: 12px;
10
+ line-height: 22px;
11
+ }
12
+ .plugin.compare {
13
+ display: flex;
14
+ justify-content: space-between;
15
+ align-items: center;
16
+ color: var(--gray-9);
17
+ }
18
+ .plugin.count {
19
+ display: flex;
20
+ flex: 1;
21
+ position: relative;
22
+ line-height: 24px;
23
+ width: 50px;
24
+ }
25
+ .plugin.detail_count {
26
+ cursor: pointer;
27
+ }
28
+ .plugin.detail_count::before {
29
+ content: '';
30
+ height: 2px;
31
+ width: 100%;
32
+ display: block;
33
+ overflow: hidden;
34
+ }
35
+ .plugin.empty::before {
36
+ width: 0;
37
+ }
38
+ .plugin.count.behind {
39
+ justify-content: flex-end;
40
+ }
41
+ .plugin.count.behind i {
42
+ font-size: 16px;
43
+ display: inline-block;
44
+ margin-top: 6px;
45
+ margin-right: 5px;
46
+ color: var(--yellow-3);
47
+ }
48
+ .plugin.count.ahead {
49
+ justify-content: flex-start;
50
+ }
51
+ .plugin.underlineleft::before {
52
+ border-radius:2px 0px 0px 2px;
53
+ background-color: var(--gray-6);
54
+ }
55
+ .plugin.underlineleft span {
56
+ padding-right: 2px;
57
+ }
58
+ .plugin.underlineright::before {
59
+ background-color: var(--blue-6);
60
+ border-radius: 0px 2px 2px 0px;
61
+ }
62
+ .plugin.underlineright span {
63
+ padding-left: 2px;
64
+ }
65
+ .plugin.ahead {
66
+ text-align: right;
67
+ padding-right:4px;
68
+ position: relative;
69
+ }
70
+ .plugin.line {
71
+ width: 1px;
72
+ height: 26px;
73
+ background-color: var(--gray-6);
74
+ }
75
+ /* 自动删除分支 */
76
+ .auto_delete_branch_head {
77
+ display: flex;
78
+ justify-content: space-between;
79
+ align-items: center;
80
+ }
81
+ .auto_delete_branch_head label {
82
+ font-weight: 700;
83
+ }
84
+ .auto_delete_branch_head .desc{
85
+ display: block;
86
+ color: var(--gray-7);
87
+ }
88
+ .set_time .el-input-number {
89
+ line-height: 32px;
90
+ }
@@ -0,0 +1 @@
1
+ (()=>{"use strict";GITEE.i18n.mergeI18n("zh-CN",{branch_settings:{default_branch_update_warn:"默认分支更新预警",default_branch_update_warn_desc:"允许通知仓库成员默认分支更新,及时更新其他分支代码"}}),GITEE.i18n.mergeI18n("en-US",{branch_settings:{default_branch_update_warn:"Default branch update alert",default_branch_update_warn_desc:"Allows repository members to be notified of default branch updates and to update other branch code in a timely manner"}});const e={name:"auto-delete-branch",props:{value:{type:Boolean,default:!1},form:{type:Object,default:()=>({})}},data:()=>({branchNames:[],page:1,total_count:0,total_pages:0,can_load_more:!1,cache:{branchNames:[],done:!1}}),watch:{"form.default_branch":{handler(e){this.$emit("form-change",{excepted_deleted_branches:this.form.excepted_deleted_branches.filter((a=>a!==e))})}}},methods:{branchVisibleChange(e){if(!e)return;this.cache.done?this.branchNames=this.cache.branchNames:this.searchBranch();const a=this.$refs.exceptedBranch.$refs.popper.$el.querySelector(".el-scrollbar__wrap");a.addEventListener("scroll",(()=>{a.scrollTop+a.offsetHeight+28>a.scrollHeight&&this.branchNames.length<this.total_count&&this.can_load_more&&(this.page+=1,this.searchBranch())}))},handleSearch(e){this.branchNames=[],this.searchBranch(e)},searchBranch(e){this.can_load_more=!1,GITEE.tools.$http.get(`${GITEE.api.goApiProjectPrefix()}/branches/names?name=${e||""}&page=${this.page}`).then((({data:a})=>{this.branchNames=[...this.branchNames,...a.data.branch||[]],this.total_count=a.meta.total_count,this.can_load_more=!0,e||(this.cache.branchNames=this.branchNames,this.cache.done=!0)}))}},template:'\n <div>\n <span class="auto_delete_branch_head">\n <span>\n <label>自动删除分支</label>\n <span v-if="value" class="desc">自动删除长时间未更新的只读分支</span>\n </span>\n <el-switch :value="value" @change="(v) => $emit(\'input\', v)" />\n </span>\n <el-alert v-if="!value" type="warning" show-icon title="自动删除分支会删除长时间未更新的只读分支,删除后无法恢复,请谨慎操作!!!!" />\n <div v-if="value" class="ml-2">\n <div class="set_time">设置未更新时长为:\n <el-input-number \n :value="form.branch_delete_days_before" \n controls-position="right"\n :precision="0"\n :min="1" \n :max="1000" \n class="ml-1 mr-1 mt-1"\n @change="v => $emit(\'form-change\', { branch_delete_days_before: v })" \n />天,自动删除分支\n </div>\n <span>排除分支</span>\n <el-popover\n placement="right"\n trigger="hover"\n content="仓库下设置的默认分支不支持自动删除,需手动操作!">\n <i slot="reference" class="el-icon-warning-outline ml-1" />\n </el-popover>\n <el-select\n ref="exceptedBranch"\n :value="form.excepted_deleted_branches" \n is-block\n filterable\n remote\n multiple\n :remote-method="handleSearch"\n @visible-change="branchVisibleChange"\n @change="v => $emit(\'form-change\', { excepted_deleted_branches: v })"\n >\n <el-option\n v-for="branch in branchNames.filter((item) => item !== form.default_branch)"\n :key="branch"\n :label="branch"\n :value="branch"\n />\n </el-select>\n </div>\n </div>\n '};GITEE.schema.update({FORM:{BRANCH_SETTINGS:{ITEMS:[{key:"default_branch_warning_enabled",value:!1,pre_key:"default_branch",customComponent:"FormItemSwitch",meta:{label:GITEE.i18n.$t("branch_settings.default_branch_update_warn"),description:GITEE.i18n.$t("branch_settings.default_branch_update_warn_desc")}},{key:"auto_delete_branch_enabled",value:!1,pre_key:"can_create_branch",extraValue:{excepted_deleted_branches:[],branch_delete_days_before:15},customComponent:e}]}}})})();
@@ -1,14 +1,31 @@
1
1
  .node_count[data-v-495d7414]{color:var(--blue-6)}
2
2
  .conversation_status[data-v-6a2bde98]{position:relative}.conversation_status[data-v-6a2bde98]:before{position:absolute;top:50%;left:-10px;margin-top:-3px;content:"";width:6px;height:6px;background-color:currentColor}
3
3
 
4
+ .log_detail_wrap {
5
+ position: relative;
6
+ max-height: 400px;
7
+ overflow: auto;
8
+ background: #1a2638;
9
+ color: #b5bbc6;
10
+ }
4
11
  .log_detail {
5
- background: var(--gray-3);
12
+ height: 100%;
13
+ width: fit-content;
6
14
  padding: 10px;
7
- max-height: 400px;
8
- overflow-x: auto;
15
+ margin-bottom: 0;
16
+ }
17
+ .el-icon-loading {
18
+ position: absolute;
19
+ left: 50%;
20
+ transform: translateX(-50%);
9
21
  }
10
22
  .no_data {
11
23
  margin-top: 0;
12
24
  }
25
+ .footer_wrap {
26
+ text-align: right;
27
+ margin-top: 10px;
28
+ }
13
29
 
14
- .view_log[data-v-520d83cc]{color:var(--blue-6)}.new_knowledge_dialog .el-dialog__footer[data-v-520d83cc]{display:none}
30
+ .view_log[data-v-a169622c]{color:var(--blue-6)}.new_knowledge_dialog .el-dialog__footer[data-v-a169622c]{display:none}
31
+ .tabs-container[data-v-27dff7de]{position:relative}.filter_icon[data-v-27dff7de]{position:absolute;top:10px;right:0}
@@ -1 +1 @@
1
- (()=>{"use strict";var t=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("PageTitle",[t._v(t._s(t.$t("conversation_manage.title")))]),t._v(" "),o("ElTabs",{on:{"tab-click":t.changeTab},model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},[o("ElTabPane",{attrs:{label:t.$t("conversation_manage.code_review_helper_tab"),name:"code_review"}}),t._v(" "),o("ElTabPane",{attrs:{label:t.$t("conversation_manage.unit_test_helper_tab"),name:"unit_test"}})],1),t._v(" "),o("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage}},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent}})],1)};t._withStripped=!0;var e=function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"node_count cursor-pointer",on:{click:t.showNotes}},[t._v("\n "+t._s(t.noteCount)+"\n")])};e._withStripped=!0;var o=function(){var t=this,e=t.$createElement;return(t._self._c||e)("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage},disableMinHeight:!0},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent}})};function a(t,e,o,a,i,n,s,r){var l,p="function"==typeof t?t.options:t;if(e&&(p.render=e,p.staticRenderFns=o,p._compiled=!0),a&&(p.functional=!0),n&&(p._scopeId="data-v-"+n),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},p._ssrRegister=l):i&&(l=r?function(){i.call(this,(p.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(p.functional){p._injectStyles=l;var c=p.render;p.render=function(t,e){return l.call(e),c(t,e)}}else{var h=p.beforeCreate;p.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:p}}o._withStripped=!0;const i=a({name:"NoteList",props:{rowData:{type:Object}},data:()=>({tableData:[],loading:!1,totalCount:0,page:1,perPage:10}),computed:{columns(){return[{label:this.$t("conversation_manage.file_path"),prop:"file","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.location"),prop:"location",width:100,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.content"),prop:"content","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.isAdopted"),prop:"is_adopted",width:100,formatter:t=>t.is_adopted?this.$t("site.yes"):this.$t("site.no")}]}},mounted(){this.getList()},methods:{changeCurrent(t){this.page=t,this.getList()},changeSize(t){this.perPage=t,this.page=1,this.getList()},getList(){this.loading=!0,this.api.conversationManage.getNoteList(this.rowData.id,{page:this.page,per_page:this.perPage}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=t.data||[]})).finally((()=>{this.loading=!1}))}}},o,[],!1,null,null,null).exports,n=a({name:"NoteCount",props:{rowData:{type:Object,required:!0}},computed:{noteCount(){return this.rowData.comment_count||0}},methods:{showNotes(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_report"),width:"60%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(i,{props:{rowData:this.rowData}})},footer:{render:t=>t(null)}}}),this.$store.commit("showDialog")}}},e,[],!1,null,"495d7414",null).exports;var s=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"conversation_status",class:t.conversationStatus.class},[t._v("\n "+t._s(t.conversationStatus.text)+"\n")])};s._withStripped=!0;const r=a({name:"ConversationStatus",props:{rowData:{type:Object}},computed:{conversationStatus(){const t=this.rowData.status;return{text:t,class:{RUNNING:"iconrunning",SUCCESS:"text-green",FAIL:"text-red",INIT:"warn",STOP:"text-muted"}[t]||""}}}},s,[],!1,null,"6a2bde98",null).exports;var l=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("span",{staticClass:"view_log cursor-pointer",on:{click:t.showLogs}},[t._v(t._s(t.$t("conversation_manage.view_detail")))])])};l._withStripped=!0;var p=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[t.execLog?o("pre",{staticClass:"log_detail"},[t._v(t._s(t.execLog))]):o("NoData",{staticClass:"no_data"})],1)};p._withStripped=!0;const c=a({name:"LogDialog",props:{rowData:{type:Object}},data:()=>({loading:!1,execLog:""}),computed:{isCodeReview(){return"code_review"===this.rowData.tab}},mounted(){this.getExecLog()},methods:{getExecLog(){this.loading=!0;let t=null;t=this.isCodeReview?this.api.conversationManage.logDetail(this.rowData.id):this.api.conversationManage.unitTestLogDetail(this.rowData.uuid),t.then((({data:t})=>{this.isCodeReview?this.execLog=t.map((t=>`[${moment(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}] ${t.step} ${t.message} ${t.duration?`${this.$t("conversation_manage.use_time")}(${t.duration})`:""}`)).join("\n"):this.execLog=t.join("\n")})).finally((()=>{this.loading=!1}))}}},p,[],!1,null,null,null).exports,h=a({name:"LogDetail",props:{rowData:{type:Object,required:!0}},data:()=>({loading:!1}),methods:{showLogs(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_logs"),width:"40%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(c,{props:{rowData:this.rowData}})},footer:{render:t=>t(null)}}}),this.$store.commit("showDialog")}}},l,[],!1,null,"520d83cc",null).exports;var g=function(){var t=this,e=t.$createElement;return(t._self._c||e)("MoreActions",{attrs:{menu:t.actions,width:"80"}})};g._withStripped=!0;const d=a({name:"LabelColumnAction",components:{MoreActions:window.comps.MoreActions},props:{rowData:Object},computed:{actions(){return[{label:this.$t("conversation_manage.restart_run"),prop:"restart",action:this.reStart,visible:!["RUNNING"].includes(this.rowData.status)},{label:this.$t("conversation_manage.stop_task"),prop:"stop",action:this.delete,visible:["INIT","RUNNING"].includes(this.rowData.status)}].filter((t=>t.visible))}},methods:{reStart(){this.$emit("action","restartTask",this.rowData)},delete(){this.$emit("action","stopTask",this.rowData)}}},g,[],!1,null,null,null).exports,_=a({name:"ConversationManage",data:()=>({tab:"code_review",tableData:[],totalCount:0,page:1,perPage:20,loading:!1}),computed:{codeReviewColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_pr"),prop:"pr_title","show-overflow-tooltip":!0,formatter:t=>`!${t.pr_iid} ${t.pr_title}`},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?moment(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?moment(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.note_count"),prop:"comment_count",component:n,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:h},{label:this.$t("action"),prop:"action",width:100,component:d,action:this.handleRowAction}]},unitTestColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_branch"),prop:"target_branch","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.change_count"),prop:"commit_interval","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?moment(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?moment(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:h},{label:this.$t("conversation_manage.adoption_status"),prop:"is_adopted",formatter:t=>t.is_adopted?this.$t("conversation_manage.adoption_yes"):this.$t("conversation_manage.adoption_no")},{label:this.$t("action"),prop:"action",width:100,component:d,action:this.handleRowAction}]},isCodeReview(){return"code_review"===this.tab},columns(){return this.isCodeReview?this.codeReviewColumns:this.unitTestColumns}},mounted(){this.getList()},methods:{changeSize(t){this.perPage=t,this.page=1,this.getList()},changeCurrent(t){this.page=t,this.getList()},changeTab(){this.page=1,this.tableData=[],this.totalCount=0,this.getList()},getList(){this.loading=!0,this.api.conversationManage[this.isCodeReview?"getCodeReviewList":"getUnitTestList"]({page:this.page,per_page:this.perPage}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=(t.data||[]).map((t=>({...t,tab:this.tab})))||[]})).finally((()=>{this.loading=!1}))},restartTask(t){this.$confirm(this.$t("conversation_manage.restart_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,o,a)=>{if("confirm"===e){o.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.reStartTask(t.id):this.api.conversationManage.reStartUnitTestTask(t.uuid),e.then((()=>{this.getList(),a()})).finally((()=>{o.confirmButtonLoading=!1}))}else a()}})},stopTask(t){this.$confirm(this.$t("conversation_manage.stop_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,o,a)=>{if("confirm"===e){o.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.stopTask(t.id):this.api.conversationManage.stopUnitTestTask(t.uuid),e.then((()=>{this.getList(),a()})).finally((()=>{o.confirmButtonLoading=!1}))}else a()}})}}},t,[],!1,null,null,null).exports;window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/conversation_manage`,name:"company#search",component:_,meta:{title:()=>"会话管理"}}]),window.GITEE.api.register("conversationManage","getCodeReviewList",(t=>window.GITEE.tools.$http.get("/api/xtreme/api/review_tasks",{params:t}))),window.GITEE.api.register("conversationManage","getUnitTestList",(t=>window.GITEE.tools.$http.get("/api/xtreme/api/unit_test_tasks",{params:t}))),window.GITEE.api.register("conversationManage","getNoteList",((t,e)=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/notes`,{params:e}))),window.GITEE.api.register("conversationManage","reStartTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","stopTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/break`))),window.GITEE.api.register("conversationManage","logDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/logs`))),window.GITEE.api.register("conversationManage","stopUnitTestTask",(t=>window.GITEE.tools.$http.delete(`/api/xtreme/api/unit_test_tasks/${t}/cancel`))),window.GITEE.api.register("conversationManage","reStartUnitTestTask",(t=>window.GITEE.tools.$http.post(`/api/xtreme/api/unit_test_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","unitTestLogDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/unit_test_tasks/${t}/logs`)))})();
1
+ (()=>{"use strict";var t=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("PageTitle",[t._v(t._s(t.$t("conversation_manage.title")))]),t._v(" "),a("div",{staticClass:"tabs-container"},[a("ElTabs",{on:{"tab-click":t.changeTab},model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},[a("ElTabPane",{attrs:{label:t.$t("conversation_manage.code_review_helper_tab"),name:"code_review"}}),t._v(" "),a("ElTabPane",{attrs:{label:t.$t("conversation_manage.unit_test_helper_tab"),name:"unit_test"}})],1),t._v(" "),a("FilterIcon",{staticClass:"filter_icon",attrs:{"show-search-filter":t.showSearchFilter},on:{"update:showSearchFilter":function(e){t.showSearchFilter=e},"update:show-search-filter":function(e){t.showSearchFilter=e}}})],1),t._v(" "),a("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage}},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent},scopedSlots:t._u([{key:"header",fn:function(){return[a("SearchFilter",{ref:"searchFilter",attrs:{opened:t.showSearchFilter},on:{search:t.handleSearch}})]},proxy:!0}])})],1)};t._withStripped=!0;var e=function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"node_count cursor-pointer",on:{click:t.showNotes}},[t._v("\n "+t._s(t.noteCount)+"\n")])};e._withStripped=!0;var a=function(){var t=this,e=t.$createElement;return(t._self._c||e)("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage},disableMinHeight:!0},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent}})};function o(t,e,a,o,i,s,n,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=a,c._compiled=!0),o&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),n?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},c._ssrRegister=l):i&&(l=r?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var p=c.render;c.render=function(t,e){return l.call(e),p(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}a._withStripped=!0;const i=o({name:"NoteList",props:{rowData:{type:Object}},data:()=>({tableData:[],loading:!1,totalCount:0,page:1,perPage:10}),computed:{columns(){return[{label:this.$t("conversation_manage.file_path"),prop:"file","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.location"),prop:"location",width:100,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.content"),prop:"content","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.isAdopted"),prop:"is_adopted",width:100,formatter:t=>t.is_adopted?this.$t("site.yes"):this.$t("site.no")}]}},mounted(){this.getList()},methods:{changeCurrent(t){this.page=t,this.getList()},changeSize(t){this.perPage=t,this.page=1,this.getList()},getList(){this.loading=!0,this.api.conversationManage.getNoteList(this.rowData.id,{page:this.page,per_page:this.perPage}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=t.data||[]})).finally((()=>{this.loading=!1}))}}},a,[],!1,null,null,null).exports,s=o({name:"NoteCount",props:{rowData:{type:Object,required:!0}},computed:{noteCount(){return this.rowData.comment_count||0}},methods:{showNotes(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_report"),width:"60%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(i,{props:{rowData:this.rowData}})},footer:{render:t=>t(null)}}}),this.$store.commit("showDialog")}}},e,[],!1,null,"495d7414",null).exports;var n=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"conversation_status",class:t.conversationStatus.class},[t._v("\n "+t._s(t.conversationStatus.text)+"\n")])};n._withStripped=!0;const r=o({name:"ConversationStatus",props:{rowData:{type:Object}},computed:{conversationStatus(){const t=this.rowData.status;return{text:t,class:{RUNNING:"iconrunning",SUCCESS:"text-green",FAIL:"text-red",INIT:"warn",STOP:"text-muted"}[t]||""}}}},n,[],!1,null,"6a2bde98",null).exports;var l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("span",{staticClass:"view_log cursor-pointer",on:{click:t.showLogs}},[t._v(t._s(t.$t("conversation_manage.view_detail")))])])};l._withStripped=!0;var c=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.execLog||t.loading?a("div",{ref:"logDetail",staticClass:"log_detail_wrap"},[a("pre",{staticClass:"log_detail"},[t._v(t._s(t.execLog))]),t._v(" "),t.loading?a("i",{staticClass:"el-icon-loading"}):t._e()]):a("NoData",{staticClass:"no_data"}),t._v(" "),a("div",{staticClass:"footer_wrap"},[a("el-button",{attrs:{type:"primary"},on:{click:t.handleRefresh}},[t._v("\n "+t._s(t.$t("conversation_manage.refresh"))+"\n ")])],1)],1)};c._withStripped=!0;const p=o({name:"LogDialog",props:{rowData:{type:Object}},data:()=>({loading:!0,execLog:"",timer:null}),computed:{isCodeReview(){return"code_review"===this.rowData.tab}},mounted(){this.getExecLog()},beforeDestroy(){this.stopGetDetail()},methods:{stopGetDetail(){this.timer&&clearTimeout(this.timer)},getExecLog(){this.toBottom();let t=null;t=this.isCodeReview?this.api.conversationManage.logDetail(this.rowData.id):this.api.conversationManage.unitTestLogDetail(this.rowData.uuid),t.then((({data:t})=>{this.isCodeReview?this.execLog=t.logs.map((t=>`[${moment(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}] ${t.step} ${t.message} ${t.duration?`${this.$t("conversation_manage.use_time")}(${t.duration})`:""}`)).join("\n"):this.execLog=t.logs.join("\n"),this.$emit("update:rowData",{...t}),this.toBottom(),["INIT","RUNNING"].includes(this.rowData.status)&&["INIT","RUNNING"].includes(t.status)&&(this.timer=setTimeout((()=>{this.getExecLog()}),5e3)),["INIT","RUNNING"].includes(t.status)||(this.loading=!1)}))},toBottom(){this.$nextTick((()=>{this.$refs.logDetail&&(this.$refs.logDetail.scrollTop=this.$refs.logDetail.scrollHeight)}))},handleRefresh(){this.stopGetDetail(),this.getExecLog()}}},c,[],!1,null,null,null).exports,h=o({name:"LogDetail",props:{rowData:{type:Object,required:!0}},data:()=>({loading:!1,row:null}),methods:{showLogs(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_logs"),width:"40%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(p,{ref:"logDialog",props:{rowData:this.rowData},on:{"update:rowData":t=>{this.row=t}}})},footer:{render:t=>t(null)}},events:{close:this.handleCancel}}),this.$store.commit("showDialog")},handleCancel(){this.$emit("action","updateRow",{...this.rowData,...this.row}),this.$store.commit("hideDialog")}}},l,[],!1,null,"a169622c",null).exports;var d=function(){var t=this,e=t.$createElement;return(t._self._c||e)("MoreActions",{attrs:{menu:t.actions,width:"80"}})};d._withStripped=!0;const g=o({name:"LabelColumnAction",components:{MoreActions:window.comps.MoreActions},props:{rowData:Object},computed:{actions(){return[{label:this.$t("conversation_manage.restart_run"),prop:"restart",action:this.reStart,visible:!["RUNNING"].includes(this.rowData.status)},{label:this.$t("conversation_manage.stop_task"),prop:"stop",action:this.delete,visible:["INIT","RUNNING"].includes(this.rowData.status)}].filter((t=>t.visible))}},methods:{reStart(){this.$emit("action","restartTask",this.rowData)},delete(){this.$emit("action","stopTask",this.rowData)}}},d,[],!1,null,null,null).exports;var m=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("CommonListFilter",{attrs:{"clear-disabled":t.clearDisabled,opened:t.opened,placeholder:t.$t_join("please_enter","conversation_manage.repo_name")},on:{search:t.handleSearch,clearFilter:t.clearFilter},scopedSlots:t._u([{key:"filterRight",fn:function(){return[a("DropDown",{attrs:{label:t.$t("conversation_manage.conversation_status"),options:t.types,value:t.status},on:{input:t.handleCommand}})]},proxy:!0}]),model:{value:t.keywords,callback:function(e){t.keywords=e},expression:"keywords"}})};m._withStripped=!0;const u=o({name:"SearchFilter",components:{DropDown:window.comps.DropDown,CommonListFilter:window.comps.CommonListFilter},props:{opened:Boolean},data:()=>({keywords:"",status:null}),computed:{clearDisabled(){return!this.keywords&&!this.status},types:()=>[{label:"RUNNING",value:"RUNNING"},{label:"SUCCESS",value:"SUCCESS"},{label:"FAIL",value:"FAIL"},{label:"INIT",value:"INIT"},{label:"STOP",value:"STOP"}]},methods:{handleSearch(){this.$emit("search",{keywords:this.keywords,status:this.status})},handleCommand(t){this.status=t,this.handleSearch()},clearFilter(){this.clearSearchData(),this.handleSearch()},clearSearchData(){this.keywords="",this.status=null}}},m,[],!1,null,null,null).exports,_=o({name:"ConversationManage",components:{FilterIcon:window.comps.FilterIcon,SearchFilter:u},data:()=>({tab:"code_review",tableData:[],totalCount:0,page:1,perPage:20,loading:!1,showSearchFilter:!0,params:null}),computed:{codeReviewColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_pr"),prop:"pr_title","show-overflow-tooltip":!0,formatter:t=>`!${t.pr_iid} ${t.pr_title}`},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?moment(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?moment(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.note_count"),prop:"comment_count",component:s,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:h,action:this.handleRowAction},{label:this.$t("action"),prop:"action",width:100,component:g,action:this.handleRowAction}]},unitTestColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_branch"),prop:"target_branch","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.change_count"),prop:"commit_interval","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?moment(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?moment(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:h},{label:this.$t("conversation_manage.adoption_status"),prop:"is_adopted",formatter:t=>t.is_adopted?this.$t("conversation_manage.adoption_yes"):this.$t("conversation_manage.adoption_no"),action:this.handleRowAction},{label:this.$t("action"),prop:"action",width:100,component:g,action:this.handleRowAction}]},isCodeReview(){return"code_review"===this.tab},columns(){return this.isCodeReview?this.codeReviewColumns:this.unitTestColumns}},mounted(){this.getList()},methods:{changeSize(t){this.perPage=t,this.page=1,this.getList()},changeCurrent(t){this.page=t,this.getList()},changeTab(){this.$refs.searchFilter.clearFilter(),this.params=null,this.page=1,this.tableData=[],this.totalCount=0,this.getList()},getList(){this.loading=!0,this.api.conversationManage[this.isCodeReview?"getCodeReviewList":"getUnitTestList"]({page:this.page,per_page:this.perPage,...this.params}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=(t.data||[]).map((t=>({...t,tab:this.tab})))||[]})).finally((()=>{this.loading=!1}))},restartTask(t){this.$confirm(this.$t("conversation_manage.restart_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,a,o)=>{if("confirm"===e){a.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.reStartTask(t.id):this.api.conversationManage.reStartUnitTestTask(t.uuid),e.then((()=>{this.getList(),o()})).finally((()=>{a.confirmButtonLoading=!1}))}else o()}})},stopTask(t){this.$confirm(this.$t("conversation_manage.stop_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,a,o)=>{if("confirm"===e){a.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.stopTask(t.id):this.api.conversationManage.stopUnitTestTask(t.uuid),e.then((()=>{this.getList(),o()})).finally((()=>{a.confirmButtonLoading=!1}))}else o()}})},handleSearch(t){this.params=t,this.page=1,this.getList()},updateRow(t){const e=this.tableData.findIndex((e=>e.id===t.id));this.$set(this.tableData,e,{...t})}}},t,[],!1,null,"27dff7de",null).exports;window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/conversation_manage`,name:"company#search",component:_,meta:{title:()=>"会话管理"}}]),window.GITEE.api.register("conversationManage","getCodeReviewList",(t=>window.GITEE.tools.$http.get("/api/xtreme/api/review_tasks",{params:t}))),window.GITEE.api.register("conversationManage","getUnitTestList",(t=>window.GITEE.tools.$http.get("/api/xtreme/api/unit_test_tasks",{params:t}))),window.GITEE.api.register("conversationManage","getNoteList",((t,e)=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/notes`,{params:e}))),window.GITEE.api.register("conversationManage","reStartTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","stopTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/break`))),window.GITEE.api.register("conversationManage","logDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/${t}/logs`))),window.GITEE.api.register("conversationManage","stopUnitTestTask",(t=>window.GITEE.tools.$http.delete(`/api/xtreme/api/unit_test_tasks/${t}/cancel`))),window.GITEE.api.register("conversationManage","reStartUnitTestTask",(t=>window.GITEE.tools.$http.post(`/api/xtreme/api/unit_test_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","unitTestLogDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/api/unit_test_tasks/${t}/logs`)))})();
@@ -0,0 +1 @@
1
+ (()=>{GITEE.i18n.mergeI18n("zh-CN",{company_settings:{code_review_question_types:"代码评审问题类型"}}),GITEE.i18n.mergeI18n("en-US",{company_settings:{code_review_question_types:"Code review question types"}});const e={name:"problemTypeTab",data:()=>({problemTypeList:[],tableLoading:!1,page:1,totalCount:0,editId:0,dialogVisible:!1,submitting:!1,detailLoading:!1,form:{name:"",description:""},rules:{name:[{required:!0}],description:[{required:!0}]},detailData:{}}),computed:{loading(){return!this.problemTypeList.length&&this.tableLoading},pending(){return!!this.problemTypeList.length&&this.tableLoading},columns(){return[{label:"问题类型",prop:"name",showOverflowTooltip:!0},{label:"问题描述",prop:"description",showOverflowTooltip:!0},{label:"操作",component:{props:["rowData"],template:'\n <more-actions\n :menu="actions"\n width="68"\n align="center"\n />\n ',data(){return{actions:[{label:"编辑",action:()=>{this.$emit("action","handleEdit",this.rowData)}},{label:"删除",action:()=>{this.$emit("action","handleDelete",this.rowData)}}]}}},action:this.handleRowAction,width:"76"}]},title(){return(this.editId?"修改":"新建")+"问题类型"}},created(){this.getList()},methods:{getList(){this.tableLoading=!0;const e={page:this.page,per_page:20};GITEE.tools.$http.get(`${GITEE.api.goComApiPrefix()}/pull_request_problem_types`,{params:e}).then((({data:e})=>{this.problemTypeList=e.data,this.totalCount=e.meta.total_count})).finally((()=>{this.tableLoading=!1}))},getDetail(){this.detailLoading=!0,GITEE.tools.$http.get(`${GITEE.api.goComApiPrefix()}/pull_request_problem_types/${this.editId}`).then((({data:e})=>{this.detailData=e,Object.keys(this.form).forEach((e=>{this.form[e]=this.detailData[e]}))})).finally((()=>{this.detailLoading=!1}))},handleRowAction(e,...t){const i=this[e];i&&i(...t)},handleEdit(e){this.dialogVisible=!0,this.editId=e.id,this.getDetail()},handleDelete(e){this.$confirm("确定要删除该问题类型吗?","删除",{beforeClose:(t,i,n)=>{"confirm"===t?(i.confirmButtonLoading=!0,GITEE.tools.$http.delete(`${GITEE.api.goComApiPrefix()}/pull_request_problem_types/${e.id}`).then((()=>{this.$message.success(GITEE.i18n.$t("company_settings.delete_success")),this.page=1,this.getList(),n()})).finally((()=>{i.confirmButtonLoading=!1}))):n()}})},handleCreateNew(){this.dialogVisible=!0},handleDialogClose(){this.editId=0,this.detailData={},this.dialogVisible=!1,this.$refs.form.resetFields()},handleSubmit(){this.$refs.form.validate((e=>{e&&((this.editId?GITEE.tools.$http.put(`${GITEE.api.goComApiPrefix()}/pull_request_problem_types/${this.detailData.id}`,{...this.form}):GITEE.tools.$http.post(`${GITEE.api.goComApiPrefix()}/pull_request_problem_types`,{...this.form})).then((({data:e})=>{this.getList(),this.$message.success(e.message)})),this.handleDialogClose(),this.page=1)}))},changeCurrent(e){this.page=e,this.getList()}},template:'\n <div>\n <page-title>\n <span>代码评审问题类型</span>\n <el-button type="osc" @click="handleCreateNew"><i class="iconfont-new iconadd-code" /> 新建问题类型</el-button>\n </page-title>\n <common-list\n ref="table"\n :table-data="problemTypeList"\n :columns="columns"\n :loading="loading"\n :pending="pending"\n :pagination="{\n count: totalCount,\n page: page,\n per_page: 20,\n layout: \'prev, pager, next\'\n }"\n @changeCurrent="changeCurrent"\n />\n <el-dialog\n :title="title"\n :visible.sync="dialogVisible"\n width="40%"\n :on-ok="handleSubmit"\n :on-cancel="handleDialogClose"\n :confirm-loading="submitting"\n @closed="handleDialogClose"\n >\n <el-form ref="form" v-loading="detailLoading" :model="form" :rules="rules" class="w100">\n <el-form-item label="问题类型" prop="name">\n <el-input v-model.trim="form.name" maxlength="50" placeholder="请输入问题类型" />\n </el-form-item>\n <el-form-item label="问题描述" prop="description">\n <el-input v-model.trim="form.description" maxlength="200" placeholder="请输入问题描述" />\n </el-form-item>\n </el-form>\n </el-dialog>\n </div>\n '};GITEE.event.REGISTER_EVENT(window.CODE_EVENTS_NAME.AFTER_INFORMATION,(t=>{const{feature_toggles:i}=t;GITEE.schema.update({TAB_PANES:{ENTERPRISE_STANDARD:{PANE:[{name:"branchPrefix",visible:i.branch_prefix_enabled},{name:"repoGlobalSetting",visible:i.repo_global_setting_enabled},{name:"problemType",label:GITEE.i18n.$t("company_settings.code_review_question_types"),component:e}]},COMPANY_ACTION_LOG:{PANE:[{name:"server_hook_logs",visible:!1}]}}})})),GITEE.schema.update({FORM:{PUSH_SETTINGS_ENTERPRISE_SETTINGS:{ITEMS:[{key:"gpg_verify_enabled",visible:!1}]},ENTERPRISE_SETTINGS:{ITEMS:[{key:"fork_enabled",visible:!1},{key:"file_access_enabled",visible:GITEE.information.FEATURE_TOGGLES.file_access_enabled},{key:"issue_enabled",visible:GITEE.information.FEATURE_TOGGLES.repo_issue_enabled},{key:"wiki_enabled",visible:GITEE.information.FEATURE_TOGGLES.wiki_enabled}]}}})})();
package/dist/group.js ADDED
@@ -0,0 +1 @@
1
+ GITEE.event.REGISTER_EVENT(window.CODE_EVENTS_NAME.AFTER_INFORMATION,(e=>{const{feature_toggles:i}=e;GITEE.schema.update({FORM:{GROUP_BASIC_SETTINGS:{ITEMS:[{key:"name",meta:{disabled:!i.edit_group_name_enabled}},{key:"description",meta:{disabled:!i.edit_group_description_enabled}}]},REPO_GROUP_SETTINGS:{ITEMS:[{key:"permission_group",visible:i.create_subgroup_enabled}]},NEW_REPO_FROM:{ITEMS:[{key:"enterprise_branch_plan_id",visible:i.branch_specification_enabled}]},ENTERPRISE_SPACE_SETTINGS:{ITEMS:[{key:"maximum_space",visible:i.create_individual_repo_enabled},{key:"personal_projects_limit",visible:i.create_individual_repo_enabled}]}}})})),GITEE.schema.update({GROUP_NAVS:()=>[{name:"group#statistics",title:GITEE.i18n.$t("code.statistics"),permission:!1},{name:"group#template_settings",title:GITEE.i18n.$t("groups.nav.group_template_manger"),permission:!1},{name:"group#label_settings",title:GITEE.i18n.$t("settings.pr_labels_settings"),permission:!1}]});
@@ -0,0 +1 @@
1
+ (()=>{"use strict";function e(){if(!(this instanceof e))return new e;this.size=0,this.uid=0,this.selectors=[],this.selectorObjects={},this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var t=window.document.documentElement,r=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.msMatchesSelector;e.prototype.matchesSelector=function(e,t){return r.call(e,t)},e.prototype.querySelectorAll=function(e,t){return t.querySelectorAll(e)},e.prototype.indexes=[];var n=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;e.prototype.indexes.push({name:"ID",selector:function(e){var t;if(t=e.match(n))return t[0].slice(1)},element:function(e){if(e.id)return[e.id]}});var o=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;e.prototype.indexes.push({name:"CLASS",selector:function(e){var t;if(t=e.match(o))return t[0].slice(1)},element:function(e){var t=e.className;if(t){if("string"==typeof t)return t.split(/\s/);if("object"==typeof t&&"baseVal"in t)return t.baseVal.split(/\s/)}}});var i,s=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;e.prototype.indexes.push({name:"TAG",selector:function(e){var t;if(t=e.match(s))return t[0].toUpperCase()},element:function(e){return[e.nodeName.toUpperCase()]}}),e.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},i="function"==typeof window.Map?window.Map:function(){function e(){this.map={}}return e.prototype.get=function(e){return this.map[e+" "]},e.prototype.set=function(e,t){this.map[e+" "]=t},e}();var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function c(e,t){var r,n,o,i,s,c,l=(e=e.slice(0).concat(e.default)).length,u=t,d=[];do{if(a.exec(""),(o=a.exec(u))&&(u=o[3],o[2]||!u))for(r=0;r<l;r++)if(s=(c=e[r]).selector(o[1])){for(n=d.length,i=!1;n--;)if(d[n].index===c&&d[n].key===s){i=!0;break}i||d.push({index:c,key:s});break}}while(o);return d}function l(e,t){var r,n,o;for(r=0,n=e.length;r<n;r++)if(o=e[r],t.isPrototypeOf(o))return o}function u(e,t){return e.id-t.id}e.prototype.logDefaultIndexUsed=function(){},e.prototype.add=function(e,t){var r,n,o,s,a,u,d,f,h=this.activeIndexes,p=this.selectors,v=this.selectorObjects;if("string"==typeof e){for(v[(r={id:this.uid++,selector:e,data:t}).id]=r,d=c(this.indexes,e),n=0;n<d.length;n++)s=(f=d[n]).key,(a=l(h,o=f.index))||((a=Object.create(o)).map=new i,h.push(a)),o===this.indexes.default&&this.logDefaultIndexUsed(r),(u=a.map.get(s))||(u=[],a.map.set(s,u)),u.push(r);this.size++,p.push(e)}},e.prototype.remove=function(e,t){if("string"==typeof e){var r,n,o,i,s,a,l,u,d=this.activeIndexes,f=this.selectors=[],h=this.selectorObjects,p={},v=1===arguments.length;for(r=c(this.indexes,e),o=0;o<r.length;o++)for(n=r[o],i=d.length;i--;)if(a=d[i],n.index.isPrototypeOf(a)){if(l=a.map.get(n.key))for(s=l.length;s--;)(u=l[s]).selector!==e||!v&&u.data!==t||(l.splice(s,1),p[u.id]=!0);break}for(o in p)delete h[o],this.size--;for(o in h)f.push(h[o].selector)}},e.prototype.queryAll=function(e){if(!this.selectors.length)return[];var t,r,n,o,i,s,a,c,l={},d=[],f=this.querySelectorAll(this.selectors.join(", "),e);for(t=0,n=f.length;t<n;t++)for(i=f[t],r=0,o=(s=this.matches(i)).length;r<o;r++)l[(c=s[r]).id]?a=l[c.id]:(a={id:c.id,selector:c.selector,data:c.data,elements:[]},l[c.id]=a,d.push(a)),a.elements.push(i);return d.sort(u)},e.prototype.matches=function(e){if(!e)return[];var t,r,n,o,i,s,a,c,l,d,f,h=this.activeIndexes,p={},v=[];for(t=0,o=h.length;t<o;t++)if(c=(a=h[t]).element(e))for(r=0,i=c.length;r<i;r++)if(l=a.map.get(c[r]))for(n=0,s=l.length;n<s;n++)!p[f=(d=l[n]).id]&&this.matchesSelector(e,d.selector)&&(p[f]=!0,v.push(d));return v.sort(u)};var d=null,f=null,h=[];function p(e,t){var r=[];function n(){var e=r;r=[],t(e)}return function(){for(var t=arguments.length,o=Array(t),i=0;i<t;i++)o[i]=arguments[i];r.push(o),1===r.length&&v(e,n)}}function v(e,t){f||(f=new MutationObserver(m)),d||(d=e.createElement("div"),f.observe(d,{attributes:!0})),h.push(t),d.setAttribute("data-twiddle",""+Date.now())}function m(){var e=h;h=[];for(var t=0;t<e.length;t++)try{e[t]()}catch(e){setTimeout((function(){throw e}),0)}}var b=new WeakMap,g=new WeakMap,y=new WeakMap,S=new WeakMap;function w(e,t){for(var r=0;r<t.length;r++){var n=t[r],o=n[0],i=n[1],s=n[2];o===N?(_(s,i),x(s,i)):o===k?O(s,i):o===C&&A(e.observers,i)}}function _(e,t){if(t instanceof e.elementConstructor){var r=b.get(t);if(r||(r=[],b.set(t,r)),-1===r.indexOf(e.id)){var n=void 0;if(e.initialize&&(n=e.initialize.call(void 0,t)),n){var o=g.get(t);o||(o={},g.set(t,o)),o[""+e.id]=n}r.push(e.id)}}}function x(e,t){if(t instanceof e.elementConstructor){var r=S.get(t);if(r||(r=[],S.set(t,r)),-1===r.indexOf(e.id)){e.elements.push(t);var n=g.get(t),o=n?n[""+e.id]:null;if(o&&o.add&&o.add.call(void 0,t),e.subscribe){var i=e.subscribe.call(void 0,t);if(i){var s=y.get(t);s||(s={},y.set(t,s)),s[""+e.id]=i}}e.add&&e.add.call(void 0,t),r.push(e.id)}}}function O(e,t){if(t instanceof e.elementConstructor){var r=S.get(t);if(r){var n=e.elements.indexOf(t);if(-1!==n&&e.elements.splice(n,1),-1!==(n=r.indexOf(e.id))){var o=g.get(t),i=o?o[""+e.id]:null;if(i&&i.remove&&i.remove.call(void 0,t),e.subscribe){var s=y.get(t),a=s?s[""+e.id]:null;a&&a.unsubscribe&&a.unsubscribe()}e.remove&&e.remove.call(void 0,t),r.splice(n,1)}0===r.length&&S.delete(t)}}}function A(e,t){var r=S.get(t);if(r){for(var n=r.slice(0),o=0;o<n.length;o++){var i=e[n[o]];if(i){var s=i.elements.indexOf(t);-1!==s&&i.elements.splice(s,1);var a=g.get(t),c=a?a[""+i.id]:null;c&&c.remove&&c.remove.call(void 0,t);var l=y.get(t),u=l?l[""+i.id]:null;u&&u.unsubscribe&&u.unsubscribe(),i.remove&&i.remove.call(void 0,t)}}S.delete(t)}}var E=null;function M(e){return"matches"in e||"webkitMatchesSelector"in e||"mozMatchesSelector"in e||"oMatchesSelector"in e||"msMatchesSelector"in e}var N=1,k=2,C=3;function I(e,t,r){for(var n=0;n<r.length;n++){var o=r[n];if(M(o))for(var i=e.selectorSet.matches(o),s=0;s<i.length;s++){var a=i[s].data;t.push([N,o,a])}if("querySelectorAll"in o)for(var c=e.selectorSet.queryAll(o),l=0;l<c.length;l++)for(var u=c[l],d=u.data,f=u.elements,h=0;h<f.length;h++)t.push([N,f[h],d])}}function T(e,t,r){for(var n=0;n<r.length;n++){var o=r[n];if("querySelectorAll"in o){t.push([C,o]);for(var i=o.querySelectorAll("*"),s=0;s<i.length;s++)t.push([C,i[s]])}}}function F(e,t,r){if(M(r))for(var n=e.selectorSet.matches(r),o=0;o<n.length;o++){var i=n[o].data;t.push([N,r,i])}if("querySelectorAll"in r){var s=S.get(r);if(s)for(var a=0;a<s.length;a++){var c=e.observers[s[a]];c&&(e.selectorSet.matchesSelector(r,c.selector)||t.push([k,r,c]))}}}var q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D=0;function j(t){var r,n,o;this.rootNode=9===t.nodeType?t.documentElement:t,this.ownerDocument=9===t.nodeType?t:t.ownerDocument,this.observers=[],this.selectorSet=new e,this.mutationObserver=new MutationObserver(R.bind(this,this)),this._scheduleAddRootNodes=p(this.ownerDocument,L.bind(this,this)),this._handleThrottledChangedTargets=p(this.ownerDocument,G.bind(this,this)),this.rootNode.addEventListener("change",P.bind(this,this),!1),r=this.ownerDocument,n=z.bind(this,this),"interactive"===(o=r.readyState)||"complete"===o?v(r,n):r.addEventListener("DOMContentLoaded",v(r,n))}function z(e){e.mutationObserver.observe(e.rootNode,{childList:!0,attributes:!0,subtree:!0}),e._scheduleAddRootNodes()}function L(e){var t=[];I(e,t,[e.rootNode]),w(e,t)}function R(e,t){var r=[];(function(e,t,r){for(var n=0;n<r.length;n++){var o=r[n];"childList"===o.type?(I(e,t,o.addedNodes),T(0,t,o.removedNodes)):"attributes"===o.type&&F(e,t,o.target)}(function(e){if(null===E){var t=e.createElement("div"),r=e.createElement("div"),n=e.createElement("div");t.appendChild(r),r.appendChild(n),t.innerHTML="",E=n.parentNode!==r}return E})(e.ownerDocument)&&function(e,t){for(var r=0;r<e.observers.length;r++){var n=e.observers[r];if(n)for(var o=n.elements,i=0;i<o.length;i++){var s=o[i];s.parentNode||t.push([C,s])}}}(e,t)})(e,r,t),w(e,r)}function P(e,t){e._handleThrottledChangedTargets(t.target)}function G(e,t){var r=[];!function(e,t,r){for(var n=0;n<r.length;n++)for(var o=r[n],i=o.form?o.form.elements:e.rootNode.querySelectorAll("input"),s=0;s<i.length;s++)F(e,t,i[s])}(e,r,t),w(e,r)}j.prototype.disconnect=function(){this.mutationObserver.disconnect()},j.prototype.observe=function(e,t){var r=void 0;"function"==typeof t?r={selector:e,initialize:t}:"object"===(void 0===t?"undefined":q(t))?(r=t).selector=e:r=e;var n=this,o={id:D++,selector:r.selector,initialize:r.initialize,add:r.add,remove:r.remove,subscribe:r.subscribe,elements:[],elementConstructor:r.hasOwnProperty("constructor")?r.constructor:this.ownerDocument.defaultView.Element,abort:function(){n._abortObserving(o)}};return this.selectorSet.add(o.selector,o),this.observers[o.id]=o,this._scheduleAddRootNodes(),o},j.prototype._abortObserving=function(e){for(var t=e.elements,r=0;r<t.length;r++)O(e,t[r]);this.selectorSet.remove(e.selector,e),delete this.observers[e.id]},j.prototype.triggerObservers=function(e){var t=[];!function(e,t,r){if("querySelectorAll"in r){F(e,t,r);for(var n=r.querySelectorAll("*"),o=0;o<n.length;o++)F(e,t,n[o])}}(this,t,e),w(this,t)};var U=void 0;function V(){var e;return(U||(U=new j(window.document)),e=U).observe.apply(e,arguments)}GITEE.schema.update({ACTION_KEYS:{PROJECTS_LIST:[{prop:"fork_repo",permission:!1}]},REPO_NAVS:[{name:"project#repository_images",title:GITEE.i18n.$t("router.repository_images"),permission:!1}]}),V(".bread_crumbs_nav .right-action .el-button-group",{add(e){e.querySelector(".iconfork")&&(e.style.display="none")}}),V(".code-project-list .common-nav #tab-forked",{add(e){e.style.display="none"}}),GITEE.tools.registerNamedMixin("Avatar",{computed:{avatarComponent:()=>"span"}}),GITEE.tools.registerNamedMixin("RepoPermissionConfigSettings",{computed:{extraBranchSettingsFormItems(){return[{key:"protected_branch_rule_enabled",value:!1,visible:!0,customComponent:"FormItemSwitch",meta:{label:this.$t("branch_manage.rule.title"),description:this.$t("company_settings.repo_global_init_text.repo_fun_permission_desc",{label:this.$t("branch_manage.rule.title")})}},{key:"enterprise_branch_plan_enabled",value:!1,visible:!0,customComponent:"FormItemSwitch",meta:{label:this.$t("branch_specification.use_enterprise_branch_specification"),description:this.repoSettingsLabelDesc("branch_specification.use_enterprise_branch_specification")}}]}}})})();
@@ -0,0 +1,18 @@
1
+ .problem-type {
2
+ margin-top: -8px;
3
+ margin-left: 22px;
4
+ }
5
+ .comment_rejected--more--message {
6
+ width: 100%;
7
+ display: inline-block;
8
+ text-overflow: ellipsis;
9
+ overflow: hidden;
10
+ white-space: nowrap;
11
+ margin-left: 5px;
12
+ }
13
+ .problem-type-loading-text {
14
+ text-align: center;
15
+ }
16
+ .problem_type_filter {
17
+ margin: 0;
18
+ }
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{width:"50%"}},[a("el-checkbox",{attrs:{value:e.value},on:{change:function(t){return e.$emit("input",t)}}},[e._v(e._s(e.$t("pulls.automatic.desc")))]),e._v(" "),e.value?a("el-form-item",{attrs:{prop:"tag_type",label:e.$t("pulls.automatic.tag_type")}},[a("el-select",{attrs:{placeholder:e.$t_join("please_select","pulls.automatic.tag_type")},on:{change:e.tagTypeChange},model:{value:e.form.tag_type,callback:function(t){e.$set(e.form,"tag_type",t)},expression:"form.tag_type"}},e._l(e.tagType,(function(e){return a("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1):e._e(),e._v(" "),e.value?a("el-form-item",{attrs:{prop:e.value?"tag_name":""},scopedSlots:e._u([{key:"label",fn:function(){return[a("span",[e._v(e._s("custom_tag"===e.form.tag_type?e.$t_join("please_enter","pulls.automatic.version"):e.$t_join("please_select","pulls.automatic.version")))]),e._v(" "),a("el-tooltip",{attrs:{placement:"right",content:e.$t("pulls.automatic.tooltip")}},[a("i",{staticClass:"iconfont-new iconremark"})])]},proxy:!0}],null,!1,2997091695)},[e._v(" "),"custom_tag"===e.form.tag_type?[a("el-input",{attrs:{maxlength:"128",placeholder:e.$t_join("please_enter","pulls.automatic.version")},model:{value:e.form.tag_name,callback:function(t){e.$set(e.form,"tag_name",t)},expression:"form.tag_name"}})]:[a("el-select",{attrs:{value:e.form.tag_name,placeholder:e.$t_join("please_select","pulls.automatic.version"),"is-block":"",filterable:"","remote-method":e.getTagList},on:{"visible-change":e.handleVisibleChange,change:function(t){return e.$emit("form-change",{tag_name:t})}}},e._l(e.list,(function(e){return a("el-option",{key:e,attrs:{value:e,label:e}})})),1)]],2):e._e()],1)};function t(e,t,a,s,o,r,n,l){var i,p="function"==typeof e?e.options:e;if(t&&(p.render=t,p.staticRenderFns=a,p._compiled=!0),s&&(p.functional=!0),r&&(p._scopeId="data-v-"+r),n?(i=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(n)},p._ssrRegister=i):o&&(i=l?function(){o.call(this,(p.functional?this.parent:this).$root.$options.shadowRoot)}:o),i)if(p.functional){p._injectStyles=i;var _=p.render;p.render=function(e,t){return i.call(t),_(e,t)}}else{var c=p.beforeCreate;p.beforeCreate=c?[].concat(c,i):[i]}return{exports:e,options:p}}e._withStripped=!0;const a=t({name:"autoCreateTag",props:{form:{type:Object,default:()=>({})},value:{type:Boolean,default:!1},sourceBranch:{type:String,default:""}},data(){return{list:[],caches:{done:!1,list:[]},tagType:[{label:this.$t("pulls.automatic.custom_tag_name"),value:"custom_tag"},{label:this.$t("pulls.automatic.integrated_delivery"),value:"integrated_delivery"}]}},methods:{tagTypeChange(){this.form.tag_name=""},handleVisibleChange(e){e&&(this.caches.done?this.list=this.caches.list:this.getTagList())},getTagList(e=""){GITEE.tools.$http.get(`${GITEE.api.goApiProjectPrefix()}/pull_requests/auto_tags?keyword=${e}&source_branch=${this.sourceBranch}`).then((({data:t})=>{this.list=t.data,e||(this.caches.list=t.data,this.caches.done=!0)}))}}},e,[],!1,null,null,null).exports;var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return["enable_create_tag","edit_tag_name","disable_create_tag"].includes(e.item.action)?a("span",[e._v("\n "+e._s(e.item.desc)+"\n "),a("span",[e._v(e._s(e.item.data||""))])]):e._e()};s._withStripped=!0;const o=t({name:"createTagActionDesc",props:{item:{type:Object,default:()=>({})}}},s,[],!1,null,null,null).exports;var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.prProblemTypeEnabled?a("el-form-item",{staticClass:"problem-type",attrs:{prop:"problem_type_ids"}},[a("div",[e._v("选择评审问题类型")]),e._v(" "),a("el-select",{attrs:{multiple:"",filterable:"",remote:"",clearable:"",placeholder:"请选择","remote-method":e.remoteMethods,"infinite-scroll":"","infinite-scroll-load":e.loadMore,"is-block":""},on:{change:function(t){return e.$emit("form-change",{problem_type_ids:t})},"visible-change":e.handleVisibleChange},model:{value:e.problem_type_ids,callback:function(t){e.problem_type_ids=t},expression:"problem_type_ids"}},[e._l(e.problemList,(function(e){return a("el-tooltip",{key:e.id,attrs:{content:e.name,"show-overflow-tooltip":""}},[a("el-option",{attrs:{label:e.name,value:e.id}})],1)})),e._v(" "),e.loading?a("div",{staticClass:"problem-type-loading-text"},[a("i",{staticClass:"el-icon-loading"})]):e._e()],2)],1):e._e()};r._withStripped=!0;const n=t({name:"prCommentproblemType",props:{form:{type:Object,default:()=>({})}},data:()=>({problemList:[],problem_type_ids:[],meta:{current_page:1,total_count:0,total_pages:0},loading:!1,keywords:""}),computed:{prProblemTypeEnabled(){return"rejected"===this.form.state&&GITEE.vuex.store.state.project.pr_problem_type_enabled}},watch:{"form.state":{handler(){this.problem_type_ids=[]}}},methods:{getList(){this.loading=!0;const e={page:this.meta.current_page,per_page:20,keywords:this.keywords};GITEE.tools.$http.get(`${GITEE.api.goComApiPrefix()}/pull_request_problem_types`,{params:e}).then((({data:e})=>{this.problemList=[...this.problemList,...e.data],this.meta=e.meta})).finally((()=>{this.loading=!1}))},loadMore(){!this.loading&&this.meta.current_page<this.meta.total_pages&&(this.meta.current_page+=1,this.getList())},remoteMethods(e){this.meta.current_page=1,this.problemList=[],this.keywords=e,this.getList()},handleVisibleChange(e){this.keywords="",e&&(this.meta.current_page=1,this.problemList=[],this.getList())}}},r,[],!1,null,null,null).exports;var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return"rejected"===e.data.data.state&&e.data.data.problem_type_refs.length?a("el-tooltip",{attrs:{content:e.moreMessage,"show-overflow-tooltip":""}},[a("span",{staticClass:"comment_rejected--more--message"},[e._v(e._s(e.moreMessage))])]):e._e()};l._withStripped=!0;const i=t({name:"commentMoreMessage",props:{data:{type:Object,default:()=>({})}},computed:{moreMessage(){return"评审问题类型: "+this.data.data.problem_type_refs?.map((e=>e.name)).join(",")}}},l,[],!1,null,null,null).exports;var p=function(){var e=this,t=e.$createElement,a=e._self._c||t;return"rejected"===e.data.approve_status?a("el-tooltip",{attrs:{content:e.moreMessage,"show-overflow-tooltip":""}},[a("span",{staticClass:"comment_rejected--more--message"},[e._v(e._s(e.moreMessage))])]):e._e()};p._withStripped=!0;const _=t({name:"reviewerCommentReason",props:{data:{type:Object,default:()=>({})}},computed:{moreMessage(){return this.data.problem_type_refs.map((e=>e.name)).join(",")}}},p,[],!1,null,null,null).exports;var c=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("common-dropdown",{attrs:{"default-name":"问题类型",width:"300",filterable:"",remote:"",multiple:"","rencent-options":e.problemList,"selected-options":e.selectedOptions,loading:e.loading,border:!1,scroll:""},on:{"update:selectedOptions":function(t){e.selectedOptions=t},"update:selected-options":function(t){e.selectedOptions=t},show:e.handleShow,search:e.handleSearch,hide:e.handleHide,scroll:e.loadMore},scopedSlots:e._u([{key:"item",fn:function(t){return[a("el-tooltip",{attrs:{content:t.item.name,"show-overflow-tooltip":""}},[a("span",{staticClass:"comment_rejected--more--message problem_type_filter"},[e._v(e._s(t.item.name))])])]}}])})};c._withStripped=!0;const m=t({name:"problemTypeFilter",props:{clear:{type:Boolean,default:!1}},data:()=>({loading:!1,problemList:[],selectedOptions:[],meta:{current_page:1,total_count:0,total_pages:0},keywords:""}),watch:{clear:{handler(e){e&&(this.selectedOptions=[])}}},methods:{getList(e=""){this.loading=!0;const t={page:this.meta.current_page,per_page:20,keywords:e};GITEE.tools.$http.get(`${GITEE.api.goComApiPrefix()}/pull_request_problem_types`,{params:t}).then((({data:e})=>{const t=[...this.problemList,...e.data];t.forEach((e=>e.value=e.id)),this.problemList=t,this.meta=e.meta})).finally((()=>{this.loading=!1}))},handleSearch(e){this.meta.current_page=1,this.keywords=e,this.problemList=[],this.getList(e)},handleHide(){this.$emit("input",this.selectedOptions.map((e=>e.id)))},loadMore(){!this.loading&&this.meta.current_page<this.meta.total_pages&&(this.meta.current_page+=1,this.getList())},handleShow(){this.meta.current_page=1,this.problemList=[],this.getList()}}},c,[],!1,null,null,null).exports;GITEE.i18n.mergeI18n("zh-CN",{pulls:{question_type:"问题类型",review_question_type:"请选择评审问题类型",automatic:{desc:"合并后自动创建tag",tag_type:"选择创建方式",custom_tag_name:"自定义版本号",integrated_delivery:"下拉选择集成交付版本号",version:"版本号",tooltip:"仅能包含字母、数字、'-'、'_'、'/'、'.',只能以字母、数字为开头和结尾,长度为1-128字符",tag_name_erorr:"版本号不能为空",tag_name_erorr_tip:"当前版本不符合tag正则表达式({err_message}),请重新选择版本或者手动创建tag"}}}),GITEE.i18n.mergeI18n("en-US",{pulls:{question_type:"Question type",review_question_type:"Please select the type of review question",automatic:{desc:"Automatically create tags after merging",tag_type:"Select creation method",custom_tag_name:"Custom version number",integrated_delivery:"Pull down to select the integrated delivery version number",version:"VERSION",tooltip:"Can only contain letters, numbers, '-', '_', '/', '.', Can only start and end with letters and numbers, with a length of 1-128 characters",tag_name_erorr:"Version number cannot be empty",tag_name_erorr_tip:"The current version does not comply with tag regular expressions ({err_message}) Please select a new version or manually create a tag"}}}),GITEE.event.REGISTER_EVENT("QUERY_PULL_REQUEST_READY",(e=>{GITEE.schema.update({payload:{FORM:{PULL_REQUEST:{ITEMS:[{key:"create_tag_enabled",pre_key:"prune_branch",value:!1,extraValue:{tag_name:"",tag_type:"custom_tag"},rule:{tag_name:[{required:!0,validator:(t,a,s)=>{if(a){const t={tag_name:a};GITEE.tools.$http.get(`${GITEE.api.goApiProjectPrefix()}/tags/check_name`,{params:t,no_error_message:!0}).then((()=>{e&&s()}),(e=>{s(new Error(`${GITEE.i18n.$t("pulls.automatic.tag_name_erorr_tip",{err_message:e.response.data.message})}`))}))}else a?s():s(new Error(GITEE.i18n.$t("pulls.automatic.tag_name_erorr")))},trigger:["change","blur"]}]},visible:e.target_is_default_branch,customComponent:a,meta:{sourceBranch:e.source_branch||e.pull_request.source_branch}}]}}},need_update:!0})})),GITEE.schema.update({PULL_REQUEST:{TIME_LINE_LOG:{ACTIONS:["enable_create_tag","edit_tag_name","disable_create_tag"],ACTION_ICONS:{enable_create_tag:"icontag",edit_tag_name:"icontag",disable_create_tag:"icontag"},ACTION_DESC_COMPONENT:o},COMMENT_MORE_MESSAGE_COMPONENT:i,REVIEWER_COMMENT_REASON_COMPONENT:_,MORE_FILTERS:[{label:GITEE.i18n.$t("pulls.question_type"),key:"problem_type_ids",defalut_value:[],config_key:"pr_problem_type",component:m}]},FORM:{PR_COMMENT:{ITEMS:[{key:"state",rule:{problem_type_ids:[{required:!0,message:GITEE.i18n.$t("pulls.review_question_type"),trigger:"blur"}]},extraValue:{problem_type_ids:[]},extraComponent:n}]}}})})();
@@ -0,0 +1 @@
1
+ (()=>{const e={name:"CheckCardDirectorAndStatus",props:{form:{type:Object,default:()=>({})}},data:()=>({statuses:[],selected_statuses:[],valid_card_statuses:{},need_card_director:!1}),watch:{"form.card_enable":{handler(e){e&&(this.need_card_director=GITEE.vuex.store.state.project.need_card_director,this.valid_card_statuses=GITEE.vuex.store.state.project.valid_card_statuses,GITEE.tools.$http.get(`${GITEE.api.goComApiPrefix()}/programs/${GITEE.vuex.store.state.project.program_uuid}/cards/card_statuses_list`).then((({data:e})=>{this.statuses=e;const t=Object.keys(this.valid_card_statuses);this.selected_statuses=e.filter((e=>t.includes(e.id)))})))},immediate:!0}},methods:{handleChange(){this.valid_card_statuses=this.selected_statuses.reduce(((e,t)=>(e[t.id]=t.name,e)),{}),this.$emit("form-change",{valid_card_statuses:this.valid_card_statuses,need_card_director:this.need_card_director})}},template:'\n <div v-if="form.card_enable" class="ml-2 mb-1">\n <el-checkbox v-model="need_card_director" @change="handleChange">代码提交人必须为卡片负责人</el-checkbox>\n <div class="mb-1">设置允许提交代码的卡片状态</div>\n <el-select v-model="selected_statuses" value-key="id" filterable multiple is-block @change="handleChange">\n <el-option v-for="item in statuses" :key="item.id" :label="item.name" :value="item" />\n </el-select>\n </div>\n '},t=(e=!0)=>({key:"team_id",value:"",label:"选择关联系统",customComponent:{template:'\n <el-select \n v-model="associatedSystem" \n value-key="id"\n is-block\n filterable\n remote\n clearable\n :remote-method="remoteMethods" \n infinite-scroll\n :infinite-scroll-load="loadMore"\n @change="handleChange"\n @visible-change="(v) => v && remoteMethods(\'\')"\n >\n <el-option v-for="item in optionsList" :key="item.id" :label="item.application_name" :value="item">\n {{ item.application_id + \'_\' + item.application_name }}\n </el-option>\n <div v-if="loading" class="problem-type-loading-text">\n <i class="el-icon-loading" />\n </div>\n </el-select>\n ',props:{form:{type:Object,default:()=>({})}},data:()=>({optionsList:[],associatedSystem:{},loading:!1,keywords:"",meta:{current_page:1,total_count:0,total_pages:0}}),watch:{form:{handler(t){e||t.team_id||t.system_code||this.handleChange(this.associatedSystem)},immediate:!0,deep:!0},"form.namespace_id"(){this.associatedSystem={},this.handleChange(this.associatedSystem)}},computed:{beNotRepoSettings:()=>!e&&GITEE.vuex.store.state.project.team_info,resetOptionsList(){return this.beNotRepoSettings&&!this.keywords}},created(){this.beNotRepoSettings&&(this.associatedSystem=GITEE.vuex.store.state.project.team_info,this.optionsList=[GITEE.vuex.store.state.project.team_info])},methods:{getList(){this.loading=!0;const t=e?{namespace_id:this.form.namespace_id}:{program_uuid:GITEE.vuex.store.state.project.program_uuid},s={page:this.meta.current_page,per_page:20,keywords:this.keywords,...t};GITEE.tools.$http.get(`${GITEE.api.goComApiPrefix()}/project_team_refs`,{params:s}).then((({data:e})=>{const t=this.resetOptionsList?e.data.filter((e=>e.id!==GITEE.vuex.store.state.project.team_info.id)):e.data;this.optionsList=[...this.optionsList,...t],this.meta=e.meta})).finally((()=>{this.loading=!1}))},loadMore(){!this.loading&&this.meta.current_page<this.meta.total_pages&&(this.meta.current_page+=1,this.getList())},remoteMethods(e){this.meta.current_page=1,this.optionsList=this.resetOptionsList?[GITEE.vuex.store.state.project.team_info]:[],this.keywords=e,this.getList()},handleChange(e){this.$emit("form-change",{system_code:e?.application_id||"",team_id:e?.id||""})}}}}),s={pre_key:"team_id",key:"system_code",value:"",label:"系统编号",customComponent:"el-input",meta:{class:"w100",disabled:!0}},a=(e,a=!0)=>[{pre_key:e,...t(a)},s];GITEE.schema.update({FORM:{PUSH_SETTINGS:{ITEMS:[{key:"card_enable",extraValue:{valid_card_statuses:{},need_card_director:!1},extraComponent:e},{key:"gpg_verify_enabled",visible:!1}]},BASIC_SETTINGS:{ITEMS:[{key:"tag_ids",visible:!1},...a("status",!1)]},NEW_REPO_FROM:{ITEMS:a("ignore")},IMPORT_REPO:{ITEMS:a("tags")},NEW_REPO_FROM_TEMPLATE:{ITEMS:a("tags")},REPO_SETTINGS:{ITEMS:[{key:"fork_enabled",visible:!1}]}}}),GITEE.event.REGISTER_EVENT("PROJECT_STORE_UPDATED",(e=>{GITEE.schema.update({FORM:{REPO_SETTINGS:{ITEMS:[{key:"pr_problem_type_enabled",value:!1,customComponent:"FormItemSwitch",meta:{disabled:e.pr_problem_type_readonly_enabled,label:"Pull Resquest问题类型",description:"启用问题类型"}}]}}})}))})();
package/dist/xtreme.js CHANGED
@@ -1 +1 @@
1
- (()=>{var e={1989:(e,t,r)=>{var n=r(1789),o=r(401),i=r(7667),s=r(1327),a=r(1866);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},8407:(e,t,r)=>{var n=r(7040),o=r(4125),i=r(2117),s=r(7518),a=r(4705);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},7071:(e,t,r)=>{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),o=r(1285),i=r(6e3),s=r(9916),a=r(5265);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},6384:(e,t,r)=>{var n=r(8407),o=r(7465),i=r(3779),s=r(7599),a=r(4758),l=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},6874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},4636:(e,t,r)=>{var n=r(2545),o=r(5694),i=r(1469),s=r(4144),a=r(5776),l=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),u=!r&&o(e),p=!r&&!u&&s(e),d=!r&&!u&&!p&&l(e),h=r||u||p||d,m=h?n(e.length,String):[],_=m.length;for(var f in e)!t&&!c.call(e,f)||h&&("length"==f||p&&("offset"==f||"parent"==f)||d&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||a(f,_))||m.push(f);return m}},6556:(e,t,r)=>{var n=r(9465),o=r(7813);e.exports=function(e,t,r){(void 0!==r&&!o(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},4865:(e,t,r)=>{var n=r(9465),o=r(7813),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var s=e[t];i.call(e,t)&&o(s,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},3118:(e,t,r)=>{var n=r(3218),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},8483:(e,t,r)=>{var n=r(5063)();e.exports=n},4239:(e,t,r)=>{var n=r(2705),o=r(9607),i=r(2333),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):i(e)}},9454:(e,t,r)=>{var n=r(4239),o=r(7005);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},8458:(e,t,r)=>{var n=r(3560),o=r(5346),i=r(3218),s=r(346),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,p=c.hasOwnProperty,d=RegExp("^"+u.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?d:a).test(s(e))}},8749:(e,t,r)=>{var n=r(4239),o=r(1780),i=r(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!s[n(e)]}},313:(e,t,r)=>{var n=r(3218),o=r(5726),i=r(3498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&r.push(a);return r}},2980:(e,t,r)=>{var n=r(6384),o=r(6556),i=r(8483),s=r(9783),a=r(3218),l=r(1704),c=r(6390);e.exports=function e(t,r,u,p,d){t!==r&&i(r,(function(i,l){if(d||(d=new n),a(i))s(t,r,l,u,e,p,d);else{var h=p?p(c(t,l),i,l+"",t,r,d):void 0;void 0===h&&(h=i),o(t,l,h)}}),l)}},9783:(e,t,r)=>{var n=r(6556),o=r(4626),i=r(7133),s=r(278),a=r(8517),l=r(5694),c=r(1469),u=r(9246),p=r(4144),d=r(3560),h=r(3218),m=r(8630),_=r(6719),f=r(6390),v=r(9881);e.exports=function(e,t,r,g,b,y,x){var w=f(e,r),j=f(t,r),E=x.get(j);if(E)n(e,r,E);else{var O=y?y(w,j,r+"",e,t,x):void 0,C=void 0===O;if(C){var S=c(j),k=!S&&p(j),T=!S&&!k&&_(j);O=j,S||k||T?c(w)?O=w:u(w)?O=s(w):k?(C=!1,O=o(j,!0)):T?(C=!1,O=i(j,!0)):O=[]:m(j)||l(j)?(O=w,l(w)?O=v(w):h(w)&&!d(w)||(O=a(j))):C=!1}C&&(x.set(j,O),b(O,j,g,y,x),x.delete(j)),n(e,r,O)}}},5976:(e,t,r)=>{var n=r(6557),o=r(5357),i=r(61);e.exports=function(e,t){return i(o(e,t,n),e+"")}},6560:(e,t,r)=>{var n=r(5703),o=r(8777),i=r(6557),s=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=s},2545:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},8363:(e,t,r)=>{var n=r(4865),o=r(9465);e.exports=function(e,t,r,i){var s=!r;r||(r={});for(var a=-1,l=t.length;++a<l;){var c=t[a],u=i?i(r[c],e[c],c,r,e):void 0;void 0===u&&(u=e[c]),s?o(r,c,u):n(r,c,u)}return r}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},1463:(e,t,r)=>{var n=r(5976),o=r(6612);e.exports=function(e){return n((function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,a&&o(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,s)}return t}))}},5063:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(!1===r(i[l],l,i))break}return t}}},8777:(e,t,r)=>{var n=r(852),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},1957:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:(e,t,r)=>{var n=r(8458),o=r(7801);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},5924:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var o=s.call(e);return n&&(t?e[a]=r:delete e[a]),o}},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},8517:(e,t,r)=>{var n=r(3118),o=r(5924),i=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},6612:(e,t,r)=>{var n=r(7813),o=r(8612),i=r(5776),s=r(3218);e.exports=function(e,t,r){if(!s(r))return!1;var a=typeof t;return!!("number"==a?o(r)&&i(t,r.length):"string"==a&&t in r)&&n(r[t],e)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,r)=>{var n,o=r(4429),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),o=r(8407),i=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&n.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},5357:(e,t,r)=>{var n=r(6874),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,a=o(i.length-t,0),l=Array(a);++s<a;)l[s]=i[t+s];s=-1;for(var c=Array(t+1);++s<t;)c[s]=i[s];return c[t]=r(l),n(e,this,c)}}},5639:(e,t,r)=>{var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},61:(e,t,r)=>{var n=r(6560),o=r(1275)(n);e.exports=o},1275:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),o=r(7071),i=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(s)}return r.set(e,t),this.size=r.size,this}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,r)=>{var n=r(9454),o=r(7005),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),o=r(1780);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},9246:(e,t,r)=>{var n=r(8612),o=r(7005);e.exports=function(e){return o(e)&&n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=r(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||o;e.exports=l},3560:(e,t,r)=>{var n=r(4239),o=r(3218);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,r)=>{var n=r(4239),o=r(5924),i=r(7005),s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=o(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==u}},6719:(e,t,r)=>{var n=r(8749),o=r(1717),i=r(1167),s=i&&i.isTypedArray,a=s?o(s):n;e.exports=a},1704:(e,t,r)=>{var n=r(4636),o=r(313),i=r(8612);e.exports=function(e){return i(e)?n(e,!0):o(e)}},2492:(e,t,r)=>{var n=r(2980),o=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=o},5062:e=>{e.exports=function(){return!1}},9881:(e,t,r)=>{var n=r(8363),o=r(1704);e.exports=function(e){return n(e,o(e))}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",e._l(e.xtremeComments,(function(t){return r("div",{key:t.comments[0].id},[r("WysiwygEditor",{class:"ai-reviewer-md-editor",attrs:{value:t.comments[0].note,preview:""}}),e._v(" "),r("div",{staticClass:"footer_actions"},[r("ElButton",{attrs:{loading:e.submitingObj[t.comments[0].id],type:"osc"},on:{click:function(r){return e.handleChangeResolveState(t,"fixed")}}},[e._v("\n "+e._s(e.$t("xtreme.adoption"))+"\n ")]),e._v(" "),r("ElButton",{attrs:{loading:e.submitingObj[t.comments[0].id]},on:{click:function(r){return e.handleChangeResolveState(t,"closed")}}},[e._v("\n "+e._s(e.$t("xtreme.adoption_no"))+"\n ")]),e._v(" "),e.commentIsResolved(t)?r("span",{staticClass:"resolve_text"},[e._v("\n "+e._s(e.$t_join("xtreme.this_suggesition"))+"\n "),r("span",{staticClass:"resolved_name"},[e._v(e._s((t.resolved_user&&t.resolved_user.name)+""))]),e._v("\n "+e._s(e.markText(t.resolved_state))+"\n ")]):e._e()],1)],1)})),0)};function t(e,t,r,n,o,i,s,a){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}e._withStripped=!0;const n=t({name:"AiReviewSuggestion",props:{suggestion:{type:Object,required:!0},diff:{type:Object,required:!0},comments:{type:Array,default:()=>[]},line:{type:Object,default:()=>({})}},data:()=>({submitingObj:{}}),computed:{pull(){return this.$store.getters["pull/getPullInfo"]},xtremeComments(){return this.suggestion.xtremeComments||[]}},watch:{suggestion:{immediate:!0,handler(){this.suggestion.xtremeComments.forEach((e=>{this.$set(this.submitingObj,e.comments[0].id,!1)}))}}},methods:{commentIsResolved:e=>["fixed","closed"].includes(e.resolved_state),markText(e){return{fixed:this.$t("xtreme.mark_adoption"),closed:this.$t("xtreme.mark_adoption_no")}[e]},handleChangeResolveState(e,t){this.$set(this.submitingObj,e.comments[0].id,!0),this.api.comment.switchPrCommentState(e.comments[0].id,this.pull.iid,{resolved_state:t}).then((r=>{window.eventHub.$emit(this.EVENT_HUB_NAME.RESOLVED_COMMENTS,{commentsId:e.comments[0].id,resolved_state:t,resolved_user:r.data})})).finally((()=>{this.$set(this.submitingObj,e.comments[0].id,!1)}))}}},e,[],!1,null,"8dc8a020",null).exports;var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("PageTitle",[e._v(e._s(e.$t("xtreme.title")))]),e._v(" "),r("ElTabs",{model:{value:e.tab,callback:function(t){e.tab=t},expression:"tab"}},[r("ElTabPane",{attrs:{label:e.$t("conversation_manage.code_review_helper_tab"),name:"code_review"}},[r("FormCommon",{attrs:{"form-items":e.codeReviewFormItems,form:e.codeReviewForm,"form-key":"CODE_REVIEW_FORM"},on:{"form-change":function(t){return e.handleFormChange(t,"codeReviewForm")}}})],1),e._v(" "),r("ElTabPane",{attrs:{label:e.$t("conversation_manage.unit_test_helper_tab"),name:"unit_test"}},[r("FormCommon",{attrs:{"form-items":e.unitTestFormItems,form:e.unitTestForm,"form-key":"UNIT_TEST_FORM"},on:{"form-change":function(t){return e.handleFormChange(t,"unitTestForm")}}})],1)],1)],1)};o._withStripped=!0;var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("FormItem",{staticClass:"branch_match",attrs:{label:e.label}},[r("div",{staticClass:"rule_wrap"},[r("ElInput",{attrs:{maxlength:e.maxlength,placeholder:e.$t("xtreme.listener_branch_desc")},model:{value:e.rule,callback:function(t){e.rule=t},expression:"rule"}}),e._v(" "),r("ElButton",{attrs:{type:"osc",disabled:e.disabled},on:{click:e.handleClick}},[e._v(e._s(e.$t("update")))])],1)])};i._withStripped=!0;const s=t({name:"ListenBranchRule",components:{FormItem:window.comps.FormItem},props:{name:String,label:{type:String,default:""},value:{type:String,default:""},maxlength:{type:Number,default:255},disabled:{type:Boolean,default:!1},searchBranchRule:{type:String,default:""}},data:()=>({rule:""}),watch:{value:{handler(e){this.rule=e},immediate:!0}},methods:{handleClick(){this.searchBranchRule!==this.rule&&this.$emit("form-change",{listen_branch_rules:this.rule})}}},i,[],!1,null,"5a765c5e",null).exports;var a=r(2492),l=r.n(a);const c={methods:{getDotObj(e){return e.split(".").reduce(((e,t)=>e[t]),this)},setForm(e,t){const r=this.getDotObj(e),n=this.getDotObj(t);r.forEach((e=>{e.key_not_in_form||this.$set(n,e.key,e.value),e.extraValue&&Object.keys(e.extraValue).forEach((t=>{this.$set(n,t,e.extraValue[t])}))}))},setRule(e,t){const r=this.getDotObj(e);let n=this.getDotObj(t);r.forEach((e=>{n=l()(n,e.rule)}))},getParams(e,t){const r=this.getDotObj(e),n=this.getDotObj(t);return r.reduce(((e,t)=>(Object.hasOwnProperty.call(t,"visible")&&!t.visible||(t.extraValue&&Object.keys(t.extraValue).forEach((t=>{e[t]=n[t]})),t.key_not_in_form||(e[t.key]=n[t.key])),e)),{})},handleFormChange(e,t="form"){const r=this.getDotObj(t);Object.keys(e).forEach((t=>{r[t]=e[t]}))}}},u=t({name:"XtremeCode",components:{FormCommon:window.comps.FormCommon},mixins:[c],data:()=>({tab:"code_review",codeReviewForm:{},unitTestForm:{},knowledgeBase:[],knowlegeLoading:!1,page:1,perPage:20,totalPages:1,keywords:"",isInit:!0,loading:!1}),computed:{codeReviewFormItems(){return[{key:"ai_review_enabled",value:!1,customComponent:"FormItemSwitch",meta:{label:this.$t("xtreme.open_code_review_helper"),description:this.$t("xtreme.open_code_review_helper_desc"),disabled:this.projectArchivedEnabled}},{key:"knowledge_base_id",value:null,label:this.$t("xtreme.select_knowledge"),customComponent:window.comps.CommonSelect,meta:{isBlock:!0,filterable:!0,clearable:!0,remote:!0,disabled:this.projectArchivedEnabled,remoteMethod:this.getKnowlegeList,loading:this.knowlegeLoading&&1===this.page,optionsList:this.knowledgeBase,infiniteScroll:!0,infiniteScrollLoad:this.infiniteScrollLoadKnow,keys:{key:"id",label:"name",value:"id",content:"name"}},listeners:{"visible-change":this.visibleChangeSelect}}]},unitTestFormItems(){return[{key:"ai_test_enabled",value:!1,customComponent:"FormItemSwitch",meta:{label:this.$t("xtreme.open_unit_test_helper"),description:this.$t("xtreme.open_unit_test_helper_desc"),disabled:this.projectArchivedEnabled}},{key:"listen_branch_rules",value:"",customComponent:s,meta:{label:this.$t("xtreme.listener_branch"),maxlength:4096},rule:{search_branch_rule:[{trigger:"blur",validator:(e,t,r)=>{if(t){/^\|.*|.*\|$/.test(t)&&r(new Error(this.$t("repo_search.branch_matching_tips")));const e=t.split("|");let n="";e.forEach((e=>{const t=window.GITEE.tools.branchNameValidator("",e);t&&(n=t)})),n?r(new Error(n)):r()}else r()}}]}}]}},watch:{codeReviewForm:{handler(){this.codeReviewForm.knowledge_base_id||(this.codeReviewForm.knowledge_base_id=null),this.submit(this.codeReviewForm)},deep:!0},unitTestForm:{handler(){this.submit(this.unitTestForm)},deep:!0}},created(){this.setForm("codeReviewFormItems","codeReviewForm"),this.setForm("unitTestFormItems","unitTestForm"),this.getXtremeDetail()},methods:{getXtremeDetail(){this.loading=!0,this.isInit=!0,this.api.xtreme.getXtremeDetail(this.projectStore.id).then((({data:e})=>{if(!e||0===Object.keys(e).length)return;const{ai_review_enabled:t,knowledge_base:r,ai_test_enabled:n,listen_branch_rules:o}=e;this.codeReviewForm={ai_review_enabled:t,knowledge_base_id:r?.id,ai_test_enabled:n,listen_branch_rules:o},this.unitTestForm={ai_review_enabled:t,knowledge_base_id:r?.id,ai_test_enabled:n,listen_branch_rules:o},r&&(this.knowledgeBase=[{...r}])})).finally((()=>{this.loading=!1,setTimeout((()=>{this.isInit=!1}),0)}))},getKnowlegeList(e){e!==this.keywords&&(this.page=1,this.knowledgeBase=[]),this.knowlegeLoading=!0,this.keywords=e,this.api.knowledge.getKnowledgeList({page:this.page,per_page:this.perPage,keywords:e}).then((({data:e})=>{this.totalPages=e.meta.total_pages,this.knowledgeBase=[...this.knowledgeBase,...e.data.filter((e=>e.id!==this.codeReviewForm.knowledge_base_id))||[]]})).finally((()=>{this.knowlegeLoading=!1}))},infiniteScrollLoadKnow(){!this.knowlegeLoading&&this.page<this.totalPages&&(this.page+=1,this.getKnowlegeList(this.keywords))},visibleChangeSelect(e){e&&(this.keywords="",this.page=1,this.knowledgeBase=[],this.getKnowlegeList(this.keywords))},submit(e){this.isInit||this.api.xtreme.createXtreme(this.projectStore.id,{...e,path:this.projectStore.path,name:this.projectStore.name,full_path:this.projectStore.full_path,language:this.projectStore.language_name,enterprise_uuid:window.gon.info.enterprise_uuid||""}).then((()=>{this.$message.success(this.$t("company_settings.update_success")),this.getXtremeDetail()}))}}},o,[],!1,null,"3755485f",null).exports;window.GITEE.api.register("xtreme","getXtremeDetail",(e=>window.GITEE.tools.$http.get(`/api/xtreme/api/projects/${e}`))),window.GITEE.api.register("xtreme","createXtreme",((e,t)=>window.GITEE.tools.$http.put(`/api/xtreme/api/projects/${e}`,t))),GITEE.schema.update({REPO_NAVS:[{name:"project#xtreme",title:"Gitee Xtreme Code",iconClass:"iconsearch",insertAfter:"Gitee Pipe",permission:!0}],FORM:{CODE_REVIEW_FORM:{VISIBLE:null,DISABLED:null,ITEMS:[]},UNIT_TEST_FORM:{VISIBLE:null,DISABLED:null,ITEMS:[]}}}),window.GITEE.router.getRouter().addRoutes([{path:window.GITEE.tools.inOneProgramPage()?`/:enterprise/:group_namespace/${window.GITEE.breakingChanges?.URL_FLAG?":flag(gitee|code)":"gitee"}/:_enterprise?/:namespace/:project/xtreme`:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/*/-/xtreme`,name:"project#xtreme",component:u,meta:{title:()=>"Gitee Xtreme",permissions:()=>window.GITEE.tools.hasEaualOrHigherPermission("Operator")||window.GITEE.STORE.state.project.permissions.can_admin}}]),GITEE.tools.registerNamedMixin("EntDiffs",(e=>({methods:{getLineCommentGroup(t,r=0){const n=e.methods.getLineCommentGroup.call(this,t);return n&&n.length&&["pr-change","timeline"].includes(this.type)?n.filter((e=>e.comments&&e.comments.length?e.comments[0].system===r:e)):n},getLineScanSuggestionsGroup(t,r){let n=e.methods.getLineScanSuggestionsGroup.call(this,t,r);if(["pr-change","timeline"].includes(this.type)){const e=this.getLineCommentGroup(t,1);if(n&&n.length){if(!e||!e.length)return n;n[0].xtremeComments=[...e]}else if(e&&e.length&&e[0].comments&&e[0].comments.length)return[{ruleId:e[0].line_code+"scan_suggestion",xtremeComments:e}]}return n}}}))),GITEE.schema.update({TAB_PANES:{PR_SCAN_SUGGESTIONS:{PANE:[{key:"scan_suggestion",permission:e=>Object.hasOwnProperty.call(e,"level")},{label:GITEE.i18n.$t("pulls.ai_review_suggestion.title"),key:"ai_reivew_suggestion",labelComponent:{data:()=>({time:(new Date).getTime()}),computed:{labelText:()=>GITEE.i18n.$t("pulls.ai_review_suggestion.title"),linearGradientIdUrl(){return`url(#paint0_linear_${this.time})`},linearGradientId(){return`paint0_linear_${this.time}`}},template:'\n <span style="display: flex;align-items: center;gap: 5px;">\n <svg width="16" height="16" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z" :fill="linearGradientIdUrl"></path>\n <path d="M17.375 7.67603C17.375 8.08325 17.198 8.44913 16.9167 8.7009V10.426H21.5C23.0188 10.426 24.25 11.6572 24.25 13.176V22.3427C24.25 23.8615 23.0188 25.0927 21.5 25.0927H10.5C8.98122 25.0927 7.75 23.8615 7.75 22.3427V13.176C7.75 11.6572 8.98122 10.426 10.5 10.426H15.0833V8.7009C14.802 8.44913 14.625 8.08325 14.625 7.67603C14.625 6.91663 15.2406 6.30103 16 6.30103C16.7594 6.30103 17.375 6.91663 17.375 7.67603ZM6.22222 15.0094C6.55973 15.0094 6.83333 15.283 6.83333 15.6205V19.8982C6.83333 20.2358 6.55973 20.5094 6.22222 20.5094H5.61111C5.2736 20.5094 5 20.2358 5 19.8982V15.6205C5 15.283 5.2736 15.0094 5.61111 15.0094H6.22222ZM26.3889 15.0094C26.7264 15.0094 27 15.283 27 15.6205V19.8982C27 20.2358 26.7264 20.5094 26.3889 20.5094H25.7778C25.4403 20.5094 25.1667 20.2358 25.1667 19.8982V15.6205C25.1667 15.283 25.4403 15.0094 25.7778 15.0094H26.3889ZM11.875 17.7591C11.875 18.5185 12.4906 19.1341 13.25 19.1341C14.0094 19.1341 14.625 18.5185 14.625 17.7591C14.625 16.9997 14.0094 16.3841 13.25 16.3841C12.4906 16.3841 11.875 16.9997 11.875 17.7591ZM17.375 17.7591C17.375 18.5185 17.9906 19.1341 18.75 19.1341C19.5094 19.1341 20.125 18.5185 20.125 17.7591C20.125 16.9997 19.5094 16.3841 18.75 16.3841C17.9906 16.3841 17.375 16.9997 17.375 17.7591Z" fill="white"></path>\n </g>\n <defs>\n <linearGradient :id="linearGradientId" x1="-7.82777e-07" y1="26.5" x2="35" y2="4.5" gradientUnits="userSpaceOnUse">\n <stop stop-color="#4E6AF9"></stop>\n <stop offset="1" stop-color="#81F8F9"></stop>\n </linearGradient>\n </defs>\n </svg>\n {{ labelText }}\n </span>\n '},component:n,permission:e=>Object.hasOwnProperty.call(e,"xtremeComments")}]}}})})()})();
1
+ (()=>{var e={1989:(e,t,r)=>{var n=r(1789),o=r(401),i=r(7667),s=r(1327),a=r(1866);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},8407:(e,t,r)=>{var n=r(7040),o=r(4125),i=r(2117),s=r(7518),a=r(4705);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},7071:(e,t,r)=>{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),o=r(1285),i=r(6e3),s=r(9916),a=r(5265);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},6384:(e,t,r)=>{var n=r(8407),o=r(7465),i=r(3779),s=r(7599),a=r(4758),l=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},6874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},4636:(e,t,r)=>{var n=r(2545),o=r(5694),i=r(1469),s=r(4144),a=r(5776),l=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),u=!r&&o(e),p=!r&&!u&&s(e),d=!r&&!u&&!p&&l(e),_=r||u||p||d,h=_?n(e.length,String):[],m=h.length;for(var v in e)!t&&!c.call(e,v)||_&&("length"==v||p&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,m))||h.push(v);return h}},6556:(e,t,r)=>{var n=r(9465),o=r(7813);e.exports=function(e,t,r){(void 0!==r&&!o(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},4865:(e,t,r)=>{var n=r(9465),o=r(7813),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var s=e[t];i.call(e,t)&&o(s,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},3118:(e,t,r)=>{var n=r(3218),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},8483:(e,t,r)=>{var n=r(5063)();e.exports=n},4239:(e,t,r)=>{var n=r(2705),o=r(9607),i=r(2333),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):i(e)}},9454:(e,t,r)=>{var n=r(4239),o=r(7005);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},8458:(e,t,r)=>{var n=r(3560),o=r(5346),i=r(3218),s=r(346),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,p=c.hasOwnProperty,d=RegExp("^"+u.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?d:a).test(s(e))}},8749:(e,t,r)=>{var n=r(4239),o=r(1780),i=r(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!s[n(e)]}},313:(e,t,r)=>{var n=r(3218),o=r(5726),i=r(3498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&r.push(a);return r}},2980:(e,t,r)=>{var n=r(6384),o=r(6556),i=r(8483),s=r(9783),a=r(3218),l=r(1704),c=r(6390);e.exports=function e(t,r,u,p,d){t!==r&&i(r,(function(i,l){if(d||(d=new n),a(i))s(t,r,l,u,e,p,d);else{var _=p?p(c(t,l),i,l+"",t,r,d):void 0;void 0===_&&(_=i),o(t,l,_)}}),l)}},9783:(e,t,r)=>{var n=r(6556),o=r(4626),i=r(7133),s=r(278),a=r(8517),l=r(5694),c=r(1469),u=r(9246),p=r(4144),d=r(3560),_=r(3218),h=r(8630),m=r(6719),v=r(6390),g=r(9881);e.exports=function(e,t,r,f,b,w,y){var x=v(e,r),j=v(t,r),E=y.get(j);if(E)n(e,r,E);else{var C=w?w(x,j,r+"",e,t,y):void 0,k=void 0===C;if(k){var O=c(j),S=!O&&p(j),T=!O&&!S&&m(j);C=j,O||S||T?c(x)?C=x:u(x)?C=s(x):S?(k=!1,C=o(j,!0)):T?(k=!1,C=i(j,!0)):C=[]:h(j)||l(j)?(C=x,l(x)?C=g(x):_(x)&&!d(x)||(C=a(j))):k=!1}k&&(y.set(j,C),b(C,j,f,w,y),y.delete(j)),n(e,r,C)}}},5976:(e,t,r)=>{var n=r(6557),o=r(5357),i=r(61);e.exports=function(e,t){return i(o(e,t,n),e+"")}},6560:(e,t,r)=>{var n=r(5703),o=r(8777),i=r(6557),s=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=s},2545:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},8363:(e,t,r)=>{var n=r(4865),o=r(9465);e.exports=function(e,t,r,i){var s=!r;r||(r={});for(var a=-1,l=t.length;++a<l;){var c=t[a],u=i?i(r[c],e[c],c,r,e):void 0;void 0===u&&(u=e[c]),s?o(r,c,u):n(r,c,u)}return r}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},1463:(e,t,r)=>{var n=r(5976),o=r(6612);e.exports=function(e){return n((function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,a&&o(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,s)}return t}))}},5063:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(!1===r(i[l],l,i))break}return t}}},8777:(e,t,r)=>{var n=r(852),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},1957:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:(e,t,r)=>{var n=r(8458),o=r(7801);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},5924:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var o=s.call(e);return n&&(t?e[a]=r:delete e[a]),o}},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},8517:(e,t,r)=>{var n=r(3118),o=r(5924),i=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},6612:(e,t,r)=>{var n=r(7813),o=r(8612),i=r(5776),s=r(3218);e.exports=function(e,t,r){if(!s(r))return!1;var a=typeof t;return!!("number"==a?o(r)&&i(t,r.length):"string"==a&&t in r)&&n(r[t],e)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,r)=>{var n,o=r(4429),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),o=r(8407),i=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&n.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},5357:(e,t,r)=>{var n=r(6874),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,a=o(i.length-t,0),l=Array(a);++s<a;)l[s]=i[t+s];s=-1;for(var c=Array(t+1);++s<t;)c[s]=i[s];return c[t]=r(l),n(e,this,c)}}},5639:(e,t,r)=>{var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},61:(e,t,r)=>{var n=r(6560),o=r(1275)(n);e.exports=o},1275:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),o=r(7071),i=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(s)}return r.set(e,t),this.size=r.size,this}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,r)=>{var n=r(9454),o=r(7005),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),o=r(1780);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},9246:(e,t,r)=>{var n=r(8612),o=r(7005);e.exports=function(e){return o(e)&&n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=r(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||o;e.exports=l},3560:(e,t,r)=>{var n=r(4239),o=r(3218);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,r)=>{var n=r(4239),o=r(5924),i=r(7005),s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=o(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==u}},6719:(e,t,r)=>{var n=r(8749),o=r(1717),i=r(1167),s=i&&i.isTypedArray,a=s?o(s):n;e.exports=a},1704:(e,t,r)=>{var n=r(4636),o=r(313),i=r(8612);e.exports=function(e){return i(e)?n(e,!0):o(e)}},2492:(e,t,r)=>{var n=r(2980),o=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=o},5062:e=>{e.exports=function(){return!1}},9881:(e,t,r)=>{var n=r(8363),o=r(1704);e.exports=function(e){return n(e,o(e))}},9107:()=>{GITEE.i18n.mergeI18n("zh-CN",{knowledge:{knowledge:"知识库",delete_knowledge_tips:"确认删除该知识库?",add_file:"添加文件",chart_total:"字符数",recall_count:"召回次数",upload_at:"上传时间",upload_doc:"上传文档",delete_document_tips:"确认删除该知识库文件?",support_file:"支持Markdown、CSV",not_support_file:"上传的文件类型不符合要求"},conversation_manage:{title:"会话管理",code_review_helper_tab:"智能代码评审助手",unit_test_helper_tab:"智能单测生成助手",conversation_id:"会话ID",belong_pr:"所属Pull Request",repo:"所属代码库",conversation_status:"会话状态",create_at:"触发时间",ent_time:"结束时间",note_count:"生成评论数",exec_log:"执行日志",belong_branch:"所属分支",change_count:"变更内容",view_logs:"查看日志",file_path:"文件路径",location:"位置",content:"内容",isAdopted:"是否被采纳",view_note:"查看评论",view_detail:"点击查看",view_report:"执行日志",restart_run:"重新运行",stop_task:"终止任务",restart_task_tips:"确定重新运行该任务?",stop_task_tips:"确定停止运行该任务?",adoption_status:"采纳状态",adoption_no:"未采纳",adoption_yes:"采纳",use_time:"耗时",refresh:"刷新",status:"",repo_name:"代码库名称"},xtreme:{title:"Gitee Xtreme Code 设置",open_code_review_helper:"开启智能代码评审助手",open_code_review_helper_desc:"开启后,智能代码评审助手会在开启Pull Request 后自动进行代码评审",select_knowledge:"选择知识库",open_unit_test_helper:"开启智能单测生成助手",open_unit_test_helper_desc:"开启后,智能单测生成助手会在监听的分支中执行单测生成",listener_branch:"监听分支规则",listener_branch_desc:"支持通配符匹配以及“|”进行匹配隔离",ai_code_review:"智能代码评审",adoption:"采纳",adoption_no:"不采纳",this_suggesition:"这个评审建议被",mark_adoption:"标记为采纳",mark_adoption_no:"标记不采纳"},pulls:{ai_review_suggestion:{title:"AI评审建议",restart:"重新执行"}}}),GITEE.i18n.mergeI18n("en-US",{knowledge:{knowledge:"Knowledge base",delete_knowledge_tips:"Are you sure you want to delete this knowledge base?",add_file:"Add file",chart_total:"Character count",recall_count:"Recall rate",upload_at:"Upload time",upload_doc:"Upload the document",delete_document_tips:"Are you sure you want to delete this document?",support_file:"Supports Markdown, CSV",not_support_file:"The uploaded file type is not supported"},conversation_manage:{title:"Conversation Management",code_review_helper_tab:"Intelligent Code Review Assistant",unit_test_helper_tab:"Intelligent Single Test Generation Assistant",conversation_id:"Session ID",belong_pr:"The associated Pull Request",repo:"The corresponding code repository",conversation_status:"Conversation status",create_at:"Trigger time",ent_time:"End time",note_count:"Number of generated comments",exec_log:"Execution Log",belong_branch:"The corresponding branch",change_count:"Change content",view_logs:"View Logs",file_path:"File path",location:"Location",content:"Content",isAdopted:"Has it been adopted?",view_note:"View Comments",view_detail:"Click to view",view_report:"Execution Log",restart_run:"Restart the operation",stop_task:"Terminate the task",restart_task_tips:"Are you sure to re-run this task?",stop_task_tips:"Are you sure to stop running this task?",adoption_status:"Adoption status",adoption_no:"Not adopted",adoption_yes:"Adopt",use_time:"Time consumed",refresh:"refresh"},xtreme:{title:"Gitee Xtreme Code Settings",open_code_review_helper:"Activate the intelligent code review assistant",open_code_review_helper_desc:"Once activated, the intelligent code review assistant will automatically conduct code reviews after a Pull Request is initiated.",select_knowledge:"Select the knowledge base",open_unit_test_helper:"Activate the intelligent single test generation assistant",open_unit_test_helper_desc:"After activation, the intelligent unit test generation assistant will execute the unit test generation within the monitored branch.",listener_branch:"Listening branch rules",listener_branch_desc:"Supports wildcard matching and “|” for matching isolation",ai_code_review:"Intelligent code review",adoption:"Adoption",adoption_no:"Not adopted",this_suggesition:"this suggesition is solved",mark_adoption:"mark as adoption",mark_adoption_no:"mark as Not adopted"},pulls:{ai_review_suggestion:{title:"AI Review Suggestions"}}})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";r(9107);var e=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",e._l(e.xtremeComments,(function(t){return r("div",{key:t.comments[0].id},[r("WysiwygEditor",{class:"ai-reviewer-md-editor",attrs:{value:t.comments[0].note,preview:""}}),e._v(" "),r("div",{staticClass:"footer_actions"},[r("ElButton",{attrs:{loading:e.submitingObj[t.comments[0].id],type:"osc"},on:{click:function(r){return e.handleChangeResolveState(t,"fixed")}}},[e._v("\n "+e._s(e.$t("xtreme.adoption"))+"\n ")]),e._v(" "),r("ElButton",{attrs:{loading:e.submitingObj[t.comments[0].id]},on:{click:function(r){return e.handleChangeResolveState(t,"closed")}}},[e._v("\n "+e._s(e.$t("xtreme.adoption_no"))+"\n ")]),e._v(" "),e.commentIsResolved(t)?r("span",{staticClass:"resolve_text"},[e._v("\n "+e._s(e.$t_join("xtreme.this_suggesition"))+"\n "),r("span",{staticClass:"resolved_name"},[e._v(e._s((t.resolved_user&&t.resolved_user.name)+""))]),e._v("\n "+e._s(e.markText(t.resolved_state))+"\n ")]):e._e()],1)],1)})),0)};function t(e,t,r,n,o,i,s,a){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}e._withStripped=!0;const n=t({name:"AiReviewSuggestion",props:{suggestion:{type:Object,required:!0},diff:{type:Object,required:!0},comments:{type:Array,default:()=>[]},line:{type:Object,default:()=>({})}},data:()=>({submitingObj:{}}),computed:{pull(){return this.$store.getters["pull/getPullInfo"]},xtremeComments(){return this.suggestion.xtremeComments||[]}},watch:{suggestion:{immediate:!0,handler(){this.suggestion.xtremeComments.forEach((e=>{this.$set(this.submitingObj,e.comments[0].id,!1)}))}}},methods:{commentIsResolved:e=>["fixed","closed"].includes(e.resolved_state),markText(e){return{fixed:this.$t("xtreme.mark_adoption"),closed:this.$t("xtreme.mark_adoption_no")}[e]},handleChangeResolveState(e,t){this.$set(this.submitingObj,e.comments[0].id,!0),this.api.comment.switchPrCommentState(e.comments[0].id,this.pull.iid,{resolved_state:t}).then((r=>{window.eventHub.$emit(this.EVENT_HUB_NAME.RESOLVED_COMMENTS,{commentsId:e.comments[0].id,resolved_state:t,resolved_user:r.data})})).finally((()=>{this.$set(this.submitingObj,e.comments[0].id,!1)}))}}},e,[],!1,null,"8dc8a020",null).exports;var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("PageTitle",[e._v(e._s(e.$t("xtreme.title")))]),e._v(" "),r("ElTabs",{model:{value:e.tab,callback:function(t){e.tab=t},expression:"tab"}},[r("ElTabPane",{attrs:{label:e.$t("conversation_manage.code_review_helper_tab"),name:"code_review"}},[r("FormCommon",{attrs:{"form-items":e.codeReviewFormItems,form:e.codeReviewForm,"form-key":"CODE_REVIEW_FORM"},on:{"form-change":function(t){return e.handleFormChange(t,"codeReviewForm")}}})],1),e._v(" "),r("ElTabPane",{attrs:{label:e.$t("conversation_manage.unit_test_helper_tab"),name:"unit_test"}},[r("FormCommon",{attrs:{"form-items":e.unitTestFormItems,form:e.unitTestForm,"form-key":"UNIT_TEST_FORM"},on:{"form-change":function(t){return e.handleFormChange(t,"unitTestForm")}}})],1)],1)],1)};o._withStripped=!0;var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("FormItem",{staticClass:"branch_match",attrs:{label:e.label}},[r("div",{staticClass:"rule_wrap"},[r("ElInput",{attrs:{maxlength:e.maxlength,placeholder:e.$t("xtreme.listener_branch_desc")},model:{value:e.rule,callback:function(t){e.rule=t},expression:"rule"}}),e._v(" "),r("ElButton",{attrs:{type:"osc",disabled:e.disabled},on:{click:e.handleClick}},[e._v(e._s(e.$t("update")))])],1)])};i._withStripped=!0;const s=t({name:"ListenBranchRule",components:{FormItem:window.comps.FormItem},props:{name:String,label:{type:String,default:""},value:{type:String,default:""},maxlength:{type:Number,default:255},disabled:{type:Boolean,default:!1},searchBranchRule:{type:String,default:""}},data:()=>({rule:""}),watch:{value:{handler(e){this.rule=e},immediate:!0}},methods:{handleClick(){this.searchBranchRule!==this.rule&&this.$emit("form-change",{listen_branch_rules:this.rule})}}},i,[],!1,null,"5a765c5e",null).exports;var a=r(2492),l=r.n(a);const c={methods:{getDotObj(e){return e.split(".").reduce(((e,t)=>e[t]),this)},setForm(e,t){const r=this.getDotObj(e),n=this.getDotObj(t);r.forEach((e=>{e.key_not_in_form||this.$set(n,e.key,e.value),e.extraValue&&Object.keys(e.extraValue).forEach((t=>{this.$set(n,t,e.extraValue[t])}))}))},setRule(e,t){const r=this.getDotObj(e);let n=this.getDotObj(t);r.forEach((e=>{n=l()(n,e.rule)}))},getParams(e,t){const r=this.getDotObj(e),n=this.getDotObj(t);return r.reduce(((e,t)=>(Object.hasOwnProperty.call(t,"visible")&&!t.visible||(t.extraValue&&Object.keys(t.extraValue).forEach((t=>{e[t]=n[t]})),t.key_not_in_form||(e[t.key]=n[t.key])),e)),{})},handleFormChange(e,t="form"){const r=this.getDotObj(t);Object.keys(e).forEach((t=>{r[t]=e[t]}))}}},u=t({name:"XtremeCode",components:{FormCommon:window.comps.FormCommon},mixins:[c],data:()=>({tab:"code_review",codeReviewForm:{},unitTestForm:{},knowledgeBase:[],knowlegeLoading:!1,page:1,perPage:20,totalPages:1,keywords:"",isInit:!0,loading:!1}),computed:{codeReviewFormItems(){return[{key:"ai_review_enabled",value:!1,customComponent:"FormItemSwitch",meta:{label:this.$t("xtreme.open_code_review_helper"),description:this.$t("xtreme.open_code_review_helper_desc"),disabled:this.projectArchivedEnabled}},{key:"knowledge_base_id",value:null,label:this.$t("xtreme.select_knowledge"),customComponent:window.comps.CommonSelect,meta:{isBlock:!0,filterable:!0,clearable:!0,remote:!0,disabled:this.projectArchivedEnabled,remoteMethod:this.getKnowlegeList,loading:this.knowlegeLoading&&1===this.page,optionsList:this.knowledgeBase,infiniteScroll:!0,infiniteScrollLoad:this.infiniteScrollLoadKnow,keys:{key:"id",label:"name",value:"id",content:"name"}},listeners:{"visible-change":this.visibleChangeSelect}}]},unitTestFormItems(){return[{key:"ai_test_enabled",value:!1,customComponent:"FormItemSwitch",meta:{label:this.$t("xtreme.open_unit_test_helper"),description:this.$t("xtreme.open_unit_test_helper_desc"),disabled:this.projectArchivedEnabled}},{key:"listen_branch_rules",value:"",customComponent:s,meta:{label:this.$t("xtreme.listener_branch"),maxlength:4096},rule:{search_branch_rule:[{trigger:"blur",validator:(e,t,r)=>{if(t){/^\|.*|.*\|$/.test(t)&&r(new Error(this.$t("repo_search.branch_matching_tips")));const e=t.split("|");let n="";e.forEach((e=>{const t=window.GITEE.tools.branchNameValidator("",e);t&&(n=t)})),n?r(new Error(n)):r()}else r()}}]}}]}},watch:{codeReviewForm:{handler(){this.codeReviewForm.knowledge_base_id||(this.codeReviewForm.knowledge_base_id=null),this.submit(this.codeReviewForm)},deep:!0},unitTestForm:{handler(){this.submit(this.unitTestForm)},deep:!0}},created(){this.setForm("codeReviewFormItems","codeReviewForm"),this.setForm("unitTestFormItems","unitTestForm"),this.getXtremeDetail()},methods:{getXtremeDetail(){this.loading=!0,this.isInit=!0,this.api.xtreme.getXtremeDetail(this.projectStore.id).then((({data:e})=>{if(!e||0===Object.keys(e).length)return;const{ai_review_enabled:t,knowledge_base:r,ai_test_enabled:n,listen_branch_rules:o}=e;this.codeReviewForm={ai_review_enabled:t,knowledge_base_id:r?.id,ai_test_enabled:n,listen_branch_rules:o},this.unitTestForm={ai_review_enabled:t,knowledge_base_id:r?.id,ai_test_enabled:n,listen_branch_rules:o},r&&(this.knowledgeBase=[{...r}])})).finally((()=>{this.loading=!1,setTimeout((()=>{this.isInit=!1}),0)}))},getKnowlegeList(e){e!==this.keywords&&(this.page=1,this.knowledgeBase=[]),this.knowlegeLoading=!0,this.keywords=e,this.api.knowledge.getKnowledgeList({page:this.page,per_page:this.perPage,keywords:e}).then((({data:e})=>{this.totalPages=e.meta.total_pages,this.knowledgeBase=[...this.knowledgeBase,...e.data.filter((e=>e.id!==this.codeReviewForm.knowledge_base_id))||[]]})).finally((()=>{this.knowlegeLoading=!1}))},infiniteScrollLoadKnow(){!this.knowlegeLoading&&this.page<this.totalPages&&(this.page+=1,this.getKnowlegeList(this.keywords))},visibleChangeSelect(e){e&&(this.keywords="",this.page=1,this.knowledgeBase=[],this.getKnowlegeList(this.keywords))},submit(e){this.isInit||this.api.xtreme.createXtreme(this.projectStore.id,{...e,path:this.projectStore.path,name:this.projectStore.name,full_path:this.projectStore.full_path,language:this.projectStore.language_name,enterprise_uuid:window.gon.info.enterprise_uuid||""}).then((()=>{this.$message.success(this.$t("company_settings.update_success")),this.getXtremeDetail()}))}}},o,[],!1,null,"3755485f",null).exports;window.GITEE.api.register("xtreme","getXtremeDetail",(e=>window.GITEE.tools.$http.get(`/api/xtreme/api/projects/${e}`))),window.GITEE.api.register("xtreme","createXtreme",((e,t)=>window.GITEE.tools.$http.put(`/api/xtreme/api/projects/${e}`,t))),GITEE.schema.update({REPO_NAVS:[{name:"project#xtreme",title:"Gitee Xtreme Code",iconClass:"iconsearch",insertAfter:"Gitee Pipe",permission:!0}],FORM:{CODE_REVIEW_FORM:{VISIBLE:null,DISABLED:null,ITEMS:[]},UNIT_TEST_FORM:{VISIBLE:null,DISABLED:null,ITEMS:[]}}}),window.GITEE.router.getRouter().addRoutes([{path:window.GITEE.tools.inOneProgramPage()?`/:enterprise/:group_namespace/${window.GITEE.breakingChanges?.URL_FLAG?":flag(gitee|code)":"gitee"}/:_enterprise?/:namespace/:project/xtreme`:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/*/-/xtreme`,name:"project#xtreme",component:u,meta:{title:()=>"Gitee Xtreme",permissions:()=>window.GITEE.tools.hasEaualOrHigherPermission("Operator")||window.GITEE.STORE.state.project.permissions.can_admin}}]),GITEE.tools.registerNamedMixin("EntDiffs",(e=>({methods:{getLineCommentGroup(t,r=0){const n=e.methods.getLineCommentGroup.call(this,t);return n&&n.length&&["pr-change","timeline"].includes(this.type)?n.filter((e=>e.comments&&e.comments.length?e.comments[0].system===r:e)):n},getLineScanSuggestionsGroup(t,r){let n=e.methods.getLineScanSuggestionsGroup.call(this,t,r);if(["pr-change","timeline"].includes(this.type)){const e=this.getLineCommentGroup(t,1);if(n&&n.length){if(!e||!e.length)return n;n[0].xtremeComments=[...e]}else if(e&&e.length&&e[0].comments&&e[0].comments.length)return[{ruleId:e[0].line_code+"scan_suggestion",xtremeComments:e}]}return n}}}))),GITEE.schema.update({TAB_PANES:{PR_SCAN_SUGGESTIONS:{PANE:[{key:"scan_suggestion",permission:e=>Object.hasOwnProperty.call(e,"level")},{label:GITEE.i18n.$t("pulls.ai_review_suggestion.title"),key:"ai_reivew_suggestion",labelComponent:{data:()=>({time:(new Date).getTime()}),computed:{labelText:()=>GITEE.i18n.$t("pulls.ai_review_suggestion.title"),linearGradientIdUrl(){return`url(#paint0_linear_${this.time})`},linearGradientId(){return`paint0_linear_${this.time}`}},template:'\n <span style="display: flex;align-items: center;gap: 5px;">\n <svg width="16" height="16" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z" :fill="linearGradientIdUrl"></path>\n <path d="M17.375 7.67603C17.375 8.08325 17.198 8.44913 16.9167 8.7009V10.426H21.5C23.0188 10.426 24.25 11.6572 24.25 13.176V22.3427C24.25 23.8615 23.0188 25.0927 21.5 25.0927H10.5C8.98122 25.0927 7.75 23.8615 7.75 22.3427V13.176C7.75 11.6572 8.98122 10.426 10.5 10.426H15.0833V8.7009C14.802 8.44913 14.625 8.08325 14.625 7.67603C14.625 6.91663 15.2406 6.30103 16 6.30103C16.7594 6.30103 17.375 6.91663 17.375 7.67603ZM6.22222 15.0094C6.55973 15.0094 6.83333 15.283 6.83333 15.6205V19.8982C6.83333 20.2358 6.55973 20.5094 6.22222 20.5094H5.61111C5.2736 20.5094 5 20.2358 5 19.8982V15.6205C5 15.283 5.2736 15.0094 5.61111 15.0094H6.22222ZM26.3889 15.0094C26.7264 15.0094 27 15.283 27 15.6205V19.8982C27 20.2358 26.7264 20.5094 26.3889 20.5094H25.7778C25.4403 20.5094 25.1667 20.2358 25.1667 19.8982V15.6205C25.1667 15.283 25.4403 15.0094 25.7778 15.0094H26.3889ZM11.875 17.7591C11.875 18.5185 12.4906 19.1341 13.25 19.1341C14.0094 19.1341 14.625 18.5185 14.625 17.7591C14.625 16.9997 14.0094 16.3841 13.25 16.3841C12.4906 16.3841 11.875 16.9997 11.875 17.7591ZM17.375 17.7591C17.375 18.5185 17.9906 19.1341 18.75 19.1341C19.5094 19.1341 20.125 18.5185 20.125 17.7591C20.125 16.9997 19.5094 16.3841 18.75 16.3841C17.9906 16.3841 17.375 16.9997 17.375 17.7591Z" fill="white"></path>\n </g>\n <defs>\n <linearGradient :id="linearGradientId" x1="-7.82777e-07" y1="26.5" x2="35" y2="4.5" gradientUnits="userSpaceOnUse">\n <stop stop-color="#4E6AF9"></stop>\n <stop offset="1" stop-color="#81F8F9"></stop>\n </linearGradient>\n </defs>\n </svg>\n {{ labelText }}\n </span>\n '},component:n,permission:e=>Object.hasOwnProperty.call(e,"xtremeComments")}]}}})})()})();
@@ -0,0 +1,4 @@
1
+ .pull-description .card-wrap:has(div.code_review_render) .title {
2
+ display: none;
3
+ }
4
+ .code_review_render_title[data-v-3861010c]{height:40px;border-bottom:1px solid var(--gray-4);margin-bottom:8px;margin-left:8px;font-size:16px;font-weight:500;color:var(--gray-9);line-height:40px}.code_ai_reivew[data-v-3861010c]{display:flex;align-items:center;justify-content:space-between}.code_ai_reivew>i[data-v-3861010c]{font-size:18px}.ai_reivew_avatar[data-v-3861010c]{display:flex;align-items:center;gap:10px}.code_review_render[data-v-3861010c]~:not(.code_review_render){background:red}.success[data-v-3861010c]{color:var(--green-5)}.fill[data-v-3861010c]{color:var(--red-5)}.running[data-v-3861010c]{color:var(--blue-5)}
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:Object.keys(e.aiTask).length,expression:"Object.keys(aiTask).length"}],ref:"codeReviewRender",staticClass:"code_review_render"},[s("div",{staticClass:"code_review_render_title hidden-md-and-down"},[e._v("\n "+e._s(e.$t("xtreme.ai_code_review"))+"\n ")]),e._v(" "),s("div",{staticClass:"code_ai_reivew"},[s("div",{staticClass:"ai_reivew_avatar"},[s("svg",{staticClass:"try_ai",attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 32 32",fill:"none"}},[s("g",{attrs:{"clip-path":"url(#clip0_3734_19920)"}},[s("path",{attrs:{d:"M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z",fill:"url(#paint0_linear_3734_19920)"}}),e._v(" "),s("path",{attrs:{d:"M17.375 7.67603C17.375 8.08325 17.198 8.44913 16.9167 8.7009V10.426H21.5C23.0188 10.426 24.25 11.6572 24.25 13.176V22.3427C24.25 23.8615 23.0188 25.0927 21.5 25.0927H10.5C8.98122 25.0927 7.75 23.8615 7.75 22.3427V13.176C7.75 11.6572 8.98122 10.426 10.5 10.426H15.0833V8.7009C14.802 8.44913 14.625 8.08325 14.625 7.67603C14.625 6.91663 15.2406 6.30103 16 6.30103C16.7594 6.30103 17.375 6.91663 17.375 7.67603ZM6.22222 15.0094C6.55973 15.0094 6.83333 15.283 6.83333 15.6205V19.8982C6.83333 20.2358 6.55973 20.5094 6.22222 20.5094H5.61111C5.2736 20.5094 5 20.2358 5 19.8982V15.6205C5 15.283 5.2736 15.0094 5.61111 15.0094H6.22222ZM26.3889 15.0094C26.7264 15.0094 27 15.283 27 15.6205V19.8982C27 20.2358 26.7264 20.5094 26.3889 20.5094H25.7778C25.4403 20.5094 25.1667 20.2358 25.1667 19.8982V15.6205C25.1667 15.283 25.4403 15.0094 25.7778 15.0094H26.3889ZM11.875 17.7591C11.875 18.5185 12.4906 19.1341 13.25 19.1341C14.0094 19.1341 14.625 18.5185 14.625 17.7591C14.625 16.9997 14.0094 16.3841 13.25 16.3841C12.4906 16.3841 11.875 16.9997 11.875 17.7591ZM17.375 17.7591C17.375 18.5185 17.9906 19.1341 18.75 19.1341C19.5094 19.1341 20.125 18.5185 20.125 17.7591C20.125 16.9997 19.5094 16.3841 18.75 16.3841C17.9906 16.3841 17.375 16.9997 17.375 17.7591Z",fill:"white"}})]),e._v(" "),s("defs",[s("linearGradient",{attrs:{id:"paint0_linear_3734_19920",x1:"-7.82777e-07",y1:"26.5",x2:"35",y2:"4.5",gradientUnits:"userSpaceOnUse"}},[s("stop",{attrs:{"stop-color":"#4E6AF9"}}),e._v(" "),s("stop",{attrs:{offset:"1","stop-color":"#81F8F9"}})],1),e._v(" "),s("clipPath",{attrs:{id:"clip0_3734_19920"}},[s("rect",{attrs:{width:"32",height:"32",rx:"8",fill:"white"}})])],1)]),e._v("\n "+e._s("AI")+"\n "),["RUNNING","INIT"].includes(this.aiTask.status)||"opened"!==e.pull.state?e._e():s("ElTooltip",{attrs:{content:e.$t("pulls.ai_review_suggestion.restart"),placement:"top"}},[s("i",{staticClass:"iconfont-new iconreset ml-1 cursor-pointer",class:{rotate:e.retryLoading},on:{click:e.handleRetry}})])],1),e._v(" "),s("i",{class:e.aiStatusData.class})])])};e._withStripped=!0;var t=function(e,t,s,i,a,n,r,o){var l="function"==typeof e?e.options:e;return t&&(l.render=t,l.staticRenderFns=[],l._compiled=!0),n&&(l._scopeId="data-v-"+n),{exports:e,options:l}}({name:"CodeReviewRender",data:()=>({aiTask:{},retryLoading:!1}),computed:{aiStatusData(){const e=this.aiTask.status;return{text:e,class:{RUNNING:"iconfont-new iconrunning icon-rotating",SUCCESS:"el-icon-success success",FAIL:"el-icon-error fill",INIT:"iconfont-new iconrunning icon-rotating",STOP:"el-icon-error icon-close"}[e]||""}}},mounted(){this.getReviewTasks()},methods:{getReviewTasks(){this.api.pullrequest.getReviewTasks(this.pull.id).then((({data:e})=>{e&&Object.keys(e).length&&(this.aiTask={...e})})).finally((()=>{Object.keys(this.aiTask).length||(this.$refs.codeReviewRender.parentElement.style.display="none")}))},handleRetry(){this.retryLoading=!0,this.api.conversationManage.reStartTask(this.aiTask.id).then((()=>{this.getReviewTasks()})).finally((()=>{this.retryLoading=!1}))}}},e,0,0,0,"3861010c");const s=t.exports;window.GITEE.api.register("pullrequest","getReviewTasks",(e=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/pull_request/${e}`))),GITEE.schema.update({PULL_REQUEST:{SIDE_CARDS:[{cardRender:s}]}}),window.GITEE.event.on("RESOLVED_COMMENTS",(e=>{if("project#pulls#detail"===window.GITEE.router.getRoute().name){const{commentsId:t,resolved_state:s}=e;window.GITEE.tools.$http.put("/api/xtreme/api/review_tasks/note_status",{is_adopted:"fixed"===s,note_id:t})}}))})();
package/manifest.yml CHANGED
@@ -1,15 +1,13 @@
1
1
  app:
2
2
  name: CODE前端插件-Xtreme
3
3
  key: code_front_plugin_xtreme
4
- version: '0.0.8'
4
+ version: '0.0.9'
5
5
  modules:
6
6
  code:front:
7
- - key: i18n
8
- resource: main
9
7
  - key: xtreme
10
8
  resource: main
11
9
  css: true
12
- - key: pullrequest
10
+ - key: xtreme_pullrequest
13
11
  resource: main
14
12
  css: true
15
13
  activationEvents:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitee-code/plugin-xtreme",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "description": "gitee前端插件-xtreme",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,6 +22,36 @@
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
25
- "dependencies": {},
26
- "devDependencies": {}
27
- }
25
+ "dependencies": {
26
+ "@giteeteam/apps-team-api": "^0.7.0",
27
+ "@giteeteam/plugin-sdk": "^0.4.1",
28
+ "express": "^4.18.2",
29
+ "lodash": "^4.17.21",
30
+ "vue-virtual-scroller": "^1.1.2",
31
+ "yaml": "^2.3.1"
32
+ },
33
+ "devDependencies": {
34
+ "@gitee-code/api-type": "^1.1.0",
35
+ "@giteeteam/apps-cli": "^0.2.12",
36
+ "axios": "1.7.4",
37
+ "clean-webpack-plugin": "^4.0.0",
38
+ "concurrently": "^8.2.2",
39
+ "cross-env": "^7.0.3",
40
+ "css-loader": "3.6.0",
41
+ "file-loader": "^6.2.0",
42
+ "mini-css-extract-plugin": "^2.9.1",
43
+ "morgan": "^1.10.0",
44
+ "rimraf": "^6.0.1",
45
+ "sass": "^1.77.8",
46
+ "sass-loader": "^10.5.2",
47
+ "ts-loader": "^9.2.5",
48
+ "ts-node": "^10.9.1",
49
+ "tslib": "^2.4.1",
50
+ "typescript": "^4.4.3",
51
+ "vue-loader": "15.10.0",
52
+ "vue-template-compiler": "2.6.14",
53
+ "webpack": "^5.74.0",
54
+ "webpack-cli": "^5.1.4",
55
+ "webpack-dev-server": "^5.0.2"
56
+ }
57
+ }
package/dist/i18n.js DELETED
@@ -1 +0,0 @@
1
- GITEE.i18n.mergeI18n("zh-CN",{knowledge:{knowledge:"知识库",delete_knowledge_tips:"确认删除该知识库?",add_file:"添加文件",chart_total:"字符数",recall_count:"召回次数",upload_at:"上传时间",upload_doc:"上传文档",delete_document_tips:"确认删除该知识库文件?",support_file:"支持Markdown、CSV",not_support_file:"上传的文件类型不符合要求"},conversation_manage:{title:"会话管理",code_review_helper_tab:"智能代码评审助手",unit_test_helper_tab:"智能单测生成助手",conversation_id:"会话ID",belong_pr:"所属Pull Request",repo:"所属代码库",conversation_status:"会话状态",create_at:"触发时间",ent_time:"结束时间",note_count:"生成评论数",exec_log:"执行日志",belong_branch:"所属分支",change_count:"变更内容",view_logs:"查看日志",file_path:"文件路径",location:"位置",content:"内容",isAdopted:"是否被采纳",view_note:"查看评论",view_detail:"点击查看",view_report:"执行日志",restart_run:"重新运行",stop_task:"终止任务",restart_task_tips:"确定重新运行该任务?",stop_task_tips:"确定停止运行该任务?",adoption_status:"采纳状态",adoption_no:"未采纳",adoption_yes:"采纳",use_time:"耗时"},xtreme:{title:"Gitee Xtreme Code 设置",open_code_review_helper:"开启智能代码评审助手",open_code_review_helper_desc:"开启后,智能代码评审助手会在开启Pull Request 后自动进行代码评审",select_knowledge:"选择知识库",open_unit_test_helper:"开启智能单测生成助手",open_unit_test_helper_desc:"开启后,智能单测生成助手会在监听的分支中执行单测生成",listener_branch:"监听分支规则",listener_branch_desc:"支持通配符匹配以及“|”进行匹配隔离",ai_code_review:"智能代码评审",adoption:"采纳",adoption_no:"不采纳",this_suggesition:"这个评审建议被",mark_adoption:"标记为采纳",mark_adoption_no:"标记不采纳"},pulls:{ai_review_suggestion:{title:"AI评审建议"}}}),GITEE.i18n.mergeI18n("en-US",{knowledge:{knowledge:"Knowledge base",delete_knowledge_tips:"Are you sure you want to delete this knowledge base?",add_file:"Add file",chart_total:"Character count",recall_count:"Recall rate",upload_at:"Upload time",upload_doc:"Upload the document",delete_document_tips:"Are you sure you want to delete this document?",support_file:"Supports Markdown, CSV",not_support_file:"The uploaded file type is not supported"},conversation_manage:{title:"Conversation Management",code_review_helper_tab:"Intelligent Code Review Assistant",unit_test_helper_tab:"Intelligent Single Test Generation Assistant",conversation_id:"Session ID",belong_pr:"The associated Pull Request",repo:"The corresponding code repository",conversation_status:"Conversation status",create_at:"Trigger time",ent_time:"End time",note_count:"Number of generated comments",exec_log:"Execution Log",belong_branch:"The corresponding branch",change_count:"Change content",view_logs:"View Logs",file_path:"File path",location:"Location",content:"Content",isAdopted:"Has it been adopted?",view_note:"View Comments",view_detail:"Click to view",view_report:"Execution Log",restart_run:"Restart the operation",stop_task:"Terminate the task",restart_task_tips:"Are you sure to re-run this task?",stop_task_tips:"Are you sure to stop running this task?",adoption_status:"Adoption status",adoption_no:"Not adopted",adoption_yes:"Adopt",use_time:"Time consumed"},xtreme:{title:"Gitee Xtreme Code Settings",open_code_review_helper:"Activate the intelligent code review assistant",open_code_review_helper_desc:"Once activated, the intelligent code review assistant will automatically conduct code reviews after a Pull Request is initiated.",select_knowledge:"Select the knowledge base",open_unit_test_helper:"Activate the intelligent single test generation assistant",open_unit_test_helper_desc:"After activation, the intelligent unit test generation assistant will execute the unit test generation within the monitored branch.",listener_branch:"Listening branch rules",listener_branch_desc:"Supports wildcard matching and “|” for matching isolation",ai_code_review:"Intelligent code review",adoption:"Adoption",adoption_no:"Not adopted",this_suggesition:"this suggesition is solved",mark_adoption:"mark as adoption",mark_adoption_no:"mark as Not adopted"},pulls:{ai_review_suggestion:{title:"AI Review Suggestions"}}});
@@ -1,4 +0,0 @@
1
- .pull-description .card-wrap:has(div.code_review_render) .title {
2
- display: none;
3
- }
4
- .code_review_render_title[data-v-7aef1f18]{height:40px;border-bottom:1px solid var(--gray-4);margin-bottom:8px;margin-left:8px;font-size:16px;font-weight:500;color:var(--gray-9);line-height:40px}.code_ai_reivew[data-v-7aef1f18]{display:flex;align-items:center;justify-content:space-between}.code_ai_reivew>i[data-v-7aef1f18]{font-size:18px}.ai_reivew_avatar[data-v-7aef1f18]{display:flex;align-items:center;gap:10px}.code_review_render[data-v-7aef1f18]~:not(.code_review_render){background:red}.success[data-v-7aef1f18]{color:var(--green-5)}.fill[data-v-7aef1f18]{color:var(--red-5)}.running[data-v-7aef1f18]{color:var(--blue-5)}
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"show",rawName:"v-show",value:Object.keys(e.aiTask).length,expression:"Object.keys(aiTask).length"}],ref:"codeReviewRender",staticClass:"code_review_render"},[i("div",{staticClass:"code_review_render_title hidden-md-and-down"},[e._v("\n "+e._s(e.$t("xtreme.ai_code_review"))+"\n ")]),e._v(" "),i("div",{staticClass:"code_ai_reivew"},[i("div",{staticClass:"ai_reivew_avatar"},[i("svg",{staticClass:"try_ai",attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 32 32",fill:"none"}},[i("g",{attrs:{"clip-path":"url(#clip0_3734_19920)"}},[i("path",{attrs:{d:"M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z",fill:"url(#paint0_linear_3734_19920)"}}),e._v(" "),i("path",{attrs:{d:"M17.375 7.67603C17.375 8.08325 17.198 8.44913 16.9167 8.7009V10.426H21.5C23.0188 10.426 24.25 11.6572 24.25 13.176V22.3427C24.25 23.8615 23.0188 25.0927 21.5 25.0927H10.5C8.98122 25.0927 7.75 23.8615 7.75 22.3427V13.176C7.75 11.6572 8.98122 10.426 10.5 10.426H15.0833V8.7009C14.802 8.44913 14.625 8.08325 14.625 7.67603C14.625 6.91663 15.2406 6.30103 16 6.30103C16.7594 6.30103 17.375 6.91663 17.375 7.67603ZM6.22222 15.0094C6.55973 15.0094 6.83333 15.283 6.83333 15.6205V19.8982C6.83333 20.2358 6.55973 20.5094 6.22222 20.5094H5.61111C5.2736 20.5094 5 20.2358 5 19.8982V15.6205C5 15.283 5.2736 15.0094 5.61111 15.0094H6.22222ZM26.3889 15.0094C26.7264 15.0094 27 15.283 27 15.6205V19.8982C27 20.2358 26.7264 20.5094 26.3889 20.5094H25.7778C25.4403 20.5094 25.1667 20.2358 25.1667 19.8982V15.6205C25.1667 15.283 25.4403 15.0094 25.7778 15.0094H26.3889ZM11.875 17.7591C11.875 18.5185 12.4906 19.1341 13.25 19.1341C14.0094 19.1341 14.625 18.5185 14.625 17.7591C14.625 16.9997 14.0094 16.3841 13.25 16.3841C12.4906 16.3841 11.875 16.9997 11.875 17.7591ZM17.375 17.7591C17.375 18.5185 17.9906 19.1341 18.75 19.1341C19.5094 19.1341 20.125 18.5185 20.125 17.7591C20.125 16.9997 19.5094 16.3841 18.75 16.3841C17.9906 16.3841 17.375 16.9997 17.375 17.7591Z",fill:"white"}})]),e._v(" "),i("defs",[i("linearGradient",{attrs:{id:"paint0_linear_3734_19920",x1:"-7.82777e-07",y1:"26.5",x2:"35",y2:"4.5",gradientUnits:"userSpaceOnUse"}},[i("stop",{attrs:{"stop-color":"#4E6AF9"}}),e._v(" "),i("stop",{attrs:{offset:"1","stop-color":"#81F8F9"}})],1),e._v(" "),i("clipPath",{attrs:{id:"clip0_3734_19920"}},[i("rect",{attrs:{width:"32",height:"32",rx:"8",fill:"white"}})])],1)]),e._v("\n "+e._s("AI")+"\n ")]),e._v(" "),i("i",{class:e.aiStatusData.class})])])};e._withStripped=!0;var t=function(e,t,i,s,a,n,r,o){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=[],c._compiled=!0),n&&(c._scopeId="data-v-"+n),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var _=c.beforeCreate;c.beforeCreate=_?[].concat(_,l):[l]}return{exports:e,options:c}}({name:"CodeReviewRender",data:()=>({aiTask:{}}),computed:{aiStatusData(){const e=this.aiTask.status;return{text:e,class:{RUNNING:"iconfont-new iconrunning icon-rotating",SUCCESS:"el-icon-success success",FAIL:"el-icon-error fill",INIT:"iconfont-new iconrunning icon-rotating"}[e]||""}}},mounted(){this.getReviewTasks()},methods:{getReviewTasks(){this.api.pullrequest.getReviewTasks(this.pull.id).then((({data:e})=>{e&&Object.keys(e).length&&(this.aiTask={...e})})).finally((()=>{Object.keys(this.aiTask).length||(this.$refs.codeReviewRender.parentElement.style.display="none")}))}}},e,0,0,0,"7aef1f18");const i=t.exports;window.GITEE.api.register("pullrequest","getReviewTasks",(e=>window.GITEE.tools.$http.get(`/api/xtreme/api/review_tasks/pull_request/${e}`))),GITEE.schema.update({PULL_REQUEST:{SIDE_CARDS:[{cardRender:i}]}}),window.GITEE.event.on("RESOLVED_COMMENTS",(e=>{if("project#pulls#detail"===window.GITEE.router.getRoute().name){const{commentsId:t,resolved_state:i}=e;window.GITEE.tools.$http.put("/api/xtreme/api/review_tasks/note_status",{is_adopted:"fixed"===i,note_id:t})}}))})();