From 7a6c320ddf10b9c525fddadc2c3b988dcf764e32 Mon Sep 17 00:00:00 2001 From: s2 Date: Fri, 18 May 2018 17:07:13 +0200 Subject: [PATCH] no notification if everything is allright --- app/css/app.css | 3 +++ app/index.html | 3 +++ app/js/index.js | 4 ++++ app/js/templates.js | 2 +- app/main.js | 5 ++--- 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 app/css/app.css diff --git a/app/css/app.css b/app/css/app.css new file mode 100644 index 00000000..56386c67 --- /dev/null +++ b/app/css/app.css @@ -0,0 +1,3 @@ +.js-container { + margin: 5px; +} diff --git a/app/index.html b/app/index.html index 14571a28..7d6fa15c 100644 --- a/app/index.html +++ b/app/index.html @@ -4,7 +4,9 @@ gitlit + + @@ -16,6 +18,7 @@ +
diff --git a/app/js/index.js b/app/js/index.js index 3e0733cf..280e8556 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -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); } }); diff --git a/app/js/templates.js b/app/js/templates.js index 68e60b1a..7a806999 100644 --- a/app/js/templates.js +++ b/app/js/templates.js @@ -33,7 +33,7 @@ gitlit.templates = { -
+
Refresh diff --git a/app/main.js b/app/main.js index 7e087d66..f373f90e 100644 --- a/app/main.js +++ b/app/main.js @@ -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' }; }