8000 License HTTP API: Rename diskusage to diskUsage (#21695) · solisoft/arangodb@f8bc7fe · GitHub
[go: up one dir, main page]

Skip to content

Commit f8bc7fe

Browse files
Simran-Bneunhoef
andauthored
License HTTP API: Rename diskusage to diskUsage (arangodb#21695)
Co-authored-by: Max Neunhöffer <max@arangodb.com>
1 parent 91f78dd commit f8bc7fe

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

CHANGELOG

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ devel
3030

3131
* FE-535: fix set cached query when bind params are equal.
3232

33-
* FE-528: adds diskusage license info to UI.
33+
* FE-528: adds disk usage license info to UI.
3434

3535
* BTS-2090: Fixes double log-lines per log
3636

@@ -47,7 +47,7 @@ devel
4747
shown twice in the result, once with `isBuilding: true` and once
4848
without. This fixes BTS-2044.
4949

50-
* Introduces first changes for the new diskusage based license.
50+
* Introduces first changes for the new disk usage-based license.
5151

5252
* BTS-2089: Fix a crash when query logging and query cache were enabled.
5353

js/apps/system/_admin/aardvark/APP/frontend/js/views/navigationView.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@
221221
licenseData.features.expires,
222222
serverTime
223223
);
224-
} else if (licenseData.hasOwnProperty("diskusage")) {
224+
} else if (licenseData.hasOwnProperty("diskUsage")) {
225225
if (
226-
licenseData.diskusage.status &&
227-
licenseData.diskusage.secondsUntilReadOnly &&
228-
licenseData.diskusage.secondsUntilShutDown
226+
licenseData.diskUsage.status &&
227+
licenseData.diskUsage.secondsUntilReadOnly &&
228+
licenseData.diskUsage.secondsUntilShutDown
229229
) {
230-
self.renderDiskUsageInfo(licenseData.diskusage);
230+
self.renderDiskUsageInfo(licenseData.diskUsage);
231231
}
232232
} else if (window.frontendConfig.isEnterprise === true) {
233233
self.showLicenseError();
@@ -315,14 +315,14 @@
315315
$('#licenseInfoArea').append(infoElement);
316316
},
317317

318-
renderDiskUsageInfo: function (diskusage) {
318+
renderDiskUsageInfo: function (diskUsage) {
319319
const currentTime = new Date();
320320
let message = '';
321321
let type = 'info';
322-
switch (diskusage.status) {
322+
switch (diskUsage.status) {
323323
case "limit-reached":
324324
const readonlyDate = new Date(
325-
currentTime.getTime() + 1000 * diskusage.secondsUntilReadOnly
325+
currentTime.getTime() + 1000 * diskUsage.secondsUntilReadOnly
326326
);
327327
message =
328328
"Your server has reached its disk usage limit of 100GB. If you don't decrease the data size, the server will be restricted to read-only mode on " +
@@ -332,7 +332,7 @@
332332
break;
333333
case "read-only":
334334
const shutdownDate = new Date(
335-
currentTime.getTime() + 1000 * diskusage.secondsUntilShutDown
335+
currentTime.getTime() + 1000 * diskUsage.secondsUntilShutDown
336336
);
337337
message =
338338
"Your server has been restricted to read-only mode due to violation of the 100GB data size limit. Please contact your ArangoDB sales representative or sales@arangodb.com to get a valid license as soon as possible. Without a valid license the server will be shut down on " + shutdownDate + ".";

js/common/modules/@arangodb/common.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -560,24 +560,24 @@ exports.enterpriseLicenseVisibility = function() {
560560
default:
561561
return;
562562
}
563-
} else if (license.hasOwnProperty("diskusage")) {
564-
if (!license.diskusage.hasOwnProperty("status") ||
565-
!license.diskusage.hasOwnProperty("secondsUntilReadOnly") ||
566-
!license.diskusage.hasOwnProperty("secondsUntilShutDown") ||
567-
!license.diskusage.hasOwnProperty("bytesUsed") ||
568-
!license.diskusage.hasOwnProperty("bytesLimit")) {
563+
} else if (license.hasOwnProperty("diskUsage")) {
564+
if (!license.diskUsage.hasOwnProperty("status") ||
565+
!license.diskUsage.hasOwnProperty("secondsUntilReadOnly") ||
566+
!license.diskUsage.hasOwnProperty("secondsUntilShutDown") ||
567+
!license.diskUsage.hasOwnProperty("bytesUsed") ||
568+
!license.diskUsage.hasOwnProperty("bytesLimit")) {
569569
return;
570570
}
571571
const currentTime = new Date();
572-
switch (license.diskusage.status) {
572+
switch (license.diskUsage.status) {
573573
case "limit-reached":
574-
let readonly = new Date(currentTime.getTime() + 1000 * (license.diskusage.secondsUntilReadOnly));
574+
let readonly = new Date(currentTime.getTime() + 1000 * (license.diskUsage.secondsUntilReadOnly));
575575
console.warn("Your server has reached its disk usage limit of 100 GiB.");
576576
console.warn("If you don't decrease the data size, the server will be restricted to read-only mode on " + readonly + ".");
577577
console.warn("Please contact your ArangoDB sales representative or sales@arangodb.com to get a valid license and continue using ArangoDB without limitations.");
578578
return;
579579
case "read-only":
580-
let shutdown = new Date(currentTime.getTime() + 1000 * (license.diskusage.secondsUntilShutDown));
580+
let shutdown = new Date(currentTime.getTime() + 1000 * (license.diskUsage.secondsUntilShutDown));
581581
console.error("Your server has been restricted to read-only mode due to violation of the 100 GiB data size limit.");
582582
console.error("Please contact your ArangoDB sales representative or sales@arangodb.com to get a valid license as soon as possible.");
583583
console.error("Without a valid license the server will be shut down on " + shutdown + ".");

0 commit comments

Comments
 (0)
0