PageSourceSearch

https://opengear.com/wp-content/plugins/opengear-configurator/public/js/deploy-core.js?ver=1.5

js opengear.com collected 2026-10-02 17:35:42 UTC 3,763 bytes, 83 lines download raw bytes

1// ─────────────────────────────────────────────
2// DEPLOYMENT MODE
3// ─────────────────────────────────────────────
4function setDeploymentMode(on) {
5  state.deploymentMode = !!on;
6  state.activeConfigId = null;
7
8  var singlePanel = document.getElementById('singleDevicePanel');
9  var deployPanel = document.getElementById('deploymentPanel');
10  var btnSingle   = document.getElementById('btnSingleDevice');
11  var btnDeploy   = document.getElementById('btnDeployMode');
12
13  if (on) {
14    if (singlePanel) singlePanel.hidden = true;
15    if (deployPanel) deployPanel.hidden = false;
16    if (btnSingle) btnSingle.classList.remove('deploy-toggle-btn--active');
17    if (btnDeploy) btnDeploy.classList.add('deploy-toggle-btn--active');
18    state.deployWizardPhase = 'overview';
19    renderDeploymentWizard();
20  } else {
21    if (singlePanel) singlePanel.hidden = false;
22    if (deployPanel) deployPanel.hidden = true;
23    if (btnSingle) btnSingle.classList.add('deploy-toggle-btn--active');
24    if (btnDeploy) btnDeploy.classList.remove('deploy-toggle-btn--active');
25    renderModelGrid();
26  }
27  renderBOM();
28}
29
30// ─────────────────────────────────────────────
31// DEPLOY WIZARD
32// ─────────────────────────────────────────────
33function escHtml(s) {
34  return (s || '').toString()
35    .replace(/&/g, '&amp;').replace(/</g, '&lt;')
36    .replace(/>/g, '&gt;').replace(/"/g, '&quot;');
37}
38
39function renderDeploymentWizard() {
40  var container = document.getElementById('deployWizardContent');
41  if (!container) return;
42  switch (state.deployWizardPhase) {
43    case 'overview':         renderDeployWizardOverview(container);         break;
44    case 'name':             renderDeployWizardName(container);             break;
45    case 'site':             renderDeployWizardSite(container);             break;
46    case 'rack-usecase':     renderDeployWizardRackUsecase(container);      break;
47    case 'rack-family':      renderDeployWizardRackFamily(container);       break;
48    case 'rack-model':       renderDeployWizardRackModel(container);        break;
49    case 'rack-options':     renderDeployWizardRackOptions(container);      break;
50    case 'rack-accessories': renderDeployWizardRackAccessories(container);  break;
51    case 'rack-support':     renderDeployWizardRackSupport(container);      break;
52    case 'rack-rename':      renderDeployWizardRackRename(container);       break;
53    default:                 renderDeployWizardOverview(container);
54  }
55}
56
57function _deployWizardProgressHtml(phase) {
58  var phases = ['rack-usecase', 'rack-family', 'rack-model', 'rack-options', 'rack-accessories', 'rack-support'];
59  var idx = phases.indexOf(phase);
60  if (idx < 0) return '';
61  return '<div class="deploy-wizard-progress">' +
62    phases.map(function(p, i) {
63      var cls = 'deploy-wizard-dot';
64      if (i < idx)        cls += ' done';
65      else if (i === idx) cls += ' active';
66      return '<div class="' + cls + '"></div>';
67    }).join('') + '</div>';
68}
69
70// ── Helper: total rack count across all sites ──────────
71function totalRackCount() {
72  return state.configs.reduce(function(sum, s) { return sum + (s.racks || []).length; }, 0);
73}
74
75function _deployStep3Summary() {
76  var sc = state.configs.length;
77  var rc = totalRackCount();
78  if (sc === 0) return '';
79  var s = sc + ' site' + (sc !== 1 ? 's' : '');
80  if (rc > 0) s += ', ' + rc + ' rack' + (rc !== 1 ? 's' : '');
81  return s;
82}
83

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.