diff --git a/dbm-ui/frontend/.prettierignore b/dbm-ui/frontend/.prettierignore index b1e3b23119..657b422922 100644 --- a/dbm-ui/frontend/.prettierignore +++ b/dbm-ui/frontend/.prettierignore @@ -1,3 +1,6 @@ node_modules dist +lib +patch +public src/types/auto-imports.d.ts \ No newline at end of file diff --git a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg index e783836126..21171643ce 100644 --- a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg +++ b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg @@ -7,682 +7,682 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dbm-ui/frontend/lib/bk-icon/iconcool.js b/dbm-ui/frontend/lib/bk-icon/iconcool.js index 3b0970e0b2..b3bb2c829b 100644 --- a/dbm-ui/frontend/lib/bk-icon/iconcool.js +++ b/dbm-ui/frontend/lib/bk-icon/iconcool.js @@ -1,11 +1,10 @@ !(function () { - var svgCode = - ''; - if (document.body) { - document.body.insertAdjacentHTML('afterbegin', svgCode); - } else { - document.addEventListener('DOMContentLoaded', function () { - document.body.insertAdjacentHTML('afterbegin', svgCode); - }); - } -})(); + var svgCode = '' + if (document.body) { + document.body.insertAdjacentHTML('afterbegin', svgCode) + } else { + document.addEventListener('DOMContentLoaded', function() { + document.body.insertAdjacentHTML('afterbegin', svgCode) + }) + } +})() diff --git a/dbm-ui/frontend/lib/bk-icon/iconcool.json b/dbm-ui/frontend/lib/bk-icon/iconcool.json index f4bfb437fa..837184d7f1 100644 --- a/dbm-ui/frontend/lib/bk-icon/iconcool.json +++ b/dbm-ui/frontend/lib/bk-icon/iconcool.json @@ -1 +1 @@ -{"iconName":"bk-dbm","icons":[{"name":"tags","svgCode":"\n\n\n\n\n\n\n\t\n\t\n\n\n","codepoint":"\\e206"},{"name":"check-circle-fill","svgCode":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n","codepoint":"\\e1a7"},{"name":"exclamation-fill","svgCode":"\n\n\n\n\n\n","codepoint":"\\e173"},{"name":"help","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1f5"},{"name":"help-document","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1fa"},{"name":"check","svgCode":"\n\n\n\n\n\t\n\t\n\n\n","codepoint":"\\e205"},{"name":"auth","svgCode":"","codepoint":"\\e152"},{"name":"apply","svgCode":"","codepoint":"\\e144"},{"name":"increase","svgCode":"","codepoint":"\\e1fb"},{"name":"close-circle-shape","svgCode":"","codepoint":"\\e1be"},{"name":"right-shape","svgCode":"","codepoint":"\\e1a3"},{"name":"bulk-edit","svgCode":"","codepoint":"\\e15f"},{"name":"funnel","svgCode":"","codepoint":"\\e1bd"},{"name":"copy-2","svgCode":"","codepoint":"\\e1e4"},{"name":"paste","svgCode":"","codepoint":"\\e1e5"},{"name":"keyboard","svgCode":"","codepoint":"\\e1ae"},{"name":"draft","svgCode":"","codepoint":"\\e145"},{"name":"todolist","svgCode":"","codepoint":"\\e146"},{"name":"file","svgCode":"","codepoint":"\\e136"},{"name":"script","svgCode":"","codepoint":"\\e137"},{"name":"fast-script","svgCode":"","codepoint":"\\e151"},{"name":"homepage","svgCode":"","codepoint":"\\e158"},{"name":"template","svgCode":"","codepoint":"\\e147"},{"name":"unlock-line","svgCode":"","codepoint":"\\e166"},{"name":"sync-failed","svgCode":"","codepoint":"\\e18c"},{"name":"sync-pending","svgCode":"","codepoint":"\\e18f"},{"name":"sync-success","svgCode":"","codepoint":"\\e18d"},{"name":"sync-default","svgCode":"","codepoint":"\\e18e"},{"name":"pulsar","svgCode":"","codepoint":"\\e1b8"},{"name":"abnormal","svgCode":"","codepoint":"\\e187"},{"name":"normal","svgCode":"","codepoint":"\\e188"},{"name":"unknown","svgCode":"","codepoint":"\\e189"},{"name":"code","svgCode":"","codepoint":"\\e139"},{"name":"download-line","svgCode":"","codepoint":"\\e1f2"},{"name":"invisible1","svgCode":"","codepoint":"\\e1ff"},{"name":"variable-manage","svgCode":"","codepoint":"\\e1f7"},{"name":"visible1","svgCode":"","codepoint":"\\e1c5"},{"name":"sync-waiting-01","svgCode":"","codepoint":"\\e18a"},{"name":"script-template","svgCode":"","codepoint":"\\e138"},{"name":"qiyeweixin","svgCode":"","codepoint":"\\e1d9"},{"name":"lianxi","svgCode":"","codepoint":"\\e209"},{"name":"sql","svgCode":"","codepoint":"\\e1cb"},{"name":"daochu","svgCode":"","codepoint":"\\e1ed"},{"name":"version","svgCode":"","codepoint":"\\e156"},{"name":"copy","svgCode":"","codepoint":"\\e103"},{"name":"database","svgCode":"","codepoint":"\\e101"},{"name":"eyes","svgCode":"","codepoint":"\\e102"},{"name":"setting-fill","svgCode":"","codepoint":"\\e104"},{"name":"resource","svgCode":"","codepoint":"\\e105"},{"name":"ticket","svgCode":"","codepoint":"\\e106"},{"name":"pc","svgCode":"","codepoint":"\\e1e6"},{"name":"edit","svgCode":"","codepoint":"\\e108"},{"name":"loading","svgCode":"","codepoint":"\\e1a8"},{"name":"help-fill","svgCode":"","codepoint":"\\e109"},{"name":"unlock-line-2","svgCode":"","codepoint":"\\e10b"},{"name":"lock-fill","svgCode":"","codepoint":"\\e10c"},{"name":"un-full-screen","svgCode":"","codepoint":"\\e10f"},{"name":"full-screen","svgCode":"","codepoint":"\\e110"},{"name":"minus-fill","svgCode":"","codepoint":"\\e111"},{"name":"plus-fill","svgCode":"","codepoint":"\\e112"},{"name":"add","svgCode":"","codepoint":"\\e116"},{"name":"delete-fill","svgCode":"","codepoint":"\\e117"},{"name":"refresh","svgCode":"","codepoint":"\\e118"},{"name":"more","svgCode":"","codepoint":"\\e119"},{"name":"arrow-fill","svgCode":"","codepoint":"\\e11e"},{"name":"attention-fill","svgCode":"","codepoint":"\\e11f"},{"name":"attention","svgCode":"","codepoint":"\\e120"},{"name":"up-big","svgCode":"","codepoint":"\\e121"},{"name":"down-big","svgCode":"","codepoint":"\\e123"},{"name":"arrow-down","svgCode":"","codepoint":"\\e122"},{"name":"arrow-up","svgCode":"","codepoint":"\\e124"},{"name":"right-big","svgCode":"","codepoint":"\\e125"},{"name":"arrow-right","svgCode":"","codepoint":"\\e126"},{"name":"arrow-left","svgCode":"","codepoint":"\\e127"},{"name":"mysql","svgCode":"","codepoint":"\\e128"},{"name":"redis","svgCode":"","codepoint":"\\e129"},{"name":"mongo-db","svgCode":"","codepoint":"\\e12a"},{"name":"kafka","svgCode":"","codepoint":"\\e12b"},{"name":"approval-node","svgCode":"","codepoint":"\\e155"},{"name":"down-shape","svgCode":"","codepoint":"\\e12c"},{"name":"import","svgCode":"","codepoint":"\\e12d"},{"name":"master","svgCode":"","codepoint":"\\e13a"},{"name":"cluster","svgCode":"","codepoint":"\\e13b"},{"name":"host","svgCode":"","codepoint":"\\e13c"},{"name":"proxy","svgCode":"","codepoint":"\\e13e"},{"name":"node","svgCode":"","codepoint":"\\e13d"},{"name":"check-search","svgCode":"","codepoint":"\\e13f"},{"name":"deploy","svgCode":"","codepoint":"\\e140"},{"name":"switch","svgCode":"","codepoint":"\\e141"},{"name":"refresh-2","svgCode":"","codepoint":"\\e142"},{"name":"stop","svgCode":"","codepoint":"\\e143"},{"name":"dns","svgCode":"","codepoint":"\\e148"},{"name":"member","svgCode":"","codepoint":"\\e14c"},{"name":"spec","svgCode":"","codepoint":"\\e149"},{"name":"timed-task","svgCode":"","codepoint":"\\e14d"},{"name":"history","svgCode":"","codepoint":"\\e14a"},{"name":"backup","svgCode":"","codepoint":"\\e14f"},{"name":"account","svgCode":"","codepoint":"\\e14b"},{"name":"note","svgCode":"","codepoint":"\\e150"},{"name":"single-node","svgCode":"","codepoint":"\\e14e"},{"name":"dba-config","svgCode":"","codepoint":"\\e154"},{"name":"db-config","svgCode":"","codepoint":"\\e157"},{"name":"default-node","svgCode":"","codepoint":"\\e159"},{"name":"position","svgCode":"","codepoint":"\\e15c"},{"name":"plus-circle","svgCode":"","codepoint":"\\e15d"},{"name":"minus-circle","svgCode":"","codepoint":"\\e15e"},{"name":"rtx","svgCode":"","codepoint":"\\e160"},{"name":"expand-line","svgCode":"","codepoint":"\\e161"},{"name":"star","svgCode":"","codepoint":"\\e162"},{"name":"search","svgCode":"","codepoint":"\\e163"},{"name":"plus-8","svgCode":"","codepoint":"\\e164"},{"name":"star-fill","svgCode":"","codepoint":"\\e165"},{"name":"unlock","svgCode":"","codepoint":"\\e167"},{"name":"return","svgCode":"","codepoint":"\\e168"},{"name":"link","svgCode":"","codepoint":"\\e169"},{"name":"new","svgCode":"","codepoint":"\\e16b"},{"name":"drag","svgCode":"","codepoint":"\\e1a4"},{"name":"warning-2","svgCode":"","codepoint":"\\e18b"},{"name":"exclamation","svgCode":"","codepoint":"\\e16c"},{"name":"close","svgCode":"","codepoint":"\\e16d"},{"name":"check-line","svgCode":"","codepoint":"\\e16e"},{"name":"early-warning","svgCode":"","codepoint":"\\e16f"},{"name":"warning","svgCode":"","codepoint":"\\e170"},{"name":"spce","svgCode":"","codepoint":"\\e171"},{"name":"password","svgCode":"","codepoint":"\\e172"},{"name":"redis-2","svgCode":"","codepoint":"\\e176"},{"name":"mysql-2","svgCode":"","codepoint":"\\e174"},{"name":"es","svgCode":"","codepoint":"\\e177"},{"name":"hdfs","svgCode":"","codepoint":"\\e175"},{"name":"delete","svgCode":"","codepoint":"\\e178"},{"name":"excel","svgCode":"","codepoint":"\\e179"},{"name":"history-2","svgCode":"","codepoint":"\\e17a"},{"name":"migration","svgCode":"","codepoint":"\\e17d"},{"name":"switch-2","svgCode":"","codepoint":"\\e17e"},{"name":"remote","svgCode":"","codepoint":"\\e17f"},{"name":"clearing","svgCode":"","codepoint":"\\e180"},{"name":"alert","svgCode":"","codepoint":"\\e181"},{"name":"rebuild","svgCode":"","codepoint":"\\e182"},{"name":"clone","svgCode":"","codepoint":"\\e183"},{"name":"associated","svgCode":"","codepoint":"\\e184"},{"name":"rollback","svgCode":"","codepoint":"\\e185"},{"name":"aa","svgCode":"","codepoint":"\\e1f6"},{"name":"data","svgCode":"","codepoint":"\\e186"},{"name":"audit","svgCode":"","codepoint":"\\e190"},{"name":"yijinyong","svgCode":"","codepoint":"\\e19a"},{"name":"kuorongzhong","svgCode":"","codepoint":"\\e19d"},{"name":"zhongqizhong","svgCode":"","codepoint":"\\e19b"},{"name":"suorongzhong","svgCode":"","codepoint":"\\e19e"},{"name":"tihuanzong","svgCode":"","codepoint":"\\e19c"},{"name":"shanchuzhong","svgCode":"","codepoint":"\\e19f"},{"name":"jinyongzhong","svgCode":"","codepoint":"\\e1a0"},{"name":"qiyongzhong","svgCode":"","codepoint":"\\e1a1"},{"name":"help-fill-2","svgCode":"","codepoint":"\\e1a2"},{"name":"2-jiantou-you","svgCode":"","codepoint":"\\e1a5"},{"name":"2-jiantou-zuo","svgCode":"","codepoint":"\\e1a6"},{"name":"tools","svgCode":"","codepoint":"\\e1a9"},{"name":"todos","svgCode":"","codepoint":"\\e1aa"},{"name":"manual","svgCode":"","codepoint":"\\e1ac"},{"name":"minimap","svgCode":"","codepoint":"\\e1ad"},{"name":"backup-2","svgCode":"","codepoint":"\\e1af"},{"name":"loading-tubiao","svgCode":"","codepoint":"\\e208"},{"name":"host-select","svgCode":"","codepoint":"\\e1b0"},{"name":"batch-host-select","svgCode":"","codepoint":"\\e1b1"},{"name":"revoke","svgCode":"","codepoint":"\\e1b3"},{"name":"en","svgCode":"","codepoint":"\\e1b4"},{"name":"cn","svgCode":"","codepoint":"\\e1b5"},{"name":"list","svgCode":"","codepoint":"\\e1b7"},{"name":"influxdb","svgCode":"","codepoint":"\\e1ba"},{"name":"summation","svgCode":"","codepoint":"\\e1bb"},{"name":"folder-open","svgCode":"","codepoint":"\\e1bc"},{"name":"wenjian","svgCode":"","codepoint":"\\e1bf"},{"name":"drag","svgCode":"","codepoint":"\\e1c0"},{"name":"gaokeyong","svgCode":"","codepoint":"\\e1c2"},{"name":"fenbushijiqun","svgCode":"","codepoint":"\\e1c3"},{"name":"danjiedian","svgCode":"","codepoint":"\\e1c1"},{"name":"zhongkongji","svgCode":"","codepoint":"\\e1c4"},{"name":"wenjian","svgCode":"","codepoint":"\\e1c6"},{"name":"manual-2","svgCode":"","codepoint":"\\e1c7"},{"name":"clock","svgCode":"","codepoint":"\\e1c8"},{"name":"auto","svgCode":"","codepoint":"\\e1c9"},{"name":"dirty-host","svgCode":"","codepoint":"\\e1ca"},{"name":"tag-3","svgCode":"","codepoint":"\\e207"},{"name":"saoba","svgCode":"","codepoint":"\\e1f4"},{"name":"dongzuo-xiazai","svgCode":"","codepoint":"\\e1f3"},{"name":"entry","svgCode":"","codepoint":"\\e1d0"},{"name":"gaojingcelve","svgCode":"","codepoint":"\\e1d1"},{"name":"lunzhi","svgCode":"","codepoint":"\\e1d5"},{"name":"gaojing","svgCode":"","codepoint":"\\e1d2"},{"name":"yonghuzu","svgCode":"","codepoint":"\\e1d3"},{"name":"pingbi","svgCode":"","codepoint":"\\e1d4"},{"name":"hongqi","svgCode":"","codepoint":"\\e1d6"},{"name":"jiankong","svgCode":"","codepoint":"\\e1d7"},{"name":"mimasuijihua","svgCode":"","codepoint":"\\e1d8"},{"name":"jiqiren","svgCode":"","codepoint":"\\e1da"},{"name":"qiyeweixin-2","svgCode":"","codepoint":"\\e1db"},{"name":"weixin-2","svgCode":"","codepoint":"\\e1dc"},{"name":"youjian","svgCode":"","codepoint":"\\e1dd"},{"name":"duanxin","svgCode":"","codepoint":"\\e1de"},{"name":"yuyin","svgCode":"","codepoint":"\\e1df"},{"name":"warn-lightning","svgCode":"","codepoint":"\\e1e1"},{"name":"unlink","svgCode":"","codepoint":"\\e1e2"},{"name":"mobanshili","svgCode":"","codepoint":"\\e1e3"},{"name":"qiangzhizhongzhi","svgCode":"","codepoint":"\\e1e7"},{"name":"sqlserver","svgCode":"","codepoint":"\\e1e8"},{"name":"qianyizhong","svgCode":"","codepoint":"\\e1ea"},{"name":"liucheng","svgCode":"","codepoint":"\\e1eb"},{"name":"kejian","svgCode":"","codepoint":"\\e1ec"},{"name":"doris","svgCode":"","codepoint":"\\e1ee"},{"name":"daochu-2","svgCode":"","codepoint":"\\e1f0"},{"name":"daoru","svgCode":"","codepoint":"\\e1ef"},{"name":"piliangluru","svgCode":"","codepoint":"\\e1f1"},{"name":"cluster-standardize","svgCode":"","codepoint":"\\e1f9"},{"name":"fill-1","svgCode":"","codepoint":"\\e1fc"},{"name":"kelong","svgCode":"","codepoint":"\\e1fe"},{"name":"yuandezhongjian","svgCode":"","codepoint":"\\e1fd"},{"name":"daihuishou-2","svgCode":"","codepoint":"\\e202"},{"name":"daihuishou","svgCode":"","codepoint":"\\e203"},{"name":"guzhangji","svgCode":"","codepoint":"\\e204"}]} \ No newline at end of file +{"iconName":"bk-dbm","icons":[{"name":"tags","svgCode":"\n\n\n\n\n\n\n\t\n\t\n\n\n","codepoint":"\\e206"},{"name":"check-circle-fill","svgCode":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n","codepoint":"\\e1a7"},{"name":"exclamation-fill","svgCode":"\n\n\n\n\n\n","codepoint":"\\e173"},{"name":"help","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1f5"},{"name":"help-document","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1fa"},{"name":"check","svgCode":"\n\n\n\n\n\t\n\t\n\n\n","codepoint":"\\e205"},{"name":"auth","svgCode":"","codepoint":"\\e152"},{"name":"apply","svgCode":"","codepoint":"\\e144"},{"name":"increase","svgCode":"","codepoint":"\\e1fb"},{"name":"close-circle-shape","svgCode":"","codepoint":"\\e1be"},{"name":"right-shape","svgCode":"","codepoint":"\\e1a3"},{"name":"bulk-edit","svgCode":"","codepoint":"\\e15f"},{"name":"funnel","svgCode":"","codepoint":"\\e1bd"},{"name":"copy-2","svgCode":"","codepoint":"\\e1e4"},{"name":"paste","svgCode":"","codepoint":"\\e1e5"},{"name":"keyboard","svgCode":"","codepoint":"\\e1ae"},{"name":"draft","svgCode":"","codepoint":"\\e145"},{"name":"todolist","svgCode":"","codepoint":"\\e146"},{"name":"file","svgCode":"","codepoint":"\\e136"},{"name":"script","svgCode":"","codepoint":"\\e137"},{"name":"fast-script","svgCode":"","codepoint":"\\e151"},{"name":"homepage","svgCode":"","codepoint":"\\e158"},{"name":"template","svgCode":"","codepoint":"\\e147"},{"name":"unlock-line","svgCode":"","codepoint":"\\e166"},{"name":"sync-failed","svgCode":"","codepoint":"\\e18c"},{"name":"sync-pending","svgCode":"","codepoint":"\\e18f"},{"name":"sync-success","svgCode":"","codepoint":"\\e18d"},{"name":"sync-default","svgCode":"","codepoint":"\\e18e"},{"name":"pulsar","svgCode":"","codepoint":"\\e1b8"},{"name":"abnormal","svgCode":"","codepoint":"\\e187"},{"name":"normal","svgCode":"","codepoint":"\\e188"},{"name":"unknown","svgCode":"","codepoint":"\\e189"},{"name":"code","svgCode":"","codepoint":"\\e139"},{"name":"download-line","svgCode":"","codepoint":"\\e1f2"},{"name":"invisible1","svgCode":"","codepoint":"\\e1ff"},{"name":"variable-manage","svgCode":"","codepoint":"\\e1f7"},{"name":"visible1","svgCode":"","codepoint":"\\e1c5"},{"name":"sync-waiting-01","svgCode":"","codepoint":"\\e18a"},{"name":"script-template","svgCode":"","codepoint":"\\e138"},{"name":"qiyeweixin","svgCode":"","codepoint":"\\e1d9"},{"name":"sql","svgCode":"","codepoint":"\\e1cb"},{"name":"daochu","svgCode":"","codepoint":"\\e1ed"},{"name":"version","svgCode":"","codepoint":"\\e156"},{"name":"copy","svgCode":"","codepoint":"\\e103"},{"name":"database","svgCode":"","codepoint":"\\e101"},{"name":"eyes","svgCode":"","codepoint":"\\e102"},{"name":"setting-fill","svgCode":"","codepoint":"\\e104"},{"name":"resource","svgCode":"","codepoint":"\\e105"},{"name":"ticket","svgCode":"","codepoint":"\\e106"},{"name":"pc","svgCode":"","codepoint":"\\e1e6"},{"name":"edit","svgCode":"","codepoint":"\\e108"},{"name":"loading","svgCode":"","codepoint":"\\e1a8"},{"name":"help-fill","svgCode":"","codepoint":"\\e109"},{"name":"unlock-line-2","svgCode":"","codepoint":"\\e10b"},{"name":"lock-fill","svgCode":"","codepoint":"\\e10c"},{"name":"un-full-screen","svgCode":"","codepoint":"\\e10f"},{"name":"full-screen","svgCode":"","codepoint":"\\e110"},{"name":"minus-fill","svgCode":"","codepoint":"\\e111"},{"name":"plus-fill","svgCode":"","codepoint":"\\e112"},{"name":"add","svgCode":"","codepoint":"\\e116"},{"name":"delete-fill","svgCode":"","codepoint":"\\e117"},{"name":"refresh","svgCode":"","codepoint":"\\e118"},{"name":"more","svgCode":"","codepoint":"\\e119"},{"name":"arrow-fill","svgCode":"","codepoint":"\\e11e"},{"name":"attention-fill","svgCode":"","codepoint":"\\e11f"},{"name":"attention","svgCode":"","codepoint":"\\e120"},{"name":"up-big","svgCode":"","codepoint":"\\e121"},{"name":"down-big","svgCode":"","codepoint":"\\e123"},{"name":"arrow-down","svgCode":"","codepoint":"\\e122"},{"name":"arrow-up","svgCode":"","codepoint":"\\e124"},{"name":"right-big","svgCode":"","codepoint":"\\e125"},{"name":"arrow-right","svgCode":"","codepoint":"\\e126"},{"name":"arrow-left","svgCode":"","codepoint":"\\e127"},{"name":"mysql","svgCode":"","codepoint":"\\e128"},{"name":"redis","svgCode":"","codepoint":"\\e129"},{"name":"mongo-db","svgCode":"","codepoint":"\\e12a"},{"name":"kafka","svgCode":"","codepoint":"\\e12b"},{"name":"approval-node","svgCode":"","codepoint":"\\e155"},{"name":"down-shape","svgCode":"","codepoint":"\\e12c"},{"name":"import","svgCode":"","codepoint":"\\e12d"},{"name":"master","svgCode":"","codepoint":"\\e13a"},{"name":"cluster","svgCode":"","codepoint":"\\e13b"},{"name":"host","svgCode":"","codepoint":"\\e13c"},{"name":"proxy","svgCode":"","codepoint":"\\e13e"},{"name":"node","svgCode":"","codepoint":"\\e13d"},{"name":"check-search","svgCode":"","codepoint":"\\e13f"},{"name":"deploy","svgCode":"","codepoint":"\\e140"},{"name":"switch","svgCode":"","codepoint":"\\e141"},{"name":"refresh-2","svgCode":"","codepoint":"\\e142"},{"name":"stop","svgCode":"","codepoint":"\\e143"},{"name":"dns","svgCode":"","codepoint":"\\e148"},{"name":"member","svgCode":"","codepoint":"\\e14c"},{"name":"spec","svgCode":"","codepoint":"\\e149"},{"name":"timed-task","svgCode":"","codepoint":"\\e14d"},{"name":"history","svgCode":"","codepoint":"\\e14a"},{"name":"backup","svgCode":"","codepoint":"\\e14f"},{"name":"account","svgCode":"","codepoint":"\\e14b"},{"name":"note","svgCode":"","codepoint":"\\e150"},{"name":"single-node","svgCode":"","codepoint":"\\e14e"},{"name":"dba-config","svgCode":"","codepoint":"\\e154"},{"name":"db-config","svgCode":"","codepoint":"\\e157"},{"name":"default-node","svgCode":"","codepoint":"\\e159"},{"name":"position","svgCode":"","codepoint":"\\e15c"},{"name":"plus-circle","svgCode":"","codepoint":"\\e15d"},{"name":"minus-circle","svgCode":"","codepoint":"\\e15e"},{"name":"rtx","svgCode":"","codepoint":"\\e160"},{"name":"expand-line","svgCode":"","codepoint":"\\e161"},{"name":"star","svgCode":"","codepoint":"\\e162"},{"name":"search","svgCode":"","codepoint":"\\e163"},{"name":"plus-8","svgCode":"","codepoint":"\\e164"},{"name":"star-fill","svgCode":"","codepoint":"\\e165"},{"name":"unlock","svgCode":"","codepoint":"\\e167"},{"name":"return","svgCode":"","codepoint":"\\e168"},{"name":"link","svgCode":"","codepoint":"\\e169"},{"name":"new","svgCode":"","codepoint":"\\e16b"},{"name":"drag","svgCode":"","codepoint":"\\e1a4"},{"name":"warning-2","svgCode":"","codepoint":"\\e18b"},{"name":"exclamation","svgCode":"","codepoint":"\\e16c"},{"name":"close","svgCode":"","codepoint":"\\e16d"},{"name":"check-line","svgCode":"","codepoint":"\\e16e"},{"name":"early-warning","svgCode":"","codepoint":"\\e16f"},{"name":"warning","svgCode":"","codepoint":"\\e170"},{"name":"spce","svgCode":"","codepoint":"\\e171"},{"name":"password","svgCode":"","codepoint":"\\e172"},{"name":"redis-2","svgCode":"","codepoint":"\\e176"},{"name":"mysql-2","svgCode":"","codepoint":"\\e174"},{"name":"es","svgCode":"","codepoint":"\\e177"},{"name":"hdfs","svgCode":"","codepoint":"\\e175"},{"name":"delete","svgCode":"","codepoint":"\\e178"},{"name":"excel","svgCode":"","codepoint":"\\e179"},{"name":"history-2","svgCode":"","codepoint":"\\e17a"},{"name":"migration","svgCode":"","codepoint":"\\e17d"},{"name":"switch-2","svgCode":"","codepoint":"\\e17e"},{"name":"remote","svgCode":"","codepoint":"\\e17f"},{"name":"clearing","svgCode":"","codepoint":"\\e180"},{"name":"alert","svgCode":"","codepoint":"\\e181"},{"name":"rebuild","svgCode":"","codepoint":"\\e182"},{"name":"clone","svgCode":"","codepoint":"\\e183"},{"name":"associated","svgCode":"","codepoint":"\\e184"},{"name":"rollback","svgCode":"","codepoint":"\\e185"},{"name":"aa","svgCode":"","codepoint":"\\e1f6"},{"name":"data","svgCode":"","codepoint":"\\e186"},{"name":"audit","svgCode":"","codepoint":"\\e190"},{"name":"yijinyong","svgCode":"","codepoint":"\\e19a"},{"name":"kuorongzhong","svgCode":"","codepoint":"\\e19d"},{"name":"zhongqizhong","svgCode":"","codepoint":"\\e19b"},{"name":"suorongzhong","svgCode":"","codepoint":"\\e19e"},{"name":"tihuanzong","svgCode":"","codepoint":"\\e19c"},{"name":"shanchuzhong","svgCode":"","codepoint":"\\e19f"},{"name":"jinyongzhong","svgCode":"","codepoint":"\\e1a0"},{"name":"qiyongzhong","svgCode":"","codepoint":"\\e1a1"},{"name":"help-fill-2","svgCode":"","codepoint":"\\e1a2"},{"name":"2-jiantou-you","svgCode":"","codepoint":"\\e1a5"},{"name":"2-jiantou-zuo","svgCode":"","codepoint":"\\e1a6"},{"name":"tools","svgCode":"","codepoint":"\\e1a9"},{"name":"todos","svgCode":"","codepoint":"\\e1aa"},{"name":"manual","svgCode":"","codepoint":"\\e1ac"},{"name":"minimap","svgCode":"","codepoint":"\\e1ad"},{"name":"backup-2","svgCode":"","codepoint":"\\e1af"},{"name":"loading-tubiao","svgCode":"","codepoint":"\\e208"},{"name":"host-select","svgCode":"","codepoint":"\\e1b0"},{"name":"batch-host-select","svgCode":"","codepoint":"\\e1b1"},{"name":"revoke","svgCode":"","codepoint":"\\e1b3"},{"name":"en","svgCode":"","codepoint":"\\e1b4"},{"name":"cn","svgCode":"","codepoint":"\\e1b5"},{"name":"list","svgCode":"","codepoint":"\\e1b7"},{"name":"influxdb","svgCode":"","codepoint":"\\e1ba"},{"name":"summation","svgCode":"","codepoint":"\\e1bb"},{"name":"folder-open","svgCode":"","codepoint":"\\e1bc"},{"name":"wenjian","svgCode":"","codepoint":"\\e1bf"},{"name":"drag","svgCode":"","codepoint":"\\e1c0"},{"name":"gaokeyong","svgCode":"","codepoint":"\\e1c2"},{"name":"fenbushijiqun","svgCode":"","codepoint":"\\e1c3"},{"name":"danjiedian","svgCode":"","codepoint":"\\e1c1"},{"name":"zhongkongji","svgCode":"","codepoint":"\\e1c4"},{"name":"wenjian","svgCode":"","codepoint":"\\e1c6"},{"name":"manual-2","svgCode":"","codepoint":"\\e1c7"},{"name":"clock","svgCode":"","codepoint":"\\e1c8"},{"name":"auto","svgCode":"","codepoint":"\\e1c9"},{"name":"dirty-host","svgCode":"","codepoint":"\\e1ca"},{"name":"tag-3","svgCode":"","codepoint":"\\e207"},{"name":"saoba","svgCode":"","codepoint":"\\e1f4"},{"name":"dongzuo-xiazai","svgCode":"","codepoint":"\\e1f3"},{"name":"entry","svgCode":"","codepoint":"\\e1d0"},{"name":"gaojingcelve","svgCode":"","codepoint":"\\e1d1"},{"name":"lunzhi","svgCode":"","codepoint":"\\e1d5"},{"name":"gaojing","svgCode":"","codepoint":"\\e1d2"},{"name":"yonghuzu","svgCode":"","codepoint":"\\e1d3"},{"name":"pingbi","svgCode":"","codepoint":"\\e1d4"},{"name":"hongqi","svgCode":"","codepoint":"\\e1d6"},{"name":"jiankong","svgCode":"","codepoint":"\\e1d7"},{"name":"mimasuijihua","svgCode":"","codepoint":"\\e1d8"},{"name":"jiqiren","svgCode":"","codepoint":"\\e1da"},{"name":"qiyeweixin-2","svgCode":"","codepoint":"\\e1db"},{"name":"weixin-2","svgCode":"","codepoint":"\\e1dc"},{"name":"youjian","svgCode":"","codepoint":"\\e1dd"},{"name":"duanxin","svgCode":"","codepoint":"\\e1de"},{"name":"yuyin","svgCode":"","codepoint":"\\e1df"},{"name":"warn-lightning","svgCode":"","codepoint":"\\e1e1"},{"name":"unlink","svgCode":"","codepoint":"\\e1e2"},{"name":"mobanshili","svgCode":"","codepoint":"\\e1e3"},{"name":"qiangzhizhongzhi","svgCode":"","codepoint":"\\e1e7"},{"name":"sqlserver","svgCode":"","codepoint":"\\e1e8"},{"name":"qianyizhong","svgCode":"","codepoint":"\\e1ea"},{"name":"liucheng","svgCode":"","codepoint":"\\e1eb"},{"name":"kejian","svgCode":"","codepoint":"\\e1ec"},{"name":"doris","svgCode":"","codepoint":"\\e1ee"},{"name":"daochu-2","svgCode":"","codepoint":"\\e1f0"},{"name":"daoru","svgCode":"","codepoint":"\\e1ef"},{"name":"piliangluru","svgCode":"","codepoint":"\\e1f1"},{"name":"cluster-standardize","svgCode":"","codepoint":"\\e1f9"},{"name":"fill-1","svgCode":"","codepoint":"\\e1fc"},{"name":"kelong","svgCode":"","codepoint":"\\e1fe"},{"name":"yuandezhongjian","svgCode":"","codepoint":"\\e1fd"},{"name":"daihuishou-2","svgCode":"","codepoint":"\\e202"},{"name":"daihuishou","svgCode":"","codepoint":"\\e203"},{"name":"guzhangji","svgCode":"","codepoint":"\\e204"}]} diff --git a/dbm-ui/frontend/package.json b/dbm-ui/frontend/package.json index 301a6b703b..0bdf00bc1e 100644 --- a/dbm-ui/frontend/package.json +++ b/dbm-ui/frontend/package.json @@ -24,14 +24,12 @@ "@blueking/login-modal": "^1.0.5", "@blueking/notice-component": "2.0.5", "@blueking/sub-saas": "0.0.0-beta.6", - "@blueking/table": "^0.0.1-beta.12", - "@blueking/vxe-table": "^4.8.0-beta.7.4", - "@icon-cool/bk-icon-bk-biz-components": "0.0.4", - "@jridgewell/gen-mapping": "0.3.5", - "@vueuse/core": "^11.0.3", - "axios": "^1.7.7", + "@blueking/table": "^0.0.1-beta.20", + "@icon-cool/bk-icon-bk-biz-components": "^0.0.4", + "@vueuse/core": "^12.0.0", + "axios": "^1.7.9", "bkui-vue": "2.0.1-beta.78", - "date-fns": "3.6.0", + "date-fns": "^4.1.0", "dayjs": "^1.11.13", "echarts": "^5.5.1", "html-to-image": "1.11.11", @@ -39,65 +37,65 @@ "jsencrypt": "3.3.2", "lodash": "4.17.21", "mitt": "3.0.1", - "monaco-editor": "^0.51.0", - "pinia": "2.2.2", - "qs": "6.13.0", + "monaco-editor": "^0.52.0", + "pinia": "^2.3.0", + "qs": "^6.13.1", "screenfull": "6.0.2", "tiny-pinyin": "1.3.2", "tippy.js": "6.3.7", "url-join": "5.0.0", - "vue": "^3.5.4", + "vue": "^3.5.13", "vue-content-loader": "2.0.1", - "vue-i18n": "^10.0.1", + "vue-i18n": "^10.0.5", "vue-request": "2.0.4", - "vue-router": "^4.4.5", + "vue-router": "^4.5.0", "vue-types": "^5.1.3", "vuedraggable": "4.1.0", "xlsx": "^0.18.5" }, "devDependencies": { - "@commitlint/config-conventional": "^19.5.0", - "@trivago/prettier-plugin-sort-imports": "4.3.0", + "@commitlint/config-conventional": "^19.6.0", + "@trivago/prettier-plugin-sort-imports": "^5.1.0", "@tsconfig/node20": "20.1.4", - "@types/lodash": "4.17.7", - "@types/node": "^22.5.4", - "@types/qs": "6.9.15", - "@vitejs/plugin-basic-ssl": "1.1.0", - "@vitejs/plugin-vue": "^5.1.3", - "@vitejs/plugin-vue-jsx": "4.0.1", + "@types/lodash": "^4.17.13", + "@types/node": "^22.10.1", + "@types/qs": "^6.9.17", + "@vitejs/plugin-basic-ssl": "^1.2.0", + "@vitejs/plugin-vue": "^5.2.1", + "@vitejs/plugin-vue-jsx": "^4.1.1", "@vue/eslint-config-typescript": "13.0.0", - "@vue/tsconfig": "0.5.1", - "commitlint": "^19.5.0", + "@vue/tsconfig": "^0.7.0", + "commitlint": "^19.6.0", "cross-env": "7.0.3", "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", - "eslint-config-tencent": "1.0.4", + "eslint-config-tencent": "^1.1.1", "eslint-plugin-simple-import-sort": "12.1.1", - "eslint-plugin-vue": "^9.28.0", - "less": "4.2.0", + "eslint-plugin-vue": "^9.32.0", + "less": "^4.2.1", "lint-staged": "^15.2.10", - "npm-run-all2": "6.2.2", + "npm-run-all2": "^7.0.1", "postcss-html": "1.7.0", "postcss-less": "6.0.0", - "prettier": "3.3.3", - "prettier-plugin-curly": "0.2.2", + "prettier": "^3.4.2", + "prettier-plugin-curly": "^0.3.1", "simple-git-hooks": "2.11.1", - "stylelint": "^16.9.0", + "stylelint": "^16.11.0", "stylelint-config-standard": "36.0.1", "stylelint-less": "3.0.1", "stylelint-order": "6.0.4", - "typescript": "5.6.2", - "unplugin-auto-import": "^0.18.3", - "unplugin-vue-components": "0.27.4", - "vite": "^5.4.5", - "vite-plugin-babel": "1.2.0", + "typescript": "^5.7.2", + "unplugin-auto-import": "^0.18.6", + "unplugin-vue-components": "^0.27.5", + "vite": "^6.0.3", + "vite-plugin-babel": "^1.3.0", "vite-plugin-html-env": "1.2.8", "vite-plugin-imp": "2.4.0", "vite-plugin-monaco-editor": "1.1.0", - "vite-plugin-static-copy": "^1.0.6", + "vite-plugin-static-copy": "^2.2.0", "vite-plugin-style-import": "2.0.0", - "vue-component-type-helpers": "^2.1.6", - "vue-tsc": "^2.1.6" + "vue-component-type-helpers": "^2.1.10", + "vue-tsc": "^2.1.10" }, "simple-git-hooks": { "pre-commit": "cd dbm-ui/frontend && npx lint-staged", diff --git a/dbm-ui/frontend/src/common/const/ticketTypes.ts b/dbm-ui/frontend/src/common/const/ticketTypes.ts index 49dece0cf1..304cec4b2c 100644 --- a/dbm-ui/frontend/src/common/const/ticketTypes.ts +++ b/dbm-ui/frontend/src/common/const/ticketTypes.ts @@ -36,7 +36,8 @@ export enum TicketTypes { MYSQL_HA_FULL_BACKUP = 'MYSQL_HA_FULL_BACKUP', MYSQL_OPEN_AREA = 'MYSQL_OPEN_AREA', // 开区 MYSQL_PARTITION = 'MYSQL_PARTITION', - MYSQL_DUMP_DATA = 'MYSQL_DUMP_DATA', // mysql mysql 数据导出 + MYSQL_DUMP_DATA = 'MYSQL_DUMP_DATA', // mysql 数据导出 + MYSQL_DATA_REPAIR = 'MYSQL_DATA_REPAIR', // mysql 数据修复 MYSQL_PROXY_UPGRADE = 'MYSQL_PROXY_UPGRADE', // MySQL Proxy 升级 MYSQL_LOCAL_UPGRADE = 'MYSQL_LOCAL_UPGRADE', // MySQL 原地升级 MYSQL_MIGRATE_UPGRADE = 'MYSQL_MIGRATE_UPGRADE', // MySQL 迁移升级 @@ -46,44 +47,45 @@ export enum TicketTypes { TENDBSINGLE_STANDARDIZE = 'TENDBSINGLE_STANDARDIZE', // 集群标准化 MySQL单节点 } export enum TicketTypes { - REDIS_CLUSTER_APPLY = 'REDIS_CLUSTER_APPLY', - REDIS_KEYS_EXTRACT = 'REDIS_KEYS_EXTRACT', - REDIS_KEYS_DELETE = 'REDIS_KEYS_DELETE', REDIS_BACKUP = 'REDIS_BACKUP', - REDIS_PURGE = 'REDIS_PURGE', + REDIS_CLUSTER_ADD_SLAVE = 'REDIS_CLUSTER_ADD_SLAVE', + REDIS_CLUSTER_APPLY = 'REDIS_CLUSTER_APPLY', + REDIS_CLUSTER_CUTOFF = 'REDIS_CLUSTER_CUTOFF', + REDIS_CLUSTER_DATA_COPY = 'REDIS_CLUSTER_DATA_COPY', + REDIS_CLUSTER_ROLLBACK_DATA_COPY = 'REDIS_CLUSTER_ROLLBACK_DATA_COPY', + REDIS_CLUSTER_SHARD_NUM_UPDATE = 'REDIS_CLUSTER_SHARD_NUM_UPDATE', + REDIS_CLUSTER_TYPE_UPDATE = 'REDIS_CLUSTER_TYPE_UPDATE', + REDIS_DATACOPY_CHECK_REPAIR = 'REDIS_DATACOPY_CHECK_REPAIR', REDIS_DESTROY = 'REDIS_DESTROY', - REDIS_PROXY_OPEN = 'REDIS_PROXY_OPEN', - REDIS_PROXY_CLOSE = 'REDIS_PROXY_CLOSE', - REDIS_PLUGIN_DNS_BIND_CLB = 'REDIS_PLUGIN_DNS_BIND_CLB', - REDIS_PLUGIN_DNS_UNBIND_CLB = 'REDIS_PLUGIN_DNS_UNBIND_CLB', + REDIS_INS_APPLY = 'REDIS_INS_APPLY', + REDIS_INSTANCE_PROXY_CLOSE = 'REDIS_INSTANCE_PROXY_CLOSE', + REDIS_INSTANCE_PROXY_OPEN = 'REDIS_INSTANCE_PROXY_OPEN', + REDIS_INSTANCE_DESTROY = 'REDIS_INSTANCE_DESTROY', // redis 主从集群删除 + REDIS_KEYS_DELETE = 'REDIS_KEYS_DELETE', + REDIS_KEYS_EXTRACT = 'REDIS_KEYS_EXTRACT', + REDIS_MASTER_SLAVE_SWITCH = 'REDIS_MASTER_SLAVE_SWITCH', REDIS_PLUGIN_CREATE_CLB = 'REDIS_PLUGIN_CREATE_CLB', - REDIS_PLUGIN_DELETE_CLB = 'REDIS_PLUGIN_DELETE_CLB', REDIS_PLUGIN_CREATE_POLARIS = 'REDIS_PLUGIN_CREATE_POLARIS', + REDIS_PLUGIN_DELETE_CLB = 'REDIS_PLUGIN_DELETE_CLB', REDIS_PLUGIN_DELETE_POLARIS = 'REDIS_PLUGIN_DELETE_POLARIS', - REDIS_CLUSTER_CUTOFF = 'REDIS_CLUSTER_CUTOFF', // redis 整机替换 - REDIS_PROXY_SCALE_UP = 'REDIS_PROXY_SCALE_UP', // redis 接入层扩容 - REDIS_PROXY_SCALE_DOWN = 'REDIS_PROXY_SCALE_DOWN', // redis 接入层缩容 - REDIS_SCALE_UPDOWN = 'REDIS_SCALE_UPDOWN', // redis 集群容量变更 - REDIS_SCALE_UP = 'REDIS_SCALE_UP', // redis 存储层扩容 - REDIS_SCALE_DOWN = 'REDIS_SCALE_DOWN', // redis 存储层缩容 - REDIS_MASTER_SLAVE_SWITCH = 'REDIS_MASTER_SLAVE_SWITCH', // redis 主故障切换 - REDIS_SLOTS_MIGRATE = 'REDIS_SLOTS_MIGRATE', // redis slots 迁移 + REDIS_PLUGIN_DNS_BIND_CLB = 'REDIS_PLUGIN_DNS_BIND_CLB', + REDIS_PLUGIN_DNS_UNBIND_CLB = 'REDIS_PLUGIN_DNS_UNBIND_CLB', REDIS_DATA_STRUCTURE = 'REDIS_DATA_STRUCTURE', // redis 定点构造 REDIS_DATA_STRUCTURE_TASK_DELETE = 'REDIS_DATA_STRUCTURE_TASK_DELETE', // redis 构造销毁 - REDIS_CLUSTER_ADD_SLAVE = 'REDIS_CLUSTER_ADD_SLAVE', // redis 新建从库 - REDIS_CLUSTER_DATA_COPY = 'REDIS_CLUSTER_DATA_COPY', // redis 数据复制 - REDIS_CLUSTER_SHARD_NUM_UPDATE = 'REDIS_CLUSTER_SHARD_NUM_UPDATE', // redis 集群分片变更 - REDIS_CLUSTER_TYPE_UPDATE = 'REDIS_CLUSTER_TYPE_UPDATE', // redis 集群类型变更 - REDIS_DATACOPY_CHECK_REPAIR = 'REDIS_DATACOPY_CHECK_REPAIR', // redis 数据校验与修复 - REDIS_CLUSTER_ROLLBACK_DATA_COPY = 'REDIS_CLUSTER_ROLLBACK_DATA_COPY', // redis 数据回写 - REDIS_VERSION_UPDATE_ONLINE = 'REDIS_VERSION_UPDATE_ONLINE', // redis 版本升级 - REDIS_INS_APPLY = 'REDIS_INS_APPLY', // redis 主从集群部署 REDIS_INSTANCE_OPEN = 'REDIS_INSTANCE_OPEN', // redis 主从集群启用 REDIS_INSTANCE_CLOSE = 'REDIS_INSTANCE_CLOSE', // redis 主从集群禁用 - REDIS_INSTANCE_DESTROY = 'REDIS_INSTANCE_DESTROY', // redis 主从集群删除 REDIS_CLUSTER_LOAD_MODULES = 'REDIS_CLUSTER_LOAD_MODULES', // redis 安装Module REDIS_CLUSTER_INS_MIGRATE = 'REDIS_CLUSTER_INS_MIGRATE', REDIS_SINGLE_INS_MIGRATE = 'REDIS_SINGLE_INS_MIGRATE', + REDIS_PURGE = 'REDIS_PURGE', + REDIS_PROXY_CLOSE = 'REDIS_PROXY_CLOSE', + REDIS_PROXY_OPEN = 'REDIS_PROXY_OPEN', + REDIS_PROXY_SCALE_DOWN = 'REDIS_PROXY_SCALE_DOWN', + REDIS_PROXY_SCALE_UP = 'REDIS_PROXY_SCALE_UP', + REDIS_SCALE_DOWN = 'REDIS_SCALE_DOWN', + REDIS_SCALE_UP = 'REDIS_SCALE_UP', + REDIS_SCALE_UPDOWN = 'REDIS_SCALE_UPDOWN', + REDIS_VERSION_UPDATE_ONLINE = 'REDIS_VERSION_UPDATE_ONLINE', } export enum TicketTypes { TENDBCLUSTER_APPLY = 'TENDBCLUSTER_APPLY', @@ -119,32 +121,35 @@ export enum TicketTypes { TENDBCLUSTER_RESTORE_LOCAL_SLAVE = 'TENDBCLUSTER_RESTORE_LOCAL_SLAVE', // spider 重建从库-原地重建 TENDBCLUSTER_RESTORE_SLAVE = 'TENDBCLUSTER_RESTORE_SLAVE', // spider 重建从库-新机重建 TENDBCLUSTER_DUMP_DATA = 'TENDBCLUSTER_DUMP_DATA', // spider 数据导出 + TENDBCLUSTER_DATA_REPAIR = 'TENDBCLUSTER_DATA_REPAIR', // spider 数据修复 TENDBCLUSTER_SEMANTIC_CHECK = 'TENDBCLUSTER_SEMANTIC_CHECK', // spider 模拟执行 TENDBCLUSTER_ACCOUNT_RULE_CHANGE = 'TENDBCLUSTER_ACCOUNT_RULE_CHANGE', // spider 权限变更 TENDBCLUSTER_STANDARDIZE = 'TENDBCLUSTER_STANDARDIZE', // spider 集群标准化 + TENDBCLUSTER_TEMPORARY_DESTROY = 'TENDBCLUSTER_TEMPORARY_DESTROY', // 临时集群销毁 } export enum TicketTypes { + MONGODB_ADD_MONGOS = 'MONGODB_ADD_MONGOS', // mongo 扩容接入层 + MONGODB_ADD_SHARD_NODES = 'MONGODB_ADD_SHARD_NODES', // mongo 扩容 shard 节点数 + MONGODB_AUTHORIZE_RULES = 'MONGODB_AUTHORIZE_RULES', // MongoDB 集群授权 + MONGODB_BACKUP = 'MONGODB_BACKUP', // mongo 库表备份 + MONGODB_CUTOFF = 'MONGODB_CUTOFF', // mongo 整机替换 MONGODB_DISABLE = 'MONGODB_DISABLE', // mongodb禁用 - MONGODB_INSTANCE_RELOAD = 'MONGODB_INSTANCE_RELOAD', // mongodb重启 - MONGODB_SHARD_APPLY = 'MONGODB_SHARD_APPLY', // MongoDB 分片式集群部署申请 - MONGODB_REPLICASET_APPLY = 'MONGODB_REPLICASET_APPLY', // MongoDB 副本集部署申请 - MONGODB_ENABLE = 'MONGODB_ENABLE', // MongoDB 集群启用 MONGODB_DESTROY = 'MONGODB_DESTROY', // MongoDB 集群删除 - MONGODB_SCALE_UPDOWN = 'MONGODB_SCALE_UPDOWN', // MongoDB 分片式集群单个容量变更 + MONGODB_ENABLE = 'MONGODB_ENABLE', // MongoDB 集群启用 MONGODB_EXCEL_AUTHORIZE = 'MONGODB_EXCEL_AUTHORIZE', // MongoDB 导入授权 - MONGODB_AUTHORIZE_RULES = 'MONGODB_AUTHORIZE_RULES', // MongoDB 集群授权 MONGODB_EXCEL_AUTHORIZE_RULES = 'MONGODB_EXCEL_AUTHORIZE_RULES', // MongoDB 导入授权 MONGODB_EXEC_SCRIPT_APPLY = 'MONGODB_EXEC_SCRIPT_APPLY', // mongo 变更脚本执行 - MONGODB_ADD_SHARD_NODES = 'MONGODB_ADD_SHARD_NODES', // mongo 扩容 shard 节点数 - MONGODB_REDUCE_SHARD_NODES = 'MONGODB_REDUCE_SHARD_NODES', // mongo 缩容 shard 节点数 - MONGODB_ADD_MONGOS = 'MONGODB_ADD_MONGOS', // mongo 扩容接入层 - MONGODB_REDUCE_MONGOS = 'MONGODB_REDUCE_MONGOS', // mongo 缩容接入层 - MONGODB_CUTOFF = 'MONGODB_CUTOFF', // mongo 整机替换 - MONGODB_FULL_BACKUP = 'MONGODB_FULL_BACKUP', // mongo 全库备份 + MONGODB_INSTANCE_RELOAD = 'MONGODB_INSTANCE_RELOAD', // mongodb重启 MONGODB_REMOVE_NS = 'MONGODB_REMOVE_NS', // mongo 清档 - MONGODB_BACKUP = 'MONGODB_BACKUP', // mongo 库表备份 + MONGODB_REDUCE_MONGOS = 'MONGODB_REDUCE_MONGOS', // mongo 缩容接入层 + MONGODB_REDUCE_SHARD_NODES = 'MONGODB_REDUCE_SHARD_NODES', // mongo 缩容 shard 节点数 MONGODB_RESTORE = 'MONGODB_RESTORE', // mongo 定点构造 + MONGODB_SCALE_UPDOWN = 'MONGODB_SCALE_UPDOWN', // MongoDB 分片式集群单个容量变更 + MONGODB_SHARD_APPLY = 'MONGODB_SHARD_APPLY', // MongoDB 分片式集群部署申请 + MONGODB_REPLICASET_APPLY = 'MONGODB_REPLICASET_APPLY', // MongoDB 副本集部署申请 MONGODB_TEMPORARY_DESTROY = 'MONGODB_TEMPORARY_DESTROY', // mongo 临时集群销毁 + MONGODB_FULL_BACKUP = 'MONGODB_FULL_BACKUP', // mongo 全库备份 + MONGODB_INSTANCE_DEINSTALL = 'MONGODB_INSTANCE_DEINSTALL', // mongo 实例下架 } export enum TicketTypes { SQLSERVER_SINGLE_APPLY = 'SQLSERVER_SINGLE_APPLY', // sqlserver单节点部署 @@ -169,6 +174,7 @@ export enum TicketTypes { SQLSERVER_FULL_MIGRATE = 'SQLSERVER_FULL_MIGRATE', // sqlserver 全量迁移 SQLSERVER_INCR_MIGRATE = 'SQLSERVER_INCR_MIGRATE', // sqlserver 增量迁移 SQLSERVER_BUILD_DB_SYNC = 'SQLSERVER_BUILD_DB_SYNC', // DB建立同步 + SQLSERVER_MODIFY_STATUS = 'SQLSERVER_MODIFY_STATUS', // SQLServer 修改故障实例状态 } export enum TicketTypes { diff --git a/dbm-ui/frontend/src/common/importComps.ts b/dbm-ui/frontend/src/common/importComps.ts index d26e79b98e..8b072ca8e9 100644 --- a/dbm-ui/frontend/src/common/importComps.ts +++ b/dbm-ui/frontend/src/common/importComps.ts @@ -12,6 +12,7 @@ */ import type { App } from 'vue'; +import { VxeTooltip } from 'vxe-pc-ui'; // import { VxeTooltip } from 'vxe-pc-ui'; import AuthButton from '@components/auth-component/button.vue'; @@ -40,9 +41,6 @@ import { ipSelector } from '@components/vue2/ip-selector'; import { Table, TableColumn } from '@blueking/table'; import UserSelector from '@patch/user-selector/selector.vue'; -// import Table from './table/BkTable.vue'; -// import TableColumn from './table/BkTableColumn.vue'; - import('@blueking/table/vue3/vue3.css'); export const setGlobalComps = (app: App) => { @@ -77,6 +75,6 @@ export const setGlobalComps = (app: App) => { app.component('BkTable', Table); app.component('BkTableColumn', TableColumn); - // app.component('VxeTooltip', VxeTooltip); + app.component('VxeTooltip', VxeTooltip); }); }; diff --git a/dbm-ui/frontend/src/components/cluster-selector/Index.vue b/dbm-ui/frontend/src/components/cluster-selector/Index.vue index f6dbe5ca12..afecd1dfc1 100644 --- a/dbm-ui/frontend/src/components/cluster-selector/Index.vue +++ b/dbm-ui/frontend/src/components/cluster-selector/Index.vue @@ -497,6 +497,7 @@ [tabKey]: tabSelectMap, }; }, {} as SelectMapValueType); + showTabTips.value = true; } }); diff --git a/dbm-ui/frontend/src/components/cluster-selector/components/common/task-panel/Item.vue b/dbm-ui/frontend/src/components/cluster-selector/components/common/task-panel/Item.vue index c913610b21..a2ddd2e50b 100644 --- a/dbm-ui/frontend/src/components/cluster-selector/components/common/task-panel/Item.vue +++ b/dbm-ui/frontend/src/components/cluster-selector/components/common/task-panel/Item.vue @@ -30,7 +30,7 @@ class="fail-tip">  ,  {{ $t('执行失败') }} -  , {{ $t('待确认') }} +  , {{ $t('待继续') }} diff --git a/dbm-ui/frontend/src/components/db-popconfirm/index.vue b/dbm-ui/frontend/src/components/db-popconfirm/index.vue index 2b645a42aa..5dd0cc3e34 100644 --- a/dbm-ui/frontend/src/components/db-popconfirm/index.vue +++ b/dbm-ui/frontend/src/components/db-popconfirm/index.vue @@ -21,12 +21,14 @@
+ :style="contentStyle">
{{ title }}
- {{ content }} + + {{ content }} +
Promise | void; cancelHandler?: () => Promise | void; } const props = withDefaults(defineProps(), { placement: 'top', + content: '', + width: 280, cancelHandler: () => Promise.resolve(), }); @@ -72,6 +77,11 @@ const popRef = ref(); const isConfirmLoading = ref(false); + const contentStyle = computed(() => ({ + width: `${props.width}px`, + padding: '15px 10px', + })); + const handleConfirm = () => { isConfirmLoading.value = true; Promise.resolve() @@ -114,7 +124,7 @@ { name: 'flip', options: { - fallbackPlacements: ['top-start', 'top-end'], + fallbackPlacements: ['top', 'bottom'], allowedAutoPlacements: ['top-start', 'top-end'], }, }, @@ -147,25 +157,25 @@ background-color: #fff; } - .tippy-arrow { - position: absolute; - bottom: -6px !important; - left: 50% !important; - background: #fff; - border: 1px solid #dcdee5 !important; - transform: translateX(-50%) rotateZ(45deg) !important; - box-shadow: 0 0 6px 0 #dcdee5 !important; - - &::before { - content: none; - } - } - - &[data-placement^='top-end'] { - & > .tippy-arrow { - right: -6px; - left: unset !important; - } - } + // .tippy-arrow { + // position: absolute; + // bottom: -6px !important; + // left: 50% !important; + // background: #fff; + // border: 1px solid #dcdee5 !important; + // transform: translateX(-50%) rotateZ(45deg) !important; + // box-shadow: 0 0 6px 0 #dcdee5 !important; + + // &::before { + // content: none; + // } + // } + + // &[data-placement^='top-end'] { + // & > .tippy-arrow { + // right: -6px; + // left: unset !important; + // } + // } } diff --git a/dbm-ui/frontend/src/components/db-search-select/index.vue b/dbm-ui/frontend/src/components/db-search-select/index.vue index 6e847af905..1a545bd1cd 100644 --- a/dbm-ui/frontend/src/components/db-search-select/index.vue +++ b/dbm-ui/frontend/src/components/db-search-select/index.vue @@ -108,6 +108,11 @@ .search-container-selected { height: 22px; max-width: 250px !important; + + .selected-name { + height: 22px; + overflow: hidden; + } } } diff --git a/dbm-ui/frontend/src/components/mult-line-text/Index.vue b/dbm-ui/frontend/src/components/multline-text/Index.vue similarity index 85% rename from dbm-ui/frontend/src/components/mult-line-text/Index.vue rename to dbm-ui/frontend/src/components/multline-text/Index.vue index 9b9b5fc2d0..6974a7bf11 100644 --- a/dbm-ui/frontend/src/components/mult-line-text/Index.vue +++ b/dbm-ui/frontend/src/components/multline-text/Index.vue @@ -18,16 +18,18 @@ text theme="primary" @click="handleToggleMore"> - {{ t('更多') }} - + + {{ t('更多') }} + +
- + @@ -177,9 +176,9 @@ } & > .scroll-faker-content { - height: inherit; - max-width: inherit; - max-height: inherit; + height: 100%; + max-width: 100%; + max-height: 100%; overflow: scroll; &::-webkit-scrollbar { diff --git a/dbm-ui/frontend/src/components/stretch-layout/StretchLayout.vue b/dbm-ui/frontend/src/components/stretch-layout/StretchLayout.vue index ebd646daad..2a9dde2a17 100644 --- a/dbm-ui/frontend/src/components/stretch-layout/StretchLayout.vue +++ b/dbm-ui/frontend/src/components/stretch-layout/StretchLayout.vue @@ -42,6 +42,22 @@ + diff --git a/dbm-ui/frontend/src/components/ticket-status-tag/Index.vue b/dbm-ui/frontend/src/components/ticket-status-tag/Index.vue new file mode 100644 index 0000000000..3bf5f44b73 --- /dev/null +++ b/dbm-ui/frontend/src/components/ticket-status-tag/Index.vue @@ -0,0 +1,73 @@ + + + diff --git a/dbm-ui/frontend/src/hooks/index.ts b/dbm-ui/frontend/src/hooks/index.ts index d8cfd8c6c8..2b3d724061 100644 --- a/dbm-ui/frontend/src/hooks/index.ts +++ b/dbm-ui/frontend/src/hooks/index.ts @@ -36,6 +36,7 @@ export * from './useTableSettings'; export * from './useTagsOverflow'; export * from './useTaskCount'; export * from './useTicketCloneInfo'; +export * from './useTicketCount'; export * from './useTicketMessage'; export * from './useTimeZoneFormat'; export * from './useUrlSearach'; diff --git a/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx b/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx index b4e246e4c6..a8721d356c 100644 --- a/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx +++ b/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx @@ -40,8 +40,8 @@ export const useSQLTaskNotify = () => { }; const { cancel: cancelRequest } = useRequest(getUserSemanticTasks, { - pollingInterval: 10000, - debounceInterval: 10000, + pollingInterval: 10000000, + debounceInterval: 10000000, onSuccess(data) { const isAlterItem = _.find(data, (item) => item.is_alter); diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/authorizeRule.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/authorizeRule.ts index 388930ded0..a7dceedeb3 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/authorizeRule.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/authorizeRule.ts @@ -10,8 +10,7 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MysqlAuthorizationDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { checkHost } from '@services/source/ipchooser'; import { getTendbhaList } from '@services/source/tendbha'; import { getTendbsingleList } from '@services/source/tendbsingle'; @@ -19,7 +18,7 @@ import { getTendbsingleList } from '@services/source/tendbsingle'; import { ClusterTypes } from '@common/const'; // Mysql 集群授权 -export async function generateMysqlAuthorizeRuleCloneData(ticketData: TicketModel) { +export async function generateMysqlAuthorizeRuleCloneData(ticketData: TicketModel) { const { authorize_data: authorizeData } = ticketData.details; const sourceIpList: ServiceReturnType = []; if (authorizeData.source_ips && Array.isArray(authorizeData.source_ips)) { diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/checksum.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/checksum.ts index ce31db2819..ac0da80761 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/checksum.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/checksum.ts @@ -11,14 +11,13 @@ * the specific language governing permissions and limitations under the License. */ import TendbhaModel from '@services/model/mysql/tendbha'; -import type { MySQLChecksumDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { getTendbhaList } from '@services/source/tendbha'; import { random } from '@utils'; // Mysql SQL变更执行 -export async function generateMysqlChecksumCloneData(ticketData: TicketModel) { +export async function generateMysqlChecksumCloneData(ticketData: TicketModel) { const { details, remark } = ticketData; const clustersResult = await getTendbhaList({ cluster_ids: details.infos.map((item) => item.cluster_id), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/clientClone.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/clientClone.ts index 7cb26710e7..d08c30eff6 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/clientClone.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/clientClone.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLCloneDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Mysql 客户端权限克隆 -export function generateMysqlClientCloneData(ticketData: TicketModel) { +export function generateMysqlClientCloneData(ticketData: TicketModel) { return Promise.resolve({ tableDataList: ticketData.details.clone_data.map((item) => ({ ...item, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dataMigrate.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dataMigrate.ts index ab5aa08720..255ac4fbc3 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dataMigrate.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dataMigrate.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MysqlDataMigrateDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL DB克隆 -export function generateMysqlDataMigrateCloneData(ticketData: TicketModel) { +export function generateMysqlDataMigrateCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableDataList = infos.map((item) => { const sourceClusterInfo = clusters[item.source_cluster]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dbRename.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dbRename.ts index 92ee67924e..ce36cc58d3 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dbRename.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/dbRename.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLRenameDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 高可用DB重命名 -export function generateMysqlDbRenameCloneData(ticketData: TicketModel) { +export function generateMysqlDbRenameCloneData(ticketData: TicketModel) { const { clusters, force, infos } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/flashback.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/flashback.ts index f2dd11db49..29d08a2992 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/flashback.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/flashback.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLFlashback } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 闪回 -export function generateMysqlFlashbackCloneData(ticketData: TicketModel) { +export function generateMysqlFlashbackCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haApply.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haApply.ts index ea8e332edb..29abf73ed1 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haApply.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haApply.ts @@ -10,11 +10,10 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; // Mysql 高可用部署 -export function generateMysqlHaApplyCloneData(ticketData: TicketModel) { +export function generateMysqlHaApplyCloneData(ticketData: TicketModel) { const { details } = ticketData; return Promise.resolve({ affinity: details.disaster_tolerance_level, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbBackup.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbBackup.ts index a3b9dcfb12..b63515d8e4 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbBackup.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbBackup.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLFullBackupDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Mysql 全库备份 -export function generateMysqlDbBackupCloneData(ticketData: TicketModel) { +export function generateMysqlDbBackupCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const isNewProtocol = Array.isArray(infos); const tableDataList = (isNewProtocol ? infos : infos.clusters).map((item) => ({ diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbClear.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbClear.ts index 7045929318..3b65e2ccf8 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbClear.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbClear.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLHATruncateDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 高可用清档 -export function generateMysqlDbClearCloneData(ticketData: TicketModel) { +export function generateMysqlDbClearCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbTableBackup.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbTableBackup.ts index 8966753389..146b8ff234 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbTableBackup.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/haDbTableBackup.ts @@ -10,15 +10,14 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLTableBackupDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { ClusterTypes } from '@common/const'; import { random } from '@utils'; // Mysql 库表备份 -export function generateMysqlDbTableBackupCloneData(ticketData: TicketModel) { +export function generateMysqlDbTableBackupCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/importSqlFile.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/importSqlFile.ts index ead1893165..8a581ba8df 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/importSqlFile.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/importSqlFile.ts @@ -10,11 +10,10 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLImportSQLFileDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; // Mysql SQL变更执行 -export function generateMysqlImportSqlFileCloneData(ticketData: TicketModel) { +export function generateMysqlImportSqlFileCloneData(ticketData: TicketModel) { const { details } = ticketData; return Promise.resolve({ backup: details.backup, @@ -22,7 +21,6 @@ export function generateMysqlImportSqlFileCloneData(ticketData: TicketModel[number]; // Mysql DB实例权限克隆 -export async function generateMysqlInstanceCloneData(ticketData: TicketModel) { +export async function generateMysqlInstanceCloneData(ticketData: TicketModel) { const instanceList = _.flatMap(ticketData.details.clone_data.map((item) => [item.source, item.target])); const instanceListInfos = await checkMysqlInstances({ bizId: ticketData.bk_biz_id, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterFailover.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterFailover.ts index 55f06f897b..402be45767 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterFailover.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterFailover.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { MySQLMasterFailDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 主库故障切换 -export function generateMysqlMasterFailoverCloneData(ticketData: TicketModel) { +export function generateMysqlMasterFailoverCloneData(ticketData: TicketModel) { const { clusters, infos, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterSlaveSwitch.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterSlaveSwitch.ts index df3a6fbec3..687cf638fb 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterSlaveSwitch.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/masterSlaveSwitch.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { MySQLMasterSlaveDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 主从互换 -export function generateMysqlMasterSlaveSwicthCloneData(ticketData: TicketModel) { +export function generateMysqlMasterSlaveSwicthCloneData(ticketData: TicketModel) { const { clusters, infos, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/migrateCluster.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/migrateCluster.ts index bb00bc7e43..ddb45552a1 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/migrateCluster.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/migrateCluster.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLMigrateDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 迁移(克隆)主从 -export function generateMysqlMigrateClusterCloneData(ticketData: TicketModel) { +export function generateMysqlMigrateClusterCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableDataList = infos.map((item) => { const clusterId = item.cluster_ids[0]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/openArea.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/openArea.ts index a65f88336c..2e389e9513 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/openArea.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/openArea.ts @@ -12,8 +12,7 @@ */ import _ from 'lodash'; -import type { MysqlOpenAreaDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { getDetail } from '@services/source/openarea'; import { random } from '@utils'; @@ -25,7 +24,7 @@ const parser = (pattern: string, input: string) => { }; // MySQL 开区 -export async function generateMysqlOpenAreaCloneData(ticketData: TicketModel) { +export async function generateMysqlOpenAreaCloneData(ticketData: TicketModel) { const { details } = ticketData; // 获取模板详情 const templateDetail = await getDetail({ id: details.config_id }); diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyAdd.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyAdd.ts index 85c01d98b6..5e5ed3a6fb 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyAdd.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyAdd.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { MySQLProxyAddDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 添加Proxy -export function generateMysqlProxyAddCloneData(ticketData: TicketModel) { +export function generateMysqlProxyAddCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableDataList = infos.map((item) => { const clusterId = item.cluster_ids[0]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyReplace.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyReplace.ts index a6887cba46..d20780b8a9 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyReplace.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/proxyReplace.ts @@ -10,11 +10,10 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLProxySwitchDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; // MySQL 替换Proxy -export function generateMysqlProxyReplaceCloneData(ticketData: TicketModel) { +export function generateMysqlProxyReplaceCloneData(ticketData: TicketModel) { const { force, infos } = ticketData.details; return Promise.resolve({ force, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreLocalSlave.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreLocalSlave.ts index f2fba038f8..b35d41344c 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreLocalSlave.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreLocalSlave.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLRestoreLocalSlaveDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 重建从库-原地重建 -export function generateMysqlRestoreLocalSlaveCloneData(ticketData: TicketModel) { +export function generateMysqlRestoreLocalSlaveCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreSlave.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreSlave.ts index d40934cfdc..74b597e73d 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreSlave.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/restoreSlave.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { MySQLRestoreSlaveDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 重建从库-新机重建 -export function generateMysqlRestoreSlaveCloneData(ticketData: TicketModel) { +export function generateMysqlRestoreSlaveCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const tableDataList = infos.map((item) => { const clusterId = item.cluster_ids[0]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/rollback.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/rollback.ts index f1b9449fd3..4d2a20f0c0 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/rollback.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/rollback.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLRollbackDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 定点构造 -export function generateMysqlRollbackCloneData(ticketData: TicketModel) { +export function generateMysqlRollbackCloneData(ticketData: TicketModel) { const { clusters, infos, rollback_cluster_type } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/singleApply.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/singleApply.ts index a993b02451..d7dd3a5027 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/singleApply.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/singleApply.ts @@ -10,11 +10,10 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; // Mysql 单节点部署 -export function generateMysqlSingleApplyCloneData(ticketData: TicketModel) { +export function generateMysqlSingleApplyCloneData(ticketData: TicketModel) { const { details } = ticketData; return Promise.resolve({ affinity: details.disaster_tolerance_level, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/slaveAdd.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/slaveAdd.ts index a80d61565d..a02299a882 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/slaveAdd.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/slaveAdd.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MySQLSlaveDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL 添加从库 -export function generateMysqlSlaveAddCloneData(ticketData: TicketModel) { +export function generateMysqlSlaveAddCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts index bf1003d137..fc309b426b 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts @@ -13,8 +13,7 @@ import TendbhaModel from '@services/model/mysql/tendbha'; import TendbsingleModel from '@services/model/mysql/tendbsingle'; -import type { MySQLLocalUpgradeDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { getTendbhaList } from '@services/source/tendbha'; import { getTendbsingleList } from '@services/source/tendbsingle'; @@ -23,7 +22,7 @@ import { ClusterTypes } from '@common/const'; import { random } from '@utils'; // MySQL 原地升级 -export async function generateMysqlVersionLocalUpgradeCloneData(ticketData: TicketModel) { +export async function generateMysqlVersionLocalUpgradeCloneData(ticketData: TicketModel) { const { clusters, infos, force } = ticketData.details; const clusterType = infos[0].display_info.cluster_type; const apiMap = { diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts index d0ea40691a..dbd3e082c6 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts @@ -12,14 +12,13 @@ */ import TendbhaModel from '@services/model/mysql/tendbha'; -import type { MySQLMigrateUpgradeDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { getTendbhaList } from '@services/source/tendbha'; import { random } from '@utils'; // MySQL 迁移升级 -export async function generateMysqlVersionMigrateUpgradeCloneData(ticketData: TicketModel) { +export async function generateMysqlVersionMigrateUpgradeCloneData(ticketData: TicketModel) { const { clusters, infos, backup_source: backupSource, force } = ticketData.details; const clusterListResult = await getTendbhaList({ cluster_ids: infos.map((item) => item.cluster_ids[0]), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts index cb46443455..93efa2a8c3 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { MySQLProxyUpgradeDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Mysql } from '@services/model/ticket/ticket'; import { random } from '@utils'; // MySQL Proxy 升级 -export function generateMysqlVersionProxyUpgradeCloneData(ticketData: TicketModel) { +export function generateMysqlVersionProxyUpgradeCloneData(ticketData: TicketModel) { const { clusters, infos, force } = ticketData.details; const tableList = infos.map((item) => { const clusterId = item.cluster_ids[0]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/apply.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/apply.ts index 703c5fd908..232bd892d8 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/apply.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/apply.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { RedisDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { TicketTypes } from '@common/const'; // Redis 集群部署 -export function generateRedisApplyCloneData(ticketData: TicketModel) { +export function generateRedisApplyCloneData(ticketData: TicketModel) { const { details } = ticketData; return Promise.resolve({ bk_biz_id: ticketData.bk_biz_id, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterAddSlave.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterAddSlave.ts index 1c6096a112..d0643991a8 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterAddSlave.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterAddSlave.ts @@ -10,14 +10,13 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { RedisAddSlaveDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisMachineList } from '@services/source/redis'; import { random } from '@utils'; // Redis 重建从库 -export async function generateRedisClusterAddSlaveCloneData(ticketData: TicketModel) { +export async function generateRedisClusterAddSlaveCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const masterIps: string[] = []; const masterSlaveIpMap: Record = {}; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterCutoff.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterCutoff.ts index f7c724a585..c9493b41f9 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterCutoff.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterCutoff.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { RedisDBReplaceDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Redis 整机替换 -export function generateRedisClusterCutoffCloneData(ticketData: TicketModel) { +export function generateRedisClusterCutoffCloneData(ticketData: TicketModel) { const { clusters, infos, specs } = ticketData.details; return Promise.resolve({ tableDataList: infos.flatMap((info) => diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterShardUpdate.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterShardUpdate.ts index 0cf5bcd9fb..298fa3270c 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterShardUpdate.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterShardUpdate.ts @@ -11,8 +11,7 @@ * the specific language governing permissions and limitations under the License. */ import RedisModel from '@services/model/redis/redis'; -import type { RedisClusterShardUpdateDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisList } from '@services/source/redis'; import { random } from '@utils'; @@ -20,9 +19,7 @@ import { random } from '@utils'; import { t } from '@locales/index'; // Redis 集群分片数变更 -export async function generateRedisClusterShardUpdateCloneData( - ticketData: TicketModel, -) { +export async function generateRedisClusterShardUpdateCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const clusterListResult = await getRedisList({ cluster_ids: infos.map((item) => item.src_cluster).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterTypeUpdate.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterTypeUpdate.ts index b1b287e808..1f25faf2bd 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterTypeUpdate.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/clusterTypeUpdate.ts @@ -11,8 +11,7 @@ * the specific language governing permissions and limitations under the License. */ import RedisModel from '@services/model/redis/redis'; -import type { RedisClusterTypeUpdateDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisList } from '@services/source/redis'; import { random } from '@utils'; @@ -20,7 +19,7 @@ import { random } from '@utils'; import { t } from '@locales/index'; // Redis 集群类型变更 -export async function generateRedisClusterTypeUpdateCloneData(ticketData: TicketModel) { +export async function generateRedisClusterTypeUpdateCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const clusterListResult = await getRedisList({ cluster_ids: infos.map((item) => item.src_cluster).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopy.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopy.ts index 7593954c09..8744a197d5 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopy.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopy.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { RedisDataCopyDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Redis 集群数据复制 -export function generateRedisDataCopyCloneData(ticketData: TicketModel) { +export function generateRedisDataCopyCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableList = infos.map((item) => ({ diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopyCheckRepair.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopyCheckRepair.ts index a387746454..1187ed0b3c 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopyCheckRepair.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataCopyCheckRepair.ts @@ -12,15 +12,14 @@ */ import dayjs from 'dayjs'; -import type { RedisDataCheckAndRepairDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { random } from '@utils'; import { t } from '@locales/index'; // Redis 数据校验与修复 -export function generateRedisDataCopyCheckRepairCloneData(ticketData: TicketModel) { +export function generateRedisDataCopyCheckRepairCloneData(ticketData: TicketModel) { const { details } = ticketData; const tableList = details.infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataStructure.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataStructure.ts index c269595ba9..4c20211445 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataStructure.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/dataStructure.ts @@ -11,14 +11,13 @@ * the specific language governing permissions and limitations under the License. */ import RedisModel from '@services/model/redis/redis'; -import type { RedisDataStructrueDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisList } from '@services/source/redis'; import { random } from '@utils'; // Redis 定点构造 -export async function generateRedisDataStructureCloneData(ticketData: TicketModel) { +export async function generateRedisDataStructureCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const clusterListResult = await getRedisList({ cluster_ids: infos.map((item) => item.cluster_id).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/masterSlaveSwitch.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/masterSlaveSwitch.ts index 50207f059d..02e739328e 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/masterSlaveSwitch.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/masterSlaveSwitch.ts @@ -10,15 +10,14 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { RedisMasterSlaveSwitchDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { checkRedisInstances } from '@services/source/instances'; import { queryMachineInstancePair } from '@services/source/redisToolbox'; import { random } from '@utils'; // Redis 主从切换 -export async function generateRedisMasterSlaveSwitchCloneData(ticketData: TicketModel) { +export async function generateRedisMasterSlaveSwitchCloneData(ticketData: TicketModel) { const { infos, force } = ticketData.details; const masterIps: string[] = []; const ipSwitchMode: Record = {}; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/operation.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/operation.ts index 8fe9a53283..869ee122c3 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/operation.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/operation.ts @@ -11,11 +11,10 @@ * the specific language governing permissions and limitations under the License. */ import RedisModel from '@services/model/redis/redis'; -import type { RedisKeysDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; // Redis 提取Key/删除Key/备份 -export function generateRedisOperationCloneData(ticketData: TicketModel) { +export function generateRedisOperationCloneData(ticketData: TicketModel) { const { clusters, rules } = ticketData.details; return Promise.resolve( rules.map( diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleDown.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleDown.ts index 480309d50e..fad832225e 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleDown.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleDown.ts @@ -15,14 +15,13 @@ import _ from 'lodash'; import RedisModel from '@services/model/redis/redis'; import RedisInstanceModel from '@services/model/redis/redis-instance'; -import type { RedisProxyScaleDownDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisInstances, getRedisList } from '@services/source/redis'; import { random } from '@utils'; // Redis 接入层缩容 -export async function generateRedisProxyScaleDownCloneData(ticketData: TicketModel) { +export async function generateRedisProxyScaleDownCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const [clusterListResult, instanceListResult] = await Promise.all([ getRedisList({ diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleUp.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleUp.ts index a68c194aca..0d273e6817 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleUp.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/proxyScaleUp.ts @@ -11,14 +11,13 @@ * the specific language governing permissions and limitations under the License. */ import RedisModel from '@services/model/redis/redis'; -import type { RedisProxyScaleUpDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisList } from '@services/source/redis'; import { random } from '@utils'; // Redis 接入层扩容 -export async function generateRedisProxyScaleUpCloneData(ticketData: TicketModel) { +export async function generateRedisProxyScaleUpCloneData(ticketData: TicketModel) { const { clusters, infos, specs } = ticketData.details; const clusterListResult = await getRedisList({ cluster_ids: infos.map((item) => item.cluster_id).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/rollbackData.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/rollbackData.ts index 0c61546f9e..045c800607 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/rollbackData.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/rollbackData.ts @@ -10,13 +10,12 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { RedisRollbackDataCopyDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Redis 以构造实例恢复 -export function generateRedisRollbackDataCloneData(ticketData: TicketModel) { +export function generateRedisRollbackDataCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const tableList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts index 6e5951e5db..3e7c38a8cc 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts @@ -11,8 +11,7 @@ * the specific language governing permissions and limitations under the License. */ import RedisModel from '@services/model/redis/redis'; -import type { RedisScaleUpDownDetails } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisList } from '@services/source/redis'; import { ClusterTypes } from '@common/const'; @@ -20,7 +19,7 @@ import { ClusterTypes } from '@common/const'; import { random } from '@utils'; // Redis 集群容量变更 -export async function generateRedisScaleUpdownCloneData(ticketData: TicketModel) { +export async function generateRedisScaleUpdownCloneData(ticketData: TicketModel) { const { clusters, infos } = ticketData.details; const clusterListResult = await getRedisList({ cluster_ids: infos.map((item) => item.cluster_id).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/versionUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/versionUpgrade.ts index 67f50961f0..73c76a32bc 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/versionUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/versionUpgrade.ts @@ -11,14 +11,13 @@ * the specific language governing permissions and limitations under the License. */ import RedisModel from '@services/model/redis/redis'; -import type { RedisVersionUpgrade } from '@services/model/ticket/details/redis'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type Redis } from '@services/model/ticket/ticket'; import { getRedisList } from '@services/source/redis'; import { random } from '@utils'; // Redis 版本升级 -export async function generateRedisRedisVersionUpgradeCloneData(ticketData: TicketModel) { +export async function generateRedisRedisVersionUpgradeCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const clusterListResult = await getRedisList({ cluster_ids: infos.map((item) => item.cluster_ids[0]).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/addMnt.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/addMnt.ts index ec580196a3..4670fba20e 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/addMnt.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/addMnt.ts @@ -12,14 +12,13 @@ */ import TendbclusterModel from '@services/model/tendbcluster/tendbcluster'; -import type { SpiderMNTApplyDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbClusterList } from '@services/source/tendbcluster'; import { random } from '@utils'; // Spider 临时节点添加 -export async function generateSpiderAddMntDataCloneData(ticketData: TicketModel) { +export async function generateSpiderAddMntDataCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const clusterListResult = await getTendbClusterList({ cluster_ids: infos.map((item) => item.cluster_id), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/apply.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/apply.ts index 670e0361ab..630c4dacbc 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/apply.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/apply.ts @@ -11,11 +11,10 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderApplyDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; // spider 集群部署 -export async function generateSpiderApplyCloneData(ticketData: TicketModel) { +export async function generateSpiderApplyCloneData(ticketData: TicketModel) { const { details } = ticketData; return Promise.resolve({ diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/authorizeRule.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/authorizeRule.ts index 1fb4dd9a7d..afbaf6374a 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/authorizeRule.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/authorizeRule.ts @@ -10,15 +10,14 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ -import type { MysqlAuthorizationDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { checkHost } from '@services/source/ipchooser'; import { getTendbClusterList } from '@services/source/tendbcluster'; import { ClusterTypes } from '@common/const'; // Spider 集群授权 -export async function generateSpiderAuthorizeRuleCloneData(ticketData: TicketModel) { +export async function generateSpiderAuthorizeRuleCloneData(ticketData: TicketModel) { const { authorize_data: authorizeData } = ticketData.details; const sourceIpList: ServiceReturnType = []; if (authorizeData.source_ips && Array.isArray(authorizeData.source_ips)) { diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/capacityChange.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/capacityChange.ts index 07f926b35c..88f4a4edba 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/capacityChange.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/capacityChange.ts @@ -12,14 +12,13 @@ */ import TendbclusterModel from '@services/model/tendbcluster/tendbcluster'; -import type { SpiderNodeRebalanceDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbClusterList } from '@services/source/tendbcluster'; import { random } from '@utils'; // Spider 集群remote节点扩缩容 -export async function generateSpiderCapacityChangeCloneData(ticketData: TicketModel) { +export async function generateSpiderCapacityChangeCloneData(ticketData: TicketModel) { const { infos, need_checksum: needChecksum, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/checksum.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/checksum.ts index c64696fb69..0606e01437 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/checksum.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/checksum.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderCheckSumDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider Checksum -export function generateSpiderChecksumCloneData(ticketData: TicketModel) { +export function generateSpiderChecksumCloneData(ticketData: TicketModel) { const { details, remark } = ticketData; const { infos, clusters } = details; const tableDataList = infos.map((item) => { diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbBackup.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbBackup.ts index f6e18d3f86..2091b29ff9 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbBackup.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbBackup.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderFullBackupDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider TenDBCluster 全备单据 -export function generateSpiderDbBackupCloneData(ticketData: TicketModel) { +export function generateSpiderDbBackupCloneData(ticketData: TicketModel) { const { infos, clusters } = ticketData.details; const isNewProtocol = Array.isArray(infos); const tableDataList = (isNewProtocol ? infos : infos.clusters).map((item) => { diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbClear.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbClear.ts index af95c16ebb..b156069b4a 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbClear.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbClear.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderTruncateDatabaseDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider tendbcluster 清档 -export function generateSpiderDbClearCloneData(ticketData: TicketModel) { +export function generateSpiderDbClearCloneData(ticketData: TicketModel) { const { infos, clusters } = ticketData.details; const tableDataList = infos.map((item) => { const clusterItem = clusters[item.cluster_id]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbRename.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbRename.ts index 8f2fecf451..30ee1b7e3a 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbRename.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbRename.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderRenameDatabaseDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider Tendbcluster 重命名 -export function generateSpiderDbRenameCloneData(ticketData: TicketModel) { +export function generateSpiderDbRenameCloneData(ticketData: TicketModel) { const { infos, force, clusters } = ticketData.details; const tableDataList = infos.map((item) => { const clusterItem = clusters[item.cluster_id]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbTableBackup.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbTableBackup.ts index c3747f01b6..8195135e86 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbTableBackup.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/dbTableBackup.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderTableBackupDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider TenDBCluster 库表备份 -export function generateSpiderDbTableBackupCloneData(ticketData: TicketModel) { +export function generateSpiderDbTableBackupCloneData(ticketData: TicketModel) { const { infos, clusters } = ticketData.details; const tableDataList = infos.map((item) => { const clusterItem = clusters[item.cluster_id]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/flashback.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/flashback.ts index 389f83d992..15fc8b2a2e 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/flashback.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/flashback.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderFlashbackDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider flashback -export function generateSpiderFlashbackCloneData(ticketData: TicketModel) { +export function generateSpiderFlashbackCloneData(ticketData: TicketModel) { const { infos, clusters } = ticketData.details; const tableDataList = infos.map((item) => { const clusterItem = clusters[item.cluster_id]; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/index.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/index.ts index 2dc6ba5184..033d50b0b7 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/index.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/index.ts @@ -29,7 +29,7 @@ export * from './privilegeCloneInst'; export * from './proxyScaleDown'; export * from './proxyScaleUp'; export * from './proxySlaveApply'; -export * from './rollback'; +// export * from './rollback'; export * from './slaveRebuildLocal'; export * from './slaveRebuildNew'; export * from './sqlExecute'; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterFailover.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterFailover.ts index 642637e93f..88c4f738d4 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterFailover.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterFailover.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderMasterSlaveSwitchDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider 主库故障切换 -export function generateSpiderMasterFailoverCloneData(ticketData: TicketModel) { +export function generateSpiderMasterFailoverCloneData(ticketData: TicketModel) { const { clusters, infos, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveClone.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveClone.ts index b4d8f366a1..c54e34869c 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveClone.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveClone.ts @@ -12,14 +12,13 @@ */ import TendbclusterMachineModel from '@services/model/tendbcluster/tendbcluster-machine'; -import type { SpiderMigrateCluster } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbclusterMachineList } from '@services/source/tendbcluster'; import { random } from '@utils'; // spider 迁移主从 -export async function generateSpiderMasterSlaveCloneCloneData(ticketData: TicketModel) { +export async function generateSpiderMasterSlaveCloneCloneData(ticketData: TicketModel) { const { infos, backup_source: backupSource } = ticketData.details; const masterMachineResult = await getTendbclusterMachineList({ ip: infos.map((item) => item.old_master.ip).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveSwap.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveSwap.ts index cdc1dde63a..f06024bc94 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveSwap.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/masterSlaveSwap.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { SpiderMasterSlaveSwitchDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider 主从切换 -export function generateSpiderMasterSlaveSwapCloneData(ticketData: TicketModel) { +export function generateSpiderMasterSlaveSwapCloneData(ticketData: TicketModel) { const { clusters, infos, diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneClient.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneClient.ts index 09eb672fd6..8d8986f1bc 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneClient.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneClient.ts @@ -11,13 +11,12 @@ * the specific language governing permissions and limitations under the License. */ -import type { MySQLCloneDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { random } from '@utils'; // Spider 权限克隆 -export function generateSpiderPrivilegeCloneClientCloneData(ticketData: TicketModel) { +export function generateSpiderPrivilegeCloneClientCloneData(ticketData: TicketModel) { return Promise.resolve({ tableDataList: ticketData.details.clone_data.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneInst.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneInst.ts index f7b912dabd..ae5155c6f1 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneInst.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/privilegeCloneInst.ts @@ -12,14 +12,15 @@ */ import TendbclusterInstanceModel from '@services/model/tendbcluster/tendbcluster-instance'; -import type { MySQLInstanceCloneDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbclusterInstanceList } from '@services/source/tendbcluster'; import { random } from '@utils'; // Spider 权限克隆 -export async function generateSpiderPrivilegeCloneInstCloneData(ticketData: TicketModel) { +export async function generateSpiderPrivilegeCloneInstCloneData( + ticketData: TicketModel, +) { const { clone_data: cloneData } = ticketData.details; const instanceListResult = await getTendbclusterInstanceList({ // instance_address: cloneData.reduce((prev, item) => [...prev, item.source], []).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleDown.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleDown.ts index a3240efc02..8f7d048247 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleDown.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleDown.ts @@ -15,14 +15,13 @@ import _ from 'lodash'; import TendbclusterModel from '@services/model/tendbcluster/tendbcluster'; import TendbclusterInstanceModel from '@services/model/tendbcluster/tendbcluster-instance'; -import type { SpiderReduceNodesDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbclusterInstanceList, getTendbClusterList } from '@services/source/tendbcluster'; import { random } from '@utils'; // spider 缩容接入层 -export async function generateSpiderProxyScaleDownCloneData(ticketData: TicketModel) { +export async function generateSpiderProxyScaleDownCloneData(ticketData: TicketModel) { const { infos, is_safe: isSafe } = ticketData.details; const [clusterListResult, instanceListResult] = await Promise.all([ getTendbClusterList({ diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleUp.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleUp.ts index deba3d271e..d7d8466247 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleUp.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxyScaleUp.ts @@ -12,14 +12,13 @@ */ import TendbclusterModel from '@services/model/tendbcluster/tendbcluster'; -import type { SpiderAddNodesDeatils } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbClusterList } from '@services/source/tendbcluster'; import { random } from '@utils'; // spider扩容接入层 -export async function generateSpiderProxyScaleUpCloneData(ticketData: TicketModel) { +export async function generateSpiderProxyScaleUpCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const clusterListResult = await getTendbClusterList({ cluster_ids: infos.map((item) => item.cluster_id), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxySlaveApply.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxySlaveApply.ts index f4295a3cc7..33c729f9f7 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxySlaveApply.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/proxySlaveApply.ts @@ -12,14 +12,13 @@ */ import TendbclusterModel from '@services/model/tendbcluster/tendbcluster'; -import type { SpiderSlaveApplyDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbClusterList } from '@services/source/tendbcluster'; import { random } from '@utils'; // Spider slave集群添加 -export async function generateSpiderProxySlaveApplyCloneData(ticketData: TicketModel) { +export async function generateSpiderProxySlaveApplyCloneData(ticketData: TicketModel) { const { infos } = ticketData.details; const clusterListResult = await getTendbClusterList({ cluster_ids: infos.map((item) => item.cluster_id), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/rollback.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/rollback.ts deleted file mode 100644 index 15da2bb195..0000000000 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/rollback.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. - * - * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at https://opensource.org/licenses/MIT - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ - -import type { SpiderRollbackDetails } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; - -import { random } from '@utils'; - -// spider 定点回档 -export function generateSpiderRollbackCloneData(ticketData: TicketModel) { - const tableDataList = [ticketData.details].map((item) => { - const clusterItem = ticketData.details.clusters[item.cluster_id]; - return { - rowKey: random(), - isLoading: false, - clusterData: { - id: clusterItem.id, - domain: clusterItem.immute_domain, - cloudId: clusterItem.bk_cloud_id, - }, - rollbackupType: item.rollback_type, - rollbackTime: item.rollback_time, - databases: item.databases, - databasesIgnore: item.databases_ignore, - tables: item.tables, - tablesIgnore: item.tables_ignore, - }; - }); - - return Promise.resolve({ - tableDataList, - remark: ticketData.remark, - }); -} diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildLocal.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildLocal.ts index 7614cd2d93..b16eb9029c 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildLocal.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildLocal.ts @@ -12,14 +12,15 @@ */ import TendbclusterInstanceModel from '@services/model/tendbcluster/tendbcluster-instance'; -import type { SpiderSlaveRebuid } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbclusterInstanceList } from '@services/source/tendbcluster'; import { random } from '@utils'; // spider 重建从库-本地重建 -export async function generateSpiderSlaveRebuildLocalCloneData(ticketData: TicketModel) { +export async function generateSpiderSlaveRebuildLocalCloneData( + ticketData: TicketModel, +) { const { infos, backup_source } = ticketData.details; const instanceListResult = await getTendbclusterInstanceList({ instance: infos.map((item) => item.slave.ip), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildNew.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildNew.ts index 8d4f1652d2..df235c7873 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildNew.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/slaveRebuildNew.ts @@ -12,14 +12,13 @@ */ import TendbclusterMachineModel from '@services/model/tendbcluster/tendbcluster-machine'; -import type { SpiderSlaveRebuid } from '@services/model/ticket/details/spider'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; import { getTendbclusterMachineList } from '@services/source/tendbcluster'; import { random } from '@utils'; // spider 重建从库-新机重建 -export async function generateSpiderSlaveRebuildNewCloneData(ticketData: TicketModel) { +export async function generateSpiderSlaveRebuildNewCloneData(ticketData: TicketModel) { const { infos, backup_source } = ticketData.details; const slaveMachineResult = await getTendbclusterMachineList({ ip: infos.map((item) => item.old_slave.ip).join(','), diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts index 6dbf2a0d28..8e5efa718a 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts @@ -11,11 +11,10 @@ * the specific language governing permissions and limitations under the License. */ -import type { MySQLImportSQLFileDetails } from '@services/model/ticket/details/mysql'; -import TicketModel from '@services/model/ticket/ticket'; +import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket'; // spider SQL变更执行 -export function generateSpiderSqlExecuteCloneData(ticketData: TicketModel) { +export function generateSpiderSqlExecuteCloneData(ticketData: TicketModel) { const { details } = ticketData; return Promise.resolve({ backup: details.backup, @@ -23,7 +22,6 @@ export function generateSpiderSqlExecuteCloneData(ticketData: TicketModel) { +export function generateSpiderRollbackCloneData(ticketData: TicketModel) { const { clusters, infos, rollback_cluster_type } = ticketData.details; const tableDataList = infos.map((item) => ({ rowKey: random(), diff --git a/dbm-ui/frontend/src/hooks/useTicketCount.ts b/dbm-ui/frontend/src/hooks/useTicketCount.ts new file mode 100644 index 0000000000..acf9be0912 --- /dev/null +++ b/dbm-ui/frontend/src/hooks/useTicketCount.ts @@ -0,0 +1,49 @@ +import { onBeforeUnmount } from 'vue'; +import { useRequest } from 'vue-request'; + +import { getTicketCount } from '@services/source/ticketFlow'; + +import { useEventBus } from '@hooks'; + +const run = () => { + const isLoading = ref(true); + const data = ref>({ + APPROVE: 0, + DONE: 0, + FAILED: 0, + INNER_TODO: 0, + MY_APPROVE: 0, + RESOURCE_REPLENISH: 0, + SELF_MANAGE: 0, + TODO: 0, + }); + + const { run } = useRequest(getTicketCount, { + onSuccess(result) { + data.value = result; + isLoading.value = false; + }, + }); + + const eventBus = useEventBus(); + + eventBus.on('refreshTicketStatus', run); + + onBeforeUnmount(() => { + eventBus.off('refreshTicketStatus', run); + }); + + return { + loading: isLoading, + data, + }; +}; + +let context: ReturnType; + +export const useTicketCount = () => { + if (!context) { + context = run(); + } + return context; +}; diff --git a/dbm-ui/frontend/src/layout/Index.vue b/dbm-ui/frontend/src/layout/Index.vue index f08e2b4827..77cbf7000b 100644 --- a/dbm-ui/frontend/src/layout/Index.vue +++ b/dbm-ui/frontend/src/layout/Index.vue @@ -133,7 +133,7 @@ 'DorisManage', 'taskHistory', 'DatabaseWhitelist', - 'ticketManage', + 'bizTicketManage', 'DBPasswordTemporaryModify', ], [menuEnum.observableManage]: ['DBHASwitchEvents', 'inspectionManage'], @@ -159,7 +159,13 @@ 'PlatformStaffManage', 'PlatformClusterStandardize', ], - [menuEnum.personalWorkbench]: ['SelfServiceMyTickets', 'MyTodos', 'serviceApply', 'ticketSelfManage'], + [menuEnum.personalWorkbench]: [ + 'serviceApply', + 'SelfServiceMyTickets', + 'MyTodos', + 'ticketSelfDone', + 'ticketSelfManage', + ], } as Record; const menuType = ref(''); @@ -179,7 +185,7 @@ const contentTitle = computed(() => route.meta.navName); const isContendFullscreen = computed(() => Boolean(route.meta.fullscreen)); // 全局搜索结果页面不显示,点击顶部导航栏后显示并自动跳转 - const needMenu = computed(() => !(route.name === 'QuickSearch' && menuType.value === '')); + const needMenu = computed(() => Boolean(menuType.value)); // 解析路由分组 watch( @@ -207,6 +213,13 @@ menuType.value = routeGroupMap[routeName]; } }); + + // // fix: menu 组件 acitve 生效有延迟的问题 + // setTimeout(() => { + // document.body.querySelector('.bk-menu-item.is-active')?.scrollIntoView({ + // block: 'start', + // }); + // }, 300); }, { immediate: true, diff --git a/dbm-ui/frontend/src/layout/components/PersonalWorkbench.vue b/dbm-ui/frontend/src/layout/components/PersonalWorkbench.vue index 47962227a4..1d9996b67e 100644 --- a/dbm-ui/frontend/src/layout/components/PersonalWorkbench.vue +++ b/dbm-ui/frontend/src/layout/components/PersonalWorkbench.vue @@ -6,18 +6,17 @@ @click="handleMenuChange"> + :name="t('单据管理')"> + key="MyTodos" + v-db-console="'personalWorkbench.myTodos'"> - - {{ t('服务申请') }} + + {{ t('我的待办') }} + {{ todoCount }} - + {{ t('我的申请') }} + key="ticketSelfDone" + v-db-console="'personalWorkbench.myTickets'"> - - {{ t('我的待办') }} + + {{ t('我的已办') }} + + {{ t('我负责的业务') }} + + + + - {{ t('我负责的业务') }} + {{ t('服务申请') }} @@ -62,6 +67,8 @@ import { Menu } from 'bkui-vue'; import { useI18n } from 'vue-i18n'; + import { useTicketCount } from '@hooks'; + import { useActiveKey } from './hooks/useActiveKey'; const { t } = useI18n(); @@ -72,5 +79,44 @@ parentKey, key: currentActiveKey, routeLocation: handleMenuChange, - } = useActiveKey(menuRef as Ref>, 'serviceApply'); + } = useActiveKey(menuRef as Ref>, 'MyTodos'); + + const { data: ticketCount } = useTicketCount(); + + const todoCount = computed(() => { + if (!ticketCount.value) { + return 0; + } + + return ( + ticketCount.value.APPROVE + + ticketCount.value.FAILED + + ticketCount.value.RESOURCE_REPLENISH + + ticketCount.value.INNER_TODO + + ticketCount.value.TODO + ); + }); + diff --git a/dbm-ui/frontend/src/layout/components/database-manage/Index.vue b/dbm-ui/frontend/src/layout/components/database-manage/Index.vue index b0bc677666..ad1596bfdb 100644 --- a/dbm-ui/frontend/src/layout/components/database-manage/Index.vue +++ b/dbm-ui/frontend/src/layout/components/database-manage/Index.vue @@ -36,7 +36,7 @@ v-db-console="'databaseManage.missionManage'" :name="t('任务中心')"> + :merge-cells="mergeCells"> + + + + + + + + - diff --git a/dbm-ui/frontend/src/views/ticket-center/business/components/list/components/TableMode.vue b/dbm-ui/frontend/src/views/ticket-center/business/components/list/components/TableMode.vue new file mode 100644 index 0000000000..b581575930 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/business/components/list/components/TableMode.vue @@ -0,0 +1,140 @@ + + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/CardModeList.vue b/dbm-ui/frontend/src/views/ticket-center/common/CardModeList.vue new file mode 100644 index 0000000000..6f1d3b7577 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/CardModeList.vue @@ -0,0 +1,264 @@ + + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/TableModeTable.vue b/dbm-ui/frontend/src/views/ticket-center/common/TableModeTable.vue new file mode 100644 index 0000000000..d5758ae701 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/TableModeTable.vue @@ -0,0 +1,532 @@ + + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/TicketClone.vue b/dbm-ui/frontend/src/views/ticket-center/common/TicketClone.vue new file mode 100644 index 0000000000..7e00f05833 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/TicketClone.vue @@ -0,0 +1,186 @@ + + + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/TicketDetailLink.vue b/dbm-ui/frontend/src/views/ticket-center/common/TicketDetailLink.vue new file mode 100644 index 0000000000..d05407fade --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/TicketDetailLink.vue @@ -0,0 +1,25 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/TicketRevoke.vue b/dbm-ui/frontend/src/views/ticket-center/common/TicketRevoke.vue new file mode 100644 index 0000000000..dc4a66a691 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/TicketRevoke.vue @@ -0,0 +1,43 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessApproveExce.vue b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessApproveExce.vue new file mode 100644 index 0000000000..62c6b7e29e --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessApproveExce.vue @@ -0,0 +1,84 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessFailedTerminate.vue b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessFailedTerminate.vue new file mode 100644 index 0000000000..010d173f8e --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessFailedTerminate.vue @@ -0,0 +1,96 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessPass.vue b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessPass.vue new file mode 100644 index 0000000000..427da256f6 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessPass.vue @@ -0,0 +1,101 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessRefuse.vue b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessRefuse.vue new file mode 100644 index 0000000000..b3130b385c --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessRefuse.vue @@ -0,0 +1,103 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessResourceReplenish.vue b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessResourceReplenish.vue new file mode 100644 index 0000000000..977fb95e23 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessResourceReplenish.vue @@ -0,0 +1,84 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessRetry.vue b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessRetry.vue new file mode 100644 index 0000000000..b90616bb72 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessRetry.vue @@ -0,0 +1,64 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessTerminate.vue b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessTerminate.vue new file mode 100644 index 0000000000..077b3a8d31 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessTerminate.vue @@ -0,0 +1,103 @@ + + diff --git a/dbm-ui/frontend/src/views/ticket-self-manage/components/list/components/hooks/use-date-picker.ts b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-date-picker.ts similarity index 84% rename from dbm-ui/frontend/src/views/ticket-self-manage/components/list/components/hooks/use-date-picker.ts rename to dbm-ui/frontend/src/views/ticket-center/common/hooks/use-date-picker.ts index 7d15acc4b5..5c4c693e71 100644 --- a/dbm-ui/frontend/src/views/ticket-self-manage/components/list/components/hooks/use-date-picker.ts +++ b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-date-picker.ts @@ -1,5 +1,6 @@ import dayjs from 'dayjs'; import { computed, ref } from 'vue'; +import { onBeforeRouteLeave } from 'vue-router'; import { useUrlSearch } from '@hooks'; @@ -7,9 +8,8 @@ interface IPicker { value: () => [Date, Date]; } -const value = ref<[Date, Date] | [string, string]>(['', '']); - -export default () => { +const create = () => { + const value = ref<[Date, Date] | [string, string]>(['', '']); const { getSearchParams } = useUrlSearch(); const searchParams = getSearchParams(); @@ -72,3 +72,17 @@ export default () => { shortcutsRange, }; }; + +let context: ReturnType | undefined; + +export default () => { + if (!context) { + context = create(); + } + + onBeforeRouteLeave(() => { + context = undefined; + }); + + return context; +}; diff --git a/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-detail-precheck.ts b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-detail-precheck.ts new file mode 100644 index 0000000000..dad3dbefc0 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-detail-precheck.ts @@ -0,0 +1,48 @@ +import { ref } from 'vue'; +import { useI18n } from 'vue-i18n'; +import { useRoute, useRouter } from 'vue-router'; + +import { getTickets } from '@services/source/ticket'; + +import { messageWarn } from '@utils'; + +export default (params: ServiceParameters) => { + const router = useRouter(); + const route = useRoute(); + + const { t } = useI18n(); + + const isChecking = ref(true); + if (params.id) { + getTickets(params) + .then((data) => { + if (data.results.length > 0) { + return; + } + messageWarn( + t('单据t不在n单据中', { + t: params.id, + n: route.meta.navName, + }), + 5000, + ); + + router.replace({ + params: { + ticketId: '', + }, + }); + }) + .finally(() => { + setTimeout(() => { + isChecking.value = false; + }); + }); + } else { + setTimeout(() => { + isChecking.value = false; + }); + } + + return isChecking; +}; diff --git a/dbm-ui/frontend/src/views/ticket-self-manage/components/list/components/hooks/use-data.ts b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-fetch-data.ts similarity index 54% rename from dbm-ui/frontend/src/views/ticket-self-manage/components/list/components/hooks/use-data.ts rename to dbm-ui/frontend/src/views/ticket-center/common/hooks/use-fetch-data.ts index 73fd98c4b1..5cf8d9c441 100644 --- a/dbm-ui/frontend/src/views/ticket-self-manage/components/list/components/hooks/use-data.ts +++ b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-fetch-data.ts @@ -1,27 +1,33 @@ import { reactive, ref } from 'vue'; import { useRequest } from 'vue-request'; +import { onBeforeRouteLeave } from 'vue-router'; import TicketModel from '@services/model/ticket/ticket'; import { getTickets, getTicketStatus } from '@services/source/ticket'; -import { useUrlSearch } from '@hooks'; +import { useEventBus, useUrlSearch } from '@hooks'; import { useTimeoutFn } from '@vueuse/core'; -const isLoading = ref(false); -const dataList = ref[]>([]); -const pagination = reactive({ - offset: 0, - limit: 15, - current: 1, - count: 0, -}); - -export default (options?: { onSuccess?: (data: TicketModel[]) => void }) => { +const create = (dataSource: typeof getTickets, options?: { onSuccess?: (data: TicketModel[]) => void }) => { + const eventBus = useEventBus(); const { replaceSearchParams, getSearchParams } = useUrlSearch(); const searchParams = getSearchParams(); + const isLoading = ref(false); + const dataList = ref([]); + const pagination = reactive({ + offset: 0, + limit: 20, + current: 1, + count: 0, + limitList: [10, 20, 50, 100, 500], + remote: true, + }); + const ordering = ref(''); + const tableMaxHeight = ref('auto'); + if (searchParams.limit && searchParams.current) { pagination.limit = Number(searchParams.limit); pagination.current = Number(searchParams.current); @@ -55,51 +61,62 @@ export default (options?: { onSuccess?: (data: TicketModel[]) => void } fetchTicketStatus(); }, 10000); - const { run: fetchTicketList } = useRequest( - (params: ServiceParameters) => - getTickets({ - limit: pagination.limit, - offset: (pagination.current - 1) * pagination.limit, - self_manage: 1, - ...params, - }), - { - manual: true, - debounceInterval: 100, - onBefore() { - isLoading.value = true; - }, - onAfter() { - isLoading.value = false; - }, - onSuccess(data, params) { + const fetchTicketList = (params: ServiceParameters) => { + isLoading.value = true; + dataSource({ + limit: pagination.limit, + offset: (pagination.current - 1) * pagination.limit, + ordering: ordering.value, + ...params, + }) + .then((data) => { dataList.value = data.results; + pagination.count = data.count; const urlSearchParams = { limit: pagination.limit, current: pagination.current, - ...params[0], + ordering: ordering.value, + ...params, }; - const searchParams = getSearchParams(); - if (Number(searchParams.viewId)) { - Object.assign(urlSearchParams, { - viewId: searchParams.viewId, - }); - } replaceSearchParams(urlSearchParams); if (options && options.onSuccess) { options.onSuccess(data.results); } - }, - }, - ); + }) + .finally(() => { + isLoading.value = false; + }); + }; + + eventBus.on('refreshTicketStatus', fetchTicketStatus); + + onBeforeRouteLeave(() => { + eventBus.off('refreshTicketStatus', fetchTicketStatus); + }); return { loading: isLoading, + tableMaxHeight, dataList, pagination, + ordering, fetchTicketList, }; }; + +let context: ReturnType | undefined; + +export default (...args: Parameters) => { + if (!context) { + context = create(...args); + } + + onBeforeRouteLeave(() => { + context = undefined; + }); + + return context; +}; diff --git a/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-search-select.ts b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-search-select.ts new file mode 100644 index 0000000000..d73651dbba --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/hooks/use-search-select.ts @@ -0,0 +1,125 @@ +import { computed, shallowRef } from 'vue'; +import { useI18n } from 'vue-i18n'; +import { useRequest } from 'vue-request'; +import { onBeforeRouteLeave } from 'vue-router'; + +import TicketModel from '@services/model/ticket/ticket'; +import { getTicketTypes } from '@services/source/ticket'; + +import { useGlobalBizs } from '@stores'; + +import type { SearchValue } from '@components/vue2/search-select/index.vue'; + +import { getSearchSelectorParams, makeMap } from '@utils'; + +const value = ref([]); + +const ticketTypeList = shallowRef<{ id: string; name: string }[]>([]); + +const create = (options = {} as { exclude: string[] }) => { + const { t } = useI18n(); + const globalBizsStore = useGlobalBizs(); + + const searchSelectData = computed(() => { + const serachList = [ + { + name: t('单号'), + id: 'id', + }, + { + name: t('单据类型'), + id: 'ticket_type__in', + multiple: true, + children: ticketTypeList.value, + }, + { + name: t('集群'), + id: 'cluster', + }, + { + name: t('业务'), + id: 'bk_biz_id', + children: globalBizsStore.bizs.map((item) => ({ + id: `${item.bk_biz_id}`, + name: item.name, + })), + }, + { + name: t('单据状态'), + id: 'status', + multiple: true, + children: Object.keys(TicketModel.statusTextMap).reduce[]>((acc, key) => { + acc.push({ + id: key, + name: TicketModel.statusTextMap[key as keyof typeof TicketModel.statusTextMap], + }); + return acc; + }, []), + }, + { + name: t('备注'), + id: 'remark', + }, + { + name: t('提单人'), + id: 'creator', + }, + ]; + + if (!options.exclude) { + return serachList; + } + + const excludeMap = makeMap(options.exclude); + return serachList.filter((item) => !excludeMap[item.id]); + }); + + const formatSearchValue = computed(() => getSearchSelectorParams(value.value)); + + const searchFieldMap = computed(() => + searchSelectData.value.reduce>((result, item) => { + if (item.children) { + Object.assign(result, { + [item.id]: item.children.map((childItem) => ({ + label: childItem.name, + value: childItem.id, + })), + }); + } + return result; + }, {}), + ); + + useRequest(getTicketTypes, { + cacheKey: 'ticketTypes', + staleTime: 24 * 60 * 60 * 1000, + onSuccess(data) { + ticketTypeList.value = data.map((item) => ({ + id: item.key, + name: item.value, + })); + }, + }); + + return { + ticketTypeList, + value, + searchSelectData, + formatSearchValue, + searchFieldMap, + }; +}; + +let context: ReturnType | undefined; + +export default (...args: Parameters) => { + if (!context) { + context = create(...args); + } + + onBeforeRouteLeave(() => { + context = undefined; + }); + + return context; +}; diff --git a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/Index.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/Index.vue new file mode 100644 index 0000000000..1edf760227 --- /dev/null +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/Index.vue @@ -0,0 +1,165 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/BaseInfo.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/BaseInfo.vue index 48a6922a8e..2bce12c707 100644 --- a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/BaseInfo.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/BaseInfo.vue @@ -1,5 +1,6 @@ diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/MessageList.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/common/MessageList.vue similarity index 98% rename from dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/MessageList.vue rename to dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/common/MessageList.vue index b35f03c07e..16acd44d08 100644 --- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/MessageList.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/common/MessageList.vue @@ -25,14 +25,14 @@ + scope="global"> {{ totalMap.errorNum }} diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/RenderFileContent.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/common/SqlFileContent.vue similarity index 97% rename from dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/RenderFileContent.vue rename to dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/common/SqlFileContent.vue index 49fa38a00b..e3c7a8d9ab 100644 --- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/RenderFileContent.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/common/SqlFileContent.vue @@ -48,11 +48,7 @@ style="height: 100%" />