Merge
This commit is contained in:
commit
a96931786c
6 changed files with 54 additions and 27 deletions
|
@ -1,4 +1,4 @@
|
||||||
USE [${install.database}]
|
USE [${install.database}]
|
||||||
GO
|
GO
|
||||||
-- update database version
|
-- update database version
|
||||||
DECLARE @build_version nvarchar(10), @build_date datetime
|
DECLARE @build_version nvarchar(10), @build_date datetime
|
||||||
|
@ -8745,3 +8745,10 @@ AND SI.ItemName = @ItemName
|
||||||
AND ((@GroupName IS NULL) OR (@GroupName IS NOT NULL AND RG.GroupName = @GroupName))
|
AND ((@GroupName IS NULL) OR (@GroupName IS NOT NULL AND RG.GroupName = @GroupName))
|
||||||
RETURN
|
RETURN
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
-- Hyper-V 2012 R2
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2')
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 30, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV', 1)
|
||||||
|
END
|
||||||
|
GO
|
|
@ -1074,10 +1074,14 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CheckNumericQuota(PackageContext cntx, List<string> errors, string quotaName, int currentVal, int val, string messageKey)
|
private static void CheckNumericQuota(PackageContext cntx, List<string> errors, string quotaName, long currentVal, long val, string messageKey)
|
||||||
{
|
{
|
||||||
CheckQuotaValue(cntx, errors, quotaName, currentVal, val, messageKey);
|
CheckQuotaValue(cntx, errors, quotaName, currentVal, val, messageKey);
|
||||||
}
|
}
|
||||||
|
private static void CheckNumericQuota(PackageContext cntx, List<string> errors, string quotaName, int currentVal, int val, string messageKey)
|
||||||
|
{
|
||||||
|
CheckQuotaValue(cntx, errors, quotaName, Convert.ToInt64(currentVal), Convert.ToInt64(val), messageKey);
|
||||||
|
}
|
||||||
|
|
||||||
private static void CheckNumericQuota(PackageContext cntx, List<string> errors, string quotaName, int val, string messageKey)
|
private static void CheckNumericQuota(PackageContext cntx, List<string> errors, string quotaName, int val, string messageKey)
|
||||||
{
|
{
|
||||||
|
@ -1094,7 +1098,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
CheckQuotaValue(cntx, errors, quotaName, 0, -1, messageKey);
|
CheckQuotaValue(cntx, errors, quotaName, 0, -1, messageKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CheckQuotaValue(PackageContext cntx, List<string> errors, string quotaName, int currentVal, int val, string messageKey)
|
private static void CheckQuotaValue(PackageContext cntx, List<string> errors, string quotaName, long currentVal, long val, string messageKey)
|
||||||
{
|
{
|
||||||
if (!cntx.Quotas.ContainsKey(quotaName))
|
if (!cntx.Quotas.ContainsKey(quotaName))
|
||||||
return;
|
return;
|
||||||
|
@ -1111,7 +1115,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
errors.Add(messageKey);
|
errors.Add(messageKey);
|
||||||
else if (quota.QuotaTypeId == 2)
|
else if (quota.QuotaTypeId == 2)
|
||||||
{
|
{
|
||||||
int maxValue = quota.QuotaAllocatedValue - quota.QuotaUsedValue + currentVal;
|
long maxValue = quota.QuotaAllocatedValue - quota.QuotaUsedValue + currentVal;
|
||||||
if(val > maxValue)
|
if(val > maxValue)
|
||||||
errors.Add(messageKey + ":" + maxValue);
|
errors.Add(messageKey + ":" + maxValue);
|
||||||
}
|
}
|
||||||
|
@ -1795,8 +1799,9 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
else if (state == VirtualMachineRequestedState.Reboot)
|
else if (state == VirtualMachineRequestedState.Reboot)
|
||||||
{
|
{
|
||||||
// shutdown first
|
// shutdown first
|
||||||
ResultObject shutdownResult = ChangeVirtualMachineState(itemId, VirtualMachineRequestedState.ShutDown);
|
ResultObject shutdownResult = ChangeVirtualMachineState(itemId,
|
||||||
if(!shutdownResult.IsSuccess)
|
VirtualMachineRequestedState.ShutDown);
|
||||||
|
if (!shutdownResult.IsSuccess)
|
||||||
{
|
{
|
||||||
TaskManager.CompleteResultTask(res);
|
TaskManager.CompleteResultTask(res);
|
||||||
return shutdownResult;
|
return shutdownResult;
|
||||||
|
@ -1817,20 +1822,29 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
JobResult result = vps.ChangeVirtualMachineState(machine.VirtualMachineId, state);
|
JobResult result = vps.ChangeVirtualMachineState(machine.VirtualMachineId, state);
|
||||||
|
|
||||||
// check return
|
if (result.Job.JobState == ConcreteJobState.Completed)
|
||||||
if (result.ReturnValue != ReturnCode.JobStarted)
|
|
||||||
{
|
{
|
||||||
LogReturnValueResult(res, result);
|
LogReturnValueResult(res, result);
|
||||||
TaskManager.CompleteResultTask(res);
|
TaskManager.CompleteTask();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// wait for completion
|
|
||||||
if (!JobCompleted(vps, result.Job))
|
|
||||||
{
|
{
|
||||||
LogJobResult(res, result.Job);
|
// check return
|
||||||
TaskManager.CompleteResultTask(res);
|
if (result.ReturnValue != ReturnCode.JobStarted)
|
||||||
return res;
|
{
|
||||||
|
LogReturnValueResult(res, result);
|
||||||
|
TaskManager.CompleteResultTask(res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// wait for completion
|
||||||
|
if (!JobCompleted(vps, result.Job))
|
||||||
|
{
|
||||||
|
LogJobResult(res, result.Job);
|
||||||
|
TaskManager.CompleteResultTask(res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,15 +56,15 @@ namespace WebsitePanel.Portal
|
||||||
set { ViewState["DisplayText"] = value; }
|
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; }
|
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; }
|
set { ViewState["Total"] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ namespace WebsitePanel.Portal
|
||||||
string bkgSrc = Page.ResolveUrl(PortalUtils.GetThemedImage("gauge_bkg.gif"));
|
string bkgSrc = Page.ResolveUrl(PortalUtils.GetThemedImage("gauge_bkg.gif"));
|
||||||
|
|
||||||
// calculate the width of the gauge
|
// 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;
|
int percent = (fTotal > 0) ? Convert.ToInt32(Math.Round((double)Progress / (double)fTotal * 100)) : 0;
|
||||||
|
|
||||||
double fFilledWidth = (fTotal > 0) ? ((double)Progress / (double)fTotal * Width) : 0;
|
double fFilledWidth = (fTotal > 0) ? ((double)Progress / (double)fTotal * Width) : 0;
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace WebsitePanel.Portal
|
||||||
|
|
||||||
private void UpdateControl()
|
private void UpdateControl()
|
||||||
{
|
{
|
||||||
int total = gauge.Total;
|
long total = gauge.Total;
|
||||||
if (QuotaTypeId == 1)
|
if (QuotaTypeId == 1)
|
||||||
{
|
{
|
||||||
litValue.Text = (total == 0) ? GetLocalizedString("Text.Disabled") : GetLocalizedString("Text.Enabled");
|
litValue.Text = (total == 0) ? GetLocalizedString("Text.Disabled") : GetLocalizedString("Text.Enabled");
|
||||||
|
|
|
@ -213,6 +213,9 @@
|
||||||
<data name="Heartbeat.OK" xml:space="preserve">
|
<data name="Heartbeat.OK" xml:space="preserve">
|
||||||
<value>OK</value>
|
<value>OK</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Heartbeat.Paused" xml:space="preserve">
|
||||||
|
<value>Paused</value>
|
||||||
|
</data>
|
||||||
<data name="locChangeHostname.Text" xml:space="preserve">
|
<data name="locChangeHostname.Text" xml:space="preserve">
|
||||||
<value>Change VPS Host Name</value>
|
<value>Change VPS Host Name</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -273,6 +276,9 @@
|
||||||
<data name="State.Starting" xml:space="preserve">
|
<data name="State.Starting" xml:space="preserve">
|
||||||
<value>Starting</value>
|
<value>Starting</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="State.Running" xml:space="preserve">
|
||||||
|
<value>Running</value>
|
||||||
|
</data>
|
||||||
<data name="State.Stopping" xml:space="preserve">
|
<data name="State.Stopping" xml:space="preserve">
|
||||||
<value>Stopping</value>
|
<value>Stopping</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -98,9 +98,9 @@ namespace WebsitePanel.Portal.VPS
|
||||||
TimeSpan uptime = TimeSpan.FromMilliseconds(vm.Uptime);
|
TimeSpan uptime = TimeSpan.FromMilliseconds(vm.Uptime);
|
||||||
uptime = uptime.Subtract(TimeSpan.FromMilliseconds(uptime.Milliseconds));
|
uptime = uptime.Subtract(TimeSpan.FromMilliseconds(uptime.Milliseconds));
|
||||||
litUptime.Text = uptime.ToString();
|
litUptime.Text = uptime.ToString();
|
||||||
litStatus.Text = GetLocalizedString("State." + vm.State.ToString());
|
litStatus.Text = GetLocalizedString("State." + vm.State);
|
||||||
litCreated.Text = vm.CreatedDate.ToString();
|
litCreated.Text = vm.CreatedDate.ToString();
|
||||||
litHeartbeat.Text = GetLocalizedString("Heartbeat." + vm.Heartbeat.ToString());
|
litHeartbeat.Text = GetLocalizedString("Heartbeat." + vm.Heartbeat);
|
||||||
|
|
||||||
// CPU
|
// CPU
|
||||||
cpuGauge.Progress = vm.CpuUsage;
|
cpuGauge.Progress = vm.CpuUsage;
|
||||||
|
@ -155,7 +155,7 @@ namespace WebsitePanel.Portal.VPS
|
||||||
|| vm.State == VirtualMachineState.Saved))
|
|| vm.State == VirtualMachineState.Saved))
|
||||||
buttons.Add(CreateActionButton("Start", "start.png"));
|
buttons.Add(CreateActionButton("Start", "start.png"));
|
||||||
|
|
||||||
if (vm.State == VirtualMachineState.Started)
|
if (vm.State == VirtualMachineState.Running)
|
||||||
{
|
{
|
||||||
if(vmi.RebootAllowed)
|
if(vmi.RebootAllowed)
|
||||||
buttons.Add(CreateActionButton("Reboot", "reboot.png"));
|
buttons.Add(CreateActionButton("Reboot", "reboot.png"));
|
||||||
|
@ -165,12 +165,12 @@ namespace WebsitePanel.Portal.VPS
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vmi.StartTurnOffAllowed
|
if (vmi.StartTurnOffAllowed
|
||||||
&& (vm.State == VirtualMachineState.Started
|
&& (vm.State == VirtualMachineState.Running
|
||||||
|| vm.State == VirtualMachineState.Paused))
|
|| vm.State == VirtualMachineState.Paused))
|
||||||
buttons.Add(CreateActionButton("TurnOff", "turnoff.png"));
|
buttons.Add(CreateActionButton("TurnOff", "turnoff.png"));
|
||||||
|
|
||||||
if (vmi.PauseResumeAllowed
|
if (vmi.PauseResumeAllowed
|
||||||
&& vm.State == VirtualMachineState.Started)
|
&& vm.State == VirtualMachineState.Running)
|
||||||
buttons.Add(CreateActionButton("Pause", "pause.png"));
|
buttons.Add(CreateActionButton("Pause", "pause.png"));
|
||||||
|
|
||||||
if (vmi.PauseResumeAllowed
|
if (vmi.PauseResumeAllowed
|
||||||
|
@ -178,7 +178,7 @@ namespace WebsitePanel.Portal.VPS
|
||||||
buttons.Add(CreateActionButton("Resume", "start2.png"));
|
buttons.Add(CreateActionButton("Resume", "start2.png"));
|
||||||
|
|
||||||
if (vmi.ResetAllowed
|
if (vmi.ResetAllowed
|
||||||
&& (vm.State == VirtualMachineState.Started
|
&& (vm.State == VirtualMachineState.Running
|
||||||
|| vm.State == VirtualMachineState.Paused))
|
|| vm.State == VirtualMachineState.Paused))
|
||||||
buttons.Add(CreateActionButton("Reset", "reset2.png"));
|
buttons.Add(CreateActionButton("Reset", "reset2.png"));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue