Skip to content

Commit 2cf87cf

Browse files
Haylibibobokun
authored andcommitted
bug: Api from components now use window.app.API instead of creating new one
1 parent 266f55f commit 2cf87cf

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

web-ui/js/components/SchedulerControl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SchedulerControl {
1313
this.container = options.container;
1414
this.onScheduleChange = options.onScheduleChange || (() => {});
1515

16-
this.api = new API();
16+
this.api = window.app.api || new API();
1717
this.currentStatus = {
1818
current_schedule: null,
1919
next_run: null,

web-ui/js/components/command-panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CommandPanel {
1313
this.drawerContainer = options.drawerContainer;
1414
this.onCommandExecute = options.onCommandExecute || (() => {});
1515

16-
this.api = new API();
16+
this.api = window.app.api || new API();
1717
this.isVisible = false;
1818
this.runCommandsModal = null; // To store the reference to the run commands modal
1919

web-ui/js/components/config-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ConfigForm {
3434
this.onDataChange = options.onDataChange || (() => {});
3535
this.onValidationChange = options.onValidationChange || (() => {});
3636

37-
this.api = new API();
37+
this.api = window.app.api || new API();
3838
this.currentSection = null;
3939
this.currentData = {};
4040
this.originalData = {}; // Store original data for reset

web-ui/js/components/log-viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class LogViewer {
1515
this.currentLogFile = localStorage.getItem('qbm-selected-log-file') || 'qbit_manage.log'; // Default log file
1616
this.currentLogLimit = parseInt(localStorage.getItem('qbm-log-limit') || '50'); // Default to 50 lines
1717

18-
this.api = new API();
18+
this.api = window.app.api || new API();
1919
this.logs = [];
2020
this.filteredLogs = [];
2121
}

web-ui/js/components/security.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { EYE_ICON_SVG, EYE_SLASH_ICON_SVG } from '../utils/icons.js';
1111
export class SecurityComponent {
1212
constructor(containerId, apiInstance = null) {
1313
this.container = document.getElementById(containerId);
14-
this.api = apiInstance || new API();
14+
this.api = apiInstance || window.app.api || new API();
1515
this.currentSettings = null;
1616
this.hasApiKey = false; // Track whether we have an API key without storing the key itself
1717
}

0 commit comments

Comments
 (0)