From d76af5f013d53a1e92aaf699696a270045c66ed7 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:09:41 +0200 Subject: [PATCH 01/17] [FIX] appStats tests --- tests/unit/appsService.test.js | 54 +++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/tests/unit/appsService.test.js b/tests/unit/appsService.test.js index 058f8988d..d58438939 100644 --- a/tests/unit/appsService.test.js +++ b/tests/unit/appsService.test.js @@ -2541,17 +2541,34 @@ describe('appsService tests', () => { }, }; verificationHelperStub.returns(true); - const dockerStub = sinon.stub(dockerService, 'dockerContainerStats').returns('some data'); + const mockStats = { + data: 1000, + }; + const mockContainer = { + Id: 'mockContainerId', + Names: ['/test_myappname'], + HostConfig: { NanoCpus: 1000 }, + }; + const dockerContainerStatsStub = sinon + .stub(dockerService, 'dockerContainerStats') + .returns(Promise.resolve(mockStats)); + + const dockerContainerInspectStub = sinon + .stub(dockerService, 'dockerContainerInspect') + .returns(Promise.resolve(mockContainer)); + const res = generateResponse(); await appsService.appStats(req, res); - + sinon.assert.notCalled(logSpy); + sinon.assert.calledOnceWithExactly(dockerContainerStatsStub, 'test_myappname'); + sinon.assert.calledTwice(dockerContainerInspectStub); + sinon.assert.calledWith(dockerContainerInspectStub, 'test_myappname'); + sinon.assert.calledWith(dockerContainerInspectStub, 'test_myappname', { size: true }); sinon.assert.calledOnceWithExactly(res.json, { status: 'success', - data: 'some data', + data: mockStats, }); - sinon.assert.notCalled(logSpy); - sinon.assert.calledOnceWithExactly(dockerStub, 'test_myappname'); }); it('should return app stats, no underscore in the name', async () => { @@ -2565,17 +2582,34 @@ describe('appsService tests', () => { }, }; verificationHelperStub.returns(true); - const dockerStub = sinon.stub(dockerService, 'dockerContainerStats').returns('some data'); + const mockStats = { + data: 1000, + }; + const mockContainer = { + Id: 'mockContainerId', + Names: ['/myappname'], + HostConfig: { NanoCpus: 1000 }, + }; + const dockerContainerStatsStub = sinon + .stub(dockerService, 'dockerContainerStats') + .returns(Promise.resolve(mockStats)); + + const dockerContainerInspectStub = sinon + .stub(dockerService, 'dockerContainerInspect') + .returns(Promise.resolve(mockContainer)); + const res = generateResponse(); await appsService.appStats(req, res); - + sinon.assert.notCalled(logSpy); + sinon.assert.calledOnceWithExactly(dockerContainerStatsStub, 'myappname'); + sinon.assert.calledTwice(dockerContainerInspectStub); + sinon.assert.calledWith(dockerContainerInspectStub, 'myappname'); + sinon.assert.calledWith(dockerContainerInspectStub, 'myappname', { size: true }); sinon.assert.calledOnceWithExactly(res.json, { status: 'success', - data: 'some data', + data: mockStats, }); - sinon.assert.notCalled(logSpy); - sinon.assert.calledOnceWithExactly(dockerStub, 'myappname'); }); }); From 919344fd1b5f8d0d1ae7a47f024389358a7abae1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Wed, 16 Oct 2024 23:02:13 +0200 Subject: [PATCH 02/17] [FIX] Corrected dark-mode styles for v-map component only --- HomeUI/src/views/components/FluxMap.vue | 38 +++++++++++++------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/HomeUI/src/views/components/FluxMap.vue b/HomeUI/src/views/components/FluxMap.vue index 70f784ee5..3e0bcc304 100644 --- a/HomeUI/src/views/components/FluxMap.vue +++ b/HomeUI/src/views/components/FluxMap.vue @@ -1,22 +1,24 @@ - From eea8cb08445fa3b50502b29536b5e935903c34c1 Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:56:55 +0200 Subject: [PATCH 05/17] [FIX] Add min-zoom to prevent white areas above and below the map --- HomeUI/src/views/components/FluxMap.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HomeUI/src/views/components/FluxMap.vue b/HomeUI/src/views/components/FluxMap.vue index 083bad97a..01fe77ad7 100644 --- a/HomeUI/src/views/components/FluxMap.vue +++ b/HomeUI/src/views/components/FluxMap.vue @@ -1,7 +1,7 @@