@gitee-code/plugin-xtreme 1.0.11 → 1.0.13

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.
@@ -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("div",{staticClass:"tabs-container"},[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("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(" "),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},scopedSlots:t._u([{key:"header",fn:function(){return[o("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 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,s,n,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=o,c._compiled=!0),a&&(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 h=c.render;c.render=function(t,e){return l.call(e),h(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}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,s=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 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=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]||""}}}},n,[],!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 c=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t.execLog||t.loading?o("div",{ref:"logDetail",staticClass:"log_detail_wrap"},[o("pre",{staticClass:"log_detail"},[t._v(t._s(t.execLog))]),t._v(" "),t.loading?o("i",{staticClass:"el-icon-loading"}):t._e()]):o("NoData",{staticClass:"no_data"}),t._v(" "),o("div",{staticClass:"footer_wrap"},[o("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 h=a({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,p=a({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(h,{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=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)}}},d,[],!1,null,null,null).exports;var m=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("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[o("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=a({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,_=a({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:p,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:p},{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,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()}})},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;function w(){const{enterprise_uuid:t}=window.gon.info;return`api/enterprises/${t}/`}window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/conversation_manage`,name:"company#xtreme",component:_,meta:{title:()=>"会话管理"}}]),window.GITEE.api.register("conversationManage","getCodeReviewList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getUnitTestList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}unit_test_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getNoteList",((t,e)=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/notes`,{params:e}))),window.GITEE.api.register("conversationManage","reStartTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","stopTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/break`))),window.GITEE.api.register("conversationManage","logDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/logs`))),window.GITEE.api.register("conversationManage","stopUnitTestTask",(t=>window.GITEE.tools.$http.delete(`/api/xtreme/${w()}unit_test_tasks/${t}/cancel`))),window.GITEE.api.register("conversationManage","reStartUnitTestTask",(t=>window.GITEE.tools.$http.post(`/api/xtreme/${w()}unit_test_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","unitTestLogDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}unit_test_tasks/${t}/logs`)))})();
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("div",{staticClass:"tabs-container"},[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("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(" "),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},scopedSlots:t._u([{key:"header",fn:function(){return[o("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 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,s,n,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=o,c._compiled=!0),a&&(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 h=c.render;c.render=function(t,e){return l.call(e),h(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}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.level"),prop:"level","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,s=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 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=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]||""}}}},n,[],!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 c=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t.execLog||t.loading?o("div",{ref:"logDetail",staticClass:"log_detail_wrap"},[o("pre",{staticClass:"log_detail"},[t._v(t._s(t.execLog))]),t._v(" "),t.loading?o("i",{staticClass:"el-icon-loading"}):t._e()]):o("NoData",{staticClass:"no_data"}),t._v(" "),o("div",{staticClass:"footer_wrap"},[o("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 h=a({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,p=a({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(h,{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=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)}}},d,[],!1,null,null,null).exports;var m=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("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[o("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=a({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,_=a({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:p,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:p},{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,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()}})},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;function w(){const{enterprise_uuid:t}=window.gon.info;return`api/enterprises/${t}/`}window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/conversation_manage`,name:"company#xtreme",component:_,meta:{title:()=>"会话管理"}}]),window.GITEE.api.register("conversationManage","getCodeReviewList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getUnitTestList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}unit_test_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getNoteList",((t,e)=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/notes`,{params:e}))),window.GITEE.api.register("conversationManage","reStartTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","stopTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/break`))),window.GITEE.api.register("conversationManage","logDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/logs`))),window.GITEE.api.register("conversationManage","stopUnitTestTask",(t=>window.GITEE.tools.$http.delete(`/api/xtreme/${w()}unit_test_tasks/${t}/cancel`))),window.GITEE.api.register("conversationManage","reStartUnitTestTask",(t=>window.GITEE.tools.$http.post(`/api/xtreme/${w()}unit_test_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","unitTestLogDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}unit_test_tasks/${t}/logs`)))})();
package/dist/xtreme.css CHANGED
@@ -1,2 +1,16 @@
1
- .ai-reviewer-md-editor[data-v-90812e6c]{background:#fff;max-height:500px;overflow:auto;min-height:unset}.ai-reviewer-md-editor [id][data-v-90812e6c]:before,.ai-reviewer-md-editor .actions[data-v-90812e6c]{display:none}.footer_actions[data-v-90812e6c]{padding:8px 12px}
1
+ .pull-detail__tab #pane-file-change .ent-diffs .line_holder .line_content {
2
+ position: relative;
3
+ }
4
+ .line_holder .line_content .ai-comment-icon {
5
+ position: absolute;
6
+ z-index: 1;
7
+ top: 50%;
8
+ right: 3px;
9
+ transform: translateY(-50%);
10
+ &:hover {
11
+ transform: translateY(-50%) scale(1.3);
12
+ }
13
+ }
14
+ .ai-reviewer-md-editor[data-v-ec2a8f1e]{background:#fff;max-height:500px;overflow:auto;min-height:unset}.ai-reviewer-md-editor [id][data-v-ec2a8f1e]:before,.ai-reviewer-md-editor .actions[data-v-ec2a8f1e]{display:none}.footer_actions[data-v-ec2a8f1e]{padding:8px 12px}
2
15
  .branch_match[data-v-5a765c5e]{display:block}.rule_wrap[data-v-5a765c5e]{display:flex;gap:20px}.rule_wrap .el-input[data-v-5a765c5e]{flex:1}
16
+ .ai-comment-icon[data-v-4c9e2018]{height:16px;transition:all .2s;cursor:pointer}
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,_=h?n(e.length,String):[],m=_.length;for(var g in e)!t&&!c.call(e,g)||h&&("length"==g||p&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||_.push(g);return _}},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),_=r(8630),m=r(6719),g=r(6390),f=r(9881);e.exports=function(e,t,r,v,b,w,y){var x=g(e,r),j=g(t,r),C=y.get(j);if(C)n(e,r,C);else{var O=w?w(x,j,r+"",e,t,y):void 0,E=void 0===O;if(E){var k=c(j),S=!k&&p(j),T=!k&&!S&&m(j);O=j,k||S||T?c(x)?O=x:u(x)?O=s(x):S?(E=!1,O=o(j,!0)):T?(E=!1,O=i(j,!0)):O=[]:_(j)||l(j)?(O=x,l(x)?O=f(x):h(x)&&!d(x)||(O=a(j))):E=!1}E&&(y.set(j,O),b(O,j,v,w,y),y.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))}},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?this.suggestion.xtremeComments[0].hasOwnProperty("comments")?this.suggestion.xtremeComments||[]:[...this.suggestion.xtremeComments[0].left||[],...this.suggestion.xtremeComments[0].right||[]]:[]}},watch:{suggestion:{immediate:!0,handler(){this.suggestion.xtremeComments.forEach((e=>{e.hasOwnProperty("comments")?this.$set(this.submitingObj,e.comments[0].id,!1):(e&&e.left&&e.left.length&&e.left[0].comments&&e.left[0].comments.length&&this.$set(this.submitingObj,e.left[0].comments[0].id,!1),e&&e.right&&e.right.length&&e.right[0].comments&&e.right[0].comments.length&&this.$set(this.submitingObj,e.right[0].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,"90812e6c",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:"iconxtreme",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=>{if(Object.hasOwnProperty.call(e,"comments")){if(e.comments&&e.comments.length)return e.comments[0].system===r}else if(Object.hasOwnProperty.call(e,"left")){const t=e.left&&e.left.length&&e.left[0].comments&&e.left[0].comments[0].system===r,n=e.right&&e.right.length&&e.right[0].comments&&e.right[0].comments[0].system===r;return t||n}return 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].hasOwnProperty("left")&&e&&e.length&&(e[0].left&&e[0].left.length&&e[0].left[0].comments&&e[0].left[0].comments.length||e[0].right&&e[0].right.length&&e[0].right[0].comments&&e[0].right[0].comments.length))return[{ruleId:e[0].line_code+"scan_suggestion",xtremeComments:[...e]}];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),h=r||u||p||d,m=h?n(e.length,String):[],_=m.length;for(var g in e)!t&&!c.call(e,g)||h&&("length"==g||p&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,_))||m.push(g);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),g=r(6390),f=r(9881);e.exports=function(e,t,r,v,b,w,y){var x=g(e,r),C=g(t,r),j=y.get(C);if(j)n(e,r,j);else{var E=w?w(x,C,r+"",e,t,y):void 0,O=void 0===E;if(O){var S=c(C),I=!S&&p(C),T=!S&&!I&&_(C);E=C,S||I||T?c(x)?E=x:u(x)?E=s(x):I?(O=!1,E=o(C,!0)):T?(O=!1,E=i(C,!0)):E=[]:m(C)||l(C)?(E=x,l(x)?E=f(x):h(x)&&!d(x)||(E=a(C))):O=!1}O&&(y.set(C,E),b(E,C,v,w,y),y.delete(C)),n(e,r,E)}}},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:"代码库名称",level:"等级"},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:"不采纳",already_adoption:"已采纳"},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",level:"level"},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",already_adoption:"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";function e(e){return Object.hasOwnProperty.call(e,"left")&&t("left",e)&&t("right",e)}function t(e,t){return e&&t&&Object.hasOwnProperty.call(t,e)&&t[e]&&t[e].length&&t[e][0].comments&&t[e][0].comments.length}r(9107);var n=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"},[e.commentIsResolved(t)?[r("ElButton",{attrs:{size:"small",loading:e.submitingObj[t.comments[0].id]},on:{click:function(r){return e.handleChangeResolveState(t,"active")}}},[e._v("\n "+e._s("fixed"===t.resolved_state?e.$t("xtreme.already_adoption"):e.$t("xtreme.adoption_no"))+"\n ")])]:[r("ElButton",{attrs:{size:"small",loading:e.submitingObj[t.comments[0].id]},on:{click:function(r){return e.handleChangeResolveState(t,"fixed")}}},[e._v("\n "+e._s(e.$t("xtreme.adoption"))+"\n ")]),e._v(" "),r("ElButton",{attrs:{size:"small",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 ")])]],2)],1)})),0)};function o(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}}n._withStripped=!0;const i=o({name:"AiReviewSuggestion",props:{suggestion:{type:Object,required:!0},diff:{type:Object,required:!0},comments:{type:Array,default:()=>[]},line:{type:Object,default:()=>({})},side:{type:String,default:""}},data:()=>({submitingObj:{}}),computed:{pull(){return this.$store.getters["pull/getPullInfo"]},xtremeComments(){return this.suggestion.xtremeComments?this.suggestion.xtremeComments[0].hasOwnProperty("comments")?this.suggestion.xtremeComments||[]:[...this.suggestion.xtremeComments[0][this.side]||[]]:[]}},watch:{suggestion:{immediate:!0,handler(){this.suggestion.xtremeComments.forEach((e=>{e.hasOwnProperty("comments")?this.$set(this.submitingObj,e.comments[0].id,!1):t(this.side,e)&&this.$set(this.submitingObj,e[this.side][0].comments[0].id,!1)}))}}},methods:{commentIsResolved:e=>["fixed","closed"].includes(e.resolved_state),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)}))}}},n,[],!1,null,"ec2a8f1e",null).exports;var s=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)};s._withStripped=!0;var a=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)])};a._withStripped=!0;const l=o({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})}}},a,[],!1,null,"5a765c5e",null).exports;var c=r(2492),u=r.n(c);const p={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=u()(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]}))}}},d=o({name:"XtremeCode",components:{FormCommon:window.comps.FormCommon},mixins:[p],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:l,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()}))}}},s,[],!1,null,"3755485f",null).exports;var h=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.showAIIcon?r("span",{staticClass:"ai-comment-icon",on:{click:e.handleClick}},[r("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("g",[r("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:e.linearGradientIdUrl}}),e._v(" "),r("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(" "),r("defs",[r("linearGradient",{attrs:{id:e.linearGradientId,x1:"-7.82777e-07",y1:"26.5",x2:"35",y2:"4.5",gradientUnits:"userSpaceOnUse"}},[r("stop",{attrs:{"stop-color":"#4E6AF9"}}),e._v(" "),r("stop",{attrs:{offset:"1","stop-color":"#81F8F9"}})],1)],1)])]):e._e()};h._withStripped=!0;const m=o({name:"AICommentIcon",props:{type:{type:String},line:{type:Object},side:{type:String},commentGroups:{type:Object}},data:()=>({time:(new Date).getTime()}),computed:{pull(){return this.$store.getters["pull/getPullInfo"]},showAIIcon(){const e="pr-change"===this.type&&this.commentGroups[this.lineCode]&&this.commentGroups[this.lineCode].filter((e=>e.comments.filter((e=>1===e.system)).length)).length;return(!e||"left"!==this.side||this.line.left?.line_code!==this.line.right?.line_code)&&e},linearGradientIdUrl(){return`url(#paint1_linear_${this.time})`},linearGradientId(){return`paint1_linear_${this.time}`},lineCode(){return["left","right"].includes(this.side)?this.line[this.side]?.line_code:"old"===this.line.type?this.line.old_line?.line_code:"new"===this.line.type?this.line.new_line?.line_code:void 0}},methods:{handleClick(){const e={full_path:this.projectStore.full_path,iid:this.pull.iid,line_code:this.lineCode};window.GITEE.vuex.store.commit("PLUGINS/xtreme_note/updatePrAiToggle",e)}}},h,[],!1,null,"4c9e2018",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.vuex.register("xtreme_note",{state:{pr_ai_toggle:{}},mutations:{updatePrAiToggle(e,t){const r=JSON.parse(JSON.stringify(e.pr_ai_toggle)),{full_path:n,iid:o,line_code:i}=t;void 0===r[n]&&(r[n]={}),void 0===r[n][o]&&(r[n][o]=[]);const s=r[n][o].indexOf(i);-1===s?r[n][o].push(i):r[n][o].splice(s,1),e.pr_ai_toggle=r},resetPrAiToggle(e){e.pr_ai_toggle={}}},getters:{getPrAiToggle:e=>e.pr_ai_toggle}}),GITEE.schema.update({REPO_NAVS:[{name:"project#xtreme",title:"Gitee Xtreme Code",iconClass:"iconxtreme",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:d,meta:{title:()=>"Gitee Xtreme",permissions:()=>window.GITEE.tools.hasEaualOrHigherPermission("Operator")||window.GITEE.STORE.state.project.permissions.can_admin}}]),GITEE.tools.registerNamedMixin("PullDetail",(e=>({watch:{$route:{immediate:!0,handler(){window.GITEE.vuex.store.commit("PLUGINS/xtreme_note/resetPrAiToggle")}}}}))),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=>{if(Object.hasOwnProperty.call(e,"comments")){if(e.comments&&e.comments.length)return e.comments[0].system===r}else if(Object.hasOwnProperty.call(e,"left")){e.left=[...e.left.filter((e=>e.comments&&e.comments.filter((e=>e.system===r)).length||0===r&&0===e.comments.length))],e.right=[...e.right.filter((e=>e.comments&&e.comments.filter((e=>e.system===r)).length||0===r&&0===e.comments.length))];const t=e.left.filter((e=>e.comments&&e.comments.filter((e=>e.system===r)).length||0===r&&0===e.comments.length)),n=e.right.filter((e=>e.comments&&e.comments.filter((e=>e.system===r)).length||0===r&&0===e.comments.length));return t||n}return e})):n},getLineScanSuggestionsGroup(r,n){let o=e.methods.getLineScanSuggestionsGroup.call(this,r,n);if(["pr-change","timeline"].includes(this.type)){const e=this.getLineCommentGroup(r,1);if(!e||!e.length)return o;const n=e[0];if((n.left||n.right)&&(t("left",n)||t("right",n)))return n.left=[...n.left.filter((e=>e.comments&&e.comments.filter((e=>1===e.system)).length))],n.right=[...n.right.filter((e=>e.comments&&e.comments.filter((e=>1===e.system)).length))],[{ruleId:`${n.left[0].line_code}_${n.right[0].line_code}scan_suggestion`,xtremeComments:[...e]}];if(n.comments&&n.comments.length)return[{ruleId:n.line_code+"scan_suggestion",xtremeComments:[...e]}];o&&o.length&&(o[0].xtremeComments=[...n])}return o}}}))),GITEE.tools.registerNamedMixin("EntDiffLine",(e=>({computed:{lineCommentsCount(){return this.group?this.group.filter((e=>e.comments&&e.comments.filter((e=>1!==e.system)).length)).length:0}}}))),GITEE.tools.registerNamedMixin("DoubleColumnLine",(e=>({computed:{leftLineCommentsCount(){return this.commentGroups[this.line?.left.line_code]?.filter((e=>e.comments&&e.comments.filter((e=>1!==e.system)).length))?.length},rightLineCommentsCount(){return this.commentGroups[this.line?.right.line_code]?.filter((e=>e.comments&&e.comments.filter((e=>1!==e.system)).length))?.length}}}))),GITEE.tools.registerNamedMixin("ScanSuggestionTabs",(t=>({props:{type:{type:String}},computed:{pull(){return this.$store.getters["pull/getPullInfo"]},prAiToggle(){return this.$store.getters["PLUGINS/xtreme_note/getPrAiToggle"]},prLineCodes(){return this.prAiToggle&&this.prAiToggle[this.projectStore.full_path]&&this.prAiToggle[this.projectStore.full_path][this.pull.iid]},tdArr(){return[{key:"scan_suggestion",colspan:4,visible:this.showSuggestionLine,permission:!e(this.suggestion.xtremeComments[0])},{key:"scan_suggestion_left",colspan:2,meta:{side:"left"},visible:this.showDoubleColumnLeftAiNote,permission:e(this.suggestion.xtremeComments[0])},{key:"scan_suggestion_right",colspan:2,meta:{side:"right"},visible:this.showDoubleColumnRightAiNote,permission:e(this.suggestion.xtremeComments[0])}].filter((e=>e.permission))},showSuggestionLine(){const e=this.suggestion.xtremeComments[0].line_code;return"pr-change"!==this.type||this.lineCodeInStore(e)},showDoubleColumnLeftAiNote(){const e=this.suggestion.xtremeComments;if(e[0].left)return"pr-change"!==this.type||this.lineCodeInStore(e[0].left[0]?.line_code)},showDoubleColumnRightAiNote(){const e=this.suggestion.xtremeComments;if(e[0].right)return"pr-change"!==this.type||this.lineCodeInStore(e[0].right[0]?.line_code)}},methods:{lineCodeInStore(e){return!!this.prLineCodes&&this.prLineCodes.includes(e)}}}))),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:i,permission:e=>Object.hasOwnProperty.call(e,"xtremeComments")}]}},PULL_REQUEST:{COMMENT_ICON:m}})})()})();
@@ -1 +1 @@
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 "),["RUNNING","INIT"].includes(this.aiTask.status)||"opened"!==e.pull.state?e._e():i("ElTooltip",{attrs:{content:e.$t("pulls.ai_review_suggestion.restart"),placement:"top"}},[i("i",{staticClass:"iconfont-new iconreset ml-1 cursor-pointer",class:{rotate:e.retryLoading},on:{click:e.handleRetry}})])],1),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 p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}({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 i=t.exports;window.GITEE.api.register("pullrequest","getReviewTasks",(e=>window.GITEE.tools.$http.get(`/api/xtreme/${function(){const{enterprise_uuid:e}=window.gon.info;return`api/enterprises/${e}/`}()}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})}}))})();
1
+ (()=>{"use strict";function e(){const{enterprise_uuid:e}=window.gon.info;return`api/enterprises/${e}/`}var t=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 "),["RUNNING","INIT"].includes(this.aiTask.status)||"opened"!==e.pull.state?e._e():i("ElTooltip",{attrs:{content:e.$t("pulls.ai_review_suggestion.restart"),placement:"top"}},[i("i",{staticClass:"iconfont-new iconreset ml-1 cursor-pointer",class:{rotate:e.retryLoading},on:{click:e.handleRetry}})])],1),e._v(" "),i("i",{class:e.aiStatusData.class})])])};t._withStripped=!0;var i=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 p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}({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}))}}},t,0,0,0,"3861010c");const s=i.exports;window.GITEE.api.register("pullrequest","getReviewTasks",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${e()}review_tasks/pull_request/${t}`))),GITEE.schema.update({PULL_REQUEST:{SIDE_CARDS:[{cardRender:s}]}}),window.GITEE.event.on("RESOLVED_COMMENTS",(t=>{if("project#pulls#detail"===window.GITEE.router.getRoute().name){const{commentsId:i,resolved_state:s}=t;window.GITEE.tools.$http.put(`/api/xtreme/${e()}review_tasks/note_status`,{is_adopted:"fixed"===s,note_id:i},{noCancel:!0})}}))})();
package/manifest.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  app:
2
2
  name: CODE前端插件-Xtreme
3
3
  key: code_front_plugin_xtreme
4
- version: '0.0.14'
4
+ version: '0.0.16'
5
5
  modules:
6
6
  code:front:
7
7
  - key: xtreme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitee-code/plugin-xtreme",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "gitee前端插件-xtreme",
5
5
  "main": "index.js",
6
6
  "scripts": {