📦 Applications
+Loading applications...
+⚙️ Git Configuration
Loading applications...
-diff --git a/apps/pusher_app_prem/appserver/static/git_pusher.js b/apps/pusher_app_prem/appserver/static/git_pusher.js index 951f20e1..bf2c5a3a 100755 --- a/apps/pusher_app_prem/appserver/static/git_pusher.js +++ b/apps/pusher_app_prem/appserver/static/git_pusher.js @@ -1,18 +1,29 @@ // ============================================ // GIT PUSHER - MAIN JAVASCRIPT -// Version 2.0 avec système de licence par fichier +// Version 2.1 avec déploiement vers SH Cluster // ============================================ // Configuration const GIT_PUSHER_CONFIG = { + // Détecter automatiquement l'URL du serveur serverUrl: window.location.protocol + '//' + window.location.hostname + ':9999', credentialsKey: 'git_pusher_credentials', - version: '2.0.0' + deployerConfigKey: 'git_pusher_deployer_config', + version: '2.1.0' +}; + +// Configuration SH Deployer (peut être modifiée via l'interface) +let SH_DEPLOYER_CONFIG = { + enabled: false, + host: '10.10.40.14', + port: 9998, + token: '' }; // État global let selectedApps = []; let isProcessing = false; +let deployerAvailable = false; // ============================================ // INITIALISATION @@ -25,7 +36,7 @@ require([ 'splunkjs/mvc/simplexml/ready!' ], function($, mvc, SearchManager) { - console.log("Git Pusher v2.0 initializing..."); + console.log("Git Pusher v2.1 initializing..."); // Initialiser le système de licence if (typeof initializeLicense === 'function') { @@ -37,6 +48,12 @@ require([ // Charger les credentials sauvegardés loadSavedCredentials(); + // Charger la config du deployer + loadDeployerConfig(); + + // Vérifier la disponibilité du SH Deployer + checkDeployerHealth(); + // Récupérer les résultats de recherche pour les apps const searchManager = mvc.Components.get('dsearch'); @@ -59,23 +76,6 @@ require([ window.toggleSelectAll = toggleSelectAll; }); -// Attacher l'événement au bouton après chargement du DOM -document.addEventListener('DOMContentLoaded', function() { - setTimeout(function() { - var pushBtn = document.getElementById('push-btn'); - if (pushBtn) { - pushBtn.onclick = function() { - if (typeof pushDashboards === 'function') { - pushDashboards(); - } else if (typeof window.pushDashboards === 'function') { - window.pushDashboards(); - } - }; - console.log("Push button event attached"); - } - }, 2000); // Attendre 2 secondes que tout soit chargé -}); - // ============================================ // RENDU DE LA LISTE DES APPLICATIONS // ============================================ @@ -84,16 +84,11 @@ function renderAppsList(rows, fields) { const container = document.getElementById('dashboard-list'); if (!container) return; - console.log("Fields:", fields); - console.log("First row:", rows[0]); - // Trouver les index des colonnes const nameIdx = fields.indexOf('name'); const labelIdx = fields.indexOf('label'); const descIdx = fields.indexOf('description'); - console.log("Index - name:", nameIdx, "label:", labelIdx); - // Générer le HTML let html = `
Deploy your Splunk applications to Git with confidence
-