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

no notification if everything is allright

This commit is contained in:
s2
2018-05-18 17:07:13 +02:00
parent 0a2e639e1c
commit 7a6c320ddf
5 changed files with 13 additions and 4 deletions

3
app/css/app.css Normal file
View File

@@ -0,0 +1,3 @@
.js-container {
margin: 5px;
}

View File

@@ -4,7 +4,9 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>gitlit</title>
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
@@ -16,6 +18,7 @@
<script src="js/index.js"></script>
<link href="node_modules/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet">
</head>
<body>
<div class="js-container">

View File

@@ -27,10 +27,14 @@
if (notification.event && notification.event === 'unlock') {
$('[data-file="' + notification.file + '"].js-unlock').hide();
$('[data-file="' + notification.file + '"].js-lock').show();
let text = 'not locked';
$('[data-file="' + notification.file + '"]').parent().prev().text(text);
}
if (notification.event && notification.event === 'lock') {
$('[data-file="' + notification.file + '"].js-lock').hide();
$('[data-file="' + notification.file + '"].js-unlock').show();
let text = notification.data.owner.name + ' (id: ' + notification.data.id + ')';
$('[data-file="' + notification.file + '"]').parent().prev().text(text);
}
});

View File

@@ -33,7 +33,7 @@ gitlit.templates = {
</table>
<div>
<div class="float-right">
<a class="btn btn-secondary js-refresh" href="javascript:///">
Refresh
</a>

View File

@@ -142,7 +142,6 @@ ipcMain.on('unlock', (event, file) => {
notification = {
file: file,
event: 'unlock',
message: stdout,
type: 'info'
};
}
@@ -152,7 +151,7 @@ ipcMain.on('unlock', (event, file) => {
});
ipcMain.on('lock', (event, file) => {
exec('git lfs lock "' + file + '"', {
exec('git lfs lock --json "' + file + '"', {
cwd: repoDir
},
(error, stdout, stderr) => {
@@ -165,7 +164,7 @@ ipcMain.on('lock', (event, file) => {
notification = {
file: file,
event: 'lock',
message: stdout,
data: JSON.parse(stdout),
type: 'info'
};
}