diff --git a/contract.cfm b/contract.cfm new file mode 100644 index 0000000..cb488f5 --- /dev/null +++ b/contract.cfm @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pageInfo=#pageInfo# + id="#d.__id#" + status=#pageInfo.status# + trackOut="tr" + idAttributesOut="id" +/> + + + + select + __name as contragent + from elma.companies k + where k.__id= + + + + + + + Договор + + #d.__name# + [#d.__id#] + + + + + + + + + + + +
+ +
+
__id
+
#d.__id#
+
+ +
+
Номер договора
+
#d.__name#
+
+ +
+
Контрагент
+
#qDecoration.contragent# [#d.company_uid#]
+
+ +
+
Дата договора
+
#d.date_of_aggrement#
+
+ +
+
Дата окончания договора
+
#d.date_end_aggrement#
+
+ +
+ +
+ + + + \ No newline at end of file diff --git a/contragent.cfm b/contragent.cfm new file mode 100644 index 0000000..0ed27f9 --- /dev/null +++ b/contragent.cfm @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pageInfo=#pageInfo# + id="#d.__id#" + status=#pageInfo.status# + trackOut="tr" + idAttributesOut="id" +/> + + + + + + + + + Контрагент + + #d.__name# + [#d.__id#] + + + + + + + + + + + +
+ +
+
__id
+
#d.__id#
+
+ +
+
__name
+
#d.__name#
+
+ +
+
_inn
+
#d._inn#
+
+ +
+
_kpp
+
#d._kpp#
+
+ +
+
id_klienta
+
#d.id_klienta#
+
+ + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/img/Arrow-Left-icon.png b/img/Arrow-Left-icon.png new file mode 100644 index 0000000..d7821a4 Binary files /dev/null and b/img/Arrow-Left-icon.png differ diff --git a/img/Arrow-left-icon (1).png b/img/Arrow-left-icon (1).png new file mode 100644 index 0000000..fcd2dd5 Binary files /dev/null and b/img/Arrow-left-icon (1).png differ diff --git a/img/DataLime.svg b/img/DataLime.svg new file mode 100644 index 0000000..8686414 --- /dev/null +++ b/img/DataLime.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/img/Knob-Left-icon.png b/img/Knob-Left-icon.png new file mode 100644 index 0000000..5b6129f Binary files /dev/null and b/img/Knob-Left-icon.png differ diff --git a/img/a-piece.png b/img/a-piece.png new file mode 100644 index 0000000..029bd20 Binary files /dev/null and b/img/a-piece.png differ diff --git a/img/add.gif b/img/add.gif new file mode 100644 index 0000000..d8c5d3f Binary files /dev/null and b/img/add.gif differ diff --git a/img/alarm-arrow-left-icon.png b/img/alarm-arrow-left-icon.png new file mode 100644 index 0000000..61a0d04 Binary files /dev/null and b/img/alarm-arrow-left-icon.png differ diff --git a/img/alarm-arrow-up-icon.png b/img/alarm-arrow-up-icon.png new file mode 100644 index 0000000..76702f1 Binary files /dev/null and b/img/alarm-arrow-up-icon.png differ diff --git a/img/arr_dn.png b/img/arr_dn.png new file mode 100644 index 0000000..e7a4ca5 Binary files /dev/null and b/img/arr_dn.png differ diff --git a/img/arr_dn1.png b/img/arr_dn1.png new file mode 100644 index 0000000..75389bb Binary files /dev/null and b/img/arr_dn1.png differ diff --git a/img/arr_dn2.png b/img/arr_dn2.png new file mode 100644 index 0000000..2cf29e7 Binary files /dev/null and b/img/arr_dn2.png differ diff --git a/img/arr_up.png b/img/arr_up.png new file mode 100644 index 0000000..44d92f2 Binary files /dev/null and b/img/arr_up.png differ diff --git a/img/arr_up1.png b/img/arr_up1.png new file mode 100644 index 0000000..cfa15b8 Binary files /dev/null and b/img/arr_up1.png differ diff --git a/img/arr_up2.png b/img/arr_up2.png new file mode 100644 index 0000000..56989ed Binary files /dev/null and b/img/arr_up2.png differ diff --git a/img/arrow-left-icon (2).png b/img/arrow-left-icon (2).png new file mode 100644 index 0000000..2442d24 Binary files /dev/null and b/img/arrow-left-icon (2).png differ diff --git a/img/asvc.jpg b/img/asvc.jpg new file mode 100644 index 0000000..a3902d1 Binary files /dev/null and b/img/asvc.jpg differ diff --git a/img/complex.png b/img/complex.png new file mode 100644 index 0000000..0a256cd Binary files /dev/null and b/img/complex.png differ diff --git a/img/component.png b/img/component.png new file mode 100644 index 0000000..49b6926 Binary files /dev/null and b/img/component.png differ diff --git a/img/component.svg b/img/component.svg new file mode 100644 index 0000000..d8bfe46 --- /dev/null +++ b/img/component.svg @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/img/deer.bk.png b/img/deer.bk.png new file mode 100644 index 0000000..85ddfae Binary files /dev/null and b/img/deer.bk.png differ diff --git a/img/deer.png b/img/deer.png new file mode 100644 index 0000000..5605a88 Binary files /dev/null and b/img/deer.png differ diff --git a/img/del.gif b/img/del.gif new file mode 100644 index 0000000..543da40 Binary files /dev/null and b/img/del.gif differ diff --git a/img/del16.png b/img/del16.png new file mode 100644 index 0000000..05dbaf8 Binary files /dev/null and b/img/del16.png differ diff --git a/img/del2.png b/img/del2.png new file mode 100644 index 0000000..cf9a957 Binary files /dev/null and b/img/del2.png differ diff --git a/img/dit.png b/img/dit.png new file mode 100644 index 0000000..807090d Binary files /dev/null and b/img/dit.png differ diff --git a/img/dit_m.png b/img/dit_m.png new file mode 100644 index 0000000..8efd316 Binary files /dev/null and b/img/dit_m.png differ diff --git a/img/dit_m1.png b/img/dit_m1.png new file mode 100644 index 0000000..1038c94 Binary files /dev/null and b/img/dit_m1.png differ diff --git a/img/download.png b/img/download.png new file mode 100644 index 0000000..cafb566 Binary files /dev/null and b/img/download.png differ diff --git a/img/edit.gif b/img/edit.gif new file mode 100644 index 0000000..8c0d109 Binary files /dev/null and b/img/edit.gif differ diff --git a/img/edit.gif.bk b/img/edit.gif.bk new file mode 100644 index 0000000..d87da1a Binary files /dev/null and b/img/edit.gif.bk differ diff --git a/img/favicon.ico b/img/favicon.ico new file mode 100644 index 0000000..6c926da Binary files /dev/null and b/img/favicon.ico differ diff --git a/img/favicon1.ico b/img/favicon1.ico new file mode 100644 index 0000000..5c1bf55 Binary files /dev/null and b/img/favicon1.ico differ diff --git a/img/json.svg b/img/json.svg new file mode 100644 index 0000000..a4ade48 --- /dev/null +++ b/img/json.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/img/logo.png b/img/logo.png new file mode 100644 index 0000000..687e1a9 Binary files /dev/null and b/img/logo.png differ diff --git a/img/logo0.png b/img/logo0.png new file mode 100644 index 0000000..ecc0019 Binary files /dev/null and b/img/logo0.png differ diff --git a/img/mimetype/document.png b/img/mimetype/document.png new file mode 100644 index 0000000..cee58b4 Binary files /dev/null and b/img/mimetype/document.png differ diff --git a/img/mimetype/excel.png b/img/mimetype/excel.png new file mode 100644 index 0000000..3cf3f34 Binary files /dev/null and b/img/mimetype/excel.png differ diff --git a/img/mimetype/ficon_pptx.gif b/img/mimetype/ficon_pptx.gif new file mode 100644 index 0000000..4d19e2a Binary files /dev/null and b/img/mimetype/ficon_pptx.gif differ diff --git a/img/mimetype/html.png b/img/mimetype/html.png new file mode 100644 index 0000000..00f4818 Binary files /dev/null and b/img/mimetype/html.png differ diff --git a/img/mimetype/image.png b/img/mimetype/image.png new file mode 100644 index 0000000..7b594f2 Binary files /dev/null and b/img/mimetype/image.png differ diff --git a/img/mimetype/image_.png b/img/mimetype/image_.png new file mode 100644 index 0000000..94fe85e Binary files /dev/null and b/img/mimetype/image_.png differ diff --git a/img/mimetype/pdf.png b/img/mimetype/pdf.png new file mode 100644 index 0000000..c68ab66 Binary files /dev/null and b/img/mimetype/pdf.png differ diff --git a/img/mimetype/powerpoint.png b/img/mimetype/powerpoint.png new file mode 100644 index 0000000..134a007 Binary files /dev/null and b/img/mimetype/powerpoint.png differ diff --git a/img/mimetype/text.png b/img/mimetype/text.png new file mode 100644 index 0000000..746afd9 Binary files /dev/null and b/img/mimetype/text.png differ diff --git a/img/mimetype/word.png b/img/mimetype/word.png new file mode 100644 index 0000000..c28b829 Binary files /dev/null and b/img/mimetype/word.png differ diff --git a/img/minus.gif b/img/minus.gif new file mode 100644 index 0000000..f4b28bd Binary files /dev/null and b/img/minus.gif differ diff --git a/img/new.gif b/img/new.gif new file mode 100644 index 0000000..754b627 Binary files /dev/null and b/img/new.gif differ diff --git a/img/ok.png b/img/ok.png new file mode 100644 index 0000000..a9925a0 Binary files /dev/null and b/img/ok.png differ diff --git a/img/paperclip.gif b/img/paperclip.gif new file mode 100644 index 0000000..2ab56be Binary files /dev/null and b/img/paperclip.gif differ diff --git a/img/piece.png b/img/piece.png new file mode 100644 index 0000000..8802d33 Binary files /dev/null and b/img/piece.png differ diff --git a/img/portlet_dot.gif b/img/portlet_dot.gif new file mode 100644 index 0000000..7e2f4cb Binary files /dev/null and b/img/portlet_dot.gif differ diff --git a/img/redmult.png b/img/redmult.png new file mode 100644 index 0000000..877be7d Binary files /dev/null and b/img/redmult.png differ diff --git a/img/redmult16.png b/img/redmult16.png new file mode 100644 index 0000000..fe83b81 Binary files /dev/null and b/img/redmult16.png differ diff --git a/img/sarrow.bk.gif b/img/sarrow.bk.gif new file mode 100644 index 0000000..bafbb1d Binary files /dev/null and b/img/sarrow.bk.gif differ diff --git a/img/sarrow.gif b/img/sarrow.gif new file mode 100644 index 0000000..bafbb1d Binary files /dev/null and b/img/sarrow.gif differ diff --git a/img/save.gif b/img/save.gif new file mode 100644 index 0000000..d70866b Binary files /dev/null and b/img/save.gif differ diff --git a/img/search.gif b/img/search.gif new file mode 100644 index 0000000..42aa6e0 Binary files /dev/null and b/img/search.gif differ diff --git a/img/search_icon.png b/img/search_icon.png new file mode 100644 index 0000000..2d1efbd Binary files /dev/null and b/img/search_icon.png differ diff --git a/img/simple.png b/img/simple.png new file mode 100644 index 0000000..3965009 Binary files /dev/null and b/img/simple.png differ diff --git a/img/svc.jpg b/img/svc.jpg new file mode 100644 index 0000000..db5ec30 Binary files /dev/null and b/img/svc.jpg differ diff --git a/img/up.gif b/img/up.gif new file mode 100644 index 0000000..2dbd4e3 Binary files /dev/null and b/img/up.gif differ diff --git a/img/view.gif b/img/view.gif new file mode 100644 index 0000000..e3ddd95 Binary files /dev/null and b/img/view.gif differ diff --git a/img/xls.gif b/img/xls.gif new file mode 100644 index 0000000..d35e1e4 Binary files /dev/null and b/img/xls.gif differ diff --git a/inc/menu.cfm b/inc/menu.cfm new file mode 100644 index 0000000..2829fbb --- /dev/null +++ b/inc/menu.cfm @@ -0,0 +1,54 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/index — копия.cfm b/index — копия.cfm deleted file mode 100644 index 7654c5b..0000000 --- a/index — копия.cfm +++ /dev/null @@ -1,241 +0,0 @@ - - - - -Нужно еще применить политики бесплатного минимума - - -Трафик хранится в той же таблице, что и остальной юзадж, можно было бы доставать в общем резалтсете - - - select sum(bytes_sent) as bytes, - placement.name as placement - 'WZ'||lpad(user_info.name, 5, '0') as wz - from s3billing.usage_bucket_by_user - join s3billing.user_info on usage_bucket_by_user.user_id=user_info.id - join s3billing.category on usage_bucket_by_user.category_id=category.id - join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id - join s3billing.placement on bucket_info.placement_id=placement.id - where 1=1 - AND usage_bucket_by_user.time >= - AND usage_bucket_by_user.time < - group by user_info.name - order by user_info.name; - - - - - - select sum(bytes_sent) as bytes, - 'WZ'||lpad(user_info.name, 5, '0') as wz - from s3billing.usage_bucket_by_user - join s3billing.user_info on usage_bucket_by_user.user_id=user_info.id - join s3billing.category on usage_bucket_by_user.category_id=category.id - --join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id - --join s3billing.placement on bucket_info.placement_id=placement.id AND placement.name='default-placement' - where s3billing.usage_bucket_by_user.bucketid='0' - AND usage_bucket_by_user.time >= - AND usage_bucket_by_user.time < - group by user_info.name - order by user_info.name; - - - - \ No newline at end of file diff --git a/index.cfm b/index.cfm index e78b937..2dc2895 100644 --- a/index.cfm +++ b/index.cfm @@ -1,457 +1 @@ - - - - - -Внимание! округление вверх при расчете метрик - - - - - - - - - - - select /* *** ниже дублирование кода агрегации round ceil etc, обратить внимание при правке */ - (sum(bucket_stat.usage_rgw_main_size_actual)/) as vol_B - ,round(sum(bucket_stat.usage_rgw_main_size_actual)//1024/1024/1024) as vol_GB - ,greatest(round(sum(bucket_stat.usage_rgw_main_size_actual)/ - /1024/1024/1024)- - case when bucket_stat.placement_id = 1 then 1 else 0 end, 0) as vol_GB_free_tier_substracted /*считается не в точности так, как в функции*/ - - ,case - when bucket_stat.placement_id = 1 then 'paas.s3.ceph' - when bucket_stat.placement_id = 2 then 'paas.s3.cphc' - else 'unknown' end as code - --,bucket_stat.placement_id - ,'WZ'||lpad(bucket_stat.owner, 5, '0') as wz -- *** здесь не число, а строка, поэтому другая формула обратной сборки WZ - - from s3billing.bucket_stat - join s3billing.placement ON s3billing.placement.id=bucket_stat.placement_id - join s3billing.bucket_info ON bucket_info.id=bucket_stat.bucket_id - where bucket_stat.placement_id in (1,2) - AND bucket_stat.timestamp_addition >= - AND bucket_stat.timestamp_addition < - group by bucket_stat.owner, bucket_stat.placement_id - order by bucket_stat.owner, bucket_stat.placement_id; - - - - -select - sum( - CASE WHEN - (category.name LIKE 'get%' - OR category.name LIKE 'head%' - OR category.name LIKE 'options%' - ) THEN ops ELSE 0 END - ) as get - ,ceil(sum( - CASE WHEN - (category.name LIKE 'get%' - OR category.name LIKE 'head%' - OR category.name LIKE 'options%' - ) THEN ops ELSE 0 END - )/10000) as get_10k - ,greatest(ceil(sum( - CASE WHEN - (category.name LIKE 'get%' - OR category.name LIKE 'head%' - OR category.name LIKE 'options%' - ) THEN ops ELSE 0 END - )/10000) - CASE WHEN bucket_info.placement_id = 1 THEN 10 ELSE 0 END, 0 - ) as get_10k_free_tier_subtracted - - ,sum( - CASE WHEN - (category.name LIKE 'put%' - OR category.name LIKE 'post%' - OR category.name LIKE 'patch%' - OR category.name LIKE 'list%' - ) THEN ops ELSE 0 END - ) as put - ,ceil(sum( - CASE WHEN - (category.name LIKE 'put%' - OR category.name LIKE 'post%' - OR category.name LIKE 'patch%' - OR category.name LIKE 'list%' - ) THEN ops ELSE 0 END - )/10000) as put_10k - ,greatest(ceil(sum( - CASE WHEN - (category.name LIKE 'put%' - OR category.name LIKE 'post%' - OR category.name LIKE 'patch%' - OR category.name LIKE 'list%' - ) THEN ops ELSE 0 END - )/10000) - CASE WHEN bucket_info.placement_id = 1 THEN 1 ELSE 0 END, 0 - ) as put_10k_free_tier_subtracted - - ,(sum(bytes_sent)) as bytes_sent - ,ceil(sum(bytes_sent)/1024/1024/1024) as bytes_sent_GB - ,greatest(ceil(sum(bytes_sent)/1024/1024/1024) - CASE WHEN bucket_info.placement_id = 1 THEN 100 ELSE 0 END, 0 - ) as bytes_sent_GB_free_tier_subtracted - - ,case - when bucket_info.placement_id = 1 then 'paas.s3.ceph' - when bucket_info.placement_id = 2 then 'paas.s3.cphc' - else 'unknown' end as code - ,bucket_info.placement_id - --category.name, bucket_info.name - ,'WZ'||lpad(user_info.name, 5, '0') as wz - from s3billing.usage_bucket_by_user - join s3billing.user_info on usage_bucket_by_user.user_id=user_info.id - join s3billing.category on usage_bucket_by_user.category_id=category.id - join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id - join s3billing.placement on bucket_info.placement_id=placement.id - where 1=1 - AND usage_bucket_by_user.time >= - AND usage_bucket_by_user.time < - group by user_info.name, bucket_info.placement_id - order by user_info.name, bucket_info.placement_id; - - - - - - - - - - - select sum(bytes_sent) as bytes, - --placement.name as placement, - case - when placement.name = 'COLD' then 'paas.s3.cphc' - when placement.name = 'default-placement' then 'paas.s3.ceph' - else 'unknown' end as code, - 'WZ'||lpad(user_info.name, 5, '0') as wz - from s3billing.usage_bucket_by_user - join s3billing.user_info on usage_bucket_by_user.user_id=user_info.id - join s3billing.category on usage_bucket_by_user.category_id=category.id - join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id - join s3billing.placement on bucket_info.placement_id=placement.id - where 1=1 - AND usage_bucket_by_user.time >= - AND usage_bucket_by_user.time < - group by user_info.name, placement.name - order by user_info.name; - - ---> - - - - - - - - - - - - - + \ No newline at end of file diff --git a/index.cfm.bak b/index.cfm.bak new file mode 100644 index 0000000..10b6c61 --- /dev/null +++ b/index.cfm.bak @@ -0,0 +1,456 @@ + + + + + +Внимание! округление вверх при расчете метрик + + + + + + + + + select distinct p.code + from elma.deals d + join elma.deals_services siv on (d.__id=ANY(siv.deal)) + join elma.service_parametrs p on (p.__id = ANY(siv.params)) + join elma.companies k on (d._companies=k.__id) + join elma.additional_agreements aa on (aa.__id = ANY(siv.additional_agreement)) + join elma.aggrements a on (aa.contract_uid = a.__id) + where p.type=3 AND aa.is_actual + order by p.code + + + + + select k.id_klienta as wz, p.code, p.price, p.discount, k.__name as contragent, a.__name as contract, d.__name as deal, siv.abstractive_service as abstract_service, siv.modifier, siv.user_description + ,p.__name as metric, p.ed_izm + --, aa.is_actual + from elma.deals d + join elma.deals_services siv on (d.__id=ANY(siv.deal)) + join elma.service_parametrs p on (p.__id = ANY(siv.params)) + join elma.companies k on (d._companies=k.__id) + join elma.additional_agreements aa on (aa.__id = ANY(siv.additional_agreement)) + join elma.aggrements a on (aa.contract_uid = a.__id) + where p.type=3 AND aa.is_actual + order by k.id_klienta, p.code + + + + + + + select 'WZ'||to_char(tenant.wzcode,'FM00000') as wz, vdc.name as vdc_name, + case + when vdc.name like '%-v1cl1%' then 'iaas.ngc.i29' + when vdc.name like '%-v1cl2%' then 'iaas.ngc.i31' + when vdc.name like '%-v1cl4%' then 'iaas.ngc.a28' + when vdc.name like '%-v1cl6%' then 'iaas.ngc.i28' + else '['||vdc.name||']' end as code, + sum(cpu_used/cpu_speed)/4. as core_h, + sum(mem_used)/1024/4. as gb_h + from ngcloud_ru.capacity_resource + join ngcloud_ru.vdc on capacity_resource.vdc_id=vdc.id + join ngcloud_ru.tenant on tenant.id=vdc.tenant_id + where tenant.wzcode > 0 + AND capacity_resource.timestamp >= + AND capacity_resource.timestamp < + group by tenant.wzcode, vdc.name + order by tenant.wzcode, vdc.name; + + + + + + select 'WZ'||to_char(tenant.wzcode,'FM00000') as wz, vdc.name as vdc_name, + case + WHEN vdc.name LIKE '%-v1cl1%' THEN 'iaas.ngc.i29' + WHEN vdc.name LIKE '%-v1cl2%' THEN 'iaas.ngc.i31' + WHEN vdc.name LIKE '%-v1cl4%' THEN 'iaas.ngc.a28' + WHEN vdc.name LIKE '%-v1cl6%' THEN 'iaas.ngc.i28' + ELSE '['||vdc.name||']' END + || CASE + WHEN storage_profile_types.name ILIKE '%-SSD%' THEN '.ssd-m' + WHEN storage_profile_types.name ILIKE '%-SAS' THEN '.sas-m' + WHEN storage_profile_types.name ILIKE '%-SATA' THEN '.sata-m' + ELSE '.['|| storage_profile_types.name ||']' END + as code, + storage_profile_types.name, -- *** это не тип, а профайл + sum("limit")/1024./4 as gb_h_limit, -- 4 потому, что сбор раз в 15 минут + sum(used)/1024./4 as gb_h_used + from ngcloud_ru.capacity_storage + join ngcloud_ru.vdc on capacity_storage.vdc_id=vdc.id + join ngcloud_ru.tenant on tenant.id=vdc.tenant_id + join ngcloud_ru.storage_profile_types on capacity_storage.storage_profile_types_id=storage_profile_types.id + where tenant.wzcode > 0 + AND capacity_storage.timestamp >= + AND capacity_storage.timestamp < + group by tenant.wzcode, vdc.name, storage_profile_types.name + order by tenant.wzcode, vdc.name, storage_profile_types.name; + + + + + + + select /* *** ниже дублирование кода агрегации - round ceil etc, обратить внимание при правке */ + (sum(bucket_stat.usage_rgw_main_size_actual)/) as vol_B + ,round(sum(bucket_stat.usage_rgw_main_size_actual)//1024/1024/1024) as vol_GB + ,greatest(round(sum(bucket_stat.usage_rgw_main_size_actual)/ + /1024/1024/1024)- + case when bucket_stat.placement_id = 1 then 1 else 0 end, 0) as vol_GB_free_tier_subtracted /*считается не в точности так, как в функции*/ + + ,case + when bucket_stat.placement_id = 1 then 'paas.s3.ceph' + when bucket_stat.placement_id = 2 then 'paas.s3.cphc' + else '['|| TO_CHAR(bucket_stat.placement_id,'FM9') ||']' end as code + --,bucket_stat.placement_id + ,'WZ'||lpad(bucket_stat.owner, 5, '0') as wz -- *** здесь не число, а строка, поэтому другая формула обратной сборки WZ + + from s3billing.bucket_stat + join s3billing.placement ON s3billing.placement.id=bucket_stat.placement_id + join s3billing.bucket_info ON bucket_info.id=bucket_stat.bucket_id + where bucket_stat.placement_id in (1,2) + AND bucket_stat.timestamp_addition >= + AND bucket_stat.timestamp_addition < + group by bucket_stat.owner, bucket_stat.placement_id + order by bucket_stat.owner, bucket_stat.placement_id; + + + + +select + sum( + CASE WHEN + (category.name LIKE 'get%' + OR category.name LIKE 'head%' + OR category.name LIKE 'options%' + ) THEN ops ELSE 0 END + ) as get + ,ceil(sum( + CASE WHEN + (category.name LIKE 'get%' + OR category.name LIKE 'head%' + OR category.name LIKE 'options%' + ) THEN ops ELSE 0 END + )/10000) as get_10k + ,greatest(ceil(sum( + CASE WHEN + (category.name LIKE 'get%' + OR category.name LIKE 'head%' + OR category.name LIKE 'options%' + ) THEN ops ELSE 0 END + )/10000) - CASE WHEN bucket_info.placement_id = 1 THEN 10 ELSE 0 END, 0 + ) as get_10k_free_tier_subtracted + + ,sum( + CASE WHEN + (category.name LIKE 'put%' + OR category.name LIKE 'post%' + OR category.name LIKE 'patch%' + OR category.name LIKE 'list%' + ) THEN ops ELSE 0 END + ) as put + ,ceil(sum( + CASE WHEN + (category.name LIKE 'put%' + OR category.name LIKE 'post%' + OR category.name LIKE 'patch%' + OR category.name LIKE 'list%' + ) THEN ops ELSE 0 END + )/10000) as put_10k + ,greatest(ceil(sum( + CASE WHEN + (category.name LIKE 'put%' + OR category.name LIKE 'post%' + OR category.name LIKE 'patch%' + OR category.name LIKE 'list%' + ) THEN ops ELSE 0 END + )/10000) - CASE WHEN bucket_info.placement_id = 1 THEN 1 ELSE 0 END, 0 + ) as put_10k_free_tier_subtracted + + ,(sum(bytes_sent)) as bytes_sent + ,ceil(sum(bytes_sent)/1024/1024/1024) as bytes_sent_GB + ,greatest(ceil(sum(bytes_sent)/1024/1024/1024) - CASE WHEN bucket_info.placement_id = 1 THEN 100 ELSE 0 END, 0 + ) as bytes_sent_GB_free_tier_subtracted + + ,case + when bucket_info.placement_id = 1 then 'paas.s3.ceph' + when bucket_info.placement_id = 2 then 'paas.s3.cphc' + else '['|| TO_CHAR(bucket_info.placement_id,'FM9') ||']' end as code --*** зачем делать там ключ bigint + ,bucket_info.placement_id + --category.name, bucket_info.name + ,'WZ'||lpad(user_info.name, 5, '0') as wz + from s3billing.usage_bucket_by_user + join s3billing.user_info on usage_bucket_by_user.user_id=user_info.id + join s3billing.category on usage_bucket_by_user.category_id=category.id + join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id + join s3billing.placement on bucket_info.placement_id=placement.id + where 1=1 + AND usage_bucket_by_user.time >= + AND usage_bucket_by_user.time < + group by user_info.name, bucket_info.placement_id + order by user_info.name, bucket_info.placement_id; + + + + +select wz, code || '.cpu-m' as code, core_h as raw_metric, core_h as metric, core_h as chargeable_metric from qComputing +union all +select wz, code || '.ram-m' as code, gb_h as raw_metric, gb_h as metric, gb_h as chargeable_metric from qComputing +union all +select wz, code, gb_h_used as raw_metric, gb_h_used as metric, gb_h_used as chargeable_metric from qStorage +union all +select wz, code || '.vol', vol_b as raw_metric, vol_gb as metric, vol_GB_free_tier_subtracted as chargeable_metric from qS3Vol +union all +select wz, code || '.get', get as raw_metric, get_10k as metric, get_10k_free_tier_subtracted as chargeable_metric from qS3OpsTrf +union all +select wz, code || '.put', put as raw_metric, put_10k as metric, put_10k_free_tier_subtracted as chargeable_metric from qS3OpsTrf +union all +select wz, code || '.trf', bytes_sent as raw_metric, bytes_sent_gb as metric, bytes_sent_gb_free_tier_subtracted as chargeable_metric from qS3OpsTrf + + + + +SELECT + wz +,code +,price +,discount +,contragent +,contract +,deal +,abstract_service +,modifier +,user_description +,ed_izm +FROM qSpec as s, qUnifiedMetric as m WHERE s.wz=m.wz AND s.code=m.code + + + + + + + + + + + + + + + + diff --git a/layout/attribute.cfm b/layout/attribute.cfm new file mode 100644 index 0000000..89bd22e --- /dev/null +++ b/layout/attribute.cfm @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/layout/column_head.cfm b/layout/column_head.cfm new file mode 100644 index 0000000..480b8a5 --- /dev/null +++ b/layout/column_head.cfm @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#ATTRIBUTES.title# + \ No newline at end of file diff --git a/layout/detail_buttons.cfm b/layout/detail_buttons.cfm new file mode 100644 index 0000000..36a9912 --- /dev/null +++ b/layout/detail_buttons.cfm @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/layout/detail_line.cfm b/layout/detail_line.cfm new file mode 100644 index 0000000..7381cbb --- /dev/null +++ b/layout/detail_line.cfm @@ -0,0 +1,10 @@ + + + +
+
#ATTRIBUTES.title#
+
\ No newline at end of file diff --git a/layout/filter_buttons.cfm b/layout/filter_buttons.cfm new file mode 100644 index 0000000..5626fea --- /dev/null +++ b/layout/filter_buttons.cfm @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/layout/filter_link.cfm b/layout/filter_link.cfm new file mode 100644 index 0000000..b1f51a1 --- /dev/null +++ b/layout/filter_link.cfm @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + #request.i18("Фильтр...","Filter")##request.i18("Фильтр","Filter")# + (#request.i18("снять","reset")#) + \ No newline at end of file diff --git a/layout/grid_head.cfm b/layout/grid_head.cfm new file mode 100644 index 0000000..2d3d599 --- /dev/null +++ b/layout/grid_head.cfm @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/layout/grid_summary.cfm b/layout/grid_summary.cfm new file mode 100644 index 0000000..cc56219 --- /dev/null +++ b/layout/grid_summary.cfm @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
 
+
+ + + Выбрано #ATTRIBUTES.recordCount# + + из #ATTRIBUTES.totalCount# + + + + + + + + + + +
+
+ #paginator.links# +
+
+
+
+ + + + +
+ #paginator.links# +
+
+
+
+ + diff --git a/layout/json.cfm b/layout/json.cfm new file mode 100644 index 0000000..47ebf3b --- /dev/null +++ b/layout/json.cfm @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + ---> + + + + + + + + + + + + + [{"#listGetAt(#columnsOut#,i)#":"#qry[listGetAt(#columnsIn#,i)]#",},] + ---> + + + + + + + + + + + + + + + //copy fields to structure, renaming fields, this preserves data type + + + + + + + + + + + + + + + + + + + +#query2json(ATTRIBUTES.qRead,ATTRIBUTES.convertSnakeToCamel)# + \ No newline at end of file diff --git a/layout/language_switch.cfm b/layout/language_switch.cfm new file mode 100644 index 0000000..6533051 --- /dev/null +++ b/layout/language_switch.cfm @@ -0,0 +1,9 @@ + + +   +   +   + style="font-weight:bold;">Ru + style="font-weight:bold;">En + + \ No newline at end of file diff --git a/layout/page.cfm b/layout/page.cfm new file mode 100644 index 0000000..8f68c66 --- /dev/null +++ b/layout/page.cfm @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +---> + + + + + + + + + + + + +<cfoutput>#pageTitle#</cfoutput> + + + + + + + + ---> + + + + + + + + + + +
+
+ + +
+ + + +
enctype="#ATTRIBUTES.pageInfo.formEncType#"> + + + +
+
+ + + + +
+ #title# +
+
+ #controls# +
+
+
+ +
+ + + + #ATTRIBUTES.pageInfo.status.errorMessage# + + + + + + +
+ + + +
+ + +
+ + + +
+ + + + + +
diff --git a/layout/xls.cfm b/layout/xls.cfm new file mode 100644 index 0000000..5d8a964 --- /dev/null +++ b/layout/xls.cfm @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#title##fieldArray[i]#
#dateFormat(data,'YYYY-MM-DD')# #timeFormat(data,'HH:mm')##Replace(data, '.', ',')##data##data#
+
+
+ + + + + + \ No newline at end of file diff --git a/layout/xlshtm.cfm b/layout/xlshtm.cfm new file mode 100644 index 0000000..b74ad64 --- /dev/null +++ b/layout/xlshtm.cfm @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#structFind(ATTRIBUTES.titleMap,field).title#
+ #ATTRIBUTES.qRead[field]# +
+ + +
+
+ + + + \ No newline at end of file diff --git a/layout/xml.cfm b/layout/xml.cfm new file mode 100644 index 0000000..65e7e41 --- /dev/null +++ b/layout/xml.cfm @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + xls-generator + + + + + + + + + + + + + + + ss:ExpandedColumnCount="#ListLen(qRead.ColumnList)#" + + ss:ExpandedRowCount="#(qRead.RecordCount + 1)#" + x:FullColumns="1" + x:FullRows="1"> + + + + + + + + + + + + + + + + + + select coalesce(max(length(#field#)),0) as maxlen from qRead + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #columns[i].title# + + + + + + + ss:StyleID="DateTime">#dateFormat(qRead[field],"YYYY-MM-DD")#T#timeFormat(qRead[field],"HH:mm:ss.l")##qRead[field]#
+ +
+ +
+ +
+ + + + + + + + \ No newline at end of file diff --git a/payg.cfm b/payg.cfm new file mode 100644 index 0000000..85b1b39 --- /dev/null +++ b/payg.cfm @@ -0,0 +1,593 @@ + + + + + + + + + + + + + + + + + + + + + + select distinct p.code + from elma.deals d + join elma.deals_services siv on (d.__id=ANY(siv.deal)) + join elma.service_parametrs p on (p.__id = ANY(siv.params)) + join elma.companies k on (d._companies=k.__id) + join elma.additional_agreements aa on (aa.__id = ANY(siv.additional_agreement)) + join elma.aggrements a on (aa.contract_uid = a.__id) + where p.type=3 AND aa.is_actual + order by p.code + + + + + select k.id_klienta as wz, k.__id::text as contragent_uid, p.code, p.price, p.discount, k.__name as contragent, a.__name as contract, a.__id::text as contract_uid, d.__name as deal, d.__id::text as deal_uid, siv.abstractive_service as abstract_service, siv.modifier, siv.user_description, siv.hash as line_key + ,siv.date_nop as dt_from, siv.date_end as dt_to + /*,p.__name as line_key*/, p.ed_izm, aa.__name as additional_agreement, aa.__id::text as additional_agreement_uid + --, aa.is_actual + from elma.deals d + join elma.deals_services siv on (d.__id=ANY(siv.deal)) + join elma.service_parametrs p on (p.__id = ANY(siv.params)) + join elma.companies k on (d._companies=k.__id) + join elma.additional_agreements aa on (aa.__id = ANY(siv.additional_agreement)) + join elma.aggrements a on (aa.contract_uid = a.__id) + where p.type=3 AND aa.is_actual + order by k.id_klienta, p.code + + + select max(dt_load) as dt_load from elma.deals_services + + + + + + + + + + select 'WZ'||to_char(tenant.wzcode,'FM00000') as wz, vdc.name as vdc_name, + case + when vdc.name like '%-v1cl1%' then 'iaas.ngc.i29' + when vdc.name like '%-v1cl2%' then 'iaas.ngc.i31' + when vdc.name like '%-v1cl4%' then 'iaas.ngc.a28' + when vdc.name like '%-v1cl6%' then 'iaas.ngc.i28' + else '['||vdc.name||']' end as code, + sum(cpu_used/cpu_speed)/4. as core_h, + sum(mem_used)/1024/4. as gb_h + from ngcloud_ru.capacity_resource + join ngcloud_ru.vdc on capacity_resource.vdc_id=vdc.id + join ngcloud_ru.tenant on tenant.id=vdc.tenant_id + where tenant.wzcode > 0 + AND capacity_resource.timestamp >= + AND capacity_resource.timestamp < + group by tenant.wzcode, vdc.name + order by tenant.wzcode, vdc.name; + + + + select max(capacity_resource.timestamp) as dt_load from ngcloud_ru.capacity_resource + + + + + select 'WZ'||to_char(tenant.wzcode,'FM00000') as wz, vdc.name as vdc_name, + case + WHEN vdc.name LIKE '%-v1cl1%' THEN 'iaas.ngc.i29' + WHEN vdc.name LIKE '%-v1cl2%' THEN 'iaas.ngc.i31' + WHEN vdc.name LIKE '%-v1cl4%' THEN 'iaas.ngc.a28' + WHEN vdc.name LIKE '%-v1cl6%' THEN 'iaas.ngc.i28' + ELSE '['||vdc.name||']' END + || CASE + WHEN storage_profile_types.name ILIKE '%-SSD%' THEN '.ssd-m' + WHEN storage_profile_types.name ILIKE '%-SAS' THEN '.sas-m' + WHEN storage_profile_types.name ILIKE '%-SATA' THEN '.sata-m' + ELSE '.['|| storage_profile_types.name ||']' END + as code, + storage_profile_types.name, -- *** это не тип, а профайл + sum("limit")/1024./4 as gb_h_limit, -- 4 потому, что сбор раз в 15 минут + sum(used)/1024./4 as gb_h_used + from ngcloud_ru.capacity_storage + join ngcloud_ru.vdc on capacity_storage.vdc_id=vdc.id + join ngcloud_ru.tenant on tenant.id=vdc.tenant_id + join ngcloud_ru.storage_profile_types on capacity_storage.storage_profile_types_id=storage_profile_types.id + where tenant.wzcode > 0 + AND capacity_storage.timestamp >= + AND capacity_storage.timestamp < + group by tenant.wzcode, vdc.name, storage_profile_types.name + order by tenant.wzcode, vdc.name, storage_profile_types.name; + + + select max(capacity_storage.timestamp) as dt_load from ngcloud_ru.capacity_storage + + + + + + + select /* *** ниже дублирование кода агрегации - round ceil etc, обратить внимание при правке */ + (sum(bucket_stat.usage_rgw_main_size_actual)/) as vol_B + ,round(sum(bucket_stat.usage_rgw_main_size_actual)//1024/1024/1024) as vol_GB + ,greatest(round(sum(bucket_stat.usage_rgw_main_size_actual)/ + /1024/1024/1024)- + case when bucket_stat.placement_id = 1 then 1 else 0 end, 0) as vol_GB_free_tier_subtracted /*считается не в точности так, как в функции*/ + ,case + when bucket_stat.placement_id = 1 then 'paas.s3.ceph' + when bucket_stat.placement_id = 2 then 'paas.s3.cphc' + else '['|| TO_CHAR(bucket_stat.placement_id,'FM9') ||']' end as code + --,bucket_stat.placement_id + ,'WZ'||lpad(bucket_stat.owner, 5, '0') as wz -- *** здесь не число, а строка, поэтому другая формула обратной сборки WZ + + from s3billing.bucket_stat + join s3billing.placement ON s3billing.placement.id=bucket_stat.placement_id + join s3billing.bucket_info ON bucket_info.id=bucket_stat.bucket_id + where bucket_stat.placement_id in (1,2) + AND bucket_stat.timestamp_addition >= + AND bucket_stat.timestamp_addition < + group by bucket_stat.owner, bucket_stat.placement_id + order by bucket_stat.owner, bucket_stat.placement_id; + + + + select max(timestamp_addition) as dt_load from s3billing.bucket_stat + + + +select + sum( + CASE WHEN + (category.name LIKE 'get%' + OR category.name LIKE 'head%' + OR category.name LIKE 'options%' + ) THEN ops ELSE 0 END + ) as get + ,ceil(sum( + CASE WHEN + (category.name LIKE 'get%' + OR category.name LIKE 'head%' + OR category.name LIKE 'options%' + ) THEN ops ELSE 0 END + )/10000) as get_10k + ,greatest(ceil(sum( + CASE WHEN + (category.name LIKE 'get%' + OR category.name LIKE 'head%' + OR category.name LIKE 'options%' + ) THEN ops ELSE 0 END + )/10000) - CASE WHEN bucket_info.placement_id = 1 THEN 10 ELSE 0 END, 0 + ) as get_10k_free_tier_subtracted + + ,sum( + CASE WHEN + (category.name LIKE 'put%' + OR category.name LIKE 'post%' + OR category.name LIKE 'patch%' + OR category.name LIKE 'list%' + ) THEN ops ELSE 0 END + ) as put + ,ceil(sum( + CASE WHEN + (category.name LIKE 'put%' + OR category.name LIKE 'post%' + OR category.name LIKE 'patch%' + OR category.name LIKE 'list%' + ) THEN ops ELSE 0 END + )/10000) as put_10k + ,greatest(ceil(sum( + CASE WHEN + (category.name LIKE 'put%' + OR category.name LIKE 'post%' + OR category.name LIKE 'patch%' + OR category.name LIKE 'list%' + ) THEN ops ELSE 0 END + )/10000) - CASE WHEN bucket_info.placement_id = 1 THEN 1 ELSE 0 END, 0 + ) as put_10k_free_tier_subtracted + + ,(sum(bytes_sent)) as bytes_sent + ,ceil(sum(bytes_sent)/1024/1024/1024) as bytes_sent_GB + ,greatest(ceil(sum(bytes_sent)/1024/1024/1024) - CASE WHEN bucket_info.placement_id = 1 THEN 100 ELSE 0 END, 0 + ) as bytes_sent_GB_free_tier_subtracted + + ,case + when bucket_info.placement_id = 1 then 'paas.s3.ceph' + when bucket_info.placement_id = 2 then 'paas.s3.cphc' + else '['|| TO_CHAR(bucket_info.placement_id,'FM9') ||']' end as code --*** зачем делать там ключ bigint + ,bucket_info.placement_id + --category.name, bucket_info.name + ,'WZ'||lpad(user_info.name, 5, '0') as wz + from s3billing.usage_bucket_by_user + join s3billing.user_info on usage_bucket_by_user.user_id=user_info.id + join s3billing.category on usage_bucket_by_user.category_id=category.id + join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id + join s3billing.placement on bucket_info.placement_id=placement.id + where 1=1 + AND usage_bucket_by_user.time >= + AND usage_bucket_by_user.time < + group by user_info.name, bucket_info.placement_id + order by user_info.name, bucket_info.placement_id; + + + select max(time) as dt_load from s3billing.usage_bucket_by_user + + + + +select wz, code || '.cpu-m' as code, core_h as raw_metric, core_h as metric, core_h as chargeable_metric from qComputing +union all +select wz, code || '.ram-m' as code, gb_h as raw_metric, gb_h as metric, gb_h as chargeable_metric from qComputing +union all +select wz, code, gb_h_used as raw_metric, gb_h_used as metric, gb_h_used as chargeable_metric from qStorage +union all +select wz, code || '.vol-m', vol_b as raw_metric, vol_gb as metric, vol_GB_free_tier_subtracted as chargeable_metric from qS3Vol +union all +select wz, code || '.get-m', get as raw_metric, get_10k as metric, get_10k_free_tier_subtracted as chargeable_metric from qS3OpsTrf +union all +select wz, code || '.put-m', put as raw_metric, put_10k as metric, put_10k_free_tier_subtracted as chargeable_metric from qS3OpsTrf +union all +select wz, code || '.trf-m', bytes_sent as raw_metric, bytes_sent_gb as metric, bytes_sent_gb_free_tier_subtracted as chargeable_metric from qS3OpsTrf + + + + + + + +SELECT + s.wz +,s.code +,s.price +,s.discount +,s.contragent, s.contragent_uid +,s.contract,s.contract_uid +,s.deal, s.deal_uid +,s.additional_agreement, s.additional_agreement_uid +,s.abstract_service +,s.modifier +,user_description +,s.ed_izm +,s.line_key, s.dt_from, s.dt_to +,s.deal,s.abstract_service,s.modifier,s.user_description +,m.raw_metric +,m.metric +,m.chargeable_metric +,s.price*(100-s.discount)/100 as discounted_price +,s.price*(100-s.discount)/100*m.chargeable_metric as charge +FROM qSpec as s, qUnifiedMetric as m WHERE s.wz=m.wz AND s.code=m.code +order by s.wz, s.code + + + + + + + Отчет по PAYG + + + + + + + +Внимание! округление вверх при расчете метрик get, put S3. Расчетные суммы могут содержать погрешности округления, поэтому окончательный расчет стоимости (количество * цену) должен выполняться в бухгалтерской программе. +Если у клиента больше 1 действующего допника с услугами PAYG, то данные в отчете могут быть замножены, в этом случае считать вручную +
+Даты актуальности пока проверять вручную + +
+Период с +по + + +
+Часов в периоде: #hours# Строк в отчете: #qCharge.recordCount#
+Актуальность данных: +VCD Computing: #dateFormat(qComputingAge.dt_load,'YYYY-MM-DD')# #timeFormat(qComputingAge.dt_load,'HH:MM:SS')# +VCD Storage: #dateFormat(qStorageAge.dt_load,'YYYY-MM-DD')# #timeFormat(qStorageAge.dt_load,'HH:MM:SS')# +S3 хранение: #dateFormat(qS3VolAge.dt_load,'YYYY-MM-DD')# #timeFormat(qS3VolAge.dt_load,'HH:MM:SS')# +S3 операции и трафик: #dateFormat(qS3OpsTrfAge.dt_load,'YYYY-MM-DD')# #timeFormat(qS3OpsTrfAge.dt_load,'HH:MM:SS')# +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WZАртикулЦена без НДС проверитьКол-во (метрика)Ед.изм.Ст-ть   Дата НОУДата оконч.Ключ строкиGPL без НДС проверитьСкидка%Сырая метрикаПриведен­ная метрикаКонтрагентДоговорДопникСделкаУслугаКлиентс. назв.
#currentRow##wz##code##discounted_price##chargeable_metric##ed_izm##charge##dateFormat(dt_from,'YYYY-MM-DD')##dateFormat(dt_to,'YYYY-MM-DD')##line_key##price##discount##raw_metric##metric##contragent##contract##additional_agreement##deal##abstract_service# #modifier##user_description#
#wz# #contragent##NumFmt(acc,2)#
+ + + + + + + + + + + + + + + + + + diff --git a/style/web.css b/style/web.css new file mode 100644 index 0000000..3463337 --- /dev/null +++ b/style/web.css @@ -0,0 +1,321 @@ +/*common elements*/ +html, body { + margin: 0; + padding: 0; + border: none; + height: 100%; +} +body, table, tr, td, th, input, select, textarea, button, form, ul, li, p { + font-size: 11px; + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + color:black; +} +form {margin: 0;padding:0;} +p {margin: 0.5em;} +table {border-collapse: collapse;} +img {border: none; margin: 0; vertical-align: middle;} +a, a:link, a:visited {color: #111111; text-decoration: underline;} +a:hover {color: #ff7600; text-decoration: underline;} + + +/* form elements */ +input {color: black; padding: 0 0.3em; } +input:read-only {color:#555; background-color:#f0f0f0;} +input:disabled {color:#555; background-color:#f0f0f0;} +select:disabled {color:#555;} +select option[disabled] { color:#ddd;} + +.detail .td input[type="text"]:disabled {border:1px solid #aaa; color:#555;} +.textbox-disabled {display:inline-block; border: 1px solid #aaa; color:#555; background-color:#f0f0f0; padding:.1em;} + +/*layout*/ + +div.vspacer {height:5px;} + +ul#mainmenu { + list-style-type:none; + padding:0; + margin:0; + display:block; + width:100%; +} +ul#mainmenu li { + text-align:right; + vertical-align:baseline; + padding:.2em 15px .2em 0 ; + margin:.3em 0; + background: url('../img/sarrow.gif') center right no-repeat; + font-size:120%; + font-weight:normal; + font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; + line-height: 1.1em; +} +ul#mainmenu li a{/*display:block;*/color:#cde;text-decoration:none;} +ul#mainmenu li a:hover{text-decoration:underline;} +ul#mainmenu li.selected {color: /*#4682b4;*/ #fa6 /*#00f*/;} +ul#mainmenu li.menu-item-ext {background: url('../img/external.gif') center right no-repeat;} +ul#mainmenu li.menu-item-noaction {background: none; color: #777;} +ul#mainmenu li.menu-title { + color: #111; + background:none white; + margin:.5em 0 0 0; + /*font-weight: bold;*/ + /*border:1px solid #ccc;*/ +} + +.page {display:table; table-layout: fixed; width:100%; height:100%;} + +.page-main {display:table-row; height:100%;} + +.page-footer {display:table-row; height:1px;} + +.menu {display:table-cell; width:150px; padding:0 0 0 .5em; background-color: #012; -border:1px solid red;} + +.content {display:table-cell; height:100%; vertical-align:top; padding: 3px;} + +.header {display:block; /*background:url('../img/portlet_dot.gif') center left no-repeat; padding-left:33px;*/ line-height: 21px; font-family: Verdana, Tahoma, sans-serif;} + +.control-bar {display:table; width:100%; color:/*#559*/white; /*border:1px solid #ccc;*/ height:19px; } +.header .control-bar a:link, .header .control-bar a:visited {color:white; padding: .2em .5em;} +.header .control-bar a:hover {background:white;color:#f90; padding: .2em .5em;} + +.title {display:table-cell; padding:1px 12px; vertical-align:middle; font-size:110%; background-color:#aaa/*#ccc*//*rgb(117,147,156)*/; /*color:#fa6;*/ border: 1px solid #bbb; border-right:none;} +.title b {color:#026;} + +.main-controls {display:table-cell; padding:0 7px; text-align:right; vertical-align: middle; background-color:#aaa/*rgb(117,147,156)*/; border: 1px solid #bbb; border-left:none;} + +.footer {height:21px; line-height: 21px; background-color:#e0e0e0; border:1px solid #bbb; text-align: right; vertical-align: middle; padding:0 3px;} + + +.table {display:table;} +.tr {display:table-row;} +.td, .th {display:table-cell; padding: 0 0.5em; vertical-align:top;} + + +.detail { + display:table; + width:100%; + margin: 3px 0; + border:1px solid #ddd; + border-collapse: collapse; +} +.detail .tr{ + line-height: 1.5em; +} +.detail .th { + display:table-cell; + text-align:right; + background-color:#e0e0e0; + padding:0.35em 0.5em; + border:none; + /*color: #5f5f5f;*/ + font-weight:normal; + vertical-align:top; + /*border:1px solid red;*/ +} +.detail .td { + display:table-cell; + background-color:#e7e7e7; + padding:0.2em 0.5em; + border:1px solid #ddd; + vertical-align:baseline; +} +.detail .td input, .detail .td select, .detail .td img, .detail .td button, .detail .td div, .detail .td span { + vertical-align: baseline; + margin: 0 0.3em; +} + +.detail .td label { + vertical-align: baseline; + margin: 0 0.3em 0 0; + line-height:normal; +} + +.detail .td input[type="checkbox"] { + vertical-align: top; margin: 0 0 0 0.3em; +} + +/*.detail .td input[type="text"] { + width: 97%; +}*/ + +.detail .td textarea { + color: black; + width: 97%; + margin-left: 0.2em; + padding: 0.2em 0.5em; +} +/***hack*/ +.detail .td a img {vertical-align:text-bottom;} + +.filter {background-color: #f7f7f7;} +.disabled, tr.disabled td, tr.disabled th {color: #888;} +.plate {background-color:#f0f0f0; padding:.1em; border:1px solid #ddd;} + +button, .button, .content a.button:link { + background: #fafafa; + -background: -webkit-linear-gradient(top, #fafafa 0%, #f4f4f4 40%,#e5e5e5 100%); + background:-webkit-linear-gradient(top, #dde 0%, #cde 40%,#bcd 100%); + border: 1px solid #aad; + padding: 1px 10px; + color: #black; + border-radius: 3px; + box-shadow: 0 1px 1px #ddd; + } + +button:disabled, .button:disabled, .maincontrol:disabled { + background: #fafafa; + background: -webkit-linear-gradient(top, #fafafa 0%,#f4f4f4 40%,#e5e5e5 100%); + border-color: #aaa; + color: #999; + box-shadow: none; +} + +button:not(:disabled):hover, +.button:not(:disabled):hover, +.maincontrol:not(:disabled):hover +{ + background: #fefefe; + background: -webkit-linear-gradient(top, #fefefe 0%,#f8f8f8 40%,#e9e9e9 100%); + box-shadow: 0 1px 3px rgba(7, 7, 7, 0.35); + border: 1px solid #aaa; + color: #ff7600; +} + +button:not(:disabled):active, .button:not(:disabled):active { + background: #f4f4f4; + background: -webkit-linear-gradient(top, #f4f4f4 0%,#efefef 40%,#dcdcdc 100%); + box-shadow: inset 0 1px 3px rgba(7, 7, 7, 0.35); +} + +button.maincontrol { + /*background-color:#c3c82f; + background:-webkit-linear-gradient(top, #cd6 0%, #cd6 40%,#bc5 100%);*/ + -background-color:#6fa0f0; + background-color:#6fa0f0; + background:-webkit-linear-gradient(top, #dde 0%, #cde 40%,#bcd 100%); + color: black; +} + +button.maincontrol:hover { + +} + + +/*не совсем аккуратно, при нажатии выглядит чуть иначе, чем кнопка*/ +.content button a, .content button a:link, .content button a:visited {color: #790; text-decoration:none; cursor:default;} +.content button:hover a, .content button:active {color: #ff7600; text-decoration:none; cursor:default;} +.content button.maincontrol a, .content button.maincontrol a:link,.content button.maincontrol a:visited {color: black;} +.content button.maincontrol:hover a, .content button.maincontrol:active a {color: #ff7600;} + +.submitnew { + background-image:url('../img/new.gif'); + width:13px; height:13px; border:none; padding:0; color:transparent; cursor:pointer; +} +.submitsave { + background-image:url('../img/save.gif'); + width:14px; height:14px; border:none; padding:0; color:transparent; cursor:pointer; +} +.submitdel { + background-image:url('../img/del.gif'); + width:13px; height:13px; border:none; padding:0; color:transparent; cursor:pointer; +} +.submitminus { + background-image:url('../img/minus.gif'); + width:13px; height:13px; border:none; padding:0; color:transparent; cursor:pointer; +} + +.content a, .content a:link, .content a:visited {color: #1111ee; text-decoration: none;} +.content a:hover {color: #ff7600; text-decoration: underline;} +.content h4 {margin-block-end: .5em;} +.content i {color:#555;} + +.cell {border: 1px solid #ddd; width:100%; padding: 0.2em;} + +.l, td.l, th.l{text-align: left;} +.r, td.r, th.r{text-align: right;} +.c, td.c, th.c{text-align: center;} +.nw {white-space: nowrap;} +.b {font-weight:bold;} +.i {font-style:italic;} +.wide {min-width:100%} +.wh100 {width:100%; height:100%;} +.table {display:table} +.tcell {display:table-cell} +.mid {vertical-align:middle} /*используется для заполнения ячейки таблицы якорем a href*/ + +.err {color: red;} +.warn {color: #f80;} + +a.up {background: url('../img/up.gif') center right no-repeat; padding-right: 7px;} +a.add {background: url('../img/add.gif') center right no-repeat; width:13px; height:13px; display:inline-block;} +a.edit {background: url('../img/edit.gif') center right no-repeat; width:13px; height:13px; display:inline-block;} +a.view {background: url('../img/view.gif') center right no-repeat; width:13px; height:13px; display:inline-block;} +a.del {background: url('../img/del.gif') center right no-repeat; width:13px; height:13px; display:inline-block;} + + +/* worktable classes */ + +table.worktable {border-collapse:separate; border-spacing:0; border-left:1px solid #ddd;} + +table.worktable th, +table.worktable td { + border-bottom: thin solid #ddd; + border-right: thin solid #ddd; +} +table.worktable thead th, +table.worktable thead td { + box-shadow: 0 -1px 0 0 #ddd; +} +table.worktable thead { + top: 0; + left: 0; + position: sticky; + z-index: 1; +} + +table.worktable td p {margin:0;} + +table.worktable thead tr td, table.worktable tr th{padding: 3px; background-color: #999;} + +table.worktable tr {height: 1.7em; background-color: white;} + +table.worktable tr td {padding:0.1em 0.3em; height:2em;} + +table.worktable tr:hover, table.worktable tr td:hover {background-color:#e5e5e5;} + +table.worktable th {font-weight:500; color:white;} + +/*double borders - not tested with border-collapse:separate*/ +table.worktable tbody tr td.lbd, +table.worktable thead tr td.lbd + {border-left: double #ccc;} + +table.worktable tbody tr td.rbd, +table.worktable thead tr td.rbd + {border-right: double #ccc;} + +table.worktable tbody tr td.tbd, +table.worktable thead tr td.tbd, +table.worktable tbody tr.tbd td, +table.worktable thead tr.tbd td + {border-top: double #ccc;} + +table.worktable tbody tr td.bbd, +table.worktable thead tr td.bbd, +table.worktable tbody tr.bbd td, +table.worktable thead tr.bbd td + {border-bottom: double #ccc;} + +table.worktable tr.hist {background-color: #f6f6f6;} +table.worktable tr.hist:hover, table.worktable tr.hist:hover td, table.worktable tr.comment:hover{background-color:#efefef;} +table.worktable tr.hist td.marked {background: #ddf5c0;} +table.worktable tr.hist:hover td.marked{background-color:#d0f0b9;} + + +@media print { + #mainmenu, .menu, .page-footer, .control-bar, .noprint {display:none;} +} + + +