1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00

show current repo

This commit is contained in:
s2
2018-05-19 22:31:13 +02:00
parent b039540e9f
commit bc5a494918
4 changed files with 17 additions and 7 deletions

View File

@@ -9,15 +9,19 @@
//events
ipcRenderer.on('fileList', (event, files) => {
if (files && files.length > 0) {
$('.js-container').html(gitlit.templates.main({files: files}));
$('.files-table-container').html(gitlit.templates.files({files: files}));
sorttable.makeSortable($('.js-filestable')[0]);
var myTH = document.getElementsByTagName("th")[0];
sorttable.innerSortFunction.apply(myTH, []);
} else {
$('.js-container').html(gitlit.templates.noGitLfsFiles());
$('.files-table-container').html(gitlit.templates.noGitLfsFiles());
}
});
ipcRenderer.on('repoDir', (event, repoDir) => {
$('.js-repo-dir').text('current repo dir: ' + repoDir).show();
});
ipcRenderer.on('isNoGitLfsRepo', (event, repoDir) => {
$('.js-container').html(gitlit.templates.isNoGitLfsRepo({repoDir: repoDir}));
});
@@ -84,5 +88,6 @@
//startup
PNotify.defaults.styling = 'bootstrap4'; // Bootstrap version 4
$('.js-container').html(gitlit.templates.main());
})(jQuery);

View File

@@ -1,6 +1,14 @@
window.gitlit = window.gitlit || {};
gitlit.templates = {
main: ejs.compile(`
<div class="alert alert-success js-repo-dir" style="display:none;"></div>
<div class="files-table-container">
<div class="alert alert-primary" role="alert">
Getting file list...
</div>
</div>
`),
files: ejs.compile(`
<table class="table table-striped sortable js-filestable">
<tr>
<th>file</th>