diff --git a/frontend/public/image/png/Component.png b/frontend/public/image/png/Component.png new file mode 100644 index 00000000..457d434d Binary files /dev/null and b/frontend/public/image/png/Component.png differ diff --git a/frontend/public/image/svg/DetectedFileListRec.svg b/frontend/public/image/svg/DetectedFileListRec.svg new file mode 100644 index 00000000..cf7458f4 --- /dev/null +++ b/frontend/public/image/svg/DetectedFileListRec.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/public/image/svg/historyMyOptionLine.svg b/frontend/public/image/svg/HistoryMyOptionLine.svg similarity index 100% rename from frontend/public/image/svg/historyMyOptionLine.svg rename to frontend/public/image/svg/HistoryMyOptionLine.svg diff --git a/frontend/public/image/svg/ListLine.svg b/frontend/public/image/svg/ListLine.svg new file mode 100644 index 00000000..08e52fb4 --- /dev/null +++ b/frontend/public/image/svg/ListLine.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/frontend/public/image/svg/PieChartLine.svg b/frontend/public/image/svg/PieChartLine.svg new file mode 100644 index 00000000..7c9756ae --- /dev/null +++ b/frontend/public/image/svg/PieChartLine.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/public/image/svg/ResultInfoLine.svg b/frontend/public/image/svg/ResultInfoLine.svg new file mode 100644 index 00000000..f93c3381 --- /dev/null +++ b/frontend/public/image/svg/ResultInfoLine.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 36dba35e..226fbd01 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -12,6 +12,7 @@ import Home from './pages/Home'; import Login from './pages/Login'; import User from './pages/User'; import History from './pages/History'; +import Result from './pages/Result'; axios.defaults.baseURL = '/api/v1/web'; function App() { @@ -24,6 +25,7 @@ function App() { } /> } /> } /> + } /> diff --git a/frontend/src/css/History_style.css b/frontend/src/css/History_style.css index 8b833f6a..d641df60 100644 --- a/frontend/src/css/History_style.css +++ b/frontend/src/css/History_style.css @@ -5,7 +5,7 @@ * found in the LICENSE file. */ - .history-send { +.history-send { background-color: #ffffff; display: flex; flex-direction: row; diff --git a/frontend/src/css/Result_style.css b/frontend/src/css/Result_style.css new file mode 100644 index 00000000..2f26095d --- /dev/null +++ b/frontend/src/css/Result_style.css @@ -0,0 +1,1869 @@ +/** + * Copyright 2023 kyudori, Basaeng, hwan5180, quswjdgma83 + * + * Use of this source code is governed by a MIT license that can be + * found in the LICENSE file. + */ + +.result-pull-request { + background-color: #ffffff; + display: flex; + flex-direction: row; + justify-content: center; + width: 100%; +} + +.result-pull-request .div { + background-color: #ffffff; + border: 1px none; + height: 1080px; + position: relative; + width: 1920px; +} + +.result-pull-request .number-menu { + height: 27px; + left: 750px; + position: absolute; + top: 1015px; + width: 286px; +} + +.result-pull-request .frame-2 { + align-items: flex-start; + display: inline-flex; + gap: 33px; + position: absolute; + top: 0; +} + +.result-pull-request .text-wrapper { + color: #000000; + font-family: "Inter-SemiBold", Helvetica; + font-size: 25px; + font-weight: 600; + letter-spacing: 0; + line-height: normal; + position: relative; + top: -1px; + width: 23px; + cursor: pointer; +} + +.result-pull-request .text-wrapper-2 { + color: #000000; + font-family: "Inter-SemiBold", Helvetica; + font-size: 25px; + font-weight: 600; + letter-spacing: 0; + line-height: normal; + position: relative; + top: -1px; + width: 23px; + cursor: pointer; +} + +.result-pull-request .text-wrapper-3 { + color: #000000; + font-family: "Inter-SemiBold", Helvetica; + font-size: 25px; + font-weight: 600; + letter-spacing: 0; + line-height: normal; + position: relative; + top: -1px; + width: 23px; + cursor: pointer; +} + +.result-pull-request .text-wrapper-4 { + color: #000000; + font-family: "Inter-SemiBold", Helvetica; + font-size: 25px; + font-weight: 600; + letter-spacing: 0; + line-height: normal; + position: relative; + top: -1px; + width: 23px; + cursor: pointer; +} + +.result-pull-request .text-wrapper-5 { + color: #000000; + font-family: "Inter-SemiBold", Helvetica; + font-size: 25px; + font-weight: 600; + letter-spacing: 0; + line-height: normal; + position: relative; + margin-top: -1px; + width: 23px; + cursor: pointer; +} + +.result-pull-request .arrow { + height: 22px; + margin-left: 0px; + position: relative; + top: 1px; + width: 13px; +} + +.result-pull-request .img { + height: 22px; + margin-left: 0px; + position: relative; + top: 1px; + width: 13px; +} + +.result-pull-request .detected-file-list { + height: 418px; + left: 38px; + position: absolute; + top: 584px; + width: 1846px; +} + +.result-pull-request .overlap { + height: 373px; + left: 0; + position: absolute; + top: 45px; + width: 1844px; +} + +.result-pull-request .detected-file-list-2 { + height: 373px; + left: 0; + position: absolute; + top: 0; + width: 1843px; +} + +.result-pull-request .match-component { + height: 42px; + left: 1561px; + position: absolute; + top: 19px; + width: 186px; +} + +.result-pull-request .text-wrapper-6 { + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: -30px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 0; + width: 250px; +} + +.result-pull-request .license-chart { + height: 339px; + left: 1123px; + position: absolute; + top: 19px; + width: 296px; +} + +.result-pull-request .text-wrapper-7 { + color: #0000ff; + font-family: "Inter-Medium", Helvetica; + font-size: 25px; + font-weight: 500; + left: -10px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 309px; + white-space: nowrap; + width: 300px; + text-align: center; +} + +.result-pull-request .text-wrapper-8 { + color: #0000ff; + font-family: "Inter-Medium", Helvetica; + font-size: 25px; + font-weight: 500; + left: -10px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 247px; + white-space: nowrap; + width: 300px; + text-align: center; +} + +.result-pull-request .text-wrapper-9 { + color: #ff0000; + font-family: "Inter-Medium", Helvetica; + font-size: 25px; + font-weight: 500; + left: -10px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 188px; + white-space: nowrap; + width: 300px; + text-align: center; +} + +.result-pull-request .text-wrapper-10 { + color: #8b0000; + font-family: "Inter-Medium", Helvetica; + font-size: 25px; + font-weight: 500; + left: -10px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 127px; + white-space: nowrap; + width: 300px; + text-align: center; +} + +.result-pull-request .text-wrapper-11 { + color: #0000ff; + font-family: "Inter-Medium", Helvetica; + font-size: 25px; + font-weight: 500; + left: -10px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 66px; + white-space: nowrap; + width: 300px; + text-align: center; +} + +.result-pull-request .text-wrapper-12 { + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: 9px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 0; + width: 275px; +} + +.result-pull-request .match-value-chart { + height: 338px; + left: 892px; + position: absolute; + top: 19px; + width: 209px; +} + +.result-pull-request .text-wrapper-13 { + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: 0; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 0; + width: 197px; +} + +.result-pull-request .text-wrapper-14 { + color: #000000; + font-family: "Inter-Medium", Helvetica; + font-size: 30px; + font-weight: 500; + left: 53px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 308px; + white-space: nowrap; + width: 86px; +} + +.result-pull-request .text-wrapper-15 { + color: #000000; + font-family: "Inter-Medium", Helvetica; + font-size: 30px; + font-weight: 500; + left: 53px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 248px; + white-space: nowrap; + width: 98px; +} + +.result-pull-request .text-wrapper-16 { + color: #000000; + font-family: "Inter-Medium", Helvetica; + font-size: 30px; + font-weight: 500; + left: 56px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 187px; + white-space: nowrap; + width: 86px; +} + +.result-pull-request .text-wrapper-17 { + color: #000000; + font-family: "Inter-Medium", Helvetica; + font-size: 30px; + font-weight: 500; + left: 55px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 127px; + white-space: nowrap; + width: 86px; +} + +.result-pull-request .text-wrapper-18 { + color: #000000; + font-family: "Inter-Medium", Helvetica; + font-size: 30px; + font-weight: 500; + left: 57px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 66px; + white-space: nowrap; + width: 86px; +} + +.result-pull-request .match-line-chart { + height: 338px; + left: 683px; + position: absolute; + top: 19px; + width: 174px; +} + +.result-pull-request .text-wrapper-19-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 150px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: 300px; +} + +.result-pull-request .text-wrapper-19-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-19-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-19-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-19.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-19.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; + text-align: center; +} + +.result-pull-request .text-wrapper-20-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 150px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -110px; +} + +.result-pull-request .text-wrapper-20-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-20-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-20-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-20.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-20.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; + text-align: center; + +} + +.result-pull-request .text-wrapper-21-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 150px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -110px; +} + +.result-pull-request .text-wrapper-21-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-21-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-21-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-21.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-21.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; + text-align: center; +} + +.result-pull-request .text-wrapper-22-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 150px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -112px; +} + + +.result-pull-request .text-wrapper-22-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-22-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-22-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-22.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-22.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; + text-align: center; +} + +.result-pull-request .text-wrapper-23-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 150px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -112px; +} + +.result-pull-request .text-wrapper-23-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-23-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-23-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-23.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-23.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; + text-align: center; +} + +.result-pull-request .text-wrapper-24 { +color: #000000; +font-family: "Inter-Bold", Helvetica; +font-size: 30px; +font-weight: 700; +left: 0; +letter-spacing: 0; +line-height: normal; +position: absolute; +top: 0; +width: 162px; +} + +.result-pull-request .path-chart { + height: 338px; + left: 271px; + position: absolute; + top: 19px; + width: 400px; +} + +.result-pull-request .text-wrapper-25-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 380px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: 300px; +} + +.result-pull-request .text-wrapper-25-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-25-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-25-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-25.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-25.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-26-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 380px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -110px; +} + +.result-pull-request .text-wrapper-26-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-26-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-26-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-26.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-26.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-27-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 380px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -110px; +} + +.result-pull-request .text-wrapper-27-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-27-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-27-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + + +.result-pull-request .text-wrapper-27.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-27.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-28-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 380px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -112px; +} + +.result-pull-request .text-wrapper-28-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-28-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-28-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-28.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-28.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-29-container { + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + max-width: 380px; + padding: 10px; + height: 50px; + box-sizing: border-box; + position: relative; + z-index: 1; + margin-top: -112px; +} + +.result-pull-request .text-wrapper-29-container::-webkit-scrollbar { + height: 10px; +} + +.result-pull-request .text-wrapper-29-container::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 10px; + background-clip: padding-box; + border: 2px solid transparent; +} + +.result-pull-request .text-wrapper-29-container::-webkit-scrollbar-track { + background-color: white; + border-radius: 10px; + box-shadow: inset 0px 0px 5px white; +} + +.result-pull-request .text-wrapper-29.long { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-29.short { + color: #000000; + font-family: "Inter-Medium", Helvetica, sans-serif; + font-size: 30px; + font-weight: 500; + line-height: normal; + padding: 0; + margin: 0; + position: absolute; + margin-top: -3px; + left: 0; + width: 100%; +} + +.result-pull-request .text-wrapper-30 { + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: 145px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 0; + white-space: nowrap; + width: 74px; +} + +.result-pull-request .status { + height: 337px; + left: 51px; + position: absolute; + top: 19px; + width: 146px; +} + +.result-pull-request .permitted { + height: 27px; + left: 0; + position: absolute; + top: 310px; + width: 146px; +} + +.result-pull-request .overlap-group { + border-radius: 5px; + height: 27px; + position: relative; + width: 144px; +} + +.result-pull-request .text-wrapper-31-prohibited { + color: #FF0000; + margin-left: -20px; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 35px; + letter-spacing: 0; + line-height: normal; + position: absolute; + margin-top: 4px; + width: 119px; + z-index: 2; +} + +.result-pull-request .text-wrapper-31-restricted { + color: #8B0000; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + margin-left: -20px; + font-weight: 500; + left: 31px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 4px; + width: 119px; + z-index: 2; +} + +.result-pull-request .text-wrapper-31-permitted { + color: #0000FF; + margin-left: -20px; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 36px; + letter-spacing: 0; + line-height: normal; + position: absolute; + margin-top: 4px; + width: 119px; + z-index: 2; +} + +.result-pull-request .text-wrapper-31-nofile { + color: #000000; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 38px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 4px; + width: 119px; + z-index: 2; +} + +.result-pull-request .text-wrapper-31-unreviewed { + color: #000000; + margin-left: -20px; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 27px; + letter-spacing: 0; + line-height: normal; + position: absolute; + margin-top: 4px; + width: 119px; + z-index: 2; +} + +.result-pull-request .rectangle { + background-color: #0000ff42; + border: 1px solid; + border-color: #0000ff; + border-radius: 5px; + height: 27px; + left: 0; + position: absolute; + top: 0; + width: 144px; +} + +.result-pull-request .overlap-wrapper { + height: 30px; + left: 0; + position: absolute; + top: 251px; + width: 146px; +} + +.result-pull-request .overlap-2 { + height: 30px; + position: relative; + width: 144px; +} + +.result-pull-request .text-wrapper-32 { + color: #0000ff; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 23px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 4px; + width: 119px; +} + +.result-pull-request .prohibited { + height: 27px; + left: 0; + position: absolute; + top: 191px; + width: 146px; +} + +.result-pull-request .text-wrapper-33 { + color: #ff0000; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 19px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 1px; + width: 102px; +} + +.result-pull-request .status-label { + background-color: #ff000054; + border: 1px solid; + border-color: #ff0000; + border-radius: 5px; + height: 27px; + left: 0; + position: absolute; + top: 0; + width: 144px; +} + +.result-pull-request .restricted { + height: 28px; + left: 0; + position: absolute; + top: 127px; + width: 146px; +} + +.result-pull-request .overlap-3 { + height: 28px; + position: relative; + width: 144px; +} + +.result-pull-request .text-wrapper-34 { + color: #8b0000; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 19px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 2px; + width: 102px; +} + +.result-pull-request .status-label-2 { + background-color: #842b2b54; + border: 1px solid; + border-color: #8b0000; + border-radius: 5px; + height: 27px; + left: 0; + position: absolute; + top: 0; + width: 144px; +} + +.result-pull-request .overlap-group-wrapper { + height: 27px; + left: 0; + position: absolute; + top: 69px; + width: 146px; +} + +.result-pull-request .text-wrapper-35 { + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: 21px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 0; + white-space: nowrap; + width: 108px; +} + +.result-pull-request .list-line { + height: 372px; + left: 0; + position: absolute; + top: 0px; + width: 1844px; + z-index: 0; +} + +.result-pull-request .component { + height: 44px; + left: 1550px; + object-fit: cover; + position: absolute; + top: 324px; + width: 202px; + cursor: pointer; +} + +.result-pull-request .component-2 { + height: 44px; + left: 1550px; + object-fit: cover; + position: absolute; + top: 264px; + width: 202px; + cursor: pointer; +} + +.result-pull-request .component-3 { + height: 44px; + left: 1550px; + object-fit: cover; + position: absolute; + top: 204px; + width: 202px; + cursor: pointer; +} + +.result-pull-request .component-4 { + height: 44px; + left: 1550px; + object-fit: cover; + position: absolute; + top: 142px; + width: 202px; + cursor: pointer; +} + +.result-pull-request .component-5 { + height: 44px; + left: 1550px; + object-fit: cover; + position: absolute; + top: 82px; + width: 202px; + cursor: pointer; +} + +.result-pull-request .text-wrapper-36 { + color: #00057b; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: 19px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 0; + white-space: nowrap; + width: 245px; +} + +.result-pull-request .detected-license { + height: 358px; + left: 1475px; + position: absolute; + top: 209px; + width: 410px; +} + +.result-pull-request .overlap-4 { + background-color: #ffffff; + border: 1px solid; + border-color: #000000; + border-radius: 25px; + height: 358px; + position: relative; + width: 408px; +} + +.result-pull-request .image { + height: 249px; + left: 91px; + object-fit: cover; + position: absolute; + top: 81px; + width: 242px; +} + +.result-pull-request .pie-chart-line { + height: 1px; + left: 12px; + object-fit: cover; + position: absolute; + top: 64px; + width: 383px; +} + +.result-pull-request .text-wrapper-37 { + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: 28px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 13px; + white-space: nowrap; + width: 341px; +} + +.result-pull-request .info { + height: 358px; + left: 38px; + position: absolute; + top: 209px; + width: 1412px; +} + +.result-pull-request .overlap-5 { + background-color: #ffffff; + border: 1px solid; + border-color: #000000; + border-radius: 25px; + height: 358px; + position: relative; + width: 1408px; +} + +.result-pull-request .flexcontainer { + align-items: flex-start; + display: flex; + flex-direction: column; + gap: 15px; + height: 117px; + left: 30px; + position: absolute; + top: 81px; + width: 1344px; +} + +.result-pull-request .text { + align-self: stretch; + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 28px; + font-weight: 400; + letter-spacing: 0; + line-height: normal; + position: relative; + margin-top: 0px; +} + +.result-pull-request .span { + font-weight: 700; +} + +.result-pull-request .text-wrapper-38 { + font-family: "Inter-Medium", Helvetica; + font-weight: 500; +} + +.result-pull-request .info-line { + height: 1px; + left: 19px; + object-fit: cover; + position: absolute; + top: 64px; + width: 1364px; +} + +.result-pull-request .text-wrapper-39 { + color: #00057b; + font-family: "Inter-Bold", Helvetica; + font-size: 30px; + font-weight: 700; + left: 30px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 13px; + width: 57px; +} + +.result-pull-request .reponame-container { + position: relative; + left: 45px; + top: 117px; +} + +.result-pull-request .pr { + height: 30px; + left: calc(100% + 20px); + position: absolute; + top: 0px; + width: 88px; +} + +.result-pull-request .div-wrapper { + background-color: #d9d9d9; + border-radius: 15px; + height: 30px; + position: relative; + width: 86px; +} + +.result-pull-request .text-wrapper-40 { + color: #000000; + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + left: 14px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 3px; + width: 59px; + text-align: center; +} + +.result-pull-request .status-2 { + height: 27px; + left: calc(100% + 20px); + position: absolute; + top: 20px; + width: 187px; +} + +.result-pull-request .overlap-6 { + border-radius: 5px; + height: 27px; + position: relative; + width: 185px; +} + +.result-pull-request .text-wrapper-41 { + font-family: "Inter-Medium", Helvetica; + font-size: 20px; + font-weight: 500; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 2px; + width: 185px; +} + +.result-pull-request .issue-detected { + color: #ff0000; + margin-left: 25px; +} + +.result-pull-request .scan-error { + color: #ff0000; + margin-left: 45px; + z-index: 100; +} + +.result-pull-request .scan-complete { + color: #0000FF; + margin-left: 20px; +} + +.result-pull-request .issue-detected-label { + background-color: #ff000054; + border: 1px solid; + border-color: #ff0000; + border-radius: 5px; + height: 27px; + left: 0; + position: absolute; + top: 0; + width: 185px; +} + +.result-pull-request .scan-error-label { + background-color: #FFF51080; + border: 1px solid; + border-color: #F9EF00; + border-radius: 5px; + height: 27px; + left: 0; + position: absolute; + top: 0; + width: 185px; +} + +.result-pull-request .scan-complete-label { + background-color: #0000FF40; + border: 1px solid; + border-color: #0000FF; + border-radius: 5px; + height: 27px; + left: 0; + position: absolute; + top: 0; + width: 185px; +} + +.result-pull-request .status-label-3 { + background-color: #ff000054; + border: 1px solid; + border-color: #ff0000; + border-radius: 5px; + height: 27px; + left: 0; + position: absolute; + top: 0; + width: 185px; +} + +.result-pull-request .text-wrapper-42 { + position: relative; + color: #000000; + font-family: "Inter-Bold", Helvetica; + font-size: 50px; + font-weight: 700; + left: 45px; + letter-spacing: 0; + line-height: normal; + top: 117px; + display: inline-block; +} + +.result-pull-request .menubar-top { + height: 101px; + left: 39px; + position: absolute; + top: 8px; + width: 1842px; +} + +.result-pull-request .menu-line { + background-color: #000000; + height: 3px; + left: 0; + position: absolute; + top: 98px; + width: 1842px; +} + +.result-pull-request .menu { + height: 96px; + left: 0; + position: absolute; + top: 0; + width: 1848px; +} + +.result-pull-request .overlap-7 { + height: 43px; + left: 1572px; + position: absolute; + top: 37px; + width: 272px; +} + +.result-pull-request .profile-border { + background-color: #d9d9d9; + height: 3px; + left: 104px; + position: absolute; + top: 20px; + transform: rotate(-90deg); + width: 40px; +} + +.result-pull-request .text-wrapper-43 { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 30px; + font-weight: 400; + left: 0; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 6px; + width: 115px; +} + +.result-pull-request .profile { + height: 43px; + left: 136px; + position: absolute; + top: 0; + width: 135px; +} + +.result-pull-request .overlap-group-2 { + background-color: #d9d9d9; + border-radius: 50px; + height: 43px; + position: relative; + width: 133px; +} + +.result-pull-request .image-2 { + height: 31px; + left: 11px; + object-fit: cover; + position: absolute; + top: 6px; + width: 35px; +} + +.result-pull-request .text-wrapper-44 { + color: #000000; + font-family: "Inter-SemiBold", Helvetica; + font-size: 20px; + font-weight: 600; + left: 56px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 10px; + white-space: nowrap; + width: 71px; +} + +.result-pull-request .text-wrapper-45 { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 30px; + font-weight: 400; + left: 125px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 6px; + white-space: nowrap; + width: 167px; +} + +.result-pull-request .text-wrapper-46 { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 30px; + font-weight: 400; + left: 1590px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 40px; + width: 115px; +} + +.result-pull-request .LPVS { + height: 96px; + left: 0; + object-fit: cover; + position: absolute; + top: 0; + width: 229px; +} + +.result-pull-request .GPLorlater { + height: 33px; + left: 25px; + position: absolute; + top: 325px; + width: 418px; +} + + +.result-pull-request .text-wrapper-GPLorlater { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 18px; + font-weight: 400; + left: 22px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 3px; + white-space: nowrap; + width: 300px; +} + +.result-pull-request .Unsupported-license { + height: 33px; + left: 200px; + position: absolute; + top: 325px; + width: 418px; + +} + +.result-pull-request .text-wrapper-300 { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 18px; + font-weight: 400; + left: 22px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 3px; + white-space: nowrap; + width: 148px; +} + +.result-pull-request .Unsupported-license-color { + background-color: #F28300; + height: 14px; + left: 0; + position: absolute; + top: 5px; + width: 14px; + z-index: 9999; +} + +.result-pull-request .GPLorlater-color { + background-color: #007c31; + height: 14px; + left: 0; + position: absolute; + top: 5px; + width: 14px; +} + +.result-pull-request .OpenSSL { + height: 33px; + left: 200px; + position: absolute; + top: 305px; + width: 418px; +} + +.result-pull-request .text-wrapper-OpenSSL { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 18px; + font-weight: 400; + left: 22px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 3px; + white-space: nowrap; + width: 148px; +} + +.result-pull-request .OpenSSL-color { + background-color: #73c541; + height: 14px; + left: 0; + position: absolute; + top: 5px; + width: 14px; +} + +.result-pull-request .GPLonly { + height: 32px; + left: 25px; + position: absolute; + top: 305px; + width: 418px; +} + +.result-pull-request .text-wrapper-GPLonly { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 18px; + font-weight: 400; + left: 22px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 3px; + white-space: nowrap; + width: 290px; +} + +.result-pull-request .GPLonly-color { + background-color: #000000; + height: 14px; + left: 0; + + position: absolute; + top: 5px; + width: 14px; + z-index: 2000; +} + +.result-pull-request .Apache { + height: 32px; + left: 200px; + position: absolute; + top: 285px; + width: 418px; +} + +.result-pull-request .text-wrapper-Apache { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 18px; + font-weight: 400; + left: 22px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 3px; + white-space: nowrap; + width: 168px; +} + +.result-pull-request .Apache-color { + background-color: #7f237d; + height: 14px; + left: 0; + position: absolute; + top: 5px; + width: 14px; +} + +.result-pull-request .MIT { + height: 32px; + left: 25px; + position: absolute; + top: 285px; + width: 418px; +} + +.result-pull-request .text-wrapper-MIT { + color: #000000; + font-family: "Inter-Regular", Helvetica; + font-size: 18px; + font-weight: 400; + left: 22px; + letter-spacing: 0; + line-height: normal; + position: absolute; + top: 3px; + white-space: nowrap; + width: 60px; +} + +.result-pull-request .MIT-color { + background-color: #a31f34; + height: 14px; + left: 0; + position: absolute; + top: 5px; + width: 14px; +} diff --git a/frontend/src/pages/History.jsx b/frontend/src/pages/History.jsx index 2561f532..920e9b08 100644 --- a/frontend/src/pages/History.jsx +++ b/frontend/src/pages/History.jsx @@ -148,6 +148,14 @@ export const History= () => { return
Loading...
; } + function truncateName(name) { + if (/[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/g.test(name)) { + return name.length > 3 ? `${name.substring(0, 3)}.` : name; + } else { + return name.length > 5 ? `${name.substring(0, 5)}.` : name; + } + } + const pageArrow=(page)=> { if(page<=5) { return false; @@ -188,7 +196,7 @@ export const History= () => {
- My option line + My option line
My Option
@@ -337,7 +345,6 @@ export const History= () => { ): null} -
@@ -348,7 +355,12 @@ export const History= () => {
Image -
{username.name}
+
{username.name ? ( +
{truncateName(username.name)}
+ ) : ( +
Loading...
+ )} +
diff --git a/frontend/src/pages/Result.jsx b/frontend/src/pages/Result.jsx new file mode 100644 index 00000000..3f074555 --- /dev/null +++ b/frontend/src/pages/Result.jsx @@ -0,0 +1,659 @@ +/** + * Copyright 2023 kyudori, Basaeng, hwan5180, quswjdgma83 + * + * Use of this source code is governed by a MIT license that can be + * found in the LICENSE file. + */ + +import { Link, useParams, useNavigate, useLocation } from "react-router-dom"; +import "../css/Result_style.css"; +import axios from "axios"; +import React, { useState, useEffect } from "react"; +import { PieChart, Pie, Sector, Cell, ResponsiveContainer, Tooltip } from 'recharts'; + +export const Result = () => { + + const [ isLoggedIn, setIsLoggedIn ] = useState(false); + const [username, setUsername] = useState(""); + + const { pull_request_id } = useParams(); + const [ lpvsResult, setLPVSResult ] = useState(); + const [ licenseDetection, setlicenseDetection ] = useState(false); + + const navigate = useNavigate(); + const location = useLocation(); + const queryParams = new URLSearchParams(location.search); + const page = queryParams.get('page') || 0; + + useEffect(() => { + axios.get("/user/login") + .then((loginresponse) => { + if (loginresponse.data.isLoggedIn) { + setIsLoggedIn(loginresponse.data.isLoggedIn); + axios.get("/user/info") + .then((userInfoResponse) => { + setUsername(userInfoResponse.data); + }) + .catch(function(error) { + console.log(error.toJSON()); + navigate("/user/login"); + }); + } else { + navigate("/user/login"); + } + }) + .catch(function(error) { + console.log(error.toJSON()); + navigate("/user/login"); + }); + }, []); + + useEffect(() => { + axios + .get(`/result/${pull_request_id}?page=${page}`) + .then((response) => { + setLPVSResult(response.data); + console.log(response.data?.lpvsResultInfo.status); + console.log(response.data) + }) + .catch(function(error) { + console.log(error.toJSON()); + const userChoice = window.confirm("Please enter the GitHub ID on the User page."); + if (userChoice) { + navigate('/user/setting'); + } else { + navigate(`/result/${pull_request_id}?page=0`); + } + }); + }, [pull_request_id, page]); + + //===============================LabelSetting============================================================== + const setLabel = (number) => { + if (lpvsResult && lpvsResult.lpvsResultFileList && lpvsResult.lpvsResultFileList[number]) { + const status = lpvsResult.lpvsResultFileList[number].status; + if (status === 'PERMITTED') { + return { + backgroundColor: '#0000ff42', + borderColor: '#0000ff' + }; + } else if (status === 'PROHIBITED') { + return { + backgroundColor: '#ff000054', + borderColor: '#ff0000' + }; + } else if (status === 'RESTRICTED') { + return { + backgroundColor: '#842b2b54', + borderColor: '#8b0000' + }; + } else { + return { + backgroundColor: '#D9D9D9', + borderColor: '#000000' + }; + } + } else { + return { + backgroundColor: '#D9D9D9', + borderColor: '#000000' + }; + } + }; + console.log(lpvsResult); + +// ===============================FontSetting============================================================== +const setFont = (number) => { + if (lpvsResult && lpvsResult.lpvsResultFileList && lpvsResult.lpvsResultFileList[number]) { + const status = lpvsResult.lpvsResultFileList[number].status; + if (status === 'PERMITTED') { + return { + color: '#0000ff' + }; + } else if (status === 'PROHIBITED') { + return { + color: '#ff0000' + }; + } else if (status === 'RESTRICTED') { + return { + color: '#8b0000' + }; + } else { + return { + color: '#000000' + }; + } + } else { + return { + color: '#000000' + }; + } +}; + +//===============================FontLocation============================================================== +const setFontAlign = (number) => { + if (lpvsResult && lpvsResult.lpvsResultFileList && lpvsResult.lpvsResultFileList[number]) { + const status = lpvsResult.lpvsResultFileList[number].status; + if (status === 'PERMITTED') { + return 'permitted'; + } else if (status === 'PROHIBITED') { + return 'prohibited'; + } else if (status === 'RESTRICTED') { + return 'restricted'; + } + else if (status === 'UNREVIEWED') { + return 'unreviewed'; + } else { + return 'nofile'; + } + } else { + return 'nofile'; + } +}; + +//===============================BottomButton============================================================== +const [pageCount,setPageCount] = useState(1); +const [currentPage, setCurrentPage] = useState(1); + + useEffect(()=> { + setPageCount(Math.ceil(lpvsResult?.count/5)) + }, [lpvsResult?.count, currentPage]); + + console.log(pageCount); + + const check_page_plus =()=> { + if(currentPage <= pageCount) { + console.log(currentPage) + return setCurrentPage(currentPage+5); + } + else { + return + } + } + + const check_page_minus =()=> { + if(currentPage <=1) { + return + } + else { + return setCurrentPage(currentPage-5); + } + } + + const trueOrFalse =(a)=> { + if(a <= pageCount) { + return true; + } + else { + return false; + } + } + +//===============================PageMove============================================================== + + const handlePageChange = (pageNumber) => { + navigate(`/result/${pull_request_id}?page=${pageNumber}`); + }; + + const [isResultEmpty, setIsResultEmpty] = useState(false); + console.log(lpvsResult?.lpvsResultFileList?.length) + useEffect(() => { + if (lpvsResult?.lpvsResultFileList?.length === 0) { + setIsResultEmpty(true); + } else { + setIsResultEmpty(false); + } + }, [lpvsResult, page]); + + //==================================ScanDateFromat======================================================== + function formatDate(dateStr) { + const dateObj = new Date(dateStr); + const year = dateObj.getFullYear(); + const month = String(dateObj.getMonth() + 1).padStart(2, '0'); + const day = String(dateObj.getDate()).padStart(2, '0'); + const hours = String(dateObj.getHours()).padStart(2, '0'); + const minutes = String(dateObj.getMinutes()).padStart(2, '0'); + const seconds = String(dateObj.getSeconds()).padStart(2, '0'); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; +} + +//===============================LicenseCounting============================================================== +const licenseCount = () => { + let count = (lpvsResult?.licenseCountMap?.MIT || 0) + + (lpvsResult?.licenseCountMap['Apache-2.0'] || 0) + + (lpvsResult?.licenseCountMap['GPL-3.0-only'] || 0) + + (lpvsResult?.licenseCountMap.OpenSSL || 0) + + (lpvsResult?.licenseCountMap['GPL-2.0-or-later'] || 0); + return count; +} + +//===============================PieChart============================================================== + const COLORS = ['#A31F34', '#7F237D', '#000000', '#73C541', '007C31', '#F28300']; + const data = [ + { name: "MIT", value: lpvsResult?.licenseCountMap?.MIT }, + { name: "Apache 2.0", value: lpvsResult?.licenseCountMap['Apache-2.0'] }, + { name: "GNU GP", value: lpvsResult?.licenseCountMap['GPL-3.0-only'] }, + { name: "Open SSL", value: lpvsResult?.licenseCountMap.OpenSSL }, + { name: "GNU LG", value: lpvsResult?.licenseCountMap['GPL-2.0-or-later'] }, + { name: "Unsupported License", value: lpvsResult?.count - licenseCount()} + ]; + +//===============================PieChart============================================================== + function truncateName(name) { + if (/[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/g.test(name)) { + return name.length > 3 ? `${name.substring(0, 3)}.` : name; + } else { + return name.length > 5 ? `${name.substring(0, 5)}.` : name; + } + } + + return ( +
+
+
+
+
+ Arrow { + if (page > 4) { + check_page_minus(); + handlePageChange(currentPage -2); + }}} style={{ cursor: "pointer" }} /> + {trueOrFalse(currentPage) &&
handlePageChange(currentPage-1)}>{currentPage}
} + {trueOrFalse(currentPage+1) &&
handlePageChange(currentPage)}>{currentPage+1}
} + {trueOrFalse(currentPage+2) &&
handlePageChange(currentPage+1)}>{currentPage+2}
} + {trueOrFalse(currentPage+3) &&
handlePageChange(currentPage+2)}>{currentPage+3}
} + {trueOrFalse(currentPage+4) &&
handlePageChange(currentPage+3)}>{currentPage+4}
} + {trueOrFalse(currentPage+5) ? Img {check_page_plus(); handlePageChange(currentPage + 4);}} style={{ cursor: "pointer" }}/> + : + } +
+
+
+
+
+ Detected file list +
+
Component
+
+
+
+ {lpvsResult?.lpvsResultFileList[4]?.licenseSpdx == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[4]?.licenseSpdx + )} +
+
+ {lpvsResult?.lpvsResultFileList[3]?.licenseSpdx == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[3]?.licenseSpdx + )} +
+
+ {lpvsResult?.lpvsResultFileList[2]?.licenseSpdx == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[2]?.licenseSpdx + )} +
+
+ {lpvsResult?.lpvsResultFileList[1]?.licenseSpdx == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[1]?.licenseSpdx + )} +
+
+ {lpvsResult?.lpvsResultFileList[0]?.licenseSpdx == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[0]?.licenseSpdx + )} +
+
Detected Licenses
+
+
+
Match Value
+
+ {lpvsResult?.lpvsResultFileList[4]?.matchValue == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[4]?.matchValue + )} +
+
+ {lpvsResult?.lpvsResultFileList[3]?.matchValue == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[3]?.matchValue + )} +
+
+ {lpvsResult?.lpvsResultFileList[2]?.matchValue == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[2]?.matchValue + )} +
+
+ {lpvsResult?.lpvsResultFileList[1]?.matchValue == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[1]?.matchValue + )} +
+
+ {lpvsResult?.lpvsResultFileList[0]?.matchValue == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[0]?.matchValue + )} +
+
+
+
+
= 11 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[4]?.matchLine == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[4]?.matchLine + )} +
+
+
+
= 11 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[3]?.matchLine == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[3]?.matchLine + )} +
+
+
+
= 11 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[2]?.matchLine == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[2]?.matchLine + )} +
+
+
+
= 11 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[1]?.matchLine == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[1]?.matchLine + )} +
+
+
+
= 11 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[0]?.matchLine == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[0]?.matchLine + )} +
+
+
Match Line
+
+
+
+
= 28 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[4]?.path == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[4]?.path + )} +
+
+
+
= 28 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[3]?.path == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[3]?.path + )} +
+
+
+
= 28 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[2]?.path == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[2]?.path + )} +
+
+
+
= 28 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[1]?.path == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[1]?.path + )} +
+
+
+
= 28 ? 'long' : 'short'}`}> + {lpvsResult?.lpvsResultFileList[0]?.path == null ? ( + "NULL" + ) : ( + lpvsResult?.lpvsResultFileList[0]?.path + )} +
+
+
Path
+
+
+
+
+
+ {lpvsResult?.lpvsResultFileList[4] != undefined && lpvsResult?.lpvsResultFileList[4]?.status != null ? ( + lpvsResult?.lpvsResultFileList[4]?.status + ) : ( + <>No File + )} +
+
+
+
+
+
+ {lpvsResult?.lpvsResultFileList[3] != undefined && lpvsResult?.lpvsResultFileList[3]?.status != null ? ( + lpvsResult?.lpvsResultFileList[3]?.status + ) : ( + <>No File + )} +
+
+
+
+
+
+
+ {lpvsResult?.lpvsResultFileList[2] != undefined && lpvsResult?.lpvsResultFileList[2]?.status != null ? ( + lpvsResult?.lpvsResultFileList[2]?.status + ) : ( + <>No File + )} +
+
+
+
+
+
+
+ {lpvsResult?.lpvsResultFileList[1] != undefined && lpvsResult?.lpvsResultFileList[1]?.status != null ? ( + lpvsResult?.lpvsResultFileList[1]?.status + ) : ( + <>No File + )} +
+
+
+
+
+
+
+ {lpvsResult?.lpvsResultFileList[0] != undefined && lpvsResult?.lpvsResultFileList[0]?.status != null ? ( + lpvsResult?.lpvsResultFileList[0]?.status + ) : ( + <>No File + )} +
+
+
+
+
Status
+
+ List line + {lpvsResult?.lpvsResultFileList[4] != undefined && lpvsResult?.lpvsResultFileList[4]?.componentFileUrl != null ? (Component{window.open(lpvsResult?.lpvsResultFileList[4].componentFileUrl)}} /> + ) : ( + null + )} + {lpvsResult?.lpvsResultFileList[3] != undefined && lpvsResult?.lpvsResultFileList[3]?.componentFileUrl != null ? (Component{window.open(lpvsResult?.lpvsResultFileList[3].componentFileUrl)}} /> + ) : ( + null + )} + {lpvsResult?.lpvsResultFileList[2] != undefined && lpvsResult?.lpvsResultFileList[2]?.componentFileUrl != null ? (Component{window.open(lpvsResult?.lpvsResultFileList[2].componentFileUrl)}} /> + ) : ( + null + )} + {lpvsResult?.lpvsResultFileList[1] != undefined && lpvsResult?.lpvsResultFileList[1]?.componentFileUrl != null ? (Component{window.open(lpvsResult?.lpvsResultFileList[1].componentFileUrl)}} /> + ) : ( + null + )} + {lpvsResult?.lpvsResultFileList[0] != undefined && lpvsResult?.lpvsResultFileList[0]?.componentFileUrl != null ? (Component{window.open(lpvsResult?.lpvsResultFileList[0].componentFileUrl)}} /> + ) : ( + null + )} +
+
Detected file list
+
+
+
+
+ {lpvsResult?.count === 0 ? ( +
No License Detected
+ ) : ( + + + { + data.map((entry, index) => + ) + } + + + + )} +
+ Pie chart line +
Detected License ({lpvsResult?.count})
+
+ {Object.entries(lpvsResult?.licenseCountMap || {}).map(([license, count]) => { + const cleanLicenseName = license.replace(/[^a-zA-Z]/g, ''); + if ( cleanLicenseName == 'MIT' || cleanLicenseName == 'Apache' || cleanLicenseName == 'GPLorlater' || cleanLicenseName == 'GPLonly' || cleanLicenseName == 'OpenSSL' ) + return ( +
+
{license}
+
+
+ ); + else return null; + })} +
+
Unsupported Licenses
+
+
+
+
+
+
+

+ Scan Date: + + {" "} + {formatDate(lpvsResult?.lpvsResultInfo.scanDate)} +
+
+

+

+ Detected Licenses: + {lpvsResult?.lpvsResultInfo?.detectedLicenses?.length === 0 ? ( + No License Detected + ) : ( + + {lpvsResult?.lpvsResultInfo?.detectedLicenses?.map((license, index) => ( + + {license} + {index !== lpvsResult.lpvsResultInfo.detectedLicenses.length - 1 && ', '} + + ))} + + )} +

+
+ Info line +
Info
+
+
+
{lpvsResult?.lpvsResultInfo?.repositoryName} +
+
+
+ {lpvsResult?.hasIssue + ?
Issue Detected
+ :
Scan Complete
} +
+ {lpvsResult?.hasIssue + ?
+ :
} +
+
+
+
{lpvsResult?.pullNumber}
+
+
+
+
+
+
+
+
+
+
+
+ Image +
{username?.name ? ( +
{truncateName(username.name)}
+ ) : ( +
Loading...
+ )} + +
+
+
+
+
History
+
+ + img + +
+
+
+ ); +}; + +export default Result; diff --git a/src/main/java/com/lpvs/controller/LPVSWebController.java b/src/main/java/com/lpvs/controller/LPVSWebController.java index 72f2df60..6f7226b7 100644 --- a/src/main/java/com/lpvs/controller/LPVSWebController.java +++ b/src/main/java/com/lpvs/controller/LPVSWebController.java @@ -124,6 +124,66 @@ public HistoryEntity newHistoryPageByUser(@PathVariable("type") String type, HistoryEntity historyEntity = new HistoryEntity(lpvsHistories, count); return historyEntity; } + + @ResponseBody + @GetMapping("/result/{prId}") + public LPVSResult resultPage(@PathVariable("prId") Long prId, @PageableDefault(size = 5, sort = "id", + direction = Sort.Direction.ASC) Pageable pageable, Authentication authentication) { + + lpvsLoginCheckService.loginVerification(authentication); + //LPVSMember findMember = lpvsLoginCheckService.getMemberFromMemberMap(authentication); + + LPVSPullRequest pr = lpvsPullRequestRepository.findById(prId).get(); + List distinctByLicense = detectedLicenseRepository.findDistinctByLicense(pr); + List detectedLicenses = new ArrayList<>(); + Map licenseCountMap = new HashMap<>(); + + List allSpdxId = licenseRepository.takeAllSpdxId(); + for (String spdxId : allSpdxId) { + licenseCountMap.put(spdxId, 0); + } + for (LPVSLicense lpvsLicense : distinctByLicense) { + detectedLicenses.add(lpvsLicense.getSpdxId()); + } + + LPVSResultInfo lpvsResultInfo = new LPVSResultInfo(pr.getId(), pr.getDate(), pr.getRepositoryName(), + pr.getStatus(), detectedLicenses); + + Page dlPage = detectedLicenseRepository.findByPullRequest(pr, pageable); + List dlList = detectedLicenseRepository.findByPullRequest(pr); + List lpvsResultFileList = new ArrayList<>(); + Boolean hasIssue = detectedLicenseRepository.existsIssue(pr); + + String licenseSpdxId; + String status; + for (LPVSDetectedLicense dl : dlPage) { + if (dl.getLicense() == null) { + licenseSpdxId = null; + status = null; + } else { + licenseSpdxId = dl.getLicense().getSpdxId(); + status = dl.getLicense().getAccess(); + } + lpvsResultFileList.add(new LPVSResultFile(dl.getId(), dl.getFilePath(), + dl.getComponentFileUrl(), dl.getLines(), dl.getMatch(), + status, licenseSpdxId)); + } + + for (LPVSDetectedLicense dl : dlList) { + if (dl.getLicense() != null) { + licenseSpdxId = dl.getLicense().getSpdxId(); + licenseCountMap.put(licenseSpdxId, + licenseCountMap.get(licenseSpdxId) + 1); + } + } + + Long count = detectedLicenseRepository.CountByDetectedLicenseWherePullRequestId(pr); + String[] tempPullNumber = pr.getPullRequestUrl().split("/"); + LPVSResult lpvsResult = new LPVSResult(lpvsResultFileList, lpvsResultInfo, count, licenseCountMap, + tempPullNumber[tempPullNumber.length-2] + '/' + + tempPullNumber[tempPullNumber.length-1], hasIssue); + return lpvsResult; + } } @GetMapping("/error") diff --git a/src/main/java/com/lpvs/repository/LPVSDetectedLicenseRepository.java b/src/main/java/com/lpvs/repository/LPVSDetectedLicenseRepository.java index da713c58..2a9967c4 100644 --- a/src/main/java/com/lpvs/repository/LPVSDetectedLicenseRepository.java +++ b/src/main/java/com/lpvs/repository/LPVSDetectedLicenseRepository.java @@ -29,4 +29,8 @@ public interface LPVSDetectedLicenseRepository extends JpaRepository findDistinctByLicense(@Param("pr") LPVSPullRequest pr); + + } diff --git a/src/main/java/com/lpvs/repository/LPVSLicenseRepository.java b/src/main/java/com/lpvs/repository/LPVSLicenseRepository.java index 6f0680aa..4eab8264 100644 --- a/src/main/java/com/lpvs/repository/LPVSLicenseRepository.java +++ b/src/main/java/com/lpvs/repository/LPVSLicenseRepository.java @@ -27,4 +27,7 @@ public interface LPVSLicenseRepository extends CrudRepository @Query(value = "SELECT * FROM licenses WHERE licenses.license_alternative_names LIKE %:licenseName% ORDER BY id DESC LIMIT 1", nativeQuery = true) LPVSLicense searchByAlternativeLicenseNames(@Param("licenseName") String licenseName); + @Query(value = "select licenses.spdxId from LPVSLicense licenses") + List takeAllSpdxId(); + }