imcp 0.1.7 → 0.1.8-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/install.js +1 -106
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/list.js +1 -90
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/pull.js +1 -16
- package/dist/cli/commands/pull.js.map +1 -0
- package/dist/cli/commands/serve.js +1 -33
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/uninstall.js +1 -46
- package/dist/cli/commands/uninstall.js.map +1 -0
- package/dist/cli/index.js +1 -65
- package/dist/cli/index.js.map +1 -0
- package/dist/core/installers/clients/BaseClientInstaller.js +1 -282
- package/dist/core/installers/clients/BaseClientInstaller.js.map +1 -0
- package/dist/core/installers/clients/ClientInstaller.js +1 -163
- package/dist/core/installers/clients/ClientInstaller.js.map +1 -0
- package/dist/core/installers/clients/ClientInstallerFactory.js +1 -36
- package/dist/core/installers/clients/ClientInstallerFactory.js.map +1 -0
- package/dist/core/installers/clients/ClineInstaller.js +1 -30
- package/dist/core/installers/clients/ClineInstaller.js.map +1 -0
- package/dist/core/installers/clients/ExtensionInstaller.js +1 -151
- package/dist/core/installers/clients/ExtensionInstaller.js.map +1 -0
- package/dist/core/installers/clients/GithubCopilotInstaller.js +1 -68
- package/dist/core/installers/clients/GithubCopilotInstaller.js.map +1 -0
- package/dist/core/installers/clients/MSRooCodeInstaller.js +1 -28
- package/dist/core/installers/clients/MSRooCodeInstaller.js.map +1 -0
- package/dist/core/installers/index.js +1 -8
- package/dist/core/installers/index.js.map +1 -0
- package/dist/core/installers/requirements/BaseInstaller.js +1 -56
- package/dist/core/installers/requirements/BaseInstaller.js.map +1 -0
- package/dist/core/installers/requirements/CommandInstaller.js +1 -213
- package/dist/core/installers/requirements/CommandInstaller.js.map +1 -0
- package/dist/core/installers/requirements/GeneralInstaller.js +1 -126
- package/dist/core/installers/requirements/GeneralInstaller.js.map +1 -0
- package/dist/core/installers/requirements/InstallerFactory.js +1 -99
- package/dist/core/installers/requirements/InstallerFactory.js.map +1 -0
- package/dist/core/installers/requirements/NpmInstaller.js +1 -235
- package/dist/core/installers/requirements/NpmInstaller.js.map +1 -0
- package/dist/core/installers/requirements/NugetInstaller.js +1 -188
- package/dist/core/installers/requirements/NugetInstaller.js.map +1 -0
- package/dist/core/installers/requirements/PipInstaller.js +1 -192
- package/dist/core/installers/requirements/PipInstaller.js.map +1 -0
- package/dist/core/installers/requirements/RequirementInstaller.js +1 -2
- package/dist/core/installers/requirements/RequirementInstaller.js.map +1 -0
- package/dist/core/loaders/ConfigurationLoader.js +1 -256
- package/dist/core/loaders/ConfigurationLoader.js.map +1 -0
- package/dist/core/loaders/ConfigurationProvider.js +1 -383
- package/dist/core/loaders/ConfigurationProvider.js.map +1 -0
- package/dist/core/loaders/InstallOperationManager.js +1 -310
- package/dist/core/loaders/InstallOperationManager.js.map +1 -0
- package/dist/core/loaders/ServerSchemaLoader.js +1 -108
- package/dist/core/loaders/ServerSchemaLoader.js.map +1 -0
- package/dist/core/loaders/ServerSchemaProvider.js +1 -89
- package/dist/core/loaders/ServerSchemaProvider.js.map +1 -0
- package/dist/core/loaders/SystemSettingsManager.js +1 -256
- package/dist/core/loaders/SystemSettingsManager.js.map +1 -0
- package/dist/core/metadatas/constants.js +1 -100
- package/dist/core/metadatas/constants.js.map +1 -0
- package/dist/core/metadatas/recordingConstants.js +1 -46
- package/dist/core/metadatas/recordingConstants.js.map +1 -0
- package/dist/core/metadatas/types.js +1 -15
- package/dist/core/metadatas/types.js.map +1 -0
- package/dist/core/onboard/FeedOnboardService.js +1 -422
- package/dist/core/onboard/FeedOnboardService.js.map +1 -0
- package/dist/core/onboard/OnboardProcessor.js +1 -333
- package/dist/core/onboard/OnboardProcessor.js.map +1 -0
- package/dist/core/onboard/OnboardStatus.js +1 -9
- package/dist/core/onboard/OnboardStatus.js.map +1 -0
- package/dist/core/onboard/OnboardStatusManager.js +1 -360
- package/dist/core/onboard/OnboardStatusManager.js.map +1 -0
- package/dist/core/validators/FeedValidator.js +1 -133
- package/dist/core/validators/FeedValidator.js.map +1 -0
- package/dist/core/validators/IServerValidator.js +1 -1
- package/dist/core/validators/IServerValidator.js.map +1 -0
- package/dist/core/validators/SSEServerValidator.js +1 -38
- package/dist/core/validators/SSEServerValidator.js.map +1 -0
- package/dist/core/validators/ServerValidatorFactory.js +1 -44
- package/dist/core/validators/ServerValidatorFactory.js.map +1 -0
- package/dist/core/validators/StdioServerValidator.js +1 -281
- package/dist/core/validators/StdioServerValidator.js.map +1 -0
- package/dist/index.js +1 -18
- package/dist/index.js.map +1 -0
- package/dist/services/InstallationService.js +1 -81
- package/dist/services/InstallationService.js.map +1 -0
- package/dist/services/MCPManager.js +1 -197
- package/dist/services/MCPManager.js.map +1 -0
- package/dist/services/RequirementService.js +1 -548
- package/dist/services/RequirementService.js.map +1 -0
- package/dist/services/ServerService.js +1 -127
- package/dist/services/ServerService.js.map +1 -0
- package/dist/services/TelemetryService.js +1 -53
- package/dist/services/TelemetryService.js.map +1 -0
- package/dist/utils/UpdateCheckTracker.js +1 -79
- package/dist/utils/UpdateCheckTracker.js.map +1 -0
- package/dist/utils/adoUtils.js +1 -254
- package/dist/utils/adoUtils.js.map +1 -0
- package/dist/utils/clientUtils.js +1 -65
- package/dist/utils/clientUtils.js.map +1 -0
- package/dist/utils/feedUtils.js +1 -28
- package/dist/utils/feedUtils.js.map +1 -0
- package/dist/utils/githubAuth.js +1 -177
- package/dist/utils/githubAuth.js.map +1 -0
- package/dist/utils/githubUtils.js +1 -125
- package/dist/utils/githubUtils.js.map +1 -0
- package/dist/utils/logger.js +1 -176
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/macroExpressionUtils.js +1 -93
- package/dist/utils/macroExpressionUtils.js.map +1 -0
- package/dist/utils/osUtils.js +1 -664
- package/dist/utils/osUtils.js.map +1 -0
- package/dist/utils/versionUtils.js +1 -101
- package/dist/utils/versionUtils.js.map +1 -0
- package/dist/web/contract/serverContract.js +1 -1
- package/dist/web/contract/serverContract.js.map +1 -0
- package/dist/web/public/js/api.js +2 -132
- package/dist/web/public/js/api.js.map +1 -0
- package/dist/web/public/js/detailsWidget.js +2 -264
- package/dist/web/public/js/detailsWidget.js.map +1 -0
- package/dist/web/public/js/flights/flights.js +2 -127
- package/dist/web/public/js/flights/flights.js.map +1 -0
- package/dist/web/public/js/modal/index.js +2 -52
- package/dist/web/public/js/modal/index.js.map +1 -0
- package/dist/web/public/js/modal/installModal.js +2 -162
- package/dist/web/public/js/modal/installModal.js.map +1 -0
- package/dist/web/public/js/modal/installation.js +2 -266
- package/dist/web/public/js/modal/installation.js.map +1 -0
- package/dist/web/public/js/modal/loadingModal.js +2 -182
- package/dist/web/public/js/modal/loadingModal.js.map +1 -0
- package/dist/web/public/js/modal/modalSetup.js +2 -595
- package/dist/web/public/js/modal/modalSetup.js.map +1 -0
- package/dist/web/public/js/modal/modalUtils.js +2 -37
- package/dist/web/public/js/modal/modalUtils.js.map +1 -0
- package/dist/web/public/js/modal/versionUtils.js +2 -20
- package/dist/web/public/js/modal/versionUtils.js.map +1 -0
- package/dist/web/public/js/modal.js +2 -42
- package/dist/web/public/js/modal.js.map +1 -0
- package/dist/web/public/js/notifications.js +2 -137
- package/dist/web/public/js/notifications.js.map +1 -0
- package/dist/web/public/js/onboard/formProcessor.js +2 -1037
- package/dist/web/public/js/onboard/formProcessor.js.map +1 -0
- package/dist/web/public/js/onboard/index.js +2 -374
- package/dist/web/public/js/onboard/index.js.map +1 -0
- package/dist/web/public/js/onboard/publishHandler.js +2 -172
- package/dist/web/public/js/onboard/publishHandler.js.map +1 -0
- package/dist/web/public/js/onboard/state.js +2 -76
- package/dist/web/public/js/onboard/state.js.map +1 -0
- package/dist/web/public/js/onboard/templates.js +2 -342
- package/dist/web/public/js/onboard/templates.js.map +1 -0
- package/dist/web/public/js/onboard/uiHandlers.js +2 -1076
- package/dist/web/public/js/onboard/uiHandlers.js.map +1 -0
- package/dist/web/public/js/onboard/validationHandlers.js +2 -493
- package/dist/web/public/js/onboard/validationHandlers.js.map +1 -0
- package/dist/web/public/js/serverCategoryDetails.js +2 -364
- package/dist/web/public/js/serverCategoryDetails.js.map +1 -0
- package/dist/web/public/js/serverCategoryList.js +2 -241
- package/dist/web/public/js/serverCategoryList.js.map +1 -0
- package/dist/web/public/js/settings.js +2 -314
- package/dist/web/public/js/settings.js.map +1 -0
- package/dist/web/server.js +1 -404
- package/dist/web/server.js.map +1 -0
- package/package.json +8 -2
- package/.github/ISSUE_TEMPLATE/JitAccess.yml +0 -28
- package/.github/acl/access.yml +0 -20
- package/.github/compliance/inventory.yml +0 -5
- package/.github/policies/jit.yml +0 -19
- package/.github/workflows/build.yml +0 -28
- package/.roo/rules-code/rules.md +0 -88
- package/dist/cli/commands/start.d.ts +0 -2
- package/dist/cli/commands/start.js +0 -32
- package/dist/cli/commands/sync.d.ts +0 -2
- package/dist/cli/commands/sync.js +0 -17
- package/dist/core/ConfigurationLoader.d.ts +0 -32
- package/dist/core/ConfigurationLoader.js +0 -236
- package/dist/core/ConfigurationProvider.d.ts +0 -35
- package/dist/core/ConfigurationProvider.js +0 -375
- package/dist/core/InstallationService.d.ts +0 -50
- package/dist/core/InstallationService.js +0 -350
- package/dist/core/MCPManager.d.ts +0 -28
- package/dist/core/MCPManager.js +0 -188
- package/dist/core/RequirementService.d.ts +0 -40
- package/dist/core/RequirementService.js +0 -110
- package/dist/core/ServerSchemaLoader.d.ts +0 -11
- package/dist/core/ServerSchemaLoader.js +0 -43
- package/dist/core/ServerSchemaProvider.d.ts +0 -17
- package/dist/core/ServerSchemaProvider.js +0 -120
- package/dist/core/constants.d.ts +0 -47
- package/dist/core/constants.js +0 -94
- package/dist/core/installers/BaseInstaller.d.ts +0 -74
- package/dist/core/installers/BaseInstaller.js +0 -253
- package/dist/core/installers/ClientInstaller.d.ts +0 -23
- package/dist/core/installers/ClientInstaller.js +0 -564
- package/dist/core/installers/CommandInstaller.d.ts +0 -37
- package/dist/core/installers/CommandInstaller.js +0 -173
- package/dist/core/installers/GeneralInstaller.d.ts +0 -33
- package/dist/core/installers/GeneralInstaller.js +0 -85
- package/dist/core/installers/InstallerFactory.d.ts +0 -54
- package/dist/core/installers/InstallerFactory.js +0 -97
- package/dist/core/installers/NpmInstaller.d.ts +0 -26
- package/dist/core/installers/NpmInstaller.js +0 -127
- package/dist/core/installers/PipInstaller.d.ts +0 -28
- package/dist/core/installers/PipInstaller.js +0 -127
- package/dist/core/installers/RequirementInstaller.d.ts +0 -33
- package/dist/core/installers/RequirementInstaller.js +0 -3
- package/dist/core/types.d.ts +0 -166
- package/dist/core/types.js +0 -16
- package/dist/services/InstallRequestValidator.d.ts +0 -21
- package/dist/services/InstallRequestValidator.js +0 -99
- package/dist/web/public/js/modal/installHandler.js +0 -227
- package/dist/web/public/js/modal/loadingUI.js +0 -74
- package/dist/web/public/js/modal/messageQueue.js +0 -112
- package/dist/web/public/js/modal/modalUI.js +0 -214
- package/dist/web/public/js/modal/version.js +0 -20
- package/dist/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +0 -370
- package/docs/ONBOARDING_PAGE_DESIGN.md +0 -260
- package/docs/Telemetry.md +0 -136
- package/memory-bank/activeContext.md +0 -26
- package/memory-bank/decisionLog.md +0 -91
- package/memory-bank/productContext.md +0 -41
- package/memory-bank/progress.md +0 -35
- package/memory-bank/systemPatterns.md +0 -10
- package/src/cli/commands/install.ts +0 -139
- package/src/cli/commands/list.ts +0 -113
- package/src/cli/commands/pull.ts +0 -16
- package/src/cli/commands/serve.ts +0 -39
- package/src/cli/commands/uninstall.ts +0 -64
- package/src/cli/index.ts +0 -82
- package/src/core/installers/clients/BaseClientInstaller.ts +0 -341
- package/src/core/installers/clients/ClientInstaller.ts +0 -222
- package/src/core/installers/clients/ClientInstallerFactory.ts +0 -43
- package/src/core/installers/clients/ClineInstaller.ts +0 -35
- package/src/core/installers/clients/ExtensionInstaller.ts +0 -165
- package/src/core/installers/clients/GithubCopilotInstaller.ts +0 -79
- package/src/core/installers/clients/MSRooCodeInstaller.ts +0 -32
- package/src/core/installers/index.ts +0 -11
- package/src/core/installers/requirements/BaseInstaller.ts +0 -85
- package/src/core/installers/requirements/CommandInstaller.ts +0 -231
- package/src/core/installers/requirements/GeneralInstaller.ts +0 -133
- package/src/core/installers/requirements/InstallerFactory.ts +0 -114
- package/src/core/installers/requirements/NpmInstaller.ts +0 -271
- package/src/core/installers/requirements/NugetInstaller.ts +0 -203
- package/src/core/installers/requirements/PipInstaller.ts +0 -207
- package/src/core/installers/requirements/RequirementInstaller.ts +0 -42
- package/src/core/loaders/ConfigurationLoader.ts +0 -298
- package/src/core/loaders/ConfigurationProvider.ts +0 -462
- package/src/core/loaders/InstallOperationManager.ts +0 -367
- package/src/core/loaders/ServerSchemaLoader.ts +0 -117
- package/src/core/loaders/ServerSchemaProvider.ts +0 -99
- package/src/core/loaders/SystemSettingsManager.ts +0 -278
- package/src/core/metadatas/constants.ts +0 -122
- package/src/core/metadatas/recordingConstants.ts +0 -65
- package/src/core/metadatas/types.ts +0 -202
- package/src/core/onboard/FeedOnboardService.ts +0 -501
- package/src/core/onboard/OnboardProcessor.ts +0 -356
- package/src/core/onboard/OnboardStatus.ts +0 -60
- package/src/core/onboard/OnboardStatusManager.ts +0 -416
- package/src/core/validators/FeedValidator.ts +0 -135
- package/src/core/validators/IServerValidator.ts +0 -21
- package/src/core/validators/SSEServerValidator.ts +0 -43
- package/src/core/validators/ServerValidatorFactory.ts +0 -51
- package/src/core/validators/StdioServerValidator.ts +0 -313
- package/src/index.ts +0 -44
- package/src/services/InstallationService.ts +0 -102
- package/src/services/MCPManager.ts +0 -249
- package/src/services/RequirementService.ts +0 -627
- package/src/services/ServerService.ts +0 -161
- package/src/services/TelemetryService.ts +0 -59
- package/src/utils/UpdateCheckTracker.ts +0 -86
- package/src/utils/adoUtils.ts +0 -293
- package/src/utils/clientUtils.ts +0 -72
- package/src/utils/feedUtils.ts +0 -31
- package/src/utils/githubAuth.ts +0 -212
- package/src/utils/githubUtils.ts +0 -164
- package/src/utils/logger.ts +0 -195
- package/src/utils/macroExpressionUtils.ts +0 -104
- package/src/utils/osUtils.ts +0 -700
- package/src/utils/versionUtils.ts +0 -114
- package/src/web/contract/serverContract.ts +0 -74
- package/src/web/public/css/detailsWidget.css +0 -235
- package/src/web/public/css/modal.css +0 -757
- package/src/web/public/css/notifications.css +0 -101
- package/src/web/public/css/onboard.css +0 -107
- package/src/web/public/css/serverCategoryList.css +0 -120
- package/src/web/public/css/serverDetails.css +0 -139
- package/src/web/public/index.html +0 -359
- package/src/web/public/js/api.js +0 -132
- package/src/web/public/js/detailsWidget.js +0 -264
- package/src/web/public/js/flights/flights.js +0 -127
- package/src/web/public/js/modal/index.js +0 -52
- package/src/web/public/js/modal/installModal.js +0 -162
- package/src/web/public/js/modal/installation.js +0 -266
- package/src/web/public/js/modal/loadingModal.js +0 -182
- package/src/web/public/js/modal/modalSetup.js +0 -595
- package/src/web/public/js/modal/modalUtils.js +0 -37
- package/src/web/public/js/modal/versionUtils.js +0 -20
- package/src/web/public/js/modal.js +0 -42
- package/src/web/public/js/notifications.js +0 -137
- package/src/web/public/js/onboard/formProcessor.js +0 -1037
- package/src/web/public/js/onboard/index.js +0 -374
- package/src/web/public/js/onboard/publishHandler.js +0 -172
- package/src/web/public/js/onboard/state.js +0 -76
- package/src/web/public/js/onboard/templates.js +0 -342
- package/src/web/public/js/onboard/uiHandlers.js +0 -1076
- package/src/web/public/js/onboard/validationHandlers.js +0 -493
- package/src/web/public/js/serverCategoryDetails.js +0 -364
- package/src/web/public/js/serverCategoryList.js +0 -241
- package/src/web/public/js/settings.js +0 -314
- package/src/web/public/modal.html +0 -84
- package/src/web/public/onboard.html +0 -296
- package/src/web/public/settings.html +0 -135
- package/src/web/public/styles.css +0 -277
- package/src/web/server.ts +0 -478
- package/tsconfig.json +0 -18
- package/wiki/Installation.md +0 -3
- package/wiki/Publish.md +0 -3
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { buildUrlWithFlights } from './flights/flights.js';
|
|
2
|
-
|
|
3
|
-
// Toast notification function
|
|
4
|
-
function showToast(message, type = 'success') {
|
|
5
|
-
const toastContainer = document.querySelector('.toast-container');
|
|
6
|
-
if (!toastContainer) return;
|
|
7
|
-
|
|
8
|
-
const toastId = `toast-${Date.now()}`;
|
|
9
|
-
const toastHTML = `
|
|
10
|
-
<div id="${toastId}" class="toast align-items-center text-white bg-${type === 'success' ? 'success' : 'danger'} border-0" role="alert" aria-live="assertive" aria-atomic="true">
|
|
11
|
-
<div class="d-flex">
|
|
12
|
-
<div class="toast-body">
|
|
13
|
-
${message}
|
|
14
|
-
</div>
|
|
15
|
-
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
`;
|
|
19
|
-
toastContainer.insertAdjacentHTML('beforeend', toastHTML);
|
|
20
|
-
const toastElement = document.getElementById(toastId);
|
|
21
|
-
const toast = new bootstrap.Toast(toastElement, { delay: 3000 });
|
|
22
|
-
toast.show();
|
|
23
|
-
toastElement.addEventListener('hidden.bs.toast', () => {
|
|
24
|
-
toastElement.remove();
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
29
|
-
// All DOM element queries and event listeners must be inside this block!
|
|
30
|
-
const settingsForm = document.getElementById('settingsForm');
|
|
31
|
-
const nodePathInput = document.getElementById('nodePath');
|
|
32
|
-
const browserPathInput = document.getElementById('browserPath');
|
|
33
|
-
const systemEnvironmentsDiv = document.getElementById('systemEnvironments');
|
|
34
|
-
|
|
35
|
-
// Python Environments elements
|
|
36
|
-
const pythonEnvsContainer = document.getElementById('pythonEnvsContainer');
|
|
37
|
-
const addPythonEnvButton = document.getElementById('addPythonEnvButton');
|
|
38
|
-
const pythonEnvsLoadingMsg = document.getElementById('pythonEnvsLoadingMsg');
|
|
39
|
-
|
|
40
|
-
// User Configurations elements
|
|
41
|
-
const userConfigurationsContainer = document.getElementById('userConfigurationsContainer');
|
|
42
|
-
const addUserConfigButton = document.getElementById('addUserConfigButton');
|
|
43
|
-
const userConfigLoadingMsg = document.getElementById('userConfigLoadingMsg');
|
|
44
|
-
|
|
45
|
-
const cancelButton = document.getElementById('cancelButton');
|
|
46
|
-
const setupButton = document.getElementById('setupButton');
|
|
47
|
-
|
|
48
|
-
// (Removed duplicate showToast function here)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
async function loadSettings() {
|
|
52
|
-
try {
|
|
53
|
-
const response = await fetch('/api/settings');
|
|
54
|
-
if (!response.ok) {
|
|
55
|
-
const errorData = await response.json();
|
|
56
|
-
throw new Error(errorData.error || `HTTP error! status: ${response.status}`);
|
|
57
|
-
}
|
|
58
|
-
const apiResponse = await response.json();
|
|
59
|
-
if (apiResponse.success && apiResponse.data) {
|
|
60
|
-
const settings = apiResponse.data;
|
|
61
|
-
|
|
62
|
-
// Populate Python Environments
|
|
63
|
-
if(pythonEnvsLoadingMsg) pythonEnvsLoadingMsg.remove(); // Remove loading message
|
|
64
|
-
pythonEnvsContainer.innerHTML = ''; // Clear previous entries
|
|
65
|
-
|
|
66
|
-
if (settings.pythonEnvs && Object.keys(settings.pythonEnvs).length > 0) {
|
|
67
|
-
Object.entries(settings.pythonEnvs).forEach(([server, path]) => {
|
|
68
|
-
renderPythonEnvInput(server, path);
|
|
69
|
-
});
|
|
70
|
-
} else if (settings.pythonEnv) {
|
|
71
|
-
// Handle legacy pythonEnv
|
|
72
|
-
renderPythonEnvInput('system', settings.pythonEnv);
|
|
73
|
-
} else {
|
|
74
|
-
if (!pythonEnvsContainer.querySelector('.python-env-row')) { // Add placeholder if no rows exist
|
|
75
|
-
const p = document.createElement('p');
|
|
76
|
-
p.className = 'text-gray-500 python-env-placeholder';
|
|
77
|
-
p.textContent = 'No Python environments defined. Click "Add Python Environment" to add one.';
|
|
78
|
-
pythonEnvsContainer.appendChild(p);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
nodePathInput.value = settings.nodePath || '';
|
|
83
|
-
browserPathInput.value = settings.browserPath || '';
|
|
84
|
-
|
|
85
|
-
// Populate System Environments
|
|
86
|
-
systemEnvironmentsDiv.innerHTML = ''; // Clear loading message
|
|
87
|
-
if (settings.systemEnvironments && Object.keys(settings.systemEnvironments).length > 0) {
|
|
88
|
-
// Create a modern, scrollable list (not a table)
|
|
89
|
-
const list = document.createElement('div');
|
|
90
|
-
list.className = 'flex flex-col';
|
|
91
|
-
|
|
92
|
-
Object.entries(settings.systemEnvironments).forEach(([key, value], idx) => {
|
|
93
|
-
const item = document.createElement('div');
|
|
94
|
-
item.className =
|
|
95
|
-
'flex flex-col sm:flex-row sm:items-center bg-white rounded-md border border-gray-200 px-4 py-2 shadow-sm hover:shadow transition group';
|
|
96
|
-
item.innerHTML = `
|
|
97
|
-
<div class="flex items-center min-w-0 w-full sm:w-1/4 sm:mb-0">
|
|
98
|
-
<i class='bx bx-cog text-blue-400 mr-2'></i>
|
|
99
|
-
<span class="font-mono font-semibold text-gray-800 text-base truncate" title="${key}">${key}</span>
|
|
100
|
-
</div>
|
|
101
|
-
<div class="flex-1 min-w-0 break-all text-gray-700 text-sm pl-7 sm:pl-4">
|
|
102
|
-
${value}
|
|
103
|
-
</div>
|
|
104
|
-
`;
|
|
105
|
-
list.appendChild(item);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// Restore frame styling for the new layout
|
|
109
|
-
systemEnvironmentsDiv.classList.remove('shadow');
|
|
110
|
-
systemEnvironmentsDiv.classList.add('rounded-lg', 'bg-white', 'border', 'border-gray-200', 'border-1');
|
|
111
|
-
systemEnvironmentsDiv.classList.remove('border-2', 'border-4', 'border-8');
|
|
112
|
-
systemEnvironmentsDiv.classList.add('p-0');
|
|
113
|
-
systemEnvironmentsDiv.style.padding = '0.5rem 0.5rem 0.5rem 0.5rem';
|
|
114
|
-
systemEnvironmentsDiv.appendChild(list);
|
|
115
|
-
} else {
|
|
116
|
-
systemEnvironmentsDiv.innerHTML = '<p class="text-gray-500">No system environment variables loaded or available.</p>';
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Populate User Configurations
|
|
120
|
-
if(userConfigLoadingMsg) userConfigLoadingMsg.remove(); // Remove loading message
|
|
121
|
-
userConfigurationsContainer.innerHTML = ''; // Clear previous entries
|
|
122
|
-
if (settings.userConfigurations && Object.keys(settings.userConfigurations).length > 0) {
|
|
123
|
-
Object.entries(settings.userConfigurations).forEach(([key, value]) => {
|
|
124
|
-
renderUserConfigInput(key, value);
|
|
125
|
-
});
|
|
126
|
-
} else {
|
|
127
|
-
if (!userConfigurationsContainer.querySelector('.user-config-row')) { // Add placeholder if no rows exist
|
|
128
|
-
const p = document.createElement('p');
|
|
129
|
-
p.className = 'text-gray-500 user-config-placeholder';
|
|
130
|
-
p.textContent = 'No user configurations defined. Click "Add User Configuration" to add one.';
|
|
131
|
-
userConfigurationsContainer.appendChild(p);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
} else {
|
|
136
|
-
throw new Error(apiResponse.error || 'Failed to load settings.');
|
|
137
|
-
}
|
|
138
|
-
} catch (error) {
|
|
139
|
-
console.error('Error loading settings:', error);
|
|
140
|
-
showToast(`Error loading settings: ${error.message}`, 'danger');
|
|
141
|
-
systemEnvironmentsDiv.innerHTML = `<p class="text-red-500">Error loading environment variables: ${error.message}</p>`;
|
|
142
|
-
if(userConfigLoadingMsg) userConfigLoadingMsg.textContent = `Error loading user configurations: ${error.message}`;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function renderPythonEnvInput(server = 'system', path = '') {
|
|
147
|
-
const placeholder = pythonEnvsContainer.querySelector('.python-env-placeholder');
|
|
148
|
-
if (placeholder) placeholder.remove();
|
|
149
|
-
|
|
150
|
-
const uniqueId = `python-env-${Date.now()}-${Math.random().toString(36).substr(2, 5)}`;
|
|
151
|
-
const div = document.createElement('div');
|
|
152
|
-
div.className = 'python-env-row flex items-center gap-3 mb-2';
|
|
153
|
-
div.innerHTML = `
|
|
154
|
-
<input type="text" value="${server}" class="form-input form-control w-1/3 px-3 py-2 rounded-md python-env-server" placeholder="Server Name (e.g., system)">
|
|
155
|
-
<input type="text" value="${path}" class="form-input form-control w-2/3 px-3 py-2 rounded-md python-env-path" placeholder="e.g., /usr/bin/python3 or C:/Python39/python.exe">
|
|
156
|
-
<button type="button" class="btn btn-danger btn-sm remove-python-env-button flex items-center">
|
|
157
|
-
<i class='bx bx-trash'></i>
|
|
158
|
-
</button>
|
|
159
|
-
`;
|
|
160
|
-
pythonEnvsContainer.appendChild(div);
|
|
161
|
-
div.querySelector('.remove-python-env-button').addEventListener('click', function() {
|
|
162
|
-
this.closest('.python-env-row').remove();
|
|
163
|
-
if (!pythonEnvsContainer.querySelector('.python-env-row')) { // Add placeholder if no rows exist after removal
|
|
164
|
-
const p = document.createElement('p');
|
|
165
|
-
p.className = 'text-gray-500 python-env-placeholder';
|
|
166
|
-
p.textContent = 'No Python environments defined. Click "Add Python Environment" to add one.';
|
|
167
|
-
pythonEnvsContainer.appendChild(p);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function renderUserConfigInput(key = '', value = '') {
|
|
173
|
-
const placeholder = userConfigurationsContainer.querySelector('.user-config-placeholder');
|
|
174
|
-
if (placeholder) placeholder.remove();
|
|
175
|
-
|
|
176
|
-
const uniqueId = `user-config-${Date.now()}-${Math.random().toString(36).substr(2, 5)}`;
|
|
177
|
-
const div = document.createElement('div');
|
|
178
|
-
div.className = 'user-config-row flex items-center gap-3 mb-2';
|
|
179
|
-
const isSecret = key.toLowerCase().includes('key');
|
|
180
|
-
const valueInputType = isSecret ? 'password' : 'text';
|
|
181
|
-
|
|
182
|
-
// Key Input
|
|
183
|
-
const keyInputHTML = `<input type="text" value="${key}" class="form-input form-control w-1/3 px-3 py-2 rounded-md user-config-key" placeholder="Key">`;
|
|
184
|
-
|
|
185
|
-
// Value Input & Eye Icon (if secret)
|
|
186
|
-
let valueSectionHTML;
|
|
187
|
-
if (isSecret) {
|
|
188
|
-
valueSectionHTML = `
|
|
189
|
-
<div class="relative w-2/3">
|
|
190
|
-
<input type="${valueInputType}" value="${value}" class="form-input form-control w-full px-3 py-2 rounded-md user-config-value pr-10" placeholder="Value">
|
|
191
|
-
<button type="button" class="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500 hover:text-gray-700 toggle-visibility-button" style="background: transparent; border: none;">
|
|
192
|
-
<i class='bx bx-show text-lg'></i>
|
|
193
|
-
</button>
|
|
194
|
-
</div>
|
|
195
|
-
`;
|
|
196
|
-
} else {
|
|
197
|
-
valueSectionHTML = `<input type="${valueInputType}" value="${value}" class="form-input form-control w-2/3 px-3 py-2 rounded-md user-config-value" placeholder="Value">`;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// Remove Button
|
|
201
|
-
const removeButtonHTML = `
|
|
202
|
-
<button type="button" class="btn btn-danger btn-sm remove-user-config-button flex items-center">
|
|
203
|
-
<i class='bx bx-trash'></i>
|
|
204
|
-
</button>
|
|
205
|
-
`;
|
|
206
|
-
|
|
207
|
-
div.innerHTML = keyInputHTML + valueSectionHTML + removeButtonHTML;
|
|
208
|
-
userConfigurationsContainer.appendChild(div);
|
|
209
|
-
|
|
210
|
-
if (isSecret) {
|
|
211
|
-
const toggleButton = div.querySelector('.toggle-visibility-button');
|
|
212
|
-
const valueInput = div.querySelector('.user-config-value');
|
|
213
|
-
const eyeIcon = toggleButton.querySelector('i');
|
|
214
|
-
|
|
215
|
-
toggleButton.addEventListener('click', (e) => {
|
|
216
|
-
e.preventDefault(); // Prevent form submission if inside a form
|
|
217
|
-
if (valueInput.type === 'password') {
|
|
218
|
-
valueInput.type = 'text';
|
|
219
|
-
eyeIcon.classList.remove('bx-show');
|
|
220
|
-
eyeIcon.classList.add('bx-hide');
|
|
221
|
-
} else {
|
|
222
|
-
valueInput.type = 'password';
|
|
223
|
-
eyeIcon.classList.remove('bx-hide');
|
|
224
|
-
eyeIcon.classList.add('bx-show');
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
div.querySelector('.remove-user-config-button').addEventListener('click', function() {
|
|
230
|
-
this.closest('.user-config-row').remove();
|
|
231
|
-
if (!userConfigurationsContainer.querySelector('.user-config-row')) { // Add placeholder if no rows exist after removal
|
|
232
|
-
const p = document.createElement('p');
|
|
233
|
-
p.className = 'text-gray-500 user-config-placeholder';
|
|
234
|
-
p.textContent = 'No user configurations defined. Click "Add User Configuration" to add one.';
|
|
235
|
-
userConfigurationsContainer.appendChild(p);
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
async function saveSettings(event) {
|
|
242
|
-
event.preventDefault();
|
|
243
|
-
setupButton.disabled = true;
|
|
244
|
-
setupButton.innerHTML = `<i class='bx bx-loader-alt bx-spin mr-2'></i>Saving...`;
|
|
245
|
-
|
|
246
|
-
const pythonEnvs = {};
|
|
247
|
-
document.querySelectorAll('.python-env-row').forEach(row => {
|
|
248
|
-
const serverInput = row.querySelector('.python-env-server');
|
|
249
|
-
const pathInput = row.querySelector('.python-env-path');
|
|
250
|
-
if (serverInput && pathInput && serverInput.value.trim()) {
|
|
251
|
-
pythonEnvs[serverInput.value.trim()] = pathInput.value.trim();
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
const userConfigs = {};
|
|
256
|
-
document.querySelectorAll('.user-config-row').forEach(row => {
|
|
257
|
-
const keyInput = row.querySelector('.user-config-key');
|
|
258
|
-
const valueInput = row.querySelector('.user-config-value');
|
|
259
|
-
if (keyInput && valueInput && keyInput.value.trim()) {
|
|
260
|
-
userConfigs[keyInput.value.trim()] = valueInput.value.trim();
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
const settingsData = {
|
|
265
|
-
pythonEnvs: pythonEnvs,
|
|
266
|
-
// Include pythonEnv for backward compatibility (use system value if available)
|
|
267
|
-
pythonEnv: pythonEnvs['system'] || null,
|
|
268
|
-
nodePath: nodePathInput.value.trim() || null,
|
|
269
|
-
browserPath: browserPathInput.value.trim() || null,
|
|
270
|
-
userConfigurations: userConfigs,
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
try {
|
|
274
|
-
const response = await fetch('/api/settings', {
|
|
275
|
-
method: 'POST',
|
|
276
|
-
headers: {
|
|
277
|
-
'Content-Type': 'application/json',
|
|
278
|
-
},
|
|
279
|
-
body: JSON.stringify(settingsData),
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
const apiResponse = await response.json();
|
|
283
|
-
|
|
284
|
-
if (response.ok && apiResponse.success) {
|
|
285
|
-
showToast('Settings saved successfully!', 'success');
|
|
286
|
-
// Optionally, reload settings to reflect any backend-applied defaults
|
|
287
|
-
await loadSettings();
|
|
288
|
-
} else {
|
|
289
|
-
throw new Error(apiResponse.error || `HTTP error! status: ${response.status}`);
|
|
290
|
-
}
|
|
291
|
-
} catch (error) {
|
|
292
|
-
console.error('Error saving settings:', error);
|
|
293
|
-
showToast(`Error saving settings: ${error.message}`, 'danger');
|
|
294
|
-
} finally {
|
|
295
|
-
setupButton.disabled = false;
|
|
296
|
-
setupButton.innerHTML = `<i class='bx bx-save mr-2'></i>Save Settings`;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
cancelButton.addEventListener('click', () => {
|
|
301
|
-
// Navigate back to index.html, preserving flight parameters
|
|
302
|
-
window.location.href = buildUrlWithFlights('index.html');
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
addPythonEnvButton.addEventListener('click', () => renderPythonEnvInput());
|
|
306
|
-
addUserConfigButton.addEventListener('click', () => renderUserConfigInput());
|
|
307
|
-
|
|
308
|
-
settingsForm.addEventListener('submit', saveSettings);
|
|
309
|
-
|
|
310
|
-
// Initial load
|
|
311
|
-
loadSettings();
|
|
312
|
-
|
|
313
|
-
// (Collapse/expand functionality removed as requested)
|
|
314
|
-
});
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<div id="installModal" class="modal">
|
|
2
|
-
<div class="modal-content">
|
|
3
|
-
<span class="close" onclick="closeModal()">×</span>
|
|
4
|
-
<div class="modal-header">
|
|
5
|
-
<h2 id="modalTitle" class="text-2xl font-bold text-gray-800"></h2>
|
|
6
|
-
<p class="text-gray-600 mt-2">Configure your installation settings below</p>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<div class="modal-sections">
|
|
10
|
-
<!-- Requirements Section -->
|
|
11
|
-
<div class="section-container">
|
|
12
|
-
<div id="modalRequirements"></div>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<!-- Client Status Section -->
|
|
16
|
-
<div class="section-container">
|
|
17
|
-
<div id="modalTargets" class="client-grid"></div>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div class="section-container">
|
|
21
|
-
<div id="modalEnvInputs" class="space-y-4">
|
|
22
|
-
<!-- Environment Variables will be injected here -->
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<div class="section-container">
|
|
27
|
-
<div id="modalArguments" class="space-y-4">
|
|
28
|
-
<!-- Arguments will be injected here -->
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<form id="installForm" class="mt-8">
|
|
36
|
-
<!-- Arguments Section -->
|
|
37
|
-
<div id="modalArguments" class="mb-6 space-y-4">
|
|
38
|
-
<!-- Arguments will be injected here -->
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
<div class="flex justify-end space-x-4">
|
|
42
|
-
<button type="button" onclick="closeModal()"
|
|
43
|
-
class="px-6 py-2.5 text-gray-600 hover:text-gray-800 font-medium rounded-lg hover:bg-gray-100 transition-colors">
|
|
44
|
-
Cancel
|
|
45
|
-
</button>
|
|
46
|
-
<button type="submit" class="submit-button">
|
|
47
|
-
Apply
|
|
48
|
-
</button>
|
|
49
|
-
</div>
|
|
50
|
-
</form>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<!-- Loading Modal -->
|
|
55
|
-
<div id="installLoadingModal" class="modal" style="display:none; z-index:2000;">
|
|
56
|
-
<div class="modal-content"
|
|
57
|
-
style="display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 340px; pointer-events:auto; position:relative;">
|
|
58
|
-
<button class="modal-close-button" onclick="hideInstallLoadingModal()" aria-label="Close">×</button>
|
|
59
|
-
<div style="width: 100%;">
|
|
60
|
-
<div style="display: flex; flex-direction: column; align-items: center; width: 100%;">
|
|
61
|
-
<div class="loading-icon" style="margin-bottom:8px;">
|
|
62
|
-
<svg width="48" height="48" viewBox="0 0 48 48" fill="none"
|
|
63
|
-
style="display: block; margin-left: auto; margin-right: auto;">
|
|
64
|
-
<circle cx="24" cy="24" r="20" stroke="#888" stroke-width="4" opacity="0.2" />
|
|
65
|
-
<circle cx="24" cy="24" r="20" stroke="#3498db" stroke-width="4" stroke-linecap="round"
|
|
66
|
-
stroke-dasharray="100" stroke-dashoffset="60">
|
|
67
|
-
<animateTransform attributeName="transform" type="rotate" from="0 24 24" to="360 24 24"
|
|
68
|
-
dur="1s" repeatCount="indefinite" />
|
|
69
|
-
</circle>
|
|
70
|
-
</svg>
|
|
71
|
-
</div>
|
|
72
|
-
<div class="loading-title"
|
|
73
|
-
style="font-size:1.5rem; font-weight:bold; margin-bottom:8px; text-align:center;">Installing...
|
|
74
|
-
</div>
|
|
75
|
-
<div id="installLoadingMessage"
|
|
76
|
-
style="min-height:48px; max-height:160px; overflow:auto; background:#f8f8f8; border-radius:6px; padding:12px; font-size:1rem; color:#444; text-align:left; width:100%;">
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<link rel="stylesheet" href="/css/modal.css">
|
|
84
|
-
<link rel="stylesheet" href="/css/modal.css">
|