minor code cleanup for plugins ui

face-manager-integrated
Moe 2022-12-11 12:33:53 -08:00
parent 8e3ddd43f7
commit 04be5de1dd
1 changed files with 37 additions and 144 deletions

View File

@ -222,23 +222,11 @@ $(document).ready(function(){
if(data.ok){
toggleCardButtons(card,[
{ action: 'install', show: false },
{
action: 'test',
show: false,
},
{ action: 'test',show: false },
{ el: '.command-line', show: true },
{
action: 'cancelInstall',
show: true,
},
{
action: 'delete',
show: false,
},
{
action: 'status',
show: false,
},
{ action: 'cancelInstall', show: true },
{ action: 'delete', show: false },
{ action: 'status', show: false },
])
}
})
@ -247,27 +235,12 @@ $(document).ready(function(){
installModule(packageName,function(data){
if(data.ok){
toggleCardButtons(card,[
{
action: 'install',
show: false,
},
{
action: 'test',
show: false,
},
{ action: 'install', show: false },
{ action: 'test',show: false },
{ el: '.command-line', show: true },
{
action: 'cancelInstall',
show: true,
},
{
action: 'delete',
show: false,
},
{
action: 'status',
show: false,
},
{ action: 'cancelInstall', show: true },
{ action: 'delete', show: false },
{ action: 'status', show: false },
])
}
})
@ -276,31 +249,13 @@ $(document).ready(function(){
testModule(packageName,function(data){
if(data.ok){
toggleCardButtons(card,[
{
action: 'install',
show: false,
},
{
action: 'test',
show: false,
},
{ action: 'install', show: false },
{ action: 'test', show: false },
{ el: '.command-line', show: false },
{
action: 'cancelInstall',
show: false,
},
{
action: 'cancelTest',
show: true,
},
{
action: 'delete',
show: false,
},
{
action: 'status',
show: false,
},
{ action: 'cancelInstall', show: false },
{ action: 'cancelTest', show: true },
{ action: 'delete', show: false },
{ action: 'status', show: false },
])
}
})
@ -312,27 +267,12 @@ $(document).ready(function(){
},function(data){
if(data.ok){
toggleCardButtons(card,[
{
action: 'install',
show: true,
},
{
action: 'test',
show: true,
},
{ action: 'install', show: true },
{ action: 'test', show: true },
{ el: '.command-line', show: false },
{
action: 'cancelInstall',
show: false,
},
{
action: 'delete',
show: true,
},
{
action: 'status',
show: true,
},
{ action: 'cancelInstall', show: false },
{ action: 'delete', show: true },
{ action: 'status', show: true },
])
}
})
@ -345,31 +285,13 @@ $(document).ready(function(){
},function(data){
if(data.ok){
toggleCardButtons(card,[
{
action: 'install',
show: true,
},
{
action: 'test',
show: true,
},
{ action: 'install', show: true },
{ action: 'test', show: true },
{ el: '.command-line', show: false },
{
action: 'cancelInstall',
show: false,
},
{
action: 'cancelTest',
show: false,
},
{
action: 'delete',
show: true,
},
{
action: 'status',
show: true,
},
{ action: 'cancelInstall', show: false },
{ action: 'cancelTest', show: false },
{ action: 'delete', show: true },
{ action: 'status', show: true },
])
}
})
@ -435,23 +357,12 @@ $(document).ready(function(){
drawModuleBlock(theModule)
if(theModule.installerRunning){
toggleCardButtons(card,[
{
action: 'install',
show: false,
},
{ action: 'install', show: false },
{ action: 'test',show: false },
{ el: '.command-line', show: true },
{
action: 'cancelInstall',
show: true,
},
{
action: 'delete',
show: false,
},
{
action: 'status',
show: false,
},
{ action: 'cancelInstall', show: true },
{ action: 'delete', show: false },
{ action: 'status', show: false },
])
}
}
@ -490,31 +401,13 @@ $(document).ready(function(){
var isTest = data.process === 'test-stdout'
var card = $(`[package-name="${name}"]`)
toggleCardButtons(card,[
{
action: 'install',
show: true,
},
{
action: 'test',
show: true,
},
{ action: 'install', show: true },
{ action: 'test', show: true },
{ el: '.command-line', show: false },
{
action: 'cancelInstall',
show: false,
},
{
action: 'cancelTest',
show: false,
},
{
action: 'delete',
show: true,
},
{
action: 'status',
show: true,
},
{ action: 'cancelInstall', show: false },
{ action: 'cancelTest', show: false },
{ action: 'delete', show: true },
{ action: 'status', show: true },
])
}
break;