Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
ee87137b
Commit
ee87137b
authored
Jul 18, 2016
by
Juorder Gonzalez
Committed by
GitHub
Jul 18, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #261 from ZBoxApp/manager_performance
add notification for domain migrating mailboxes
parents
0d526cdb
8b6f65ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
94 deletions
+110
-94
path.json
path.json
+1
-1
domain_mailbox_plans.jsx
src/components/domain/domain_mailbox_plans.jsx
+109
-93
No files found.
path.json
View file @
ee87137b
module.exports
=
{
"main"
:{
"js"
:
"/142926bundle.js"
}}
module.exports
=
{
"main"
:{
"js"
:
"/975145bundle.js"
}}
\ No newline at end of file
\ No newline at end of file
src/components/domain/domain_mailbox_plans.jsx
View file @
ee87137b
...
@@ -42,6 +42,7 @@ export default class DomainMailboxPlans extends React.Component {
...
@@ -42,6 +42,7 @@ export default class DomainMailboxPlans extends React.Component {
);
);
}
}
render
()
{
render
()
{
const
countAccounts
=
this
.
state
.
plans
;
if
(
!
this
.
state
.
plans
)
{
if
(
!
this
.
state
.
plans
)
{
return
<
div
/>;
return
<
div
/>;
}
}
...
@@ -72,127 +73,142 @@ export default class DomainMailboxPlans extends React.Component {
...
@@ -72,127 +73,142 @@ export default class DomainMailboxPlans extends React.Component {
const
mailboxPlans
=
[];
const
mailboxPlans
=
[];
let
panelBody
=
null
;
let
panelBody
=
null
;
const
cos
=
Utils
.
getEnabledPlansByCosId
(
ZimbraStore
.
getAllCos
());
const
planKeys
=
Object
.
keys
(
cos
).
map
((
c
)
=>
{
return
cos
[
c
];
});
const
domain
=
this
.
props
.
domain
;
const
domainCos
=
domain
.
maxAccountsByCos
();
const
domainPlans
=
Utils
.
getPlansFromDomain
(
domain
);
const
plans
=
{};
let
noLimitError
;
let
noLimitError
;
let
totalUsed
=
0
;
const
isNotMigrating
=
!
countAccounts
.
migracion
;
let
totalLimit
=
0
;
if
(
isNotMigrating
)
{
planKeys
.
forEach
((
key
)
=>
{
const
cos
=
Utils
.
getEnabledPlansByCosId
(
ZimbraStore
.
getAllCos
());
plans
[
key
]
=
{
const
planKeys
=
Object
.
keys
(
cos
).
map
((
c
)
=>
{
limit
:
0
,
return
cos
[
c
];
used
:
0
};
});
let
used
=
0
;
if
(
domainCos
)
{
Object
.
keys
(
domainCos
).
forEach
((
id
)
=>
{
const
limit
=
domainCos
[
id
];
used
=
domainPlans
[
cos
[
id
]].
used
;
plans
[
cos
[
id
]].
limit
+=
limit
;
plans
[
cos
[
id
]].
used
+=
used
;
});
});
}
for
(
const
key
in
plans
)
{
const
domain
=
this
.
props
.
domain
;
if
(
plans
.
hasOwnProperty
(
key
)
&&
plans
[
key
].
limit
!==
0
)
{
const
domainCos
=
domain
.
maxAccountsByCos
();
const
plan
=
plans
[
key
];
const
domainPlans
=
Utils
.
getPlansFromDomain
(
domain
);
totalUsed
+=
(
parseInt
(
plan
.
used
,
10
))
?
parseInt
(
plan
.
used
,
10
)
:
0
;
const
plans
=
{};
if
(
plan
.
limit
===
0
)
{
let
totalUsed
=
0
;
//totalLimit = '\u221e';
let
totalLimit
=
0
;
if
(
!
noLimitError
)
{
planKeys
.
forEach
((
key
)
=>
{
noLimitError
=
(
plans
[
key
]
=
{
<
MessageBar
limit
:
0
,
message=
'Existen dominios sin límites asignados'
used
:
0
type=
'WARNING'
};
autoclose=
{
true
}
});
/>
);
let
used
=
0
;
if
(
domainCos
)
{
Object
.
keys
(
domainCos
).
forEach
((
id
)
=>
{
const
limit
=
domainCos
[
id
];
used
=
domainPlans
[
cos
[
id
]].
used
;
plans
[
cos
[
id
]].
limit
+=
limit
;
plans
[
cos
[
id
]].
used
+=
used
;
});
}
for
(
const
key
in
plans
)
{
if
(
plans
.
hasOwnProperty
(
key
)
&&
plans
[
key
].
limit
!==
0
)
{
const
plan
=
plans
[
key
];
totalUsed
+=
(
parseInt
(
plan
.
used
,
10
))
?
parseInt
(
plan
.
used
,
10
)
:
0
;
if
(
plan
.
limit
===
0
)
{
//totalLimit = '\u221e';
if
(
!
noLimitError
)
{
noLimitError
=
(
<
MessageBar
message=
'Existen dominios sin límites asignados'
type=
'WARNING'
autoclose=
{
true
}
/>
);
}
}
else
{
totalLimit
+=
plan
.
limit
;
}
}
}
else
{
totalLimit
+=
plan
.
limit
;
mailboxPlans
.
push
(
<
tr
key=
{
`plan-${key}`
}
>
<
td
className=
'mbx-plan'
style=
{
{
borderTop
:
0
}
}
>
{
key
}
</
td
>
<
td
className=
'text-center'
style=
{
{
borderTop
:
0
}
}
>
{
plan
.
limit
||
'
\
u221e'
}
</
td
>
<
td
className=
'text-center'
style=
{
{
borderTop
:
0
}
}
>
{
plan
.
used
}
</
td
>
</
tr
>
);
}
}
}
if
(
mailboxPlans
.
length
>
0
)
{
mailboxPlans
.
push
(
mailboxPlans
.
push
(
<
tr
key=
{
`plan-${key}`
}
>
<
tr
key=
'totalizacion-planes'
>
<
td
className=
'mbx-plan'
<
td
className=
'mbx-plan'
style=
{
{
borderTop
:
0
}
}
style=
{
{
borderTop
:
0
}
}
>
>
{
key
}
<
strong
>
{
'Total'
}
</
strong
>
</
td
>
</
td
>
<
td
<
td
className=
'text-center'
className=
'text-center'
style=
{
{
borderTop
:
0
}
}
style=
{
{
borderTop
:
0
}
}
>
>
{
plan
.
limit
||
'
\
u221e'
}
<
strong
>
{
totalLimit
}
</
strong
>
</
td
>
</
td
>
<
td
<
td
className=
'text-center'
className=
'text-center'
style=
{
{
borderTop
:
0
}
}
style=
{
{
borderTop
:
0
}
}
>
>
{
plan
.
used
}
<
strong
>
{
totalUsed
}
</
strong
>
</
td
>
</
td
>
</
tr
>
</
tr
>
);
);
}
}
if
(
mailboxPlans
.
length
>
0
)
{
panelBody
=
(
mailboxPlans
.
push
(
<
table
<
tr
key=
'totalizacion-planes'
>
id=
'domain-mbxs'
<
td
className=
'mbx-plan'
cellPadding=
'1'
style=
{
{
borderTop
:
0
}
}
cellSpacing=
'1'
className=
'table'
style=
{
{
marginBottom
:
'0px'
}
}
>
>
<
strong
>
{
'Total'
}
</
strong
>
<
thead
>
</
td
>
<
tr
>
<
td
<
th
style=
{
{
width
:
'50%'
}
}
></
th
>
className=
'text-center'
<
th
className=
'text-center'
>
{
'Límite'
}
</
th
>
style=
{
{
borderTop
:
0
}
}
<
th
className=
'text-center'
>
{
'Usadas'
}
</
th
>
>
</
tr
>
<
strong
>
{
totalLimit
}
</
strong
>
</
thead
>
</
td
>
<
tbody
>
<
td
{
mailboxPlans
}
className=
'text-center'
</
tbody
>
style=
{
{
borderTop
:
0
}
}
</
table
>
>
);
<
strong
>
{
totalUsed
}
</
strong
>
}
else
{
</
td
>
panelBody
=
(
</
tr
>
<
div
className=
'text-center'
>
);
<
h4
className=
'text-danger'
>
{
'No se han asignado límites de casillas.'
}
</
h4
>
</
div
>
panelBody
=
(
);
<
table
}
id=
'domain-mbxs'
cellPadding=
'1'
cellSpacing=
'1'
className=
'table'
style=
{
{
marginBottom
:
'0px'
}
}
>
<
thead
>
<
tr
>
<
th
style=
{
{
width
:
'50%'
}
}
></
th
>
<
th
className=
'text-center'
>
{
'Límite'
}
</
th
>
<
th
className=
'text-center'
>
{
'Usadas'
}
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{
mailboxPlans
}
</
tbody
>
</
table
>
);
}
else
{
}
else
{
panelBody
=
(
panelBody
=
(
<
div
className=
'text-center'
>
<
div
className=
'text-center'
>
<
h4
className=
'text-danger'
>
{
'No se han asignado límites de casillas.'
}
</
h4
>
<
h4
className=
'text-danger'
>
{
'Se esta realizando una migracion.'
}
</
h4
>
<
blockquote
>
{
`Limite : ${countAccounts.migracion.limit || 'No definido'}`
}
<
br
/>
{
`Usadas : ${countAccounts.migracion.used || 'No definido'}`
}
</
blockquote
>
</
div
>
</
div
>
);
);
}
}
...
...
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