File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed
Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " exorcist" ,
3- "version" : " 0.0.5 " ,
3+ "version" : " 0.1.0 " ,
44 "description" : " Got rogue daemons in your system?" ,
55 "main" : " src/index.js" ,
66 "scripts" : {
5050 },
5151 "build" : {
5252 "appId" : " io.debs.code.exorcist" ,
53- "compression" : " store" ,
5453 "files" : [
5554 " src/**/*" ,
5655 " !src/app" ,
Original file line number Diff line number Diff line change 1212 {{ props.row.description }}
1313 </b-table-column >
1414 <b-table-column field =" action" label =" Dispel" >
15- <button class =" button is-light is-small" >disable</button >
15+ <button
16+ @click.stop =" dispel"
17+ :data-daemon =" props.row.daemon"
18+ class =" button is-light is-small" >
19+ disable
20+ </button >
1621 </b-table-column >
1722 </template >
1823 </b-table >
@@ -28,10 +33,21 @@ export default {
2833 data () {
2934 return { daemons: [] }
3035 },
36+ methods: {
37+ dispel : (event ) => {
38+ let message = event .target .dataset .daemon
39+ ipcRenderer .send (' action' , message)
40+ }
41+ },
3142 created () {
3243 let self = this
3344 ipcRenderer .on (' loaded' , (event , data ) => {
3445 self .daemons = data
46+
47+ ipcRenderer .on (' dispelled' , (e , d ) => {
48+ let button = ' [data-daemon="' + d + ' "]'
49+ document .querySelector (button).disabled = true
50+ })
3551 })
3652 }
3753}
Original file line number Diff line number Diff line change 11// Application entrypoint
22
3- const { app, BrowserWindow } = require ( 'electron' )
3+ const { app, BrowserWindow, ipcMain } = require ( 'electron' )
44const exec = require ( 'child_process' ) . exec
55
66const config = require ( './config.json' )
@@ -22,6 +22,12 @@ const createWindow = () => {
2222 } )
2323 } )
2424
25+ ipcMain . on ( 'action' , ( event , arg ) => {
26+ exec ( 'systemctl disable ' + arg , ( e , out , err ) => {
27+ if ( ! e ) window . webContents . send ( 'dispelled' , arg )
28+ } )
29+ } )
30+
2531 // Avoids flash of white background
2632 window . on ( 'ready-to-show' , ( ) => {
2733 window . show ( )
You can’t perform that action at this time.
0 commit comments