078 improvements

This commit is contained in:
2026-08-21 22:01:53 +03:00
parent beeb83cda5
commit 98af1aa4b9
4 changed files with 121 additions and 115 deletions
+33 -112
View File
@@ -10,25 +10,13 @@
<cfquery name="qVM" cachedWithin=#createTimeSpan(0, 0, 25, 0)#>
select "Name", "Object_UUID", "UUID_VM",
"VDC", "Organization_UUID", "Organization", "WZ", "Cluster", "Host",
"Host_Model", "CPU_Model", "Host_CPU_Cores", "Host_CPU_Sockets", "Host_CPU_Speed", "Host_RAM",
"Host_CPU_Used", "Host_CPU_Used_Avg",
"VDC_CPU_Reserv", "VDC_CPU_Speed",
"VM_vCPU_count", "VM_CPU_Used", "VM_CPU_Used_AVG", "VM_CPU_Reserv_GHz", "VM_CPU_Reserv_perc",
"VM_RAM_Allocated", "VM_RAM_Used",
"VM_is_ON",
k.__id as company_uid
from vmreports.compute c
left outer join elma.companies k ON (lower(k.id_klienta)=lower(c."WZ"))
where c.ts=(select max(ts) from vmreports.compute)
--order by "WZ"
<cfquery name="qGPU" datasource="billing-vc" cachedWithin=#createTimeSpan(0, 0, 25, 0)#>
select obj_uuid, obj_id, client_id as WZ, vcd, org, org_vdc, vcenter, gpu, dt_load, dt_load_ts, org_status, cluster as clus, is_template
from gpu.vm
order by client_id
</cfquery>
<!--- <cfdump var=#qVM# abort=true/> --->
<!--- <cfdump var=#qGPU# abort=true/> --->
<cfif isDefined("output_xls")>
<layout:xml qRead=#qCharge# titleMap=#titleMap# filename="#pageInfo.entity#.xml"/>
@@ -40,7 +28,7 @@ where c.ts=(select max(ts) from vmreports.compute)
---><layout:page section="header" pageInfo=#pageInfo#>
<layout:attribute name="title">
<cfoutput><b>Сверка CRM - Cloud</b></cfoutput>
<cfoutput><b>VM с GPU</b></cfoutput>
</layout:attribute>
<layout:attribute name="controls">
<!---skip filter link, filter is not implemented--->
@@ -51,111 +39,44 @@ where c.ts=(select max(ts) from vmreports.compute)
<!--- <cfdump var=#qReconciliation# abort=true/> --->
<cfoutput>
<!--- <form method="post" action="">
Период с <input type="text" name="dt_start" value="#dateFormat(dt_start,'YYYY-MM-DD')#"/>
по <input type="text" name="dt_finish" value="#dateFormat(dt_finish,'YYYY-MM-DD')#"/>
<input type="submit" style="cursor:pointer;"/>
<input type="submit" name="DEBUG" value="DEBUG" style="cursor:pointer;"/>
</form> --->
<!--- Часов в периоде: <b>#hours#</b> Строк в отчете: <b>#qCharge.recordCount#</b><br/>
Актуальность данных:
VCD Computing: <b>#dateFormat(qComputingAge.dt_load,'YYYY-MM-DD')# #timeFormat(qComputingAge.dt_load,'HH:MM:SS')#</b>
VCD Storage: <b>#dateFormat(qStorageAge.dt_load,'YYYY-MM-DD')# #timeFormat(qStorageAge.dt_load,'HH:MM:SS')#</b>
S3 хранение: <b>#dateFormat(qS3VolAge.dt_load,'YYYY-MM-DD')# #timeFormat(qS3VolAge.dt_load,'HH:MM:SS')#</b>
S3 операции и трафик: <b>#dateFormat(qS3OpsTrfAge.dt_load,'YYYY-MM-DD')# #timeFormat(qS3OpsTrfAge.dt_load,'HH:MM:SS')#</b>
--->
<br/>
<a href="#request.thisPage#?output_xls" title="экспорт в Excel" style="margin-left:.5em; height:100%;" target="_blank"><img src="img/xls.gif" style="vertical-align:text-bottom;"/></a>
<a href="#request.thisPage#?output_json" title="экспорт в json" style="margin-left:.5em; height:100%;" target="_blank"><img src="img/json.svg" style="vertical-align:text-bottom;" width="13" height="13"/></a>
</cfoutput>
<cfoutput><b>#qVM.recordCount#</b></cfoutput>
<cfoutput><b>#qGPU.recordCount#</b></cfoutput>
<table class="worktable">
<thead>
<tr>
<th width="5%">WZ</th>
<th width="5%">Имя</th>
<th width="5%">Уникальное имя</th>
<th width="3%">Organization</th>
<th width="3%">VDC</th>
<th width="3%">VDC CPU Reserv</th>
<th width="3%">VDC CPU Speed GHz</th>
<th width="3%">Cluster</th>
<th width="3%">Host</th>
<th width="7%">Host Model</th>
<th width="7%">CPU Model</th>
<th width="3%">Host CPU Cores</th>
<th width="3%">Host CPU Sockets</th>
<th width="3%">Host CPU Speed GHz</th>
<th width="3%">Host RAM GB</th>
<th width="3%">Host CPU Used</th>
<th width="3%">Host CPU Used_Avg</th>
<th width="3%">VM vCPU count</th>
<th width="3%">VM CPU Used</th>
<th width="3%">VM CPU Used AVG</th>
<th width="3%">VM CPU Reserv GHz</th>
<th width="3%">VM CPU Reserv perc</th>
<th width="3%">VM RAM Allocated GB</th>
<th width="3%">VM RAM Used GB</th>
<th width="3%">VM is ON</th>
<th width="5%">WZ</th>
<th width="5%">obj_uuid</th>
<th width="5%">obj_id</th>
<th width="3%">org</th>
<th width="3%">org_vdc</th>
<th width="3%">gpu</th>
<th width="3%">dt_load</th>
<th width="3%">dt_load_ts</th>
<th width="7%">cluster</th>
<th width="3%">is_template</th>
</tr>
</thead>
<cfoutput query="qVM">
<tr>
<td><a href="contragent.cfm?__id=#company_uid#&#tr.fwx#">#WZ#</a><a href="contragent_rpt.cfm?__id=#company_uid#&#tr.fwx#" style="float:right"><img src="img/view.gif" title="сводка по контрагенту"/></a></td>
<td>#Name#</td>
<td>#UUID_VM#</td>
<td>#Organization#</td>
<td>#VDC#</td>
<td><cftry>#round(VDC_CPU_Reserv,3)#<cfcatch></cfcatch></cftry></td>
<td><cftry>#round(VDC_CPU_Speed,3)#<cfcatch></cfcatch></cftry></td>
<td>#qVM.Cluster#</td>
<td>#Host#</td>
<td>#Host_Model#</td>
<td>#CPU_Model#</td>
<td>#Host_CPU_Cores#</td>
<td>#Host_CPU_Sockets#</td>
<td>#round(Host_CPU_Speed,3)#</td>
<td>#round(Host_RAM)#</td>
<td><cftry>#round(Host_CPU_Used,1)#<cfcatch></cfcatch></cftry></td>
<td><cftry>#round(Host_CPU_Used_Avg,1)#<cfcatch></cfcatch></cftry></td>
<td>#VM_vCPU_count#</td>
<td><cftry>#round(VM_CPU_Used,1)#<cfcatch></cfcatch></cftry></td>
<td><cftry>#round(VM_CPU_Used_AVG,1)#<cfcatch></cfcatch></cftry></td>
<td><cftry>#round(VM_CPU_Reserv_GHz,1)#<cfcatch></cfcatch></cftry></td>
<td>#VM_CPU_Reserv_perc#</td>
<td>#VM_RAM_Allocated#</td>
<td><cftry>#round(VM_RAM_Used)#<cfcatch></cfcatch></cftry></td>
<td>#VM_is_ON#</td>
<!--- <td><a href="contragent.cfm?__id=#company_uid#&#tr.fwx#">#client_sold#</a></td> --->
</tr>
<cfoutput query="qGPU">
<tr>
<td><a href="contragent.cfm?wz=#WZ#&#tr.fwx#">#WZ#</a></td>
<td>#obj_uuid#</td>
<td>#obj_id#</td>
<td>#org#</td>
<td>#org_vdc#</td>
<td>#gpu#</td>
<td>#dateFormat(dt_load, "YYYY-MM-DD")# #timeFormat(dt_load, "HH:MM")#</td>
<td>#dateFormat(dt_load_ts, "YYYY-MM-DD")# #timeFormat(dt_load_ts, "HH:MM")#</td>
<td>#clus#</td>
<td>#is_template#</td>
</tr>
</cfoutput>
</table>
<!--- <cfdump var=#qCharge#/> --->