-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDefault.aspx
More file actions
111 lines (83 loc) · 4.11 KB
/
Default.aspx
File metadata and controls
111 lines (83 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OSCAL_POAM_Mapper._Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
function showProgress() {
var updateProgress = $get("<%= UpdateProgress.ClientID %>");
updateProgress.style.display = "block";
}
</script>
<div class="row" onchange ="scrollUp()">
<div class="col-md-8" runat="server" >
<h2>Upload OSCAL POAM XML File</h2>
<p>
Browse to the OSCAL Version 1.0.0 POAM XML file and click upload
to start process.</p>
<p>
<strong> Note:</strong> <strong> The generation process can take several minutes to complete.</strong></p>
<p>
</p>
<p>
<asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" width="500px" size="50"/>
<asp:Button runat="server" id="UploadButton" controlid="UploadButton" text="Upload" onclick="UploadButton_Click" onclientclick="showProgress()" />
<asp:SqlDataSource ID="SQLConnnection" runat="server" ConnectionString="<%$ ConnectionStrings:CONVERTREPOConnectionString %>" SelectCommand="GetPOAMList" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="SourceFile" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:UpdateProgress ID="UpdateProgress" runat="server" AssociatedUpdatePanelID="updatepanel1" Visible ="False">
<ProgressTemplate>
<div class="overlay">
<div style=" z-index: 200; margin-left: 250px;margin-top:150px;opacity: 1;">
<img alt="" src="../loading.gif" />
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:Label ID="StatusLabel1" runat="server" ForeColor="#009933"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="UploadButton" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="OpenMyFile" runat="server" OnClick="OpenMyFile_Click" Text="Download Excel Document" Visible="False" />
</p>
</div>
</div>
<div class="container">
<p id="realmessage"></p>
<div class="progress">
<div runat="server" id ="mainbar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0% ">
<span id = "realbar" class="sr-only">0% Complete</span>
</div>
</div>
</div>
<script type="text/javascript">
var uniqueId = '<%= Guid.NewGuid().ToString() %>';
$(document).ready(function (event) {
$('#startProcess').click(function () {
$.post("Default/StartLongRunningProcess", { id: uniqueId }, function () {
$('#statusBorder').show();
getStatus();
});
event.preventDefault;
});
});
function getStatus() {
var url = 'Default/GetCurrentProgress/' + uniqueId;
$.get(url, function (data) {
if (data != "100") {
$('#status').html(data);
$('#statusFill').width(data);
window.setTimeout("getStatus()", 100);
}
else {
$('#status').html("Done");
$('#statusBorder').hide();
alert("The Long process has finished");
};
});
}
</script>
</asp:Content>