mirror of
https://github.com/S2-/gitlit
synced 2025-08-02 12:20:05 +02:00
show splash screen on startup if passed path is not a git repo
This commit is contained in:
@@ -4,8 +4,11 @@
|
||||
const electronFind = require('electron-find');
|
||||
let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents());
|
||||
|
||||
let firstRun = true;
|
||||
|
||||
//events
|
||||
ipcRenderer.on('fileList', (event, files) => {
|
||||
firstRun = false;
|
||||
if (files && files.length > 0) {
|
||||
ejs.preloadTemplate('templates/files.ejs')
|
||||
.then(t => {
|
||||
@@ -28,7 +31,12 @@
|
||||
});
|
||||
|
||||
ipcRenderer.on('isNoGitLfsRepo', (event, repoDir) => {
|
||||
$('.js-container').html(ejs.rr('templates/isNoGitLfsRepo.ejs', {repoDir: repoDir}));
|
||||
if (firstRun) {
|
||||
firstRun = false;
|
||||
$('.js-container').html(ejs.rr('templates/firstRun.ejs', {repoDir: repoDir}));
|
||||
} else {
|
||||
$('.js-container').html(ejs.rr('templates/isNoGitLfsRepo.ejs', {repoDir: repoDir}));
|
||||
}
|
||||
});
|
||||
|
||||
ipcRenderer.on('notification', (event, notification) => {
|
||||
|
8
app/templates/firstRun.ejs
Normal file
8
app/templates/firstRun.ejs
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="jumbotron text-center">
|
||||
<h1>gitlit</h1>
|
||||
<p class="lead">Handle git lfs locks with ease</p>
|
||||
<div class="text-center">
|
||||
<a class="btn btn-primary btn-lg js-open-folder" href="javascript:///">Open git repository folder</a>
|
||||
<input type="file" style="display: none" class="js-open-folder-input" webkitdirectory />
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user