progress feed for database installer

[TFS Changeset #81595]
This commit is contained in:
PerPloug
2010-12-07 13:41:58 +00:00
parent 7e7ca233c0
commit 41c3db56a0
2 changed files with 21 additions and 21 deletions

View File

@@ -162,10 +162,14 @@
</footer>
</div>
<script type="text/javascript">
var intervalId = 0;
var pBar = jQuery(".progress-bar").progressbar({value: 0});
jQuery(document).ready(function () {
jQuery(".progress-bar").progressbar("option", "value", 0);
intervalId = setInterval("updateProgressBar()", 1000);
@@ -174,24 +178,21 @@
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: '{}',
dataType: 'json',
dataType: 'json',
url: 'utills/p.aspx/installOrUpgrade',
success: function (result) {
clearInterval(intervalId);
jQuery(".btn-box").show();
}
});
});
function updateProgressBar() {
jQuery.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: '{}',
dataType: 'json',
url: 'utills/p.aspx?feed=progress',
success: function (result) {
});
function updateProgressBar() {
jQuery.getJSON('utills/p.aspx?feed=progress', function (data) {
alert(data.percentage);
jQuery(".progress-bar").progressbar("option", "value", data.percentage);
jQuery(".loader strong").text(data.description);
});
@@ -220,7 +221,7 @@
<%=umbraco.GlobalSettings.CurrentVersion%>.<br />
Press <b>Continue</b> to proceed.
</p>
</div>
</div>
</asp:PlaceHolder>
<!-- btn box -->
<footer class="btn-box" style="display: none;">

View File

@@ -28,13 +28,12 @@ namespace umbraco.presentation.install {
}
public static string getProgress(){
string json = @"{'progress': {
'percentage': '%p',
'message': '%m',
'error': '%e'
}
}";
string retval = json.Replace("%p", Percentage.ToString()).Replace("%m", Description).Replace("%e", Error);
string json = @"{
'percentage': '%p',
'message': '%m',
'error': '%e'
}";
string retval = json.Replace("%p", Percentage.ToString()).Replace("%m", Description).Replace("%e", Error).Replace("'", "\"");
return retval;
}
}