Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
smradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shail
smradius
Commits
e04b4659
Commit
e04b4659
authored
14 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Use same usage display calculations as admin interface
parent
0ef9f9d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webui/user/index.php
+6
-22
6 additions, 22 deletions
webui/user/index.php
with
6 additions
and
22 deletions
webui/user/index.php
+
6
−
22
View file @
e04b4659
...
@@ -237,11 +237,6 @@ function displayDetails() {
...
@@ -237,11 +237,6 @@ function displayDetails() {
# Traffic topups
# Traffic topups
if
(
$topup
[
'Type'
]
==
1
)
{
if
(
$topup
[
'Type'
]
==
1
)
{
# Note this usage from previous topups as well
if
(
isset
(
$topup
[
'CurrentLimit'
]))
{
$totalTraffic
+=
(
$topup
[
'Limit'
]
-
$topup
[
'CurrentLimit'
]);
}
# Topup not currently in use
# Topup not currently in use
if
(
$excess
<=
0
)
{
if
(
$excess
<=
0
)
{
$trafficRows
[
$i
]
=
array
();
$trafficRows
[
$i
]
=
array
();
...
@@ -252,7 +247,7 @@ function displayDetails() {
...
@@ -252,7 +247,7 @@ function displayDetails() {
$trafficRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
$trafficRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
# Set total available topups
# Set total available topups
$totalTrafficTopupsAvail
+=
$topup
[
'Limit'
];
$totalTrafficTopupsAvail
+=
isset
(
$topup
[
'CurrentLimit'
])
?
$topup
[
'CurrentLimit'
]
:
$topup
[
'Limit'
];
$i
++
;
$i
++
;
...
@@ -288,7 +283,7 @@ function displayDetails() {
...
@@ -288,7 +283,7 @@ function displayDetails() {
$trafficRows
[
$i
][
'Used'
]
=
(
$topup
[
'Limit'
]
-
$topup
[
'CurrentLimit'
])
+
$excess
;
$trafficRows
[
$i
][
'Used'
]
=
(
$topup
[
'Limit'
]
-
$topup
[
'CurrentLimit'
])
+
$excess
;
# Set total available topups
# Set total available topups
$totalTrafficTopupsAvail
+=
$topup
[
'Limit'
];
$totalTrafficTopupsAvail
+=
$topup
[
'
Current
Limit'
];
# Set current topup
# Set current topup
$currentTrafficTopup
=
array
();
$currentTrafficTopup
=
array
();
...
@@ -309,11 +304,8 @@ function displayDetails() {
...
@@ -309,11 +304,8 @@ function displayDetails() {
$trafficRows
[
$i
][
'ValidFrom'
]
=
$topup
[
'ValidFrom'
];
$trafficRows
[
$i
][
'ValidFrom'
]
=
$topup
[
'ValidFrom'
];
$trafficRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
$trafficRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
# Set total available topups
$totalTrafficTopupsAvail
+=
$topup
[
'Limit'
];
# Subtract this topup from excess usage
# Subtract this topup from excess usage
$excess
-=
$topup
[
'Limit'
];
$excess
-=
isset
(
$topup
[
'CurrentLimit'
])
?
$topup
[
'CurrentLimit'
]
:
$topup
[
'Limit'
];
$i
++
;
$i
++
;
}
}
...
@@ -341,11 +333,6 @@ function displayDetails() {
...
@@ -341,11 +333,6 @@ function displayDetails() {
# Uptime topups
# Uptime topups
if
(
$topup
[
'Type'
]
==
2
)
{
if
(
$topup
[
'Type'
]
==
2
)
{
# Note this usage from previous topups as well
if
(
isset
(
$topup
[
'CurrentLimit'
]))
{
$totalUptime
+=
(
$topup
[
'Limit'
]
-
$topup
[
'CurrentLimit'
]);
}
# Topup not currently in use
# Topup not currently in use
if
(
$excess
<=
0
)
{
if
(
$excess
<=
0
)
{
$uptimeRows
[
$i
]
=
array
();
$uptimeRows
[
$i
]
=
array
();
...
@@ -356,7 +343,7 @@ function displayDetails() {
...
@@ -356,7 +343,7 @@ function displayDetails() {
$uptimeRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
$uptimeRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
# Set total available topups
# Set total available topups
$totalUptimeTopupsAvail
+=
$topup
[
'Limit'
];
$totalUptimeTopupsAvail
+=
isset
(
$topup
[
'CurrentLimit'
])
?
$topup
[
'CurrentLimit'
]
:
$topup
[
'Limit'
];
$i
++
;
$i
++
;
...
@@ -392,7 +379,7 @@ function displayDetails() {
...
@@ -392,7 +379,7 @@ function displayDetails() {
$uptimeRows
[
$i
][
'Used'
]
=
(
$topup
[
'Limit'
]
-
$topup
[
'CurrentLimit'
])
+
$excess
;
$uptimeRows
[
$i
][
'Used'
]
=
(
$topup
[
'Limit'
]
-
$topup
[
'CurrentLimit'
])
+
$excess
;
# Set total available topups
# Set total available topups
$totalUptimeTopupsAvail
+=
$topup
[
'Limit'
];
$totalUptimeTopupsAvail
+=
$topup
[
'
Current
Limit'
];
# Set current topup
# Set current topup
$currentUptimeTopup
=
array
();
$currentUptimeTopup
=
array
();
...
@@ -413,11 +400,8 @@ function displayDetails() {
...
@@ -413,11 +400,8 @@ function displayDetails() {
$uptimeRows
[
$i
][
'ValidFrom'
]
=
$topup
[
'ValidFrom'
];
$uptimeRows
[
$i
][
'ValidFrom'
]
=
$topup
[
'ValidFrom'
];
$uptimeRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
$uptimeRows
[
$i
][
'Expires'
]
=
$topup
[
'Expires'
];
# Set total available topups
$totalUptimeTopupsAvail
+=
$topup
[
'Limit'
];
# Subtract this topup from excess usage
# Subtract this topup from excess usage
$excess
-=
$topup
[
'Limit'
];
$excess
-=
isset
(
$topup
[
'CurrentLimit'
])
?
$topup
[
'CurrentLimit'
]
:
$topup
[
'Limit'
];
$i
++
;
$i
++
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment