mirror of
https://github.com/friendica/friendica
synced 2025-09-04 15:56:06 +02:00
Merge pull request #139 from fabrixxm/update
Experiment with on-line update
This commit is contained in:
commit
f35a61761a
6 changed files with 616 additions and 8 deletions
|
@ -17,6 +17,10 @@
|
|||
<li class='admin link $admin.plugins.2'><a href='$admin.plugins.0'>$admin.plugins.1</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class='admin linklist'>
|
||||
<li class='admin link $admin.update.2'><a href='$admin.update.0'>$admin.update.1</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
{{ if $admin.plugins_admin }}<h4>Plugins</h4>{{ endif }}
|
||||
<ul class='admin linklist'>
|
||||
|
@ -30,3 +34,4 @@
|
|||
<ul class='admin linklist'>
|
||||
<li class='admin link $admin.logs.2'><a href='$admin.logs.0'>$admin.logs.1</a></li>
|
||||
</ul>
|
||||
|
||||
|
|
98
view/admin_remoteupdate.tpl
Normal file
98
view/admin_remoteupdate.tpl
Normal file
|
@ -0,0 +1,98 @@
|
|||
<script src="include/jquery.htmlstream.js"></script>
|
||||
<script>
|
||||
/* ajax updater */
|
||||
function updateEnd(data){
|
||||
//$("#updatepopup .panel_text").html(data);
|
||||
$("#remoteupdate_form").find("input").removeAttr('disabled');
|
||||
$(".panel_action_close").fadeIn()
|
||||
}
|
||||
function updateOn(data){
|
||||
|
||||
var patt=/§([^§]*)§/g;
|
||||
var matches = data.match(patt);
|
||||
$(matches).each(function(id,data){
|
||||
data = data.replace(/§/g,"");
|
||||
d = data.split("@");
|
||||
console.log(d);
|
||||
elm = $("#updatepopup .panel_text #"+d[0]);
|
||||
html = "<div id='"+d[0]+"' class='progress'>"+d[1]+"<span>"+d[2]+"</span></div>";
|
||||
if (elm.length==0){
|
||||
$("#updatepopup .panel_text").append(html);
|
||||
} else {
|
||||
$(elm).replaceWith(html);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#remoteupdate_form").submit(function(){
|
||||
var data={};
|
||||
$(this).find("input").each(function(i, e){
|
||||
name = $(e).attr('name');
|
||||
value = $(e).val();
|
||||
e.disabled = true;
|
||||
data[name]=value;
|
||||
});
|
||||
|
||||
$("#updatepopup .panel_text").html("");
|
||||
$("#updatepopup").show();
|
||||
$("#updatepopup .panel").hide().slideDown(500);
|
||||
$(".panel_action_close").hide().click(function(){
|
||||
$("#updatepopup .panel").slideUp(500, function(){
|
||||
$("#updatepopup").hide();
|
||||
});
|
||||
});
|
||||
|
||||
$.post(
|
||||
$(this).attr('action'),
|
||||
data,
|
||||
updateEnd,
|
||||
'text',
|
||||
updateOn
|
||||
);
|
||||
|
||||
|
||||
return false;
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<div id="updatepopup" class="popup">
|
||||
<div class="background"></div>
|
||||
<div class="panel">
|
||||
<div class="panel_in">
|
||||
<h1>Friendika Update</h1>
|
||||
<div class="panel_text"></div>
|
||||
<div class="panel_actions">
|
||||
<input type="button" value="$close" class="panel_action_close">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="adminpage">
|
||||
<dl> <dt>Your version:</dt><dd>$localversion</dd> </dl>
|
||||
{{ if $needupdate }}
|
||||
<dl> <dt>New version:</dt><dd>$remoteversion</dd> </dl>
|
||||
|
||||
<form id="remoteupdate_form" method="POST" action="$baseurl/admin/update">
|
||||
<input type="hidden" name="$remotefile.0" value="$remotefile.2">
|
||||
|
||||
{{ if $canwrite }}
|
||||
<div class="submit"><input type="submit" name="remoteupdate" value="$submit" /></div>
|
||||
{{ else }}
|
||||
<h3>Your friendika installation is not writable by web server.</h3>
|
||||
{{ if $canftp }}
|
||||
<p>You can try to update via FTP</p>
|
||||
{{ inc field_input.tpl with $field=$ftphost }}{{ endinc }}
|
||||
{{ inc field_input.tpl with $field=$ftppath }}{{ endinc }}
|
||||
{{ inc field_input.tpl with $field=$ftpuser }}{{ endinc }}
|
||||
{{ inc field_password.tpl with $field=$ftppwd }}{{ endinc }}
|
||||
<div class="submit"><input type="submit" name="remoteupdate" value="$submit" /></div>
|
||||
{{ endif }}
|
||||
{{ endif }}
|
||||
</form>
|
||||
{{ else }}
|
||||
<h4>No updates</h4>
|
||||
{{ endif }}
|
||||
</div>
|
|
@ -1943,7 +1943,6 @@ a.mail-list-link {
|
|||
#install-dbuser-label,
|
||||
#install-dbpass-label,
|
||||
#install-dbdata-label,
|
||||
#install-admin-label,
|
||||
#install-tz-desc {
|
||||
float: left;
|
||||
width: 250px;
|
||||
|
@ -1955,8 +1954,7 @@ a.mail-list-link {
|
|||
#install-dbhost,
|
||||
#install-dbuser,
|
||||
#install-dbpass,
|
||||
#install-dbdata,
|
||||
#install-admin {
|
||||
#install-dbdata {
|
||||
float: left;
|
||||
width: 200px;
|
||||
margin-left: 20px;
|
||||
|
@ -1966,7 +1964,6 @@ a.mail-list-link {
|
|||
#install-dbuser-end,
|
||||
#install-dbpass-end,
|
||||
#install-dbdata-end,
|
||||
#install-admin-end,
|
||||
#install-tz-end {
|
||||
clear: both;
|
||||
}
|
||||
|
@ -2573,6 +2570,38 @@ a.mail-list-link {
|
|||
#adminpage table#users img { width: 16px; height: 16px; }
|
||||
#adminpage table tr:hover { background-color: #bbc7d7; }
|
||||
#adminpage .selectall { text-align: right; }
|
||||
|
||||
/*
|
||||
* UPDATE
|
||||
*/
|
||||
.popup {
|
||||
width: 100%; height: 100%;
|
||||
top:0px; left:0px;
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.popup .background {
|
||||
background-color: rgba(0,0,0,128);
|
||||
opacity: 0.5;
|
||||
width: 100%; height: 100%;
|
||||
position: absolute;
|
||||
top:0px; left:0px;
|
||||
}
|
||||
.popup .panel {
|
||||
top:25%;left:25%;width:50%;height:50%;
|
||||
padding: 1em;
|
||||
position: absolute;
|
||||
border: 4px solid #000000;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.popup .panel .panel_text { display: block; overflow: auto; height: 80%; }
|
||||
.popup .panel .panel_in { width: 100%; height: 100%; position: relative; }
|
||||
.popup .panel .panel_actions { width: 100%; bottom: 4px; left: 0px; position: absolute; }
|
||||
.panel_text .progress { width: 50%; overflow: hidden; height: auto; border: 1px solid #cccccc; margin-bottom: 5px}
|
||||
.panel_text .progress span {float: right; display: block; width: 25%; background-color: #eeeeee; text-align: right;}
|
||||
|
||||
|
||||
/**
|
||||
* ICONS
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue