WIP: upgrade button

This commit is contained in:
olevole
2023-04-07 14:04:54 +03:00
parent 2a61757412
commit dcee499b7c
4 changed files with 28 additions and 3 deletions

View File

@@ -159,8 +159,6 @@ class ClonOS {
}
echo json_encode($new_array);
return;
}else{
echo json_encode(array('error'=>true,'error_message'=>'PHP Method is not exists: '.$this->mode));
}
$included_result_array='';
@@ -252,6 +250,12 @@ class ClonOS {
echo json_encode($this->saveHelperValues());
return;
*/
if(!method_exists($this,$cfunc))
{
//echo json_encode(array('error'=>true,'error_message'=>'PHP Method is not exists: '.$this->mode));
$this->vars['error']=true;
$this->vars['error_message']='PHP Method is not exists: '.$this->mode;
}
}
}
}

View File

@@ -870,6 +870,9 @@ dialog.fullscreen #vnc-iframe {
background-color:coral;
text-shadow:1px 1px 2px black;
}
.buttons .button.hidden {
display:none;
}
.window-box h1 {
color:gray;

View File

@@ -4,6 +4,7 @@
Check for updates…
</div>
<div class="buttons">
<input type="button" value="<?php echo $this->translate('Get updates');?>" class="new button ok-but hidden">
<input type="button" value="<?php echo $this->translate('Close');?>" class="button red cancel-but" />
</div>
</dialog>

View File

@@ -5,6 +5,8 @@ var clonos={
lastX:0,
oldHash:'',
authorized:false,
updates_exists:false,
updates:{},
commands:
{
'jstart':{stat:['Not launched','Starting','Launched'],cmd:'jailStart'},
@@ -882,7 +884,19 @@ var clonos={
},
onSettingsUpdateCheck:function(data)
{
$('dialog#settings-update .window-content').append('<p>'+data.installed+'</p>');
var msg='<p>'+this.translate('No updates&hellip;')+'</p>';
if(this.updates_exists)
{
msg='<p>'+this.translate('Updates available:')+'</p>';
for(n in this.updates)
{
msg+='<p>'+n+', version: '+this.updates[n]+'</p>';
}
$('#settings-update .button.ok-but').removeClass('hidden');
}else{
$('#settings-update .button.ok-but').addClass('hidden');
}
$('dialog#settings-update .window-content').html(msg);
},
onUsersAdd:function(data)
@@ -2229,12 +2243,15 @@ var clonos={
checkLatestUpdates:function(data)
{
this.updates_exists=false;
for(n in data)
{
var key='updlist_'+n;
$('#'+key).addClass('changed');
$('#'+key).find('td:eq(2)').text(data[n]);
this.updates_exists=true;
}
if(this.updates_exists) this.updates=data;
},