137 lines
5.4 KiB
Plaintext
137 lines
5.4 KiB
Plaintext
<cfsilent>
|
|
<cfimport prefix="m" taglib="lib"/>
|
|
<cfimport prefix="c" taglib="lib/controls"/>
|
|
<cfimport prefix="d" taglib="lib/data"/>
|
|
<cfimport prefix="layout" taglib="layout"/>
|
|
</cfsilent>
|
|
|
|
<m:prepare_ls entity="vdc" accessObject="" pageInfoOut="pageInfo" trackOut="tr"/>
|
|
|
|
|
|
|
|
|
|
<cfquery name="qStorage" datasource="billing-vc" ><!--- cachedWithin=#createTimeSpan(0, 0, 25, 0)# --->
|
|
SELECT
|
|
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
|
<d:field title="Тенант">t.name AS tenant</d:field>
|
|
<d:field title="WZ">m.clientid AS wz</d:field>
|
|
<d:field title="status">m.status</d:field>
|
|
<d:field title="End of Test">m.end_test_date</d:field>
|
|
<d:field title="VDC">v.name AS vdc</d:field>
|
|
<d:field title="Provider VDC">p.name AS provider_vdc</d:field>
|
|
<d:field title="code">CASE
|
|
WHEN v.name LIKE '%-v1cl1%' THEN 'iaas.ngc.i29'
|
|
WHEN v.name LIKE '%-v1cl2%' THEN 'iaas.ngc.i31'
|
|
WHEN v.name LIKE '%-v1cl4%' THEN 'iaas.ngc.a28'
|
|
WHEN v.name LIKE '%-v1cl5%' THEN 'iaas.ngc.a45'
|
|
WHEN v.name LIKE '%-v1cl6%' THEN 'iaas.ngc.i28'
|
|
WHEN v.name LIKE '%-v1cl7%' THEN 'iaas.ngc.a40'
|
|
ELSE '['||v.name||']'
|
|
END AS code</d:field>
|
|
<d:field title="Storage Profile">sp.name AS storage_profile</d:field>
|
|
<d:field title="Limit GB">round(AVG(c."limit")/1024.) AS limit_gb</d:field>
|
|
<d:field title="Allocation GB">round(AVG(c."used")/1024.) AS alloc_gb</d:field>
|
|
<d:field title="Timestamp">tm.ts</d:field>
|
|
</d:field_set>
|
|
FROM ngcloud_ru.capacity_storage c
|
|
JOIN ngcloud_ru.storage_profile_types sp ON c.storage_profile_types_id = sp.id
|
|
JOIN ngcloud_ru.vdc v ON c.vdc_id = v.id
|
|
JOIN ngcloud_ru.provider_vdc p ON v.provider_vdc_id = p.id
|
|
JOIN ngcloud_ru.tenant t ON t.id = v.tenant_id
|
|
LEFT JOIN LATERAL (
|
|
SELECT tm.ts, tm.metadata_id
|
|
FROM ngcloud_ru.tenant_metadata tm
|
|
WHERE tm.tenant_id = t.id
|
|
ORDER BY tm.ts DESC, tm.metadata_id DESC
|
|
LIMIT 1
|
|
) tm ON true
|
|
LEFT JOIN ngcloud_ru.metadata m ON tm.metadata_id = m.id
|
|
WHERE c.timestamp >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dateAdd("d",-1,Now())#/>
|
|
GROUP BY
|
|
m.clientid, v.name, p.name, sp.name, t.name,
|
|
m.status, m.end_test_date, tm.ts
|
|
ORDER BY
|
|
<m:order_build sortArray=#pageInfo.settings.sort.sortArray# fieldCount=#fieldCount#/>
|
|
</cfquery>
|
|
|
|
|
|
|
|
|
|
<cfif isDefined("output_xls")>
|
|
<layout:xml qRead=#qCharge# titleMap=#titleMap# filename="#pageInfo.entity#.xml"/>
|
|
<cfabort/>
|
|
</cfif><cfif isDefined("output_json")>
|
|
<layout:json qRead=#qCharge# titleMap=#titleMap# filename="#pageInfo.entity#.json"/>
|
|
<cfabort/>
|
|
</cfif><!---
|
|
---><layout:page section="header" pageInfo=#pageInfo#>
|
|
|
|
<layout:attribute name="title">
|
|
<cfoutput><b>Тесты и хранение</b></cfoutput>
|
|
</layout:attribute>
|
|
<layout:attribute name="controls">
|
|
<!---skip filter link, filter is not implemented--->
|
|
<!---<layout:language_switch/>--->
|
|
</layout:attribute>
|
|
</layout:page>
|
|
|
|
<!--- <cfdump var=#qReconciliation# abort=true/> --->
|
|
|
|
<!--- <cfoutput>
|
|
|
|
<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>#qStorage.recordCount#</b></cfoutput> --->
|
|
|
|
<layout:grid_summary
|
|
recordCount=#qStorage.recordCount#
|
|
footerOut="gridFooter"
|
|
excelLink="Yes"
|
|
jsonLink="Yes"
|
|
/>
|
|
|
|
|
|
<table class="worktable">
|
|
<layout:grid_head titleMap=#titleMap# sortArray=#pageInfo.settings.sort.sortArray#>
|
|
<tr>
|
|
<th><layout:column_head name="tenant"/></th>
|
|
<th><layout:column_head name="wz"/></th>
|
|
<th><layout:column_head name="status"/></th>
|
|
<th><layout:column_head name="end_test_date"/></th>
|
|
<th><layout:column_head name="vdc"/></th>
|
|
<th><layout:column_head name="provider_vdc"/></th>
|
|
<th><layout:column_head name="code"/></th>
|
|
<th><layout:column_head name="storage_profile"/></th>
|
|
<th><layout:column_head name="limit_gb"/></th>
|
|
<th><layout:column_head name="alloc_gb"/></th>
|
|
<th><layout:column_head name="ts"/></th>
|
|
</tr>
|
|
</layout:grid_head>
|
|
|
|
<cfoutput query="qStorage">
|
|
<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>#tenant#</td>
|
|
<td>#wz#</td>
|
|
<td<cfif NOT (status EQ "prod" OR status EQ "internal-test")> class="b"</cfif>>#status#</td>
|
|
<td<cfif NOT (status EQ "prod" OR status EQ "internal-test") AND isDate(end_test_date) AND end_test_date LE Now()> class="b err"</cfif>>#end_test_date#</td>
|
|
<td>#VDC#</td>
|
|
<td>#provider_vdc#</td>
|
|
<td>#code#</td>
|
|
<td>#storage_profile#</td>
|
|
<td<cfif NOT (status EQ "prod" OR status EQ "internal-test") AND isDate(end_test_date) AND end_test_date LE Now()> class="b err"</cfif>>#limit_gb#</td>
|
|
<td<cfif NOT (status EQ "prod" OR status EQ "internal-test") AND isDate(end_test_date) AND end_test_date LE Now()> class="b err"</cfif>>#alloc_gb#</td>
|
|
<td>#dateFormaT(ts,"YYYY-MM-DD")# #timeFormaT(ts,"HH-MM")#</td>
|
|
</tr>
|
|
|
|
</cfoutput>
|
|
|
|
</table>
|
|
|
|
|
|
<layout:page section="footer"/>
|
|
|