Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
391e50f7
Commit
391e50f7
authored
Aug 05, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: lint
parent
308f2678
Pipeline
#10857
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
20 deletions
+20
-20
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Base_getServiceLevelObjectGradeAsHTML.py
...s_crm_monitoring/Base_getServiceLevelObjectGradeAsHTML.py
+11
-11
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputerModule_getComputerTicketReportList.py
..._monitoring/ComputerModule_getComputerTicketReportList.py
+2
-2
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Computer_getRelatedSupportRequestList.py
...s_crm_monitoring/Computer_getRelatedSupportRequestList.py
+3
-3
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/HostingSubscriptionModule_getResilienceUsageReportList.py
...HostingSubscriptionModule_getResilienceUsageReportList.py
+2
-2
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/HostingSubscriptionModule_getUsageReportList.py
...onitoring/HostingSubscriptionModule_getUsageReportList.py
+2
-2
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Base_getServiceLevelObjectGradeAsHTML.py
View file @
391e50f7
...
...
@@ -3,14 +3,14 @@ grade = context.Base_getServiceLevelObjectGrade(slo, value)
return
grade
# Report seems not able to render HTML
color_dict
=
{
"A"
:
"lightgreen"
,
"B"
:
"green"
,
"C"
:
"blue"
,
"D"
:
"orange"
,
"E"
:
"red"
,
"F"
:
"red"
,
}
for
g
,
color
in
color_dict
.
iteritems
():
if
grade
.
startswith
(
g
):
return
"<font color='%s'>%s</font>"
%
(
color
,
grade
)
#
color_dict = {
#
"A": "lightgreen",
#
"B": "green",
#
"C": "blue",
#
"D": "orange",
#
"E": "red",
#
"F": "red",
#
}
#
for g, color in color_dict.iteritems():
#
if grade.startswith(g):
#
return "<font color='%s'>%s</font>" % (color, grade)
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputerModule_getComputerTicketReportList.py
View file @
391e50f7
from
DateTime
import
DateTime
import
json
portal
=
context
.
getPortalObject
()
from
Products.ERP5Type.Document
import
newTemp
Document
from
Products.ERP5Type.Document
import
newTemp
Base
public_category_uid
=
portal
.
restrictedTraverse
(
"portal_categories/allocation_scope/open/public"
,
None
).
getUid
()
...
...
@@ -78,7 +78,7 @@ for computer in portal.portal_catalog(
instance_error_ratio
=
float
(
instance_error_count
)
/
instance_count
l
.
append
(
newTemp
Document
(
context
,
'%s'
%
computer
.
id
,
**
{
"title"
:
computer
.
title
,
newTemp
Base
(
context
,
'%s'
%
computer
.
id
,
**
{
"title"
:
computer
.
title
,
"uid"
:
"%s_%s"
%
(
computer
.
getUid
(),
instance_count
),
"reference"
:
computer
.
reference
,
"partition_use_ratio"
:
partition_use_ratio
,
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Computer_getRelatedSupportRequestList.py
View file @
391e50f7
...
...
@@ -2,9 +2,9 @@ portal = context.getPortalObject()
uid_list
=
[
context
.
getUid
()]
for
instance
in
portal
.
portal_catalog
(
portal_type
=
"Software Instance"
,
default_aggregate_uid
=
[
cp
.
uid
for
cp
in
context
.
searchFolder
(
portal_type
=
"Computer Partition"
)]):
uid_list
.
append
(
instance
.
getSpecialiseUid
(
portal_type
=
"Hosting Subscription"
))
portal_type
=
"Software Instance"
,
default_aggregate_uid
=
[
cp
.
uid
for
cp
in
context
.
searchFolder
(
portal_type
=
"Computer Partition"
)]):
uid_list
.
append
(
instance
.
getSpecialiseUid
(
portal_type
=
"Hosting Subscription"
))
return
portal
.
portal_catalog
(
portal_type
=
'Support Request'
,
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/HostingSubscriptionModule_getResilienceUsageReportList.py
View file @
391e50f7
portal
=
context
.
getPortalObject
()
from
Products.ERP5Type.Document
import
newTemp
Document
from
Products.ERP5Type.Document
import
newTemp
Base
kw
=
{}
kw
[
"portal_type"
]
=
"Hosting Subscription"
...
...
@@ -39,7 +39,7 @@ document_list = []
for
person_relative_url
in
l
:
person
=
portal
.
restrictedTraverse
(
person_relative_url
)
document_list
.
append
(
newTemp
Document
(
context
.
person_module
,
person
.
getId
(),
newTemp
Base
(
context
.
person_module
,
person
.
getId
(),
uid
=
"t_%s"
%
person
.
getUid
(),
title
=
person
.
getTitle
(),
**
l
[
person_relative_url
]))
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/HostingSubscriptionModule_getUsageReportList.py
View file @
391e50f7
from
DateTime
import
DateTime
from
Products.ERP5Type.Document
import
newTemp
Document
from
Products.ERP5Type.Document
import
newTemp
Base
portal
=
context
.
getPortalObject
()
...
...
@@ -37,7 +37,7 @@ creation_date_list = list(date_set)
creation_date_list
.
sort
()
for
creation_date
in
creation_date_list
:
line
=
newTemp
Document
(
context
,
'%s'
%
creation_date
.
replace
(
"/"
,
"_"
),
**
{
line
=
newTemp
Base
(
context
,
'%s'
%
creation_date
.
replace
(
"/"
,
"_"
),
**
{
"uid"
:
"%s_%s"
%
(
context
.
getUid
(),
len
(
stats_list
)),
"title"
:
creation_date
,
"hosting_subscription_quantity"
:
countDocument
(
creation_date
,
"Hosting Subscription"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment