Skip to content

Commit

Permalink
hints + git key fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyplay authored and olegklimov committed Sep 22, 2023
1 parent 9cf9f65 commit 2516075
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion self_hosting_machinery/webgui/static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function plugins_to_top_nav_bar(plugins)
const target_tab = tab_button.dataset.tab;

tab_buttons.forEach(btn => {
btn.classList.remove('main-active');
btn.classList.remove('main-active');
});

tab_panes.forEach(pane => {
Expand Down
1 change: 1 addition & 0 deletions self_hosting_machinery/webgui/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ h3 {
}
.sources-buttons {
display: flex;
align-items: center;
}
.sources-buttons .btn:not(:last-child) {
margin-right: 5px;
Expand Down
19 changes: 14 additions & 5 deletions self_hosting_machinery/webgui/static/tab-upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ <h3>Code and Text Sources</h3>
</tbody>
</table>
<div class="sources-buttons">
<button id="upload-tab-git-button" data-bs-toggle="modal" data-bs-target="#upload-tab-git-modal"
type="button" class="btn btn-primary btn-lg">Add git repo&mldr;</button>
<button id="upload-tab-file-button" data-bs-toggle="modal" data-bs-target="#upload-tab-files-modal"
type="button" class="btn btn-primary">Upload files</button>
type="button" class="btn btn-primary">Upload files&mldr;</button>
<button id="upload-tab-url-button" data-bs-toggle="modal" data-bs-target="#upload-tab-url-modal"
type="button" class="btn btn-primary">Add file from URL</button>
<button id="upload-tab-git-button" data-bs-toggle="modal" data-bs-target="#upload-tab-git-modal"
type="button" class="btn btn-primary">Add git repo...</button>
type="button" class="btn btn-primary">Add file from URL&mldr;</button>
<button id="tab_files_process_now" type="button" class="btn btn-success tab-files-process-now">Scan
sources</button>
</div>
Expand Down Expand Up @@ -88,6 +88,9 @@ <h5 class="modal-title" id="uploadModalLabel">Upload File</h5>
<div class="mb-3">
<input type="file" id="tab-upload-file-input" class="form-control">
</div>
<div class="mb-3 form-text ssh-info">
You can upload .zip, .tar.gz, .tar.bz2 archives, or an individual file such as "my_program.py".
</div>
<div class="progress d-none">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Expand Down Expand Up @@ -137,7 +140,13 @@ <h5 class="modal-title" id="gitModalLabel">Add Git Repository</h5>
class="form-control">
</div>
<div class="mb-3 form-text ssh-info">
Please <span class="ssh-link main-tab-button fake-link" data-tab="settings">add SSH Key</span> if you use private repository.
For public repositories, a https link works best:
<code>https://github.com/my_company/my_repo</code>
</div>
<div class="mb-3 form-text ssh-info">
For private repositories, <span class="ssh-link main-tab-button fake-link" data-tab="settings">add SSH Key</span> and add a link like this:
<code>[email protected]:my_company/my_repo.git</code>
<code>[email protected]:smallcloudai/refact.git</code>
</div>
<div class="mb-3 ssh-selector d-none">
<label class="form-label">SSH Key</label>
Expand Down
7 changes: 7 additions & 0 deletions self_hosting_machinery/webgui/static/tab-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,14 @@ export async function init() {
event.preventDefault()
const ssh_modal = bootstrap.Modal.getOrCreateInstance(document.getElementById('upload-tab-git-modal'));
ssh_modal.hide();

document.querySelector('#upload').classList.remove('main-active');
document.querySelector('#settings').classList.add('main-active');
document.querySelectorAll('.nav-link').forEach(function(link) {
link.classList.remove('main-active');
});
});

let delete_modal_button = document.querySelector('.delete-modal-submit');
delete_modal_button.addEventListener('click', function() {
if(this.dataset.file && this.dataset.file !== '') {
Expand Down

0 comments on commit 2516075

Please sign in to comment.