wsp-10323 Сonvert the VSP provider into one utilizing PowerShell - Step 1.

This commit is contained in:
me 2015-03-04 20:04:18 +04:00
parent e717a15781
commit d9d41827f6
24 changed files with 3677 additions and 39 deletions

View file

@ -56,15 +56,15 @@ namespace WebsitePanel.Portal
set { ViewState["DisplayText"] = value; }
}
public int Progress
public long Progress
{
get { return (ViewState["Progress"] != null) ? (int)ViewState["Progress"] : 0; }
get { return (ViewState["Progress"] != null) ? (long)ViewState["Progress"] : 0; }
set { ViewState["Progress"] = value; }
}
public int Total
public long Total
{
get { return (ViewState["Total"] != null) ? (int)ViewState["Total"] : 0; }
get { return (ViewState["Total"] != null) ? (long)ViewState["Total"] : 0; }
set { ViewState["Total"] = value; }
}
@ -101,7 +101,7 @@ namespace WebsitePanel.Portal
string bkgSrc = Page.ResolveUrl(PortalUtils.GetThemedImage("gauge_bkg.gif"));
// calculate the width of the gauge
int fTotal = Total;
long fTotal = Total;
int percent = (fTotal > 0) ? Convert.ToInt32(Math.Round((double)Progress / (double)fTotal * 100)) : 0;
double fFilledWidth = (fTotal > 0) ? ((double)Progress / (double)fTotal * Width) : 0;

View file

@ -92,7 +92,7 @@ namespace WebsitePanel.Portal
private void UpdateControl()
{
int total = gauge.Total;
long total = gauge.Total;
if (QuotaTypeId == 1)
{
litValue.Text = (total == 0) ? GetLocalizedString("Text.Disabled") : GetLocalizedString("Text.Enabled");

View file

@ -213,6 +213,9 @@
<data name="Heartbeat.OK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Heartbeat.Paused" xml:space="preserve">
<value>Paused</value>
</data>
<data name="locChangeHostname.Text" xml:space="preserve">
<value>Change VPS Host Name</value>
</data>
@ -273,6 +276,9 @@
<data name="State.Starting" xml:space="preserve">
<value>Starting</value>
</data>
<data name="State.Running" xml:space="preserve">
<value>Running</value>
</data>
<data name="State.Stopping" xml:space="preserve">
<value>Stopping</value>
</data>

View file

@ -98,9 +98,9 @@ namespace WebsitePanel.Portal.VPS
TimeSpan uptime = TimeSpan.FromMilliseconds(vm.Uptime);
uptime = uptime.Subtract(TimeSpan.FromMilliseconds(uptime.Milliseconds));
litUptime.Text = uptime.ToString();
litStatus.Text = GetLocalizedString("State." + vm.State.ToString());
litStatus.Text = GetLocalizedString("State." + vm.State);
litCreated.Text = vm.CreatedDate.ToString();
litHeartbeat.Text = GetLocalizedString("Heartbeat." + vm.Heartbeat.ToString());
litHeartbeat.Text = GetLocalizedString("Heartbeat." + vm.Heartbeat);
// CPU
cpuGauge.Progress = vm.CpuUsage;
@ -155,7 +155,7 @@ namespace WebsitePanel.Portal.VPS
|| vm.State == VirtualMachineState.Saved))
buttons.Add(CreateActionButton("Start", "start.png"));
if (vm.State == VirtualMachineState.Started)
if (vm.State == VirtualMachineState.Running)
{
if(vmi.RebootAllowed)
buttons.Add(CreateActionButton("Reboot", "reboot.png"));
@ -165,12 +165,12 @@ namespace WebsitePanel.Portal.VPS
}
if (vmi.StartTurnOffAllowed
&& (vm.State == VirtualMachineState.Started
&& (vm.State == VirtualMachineState.Running
|| vm.State == VirtualMachineState.Paused))
buttons.Add(CreateActionButton("TurnOff", "turnoff.png"));
if (vmi.PauseResumeAllowed
&& vm.State == VirtualMachineState.Started)
&& vm.State == VirtualMachineState.Running)
buttons.Add(CreateActionButton("Pause", "pause.png"));
if (vmi.PauseResumeAllowed
@ -178,7 +178,7 @@ namespace WebsitePanel.Portal.VPS
buttons.Add(CreateActionButton("Resume", "start2.png"));
if (vmi.ResetAllowed
&& (vm.State == VirtualMachineState.Started
&& (vm.State == VirtualMachineState.Running
|| vm.State == VirtualMachineState.Paused))
buttons.Add(CreateActionButton("Reset", "reset2.png"));