mirror of
https://github.com/S2-/gitlit
synced 2025-08-02 12:20:05 +02:00
show current repo
This commit is contained in:
@@ -22,9 +22,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="js-container">
|
||||
<div class="alert alert-primary" role="alert">
|
||||
Getting file list...
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/index.js"></script>
|
||||
</body>
|
||||
|
@@ -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);
|
||||
|
@@ -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>
|
||||
|
@@ -9,7 +9,7 @@ const args = require('minimist')(process.defaultApp ? process.argv.slice(2) : pr
|
||||
}
|
||||
});
|
||||
|
||||
const repoDir = args._.join(' ');
|
||||
const repoDir = path.normalize(args._.join(' '));
|
||||
|
||||
function getLfsFileList(dir, cb) {
|
||||
exec('git lfs ls-files', {
|
||||
@@ -98,7 +98,7 @@ function createWindow() {
|
||||
});
|
||||
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
console.log('getting file list and lock status in ' + repoDir + '...');
|
||||
win.webContents.send('repoDir', repoDir);
|
||||
|
||||
getLfsFileList(repoDir, (err, files) => {
|
||||
if (err) {
|
||||
|
Reference in New Issue
Block a user