-
Notifications
You must be signed in to change notification settings - Fork 18
Crest v1.4.1 code changes #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhruvilbhatt-crest
wants to merge
2
commits into
databrickslabs:master
Choose a base branch
from
dhruvilbhatt-crest:crest-v1.4.1-code-changes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
.cancel_button{ | ||
display: inline-block; | ||
padding: 4px 12px; | ||
margin-bottom: 0; | ||
border-radius: 100px; | ||
text-align: center; | ||
font-size: 17px; | ||
line-height: 16px; | ||
cursor: pointer; | ||
background-color: #00A36C; | ||
color: #fff; | ||
} | ||
|
||
.loading{ | ||
display: inline-block; | ||
padding: 4px 12px; | ||
margin-bottom: 0; | ||
border-radius: 100px; | ||
text-align: center; | ||
font-size: 17px; | ||
line-height: 16px; | ||
cursor: pointer; | ||
background-color: #0096FF; | ||
color: #fff; | ||
} | ||
|
||
.cancel_button_disabled{ | ||
display: inline-block; | ||
padding: 4px 12px; | ||
margin-bottom: 0; | ||
border-radius: 100px; | ||
text-align: center; | ||
font-size: 17px; | ||
line-height: 16px; | ||
cursor: pointer; | ||
background-color: grey; | ||
color: #fff; | ||
} | ||
|
||
.popup-container-for-no-cancelation { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.popup-content-for-no-cancelation { | ||
background-color: black; | ||
color: white; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); | ||
max-width: 80%; | ||
text-align: center; | ||
font-size: 18px; | ||
} | ||
|
||
.popup-container-for-successful-cancelation { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.popup-content-for-successful-cancelation { | ||
background-color: green; | ||
color: white; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); | ||
max-width: 80%; | ||
text-align: center; | ||
font-size: 18px; | ||
} | ||
|
||
.popup-container-for-err-in-cancelation { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.popup-content-for-err-in-cancelation { | ||
background-color: red; | ||
color: white; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); | ||
max-width: 80%; | ||
text-align: center; | ||
font-size: 18px; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,102 @@ | ||||||
require([ | ||||||
'underscore', | ||||||
'splunkjs/mvc', | ||||||
'splunkjs/mvc/tableview', | ||||||
'splunkjs/mvc/searchmanager', | ||||||
'splunkjs/mvc/simplexml/ready!' | ||||||
], function(_, mvc, TableView, SearchManager) { | ||||||
|
||||||
var runDetailsTable = mvc.Components.get("databricks_run_table"); | ||||||
var jobDetailsTable = mvc.Components.get("databricks_job_table"); | ||||||
customRenderer = TableView.BaseCellRenderer.extend({ | ||||||
canRender: function (cell) { | ||||||
return _(['Cancel Run']).contains(cell.field); | ||||||
}, | ||||||
render: function ($td, cell) { | ||||||
if(cell.field == "Cancel Run"){ | ||||||
let isCancelled = false; | ||||||
var run_details = cell.value; | ||||||
var array = run_details.split("||"); | ||||||
var run_ex_status = array[2]; | ||||||
|
||||||
if(run_ex_status !== "Running" && run_ex_status !== "Initiated" && run_ex_status !== "Pending"){ | ||||||
$td.html("<div class='ar_containter'><div class='cancel_button_disabled' value='Cancel'>Cancel Run</div></div>"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Typo in the CSS class name 'ar_containter'; consider correcting it to 'ar_container' for clarity.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
$td.on('click', function(event) { | ||||||
var popupContainer = document.createElement('div'); | ||||||
popupContainer.className = 'popup-container-for-no-cancelation'; | ||||||
var popupContent = document.createElement('div'); | ||||||
popupContent.className = 'popup-content-for-no-cancelation'; | ||||||
popupContent.innerHTML = 'This can not be canceled as Execution Status is not in Running, Pending or Initiated mode!'; | ||||||
popupContainer.appendChild(popupContent); | ||||||
document.body.appendChild(popupContainer); | ||||||
popupContainer.addEventListener('click', function() { | ||||||
document.body.removeChild(popupContainer); | ||||||
}); | ||||||
}); | ||||||
} | ||||||
else{ | ||||||
$td.html("<div class='ar_containter'><div class='cancel_button' value='Cancel'>Cancel Run</div></div>"); | ||||||
$td.on('click', function (event) { | ||||||
if (isCancelled){ | ||||||
return; | ||||||
} | ||||||
$td.html("<div class='ar_containter'><div class='loading' value='Loading'>Canceling..</div></div>"); | ||||||
var fields = {} | ||||||
fields['run_id'] = array[0] | ||||||
var ENDPOINT_URL = '/services/cancel_run' | ||||||
var service = mvc.createService({ owner: "nobody" }); | ||||||
fields['account_name'] = array[1] | ||||||
fields['uid'] = array[3] | ||||||
$td.css("pointer-events", "none"); | ||||||
|
||||||
service.post(ENDPOINT_URL, fields, function (err, response) { | ||||||
if (response != undefined && (response.data != null || response.data != undefined)) { | ||||||
canceled_response = response.data['canceled'] | ||||||
if (canceled_response == "Success"){ | ||||||
var popupContainer = document.createElement('div'); | ||||||
popupContainer.className = 'popup-container-for-successful-cancelation'; | ||||||
var popupContent = document.createElement('div'); | ||||||
popupContent.className = 'popup-content-for-successful-cancelation'; | ||||||
popupContent.innerHTML = 'Successfully Canceled the run! An updated event with canceled execution status will be ingested in Splunk in few minutes.'; | ||||||
popupContainer.appendChild(popupContent); | ||||||
document.body.appendChild(popupContainer); | ||||||
popupContainer.addEventListener('click', function() { | ||||||
document.body.removeChild(popupContainer); | ||||||
}); | ||||||
$td.html("<div class='ar_containter'><div class='cancel_button_disabled' value='Cancel'>Canceled</div></div>"); | ||||||
isCancelled = true; | ||||||
} | ||||||
} | ||||||
else { | ||||||
var popupContainer = document.createElement('div'); | ||||||
popupContainer.className = 'popup-container-for-err-in-cancelation'; | ||||||
var popupContent = document.createElement('div'); | ||||||
popupContent.className = 'popup-content-for-err-in-cancelation'; | ||||||
popupContent.innerHTML = 'Error while Canceling the run! Please try after sometime!'; | ||||||
popupContainer.appendChild(popupContent); | ||||||
document.body.appendChild(popupContainer); | ||||||
popupContainer.addEventListener('click', function() { | ||||||
document.body.removeChild(popupContainer); | ||||||
}); | ||||||
$td.html("<div class='ar_containter'><div class='cancel_button' value='Cancel'>Cancel Run</div></div>"); | ||||||
} | ||||||
$td.css("pointer-events", "auto"); | ||||||
}); | ||||||
}); | ||||||
} | ||||||
} | ||||||
} | ||||||
}); | ||||||
if (runDetailsTable !== undefined) { | ||||||
runDetailsTable.getVisualization(function (tableView) { | ||||||
tableView.table.addCellRenderer(new customRenderer()); | ||||||
tableView.table.render(); | ||||||
}); | ||||||
} | ||||||
if (jobDetailsTable !== undefined) { | ||||||
jobDetailsTable.getVisualization(function (tableView) { | ||||||
tableView.table.addCellRenderer(new customRenderer()); | ||||||
tableView.table.render(); | ||||||
}); | ||||||
} | ||||||
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#run_name_text.input.input-text::after { | ||
content: "Run Name to identify the run execution."; | ||
display: inline-block; | ||
color: black; | ||
margin-left: 5px; | ||
font-size: 12px; | ||
font-style: italic; | ||
} | ||
|
||
#path_text.input.input-text::after { | ||
content: "[Required] Absolute path of notebook to be run in Databricks. eg: /Users/user_1/notebook_1"; | ||
display: inline-block; | ||
color: black; | ||
margin-left: 5px; | ||
font-size: 12px; | ||
font-style: italic; | ||
} | ||
|
||
#revision_timestamp_text.input.input-text::after { | ||
content: "The timestamp of the revision of the notebook."; | ||
display: inline-block; | ||
color: black; | ||
margin-left: 5px; | ||
font-size: 12px; | ||
font-style: italic; | ||
} | ||
|
||
#params_text.input.input-text::after { | ||
content: "Parameters to pass while executing the notebook. eg: key1=value1||key2=value2"; | ||
display: inline-block; | ||
color: black; | ||
margin-left: 5px; | ||
font-size: 12px; | ||
font-style: italic; | ||
} | ||
|
||
#cluster_text.input.input-text::after { | ||
content: "Name of Databricks cluster to use for execution."; | ||
display: inline-block; | ||
color: black; | ||
margin-left: 5px; | ||
font-size: 12px; | ||
font-style: italic; | ||
} | ||
|
||
#acct_dropdown.input.input-dropdown::after { | ||
content: "[Required] Name of Databricks Account to use for execution."; | ||
display: inline-block; | ||
color: black; | ||
margin-left: 5px; | ||
font-size: 12px; | ||
font-style: italic; | ||
} | ||
|
||
#auto_fwd.input.input-dropdown::after { | ||
content: "Whether to directly redirect to Databricks portal."; | ||
display: inline-block; | ||
color: black; | ||
margin-left: 5px; | ||
font-size: 12px; | ||
font-style: italic; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare 'customRenderer' using var, let, or const to avoid polluting the global namespace.
Copilot uses AI. Check for mistakes.