Skip to content

Commit

Permalink
version 0.90.1 added
Browse files Browse the repository at this point in the history
  • Loading branch information
Arifkarakilic committed Oct 19, 2023
1 parent c21f051 commit ee060a3
Show file tree
Hide file tree
Showing 26 changed files with 4,791 additions and 658 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
.vscode-test/
*.vsix
.vscode/settings.json
codethreat.json


# Node.js artifacts
Expand Down
Empty file added CHANGELOG.md
Empty file.
2 changes: 0 additions & 2 deletions media/assets/arrow-2-circlepath-black.svg

This file was deleted.

9 changes: 0 additions & 9 deletions media/assets/arrow-2-circlepath-white.svg

This file was deleted.

3 changes: 3 additions & 0 deletions media/assets/readMore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions media/css/detailPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
.panel {
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
background-color: #2b2b2b;
box-shadow: 0px 2px 5px rgba(0,0,0,0.1);
color: #ffdd57;

}

.panel-header {
font-size: 12px;
margin-bottom: 10px;
}

.panel-content {
font-size: 11px;
}
.panel-content h1, .panel-content h2, .panel-content h3 {
color: #ffdd57;
}

.panel-content a {
color: #1e90ff;
text-decoration: underline;
}

.panel-content ul {
list-style-type: disc;
list-style-position: inside;
}

.panel-content li {
color: #eaeaea;
}

.panel-content code {
background-color: #333333;
padding: 2px 4px;
border-radius: 4px;
color: #f1c40f;
}

.panel-content pre {
background-color: #333333;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}

.panel-content blockquote {
border-left: 3px solid #ffdd57;
padding-left: 10px;
color: #ddd;
}
.label {
margin-right: 3px;
padding: 5px 7px;
font-size: 10px;
font-family: inherit;
}
.badge{
background-color: #2C74B3 !important;
color: white;
}
.detail-group {
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 0;
margin-top: 1rem;
}

.detail-icon {
width: 20px;
height: 20px;
color: rgb(136, 0, 0);
fill: white;
margin-right: 4px;
}
#kbfields-title{
font-size: large;
font-weight: bolder;
}
27 changes: 12 additions & 15 deletions media/css/main.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
:root {
--vscode-dark-bg: #1e1e1e; /* Dark background color similar to VSCode */
--vscode-dark-fg: #d4d4d4; /* Foreground/text color for dark theme */
--vscode-link-color: #569cd6; /* Typical VSCode link color */
--vscode-dark-bg: #1e1e1e;
--vscode-dark-fg: #d4d4d4;
--vscode-link-color: #569cd6;
}
body {
background-color: var(--vscode-dark-bg);
color: var(--vscode-dark-fg);
font-size: 0.7rem;
}
button {
white-space: nowrap; /* Prevents text wrapping inside the button */
overflow: hidden; /* Ensures any overflow is hidden */
text-overflow: ellipsis; /* If text overflows, it will be truncated with an ellipsis */
min-width: 150px; /* Sets a minimum width for the button */
white-space: nowrap;
text-overflow: ellipsis;
min-width: 150px;
}

@media (max-width: 576px) {
Expand All @@ -22,7 +21,6 @@ button {
}
}

/* Make the main content take full height and use flex to position the footer at the bottom */
.full-height-flex {
display: flex;
flex-direction: column;
Expand All @@ -33,10 +31,9 @@ min-height: 100vh;
flex: 1;
}

/* Styling for the footer */
.footer {
font-size: 0.85rem; /* Reduced font size */
margin-top: 1rem; /* Space above the footer */
font-size: 0.85rem;
margin-top: 1rem;
}
h4,
h5,
Expand Down Expand Up @@ -66,9 +63,9 @@ a:focus {
156,
214,
0.8
); /* Slightly lighter version of --vscode-link-color */
);
}
#scan-button {
#buttons {
display: block;
border: none;
margin: 0 auto;
Expand All @@ -83,7 +80,7 @@ a:focus {
max-width: 320px;
margin-top: 20px;
}
#scan-button:hover {
#buttons:hover {
background-color: gainsboro;
opacity: 0.75;
}
Expand All @@ -105,4 +102,4 @@ a:focus {
#settings:hover {
background-color: gainsboro;
opacity: 0.75;
}
}
55 changes: 55 additions & 0 deletions media/css/questionPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.panel {
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
background-color: #2b2b2b;
box-shadow: 0px 2px 5px rgba(0,0,0,0.1);
color: #ffdd57;

}

.panel-header {
font-size: 12px;
margin-bottom: 10px;
}

.panel-content {
font-size: 11px;
}
.panel-content h1, .panel-content h2, .panel-content h3 {
color: #ffdd57;
}

.panel-content a {
color: #1e90ff;
text-decoration: underline;
}

.panel-content ul {
list-style-type: disc;
list-style-position: inside;
}

.panel-content li {
color: #eaeaea;
}

.panel-content code {
background-color: #333333;
padding: 2px 4px;
border-radius: 4px;
color: #f1c40f;
}

.panel-content pre {
background-color: #333333;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}

.panel-content blockquote {
border-left: 3px solid #ffdd57;
padding-left: 10px;
color: #ddd;
}
14 changes: 5 additions & 9 deletions media/js/ask.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,28 @@ function renderMarkdown(markdownContent, targetElement) {
}

function showTab(tabId) {
// Hide all tabs
const tabs = document.querySelectorAll(".tab-content");
tabs.forEach((tab) => tab.classList.remove("active"));

// Deactivate all tab buttons
const tabButtons = document.querySelectorAll(".tab-button");
tabButtons.forEach((button) => button.classList.remove("active"));

// Show the selected tab and activate the button
document.getElementById(tabId).classList.add("active");
document
.querySelector(`.tab-button[onclick="showTab('${tabId}')"]`)
.classList.add("active");
}

window.addEventListener("message", (event) => {
const message = event.data; // The JSON data our extension sent
const message = event.data;

switch (message.command) {
case "aiJobResponse":
console.log(message)
const panels = document.querySelectorAll(".panel-content");
renderMarkdown(message.data.example_exploit_request_or_methods, panels[0]);
renderMarkdown(message.data.human_readable_flow_graph_and_explaination, panels[1]);
renderMarkdown(message.data.optimal_fix_remediation, panels[2]);
message = JSON.parse(message.data);
renderMarkdown(message.example_exploit_request_or_methods, panels[0]);
renderMarkdown(message.human_readable_flow_graph_and_explaination, panels[1]);
renderMarkdown(message.optimal_fix_remediation, panels[2]);
break;
// ... handle other commands
}
});
36 changes: 36 additions & 0 deletions media/js/detail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const goPage = document.getElementById("buttons");
const vscode = acquireVsCodeApi();


(function () {
window.addEventListener("message", (event) => {
const message = event.data;
switch (message.command) {
case "ctgetDetail":
const responseData = message.data;
handleCtgetDetail(responseData);
break;
case "getTitle":
document.querySelector("#kbfields-title").innerHTML = message.data;
break;
case "getLabels":
let labelselement = document.querySelector(".labels");
labelselement.innerHTML = '';
message.data.forEach(label => {
let el = document.createElement("span");
el.className = "label badge";
el.innerText = label;
labelselement.append(el);
});
break;
case "gopage":
document.getElementById("readMoreLink").href = message.data;
break;
}
});
function handleCtgetDetail(data) {
document.querySelector("#description-content").innerHTML = data.description;
document.querySelector("#mitigation-content").innerHTML = data.mitigation;

}
})();
23 changes: 9 additions & 14 deletions media/js/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Inside the script tag in your HTML
const scanButton = document.getElementById("scan-button");
const scanButton = document.getElementById("buttons");
const vscode = acquireVsCodeApi();

scanButton.addEventListener("click", () => {
// Disable the button and change its style on click
scanButton.disabled = true;
scanButton.style.opacity = "0.5"; // Makes the button look disabled
scanButton.textContent = "Syncing..."; // Change the text to indicate it's syncing
scanButton.style.opacity = "0.5";
scanButton.textContent = "Syncing...";

vscode.postMessage({ command: "startScan" });
});
Expand All @@ -17,35 +16,31 @@ scanButton.addEventListener("click", () => {
switch (message.command) {
case "ctSyncActive":
const responseData = message.data;
console.log("ct sync active notification" + responseData);
handleCtSyncActiveResponse(responseData);
break;
case "scanFinished":
// Re-enable the button and reset its style once scan is finished
scanButton.disabled = false;
scanButton.style.opacity = "1"; // Reset the button's opacity
scanButton.textContent = "Syncronize"; // Reset the button's text
scanButton.style.opacity = "1";
scanButton.textContent = "Syncronize";
break;
default:
break;
// ... handle other commands
}
});
function handleCtSyncActiveResponse(data) {
const badgeElement = document.querySelector(".badge");
const projectNameElement = document.getElementById("projectName");
const scanStatusElement = document.getElementById("scanStatus");

if (data) {
badgeElement.textContent = "Active"; // This sets the badge to "Active"
badgeElement.textContent = "Active";
badgeElement.classList.remove("badge-danger");
badgeElement.classList.add("badge-success");

projectNameElement.textContent = data.project_name; // This sets the project name
projectNameElement.textContent = data.project_name;


} else {
badgeElement.textContent = "Disabled"; // This sets the badge to "Disabled"
badgeElement.textContent = "Disabled";
badgeElement.classList.remove("badge-success");
badgeElement.classList.add("badge-danger");
}
Expand Down
3,713 changes: 3,712 additions & 1 deletion media/js/showdown.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit ee060a3

Please sign in to comment.