1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
|
function ChargementTableRelance()
{
var day = new Date();
day.setDate(day.getDate() - 1); // On sélectionne le jour précédent
var mm = ((day.getMonth() + 1) < 10) ? '0' + (day.getMonth() + 1) : (day.getMonth() + 1);
var dd = (day.getDate() < 10) ? '0' + day.getDate() : day.getDate();
var dayInit_Rel = day.getFullYear().toString() + mm + dd;
var dayInitAlt_Rel = dd + "/" + mm + "/" + day.getFullYear(); // Utiliser pour le nouveau DatePicket
let TabRelanceByID = document.getElementById("table_relance");
let InsertLig = "";
let InsertCell = "";
let NomLig = "";
let NomCell = "";
let BtnCell = "";
let NomDate = "";
let NomDate2 = "";
let Rel_NomDate = "";
let TitreExec = "";
let CmdAExecuter_01 = "";
let MinutesExec_01 = "";
let CmdAExecuter_02 = "";
let MinutesExec_02 = "";
let CmdAExecuter_03 = "";
let MinutesExec_03 = "";
let DateExec = "";
let JJExec = "";
let MMExec = "";
let AAExec = "";
let Rel_NumLig = 0;
let Cmd = "";
let Min = "";
let NumAction = 0;
let TabCmd = [];
let TabMin = [];
// Relance et envoie les emails pour tous les traitements VISTA pour une date données.
// => reconstitue le répertoire $visu/aaaa/mm/oljjmmaaaa
// cd $ss
// sh scripts_batch_auto_guichet.csh JJ MM AAAA
Rel_NumLig = Rel_NumLig + 1;
TitreExec = "Relance et envoie les emails pour tous les traitements VISTA pour une date données => reconstitue le répertoire $visu/aaaa/mm/oljjmmaaaa";
TitreExec = TitreExec + "<br />" + "(cd $ss;sh scripts_batch_auto_guichet.csh JJ MM AAAA)";
NomLig = "L" + twoDigit(Rel_NumLig);
NomCell = "C01";
InsertLig = TabRelanceByID.insertRow(-1);
InsertLig.id = NomLig;
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
InsertCell.innerHTML = TitreExec;
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col3");
NomCell = "C02";
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
NomDate = "Rel_date_deb_" + twoDigit(Rel_NumLig);
Rel_NomDate = "<INPUT class='' name='" + NomDate +"' id='" + NomDate+ "' type='text';></INPUT>";
InsertCell.innerHTML = Rel_NomDate;
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col4");
datePickerInit(dayInitAlt_Rel, NomDate, "dd/mm/yy"); //
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col4");
NomCell = "C03";
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
BtnCell = document.createElement("button");
BtnCell.id = "Rel_BTN" + twoDigit(Rel_NumLig);
BtnCell.title = "Exécution : " + TitreExec;
DateExec = $('input[name=' + NomDate + ']').val();
JJExec = DateExec.substr(0, 2);
MMExec = DateExec.substr(3, 2);
AAExec = DateExec.substr(6, 4);
// CmdAExecuter_01 = "cd $ss;";
// CmdAExecuter_01 = CmdAExecuter_01 + "sh scripts_batch_auto_guichet.csh ";
// CmdAExecuter_01 = CmdAExecuter_01 + JJExec + " " + MMExec + " " + AAExec;
// CmdAExecuter_01 = CmdAExecuter_01 + " &";
// MinutesExec_01 = "1234567";
// BtnCell.onclick = function()
// {
// ExecSSH(CmdAExecuter_01, MinutesExec_01);
// };
Cmd = "cd $ss;";
Cmd = Cmd + "sh scripts_batch_auto_guichet.csh ";
Cmd = Cmd + JJExec + " " + MMExec + " " + AAExec;
Cmd = Cmd + " &";
Min = "1234567";
NumAction = 1;
TabCmd[NumAction] = Cmd;
TabMin[NumAction] = Min;
BtnCell.onclick = function()
{
ExecSSH(TabCmd[NumAction], TabMin[NumAction]);
};
InsertCell.appendChild(BtnCell);
BtnCell.className = "btn btn-warning fas fa-rocket fa-2x center";
InsertCell.classList.add("text-center");
InsertCell.classList.add("CentrageVerticalForce");
InsertCell.classList.add("Table_Largeur_Col6");
// Relance fichiers mensuels ou annuels incomplets => IL FAUT EXECUTER LES 3 SCRIPTS
// cd $ss
// sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_v7
// sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_taxi_time_v7
// sh go.fab.stats.vista.annee.candidate.csh aaaa
Rel_NumLig = Rel_NumLig + 1;
TitreExec = "Relance fichiers mensuels ou annuels incomplets => IL FAUT EXECUTER LES 3 SCRIPTS";
TitreExec = TitreExec + "<br />" + "(cd $ss;sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_v7;<br />sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_taxi_time_v7;<br />sh go.fab.stats.vista.annee.candidate.csh aaaa)";
NomLig = "L" + twoDigit(Rel_NumLig);
NomCell = "C01";
InsertLig = TabRelanceByID.insertRow(-1);
InsertLig.id = NomLig;
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
InsertCell.innerHTML = TitreExec;
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col3");
NomCell = "C02";
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
NomDate = "Rel_date_deb_" + twoDigit(Rel_NumLig)
Rel_NomDate = "<INPUT class='' name='" + NomDate +"' id='" + NomDate+ "' type='text';></INPUT>";
InsertCell.innerHTML = Rel_NomDate;
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col4");
datePickerInit(dayInitAlt_Rel, NomDate, "dd/mm/yy"); //
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col4");
NomCell = "C03";
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
BtnCell = document.createElement("button");
BtnCell.id = "Rel_BTN" + twoDigit(Rel_NumLig);
BtnCell.title = "Exécution : " + TitreExec;
DateExec = $('input[name=' + NomDate + ']').val();
JJExec = DateExec.substr(0, 2);
MMExec = DateExec.substr(3, 2);
AAExec = DateExec.substr(6, 4);
// CmdAExecuter_02 = "cd $ss;";
// CmdAExecuter_02 = CmdAExecuter_02 + "sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_v7 ";
// CmdAExecuter_02 = CmdAExecuter_02 + JJExec + " " + MMExec + " " + AAExec + ";";
// CmdAExecuter_02 = CmdAExecuter_02 + "sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_taxi_time_v7 ";
// CmdAExecuter_02 = CmdAExecuter_02 + JJExec + " " + MMExec + " " + AAExec + ";";
// CmdAExecuter_02 = CmdAExecuter_02 + "sh go.fab.stats.vista.annee.candidate.csh aaaa ";
// CmdAExecuter_02 = CmdAExecuter_02 + AAExec;
// CmdAExecuter_02 = CmdAExecuter_02 + " &";
// MinutesExec_02 = "1234567";
// BtnCell.onclick = function()
// {
// ExecSSH(CmdAExecuter_02, MinutesExec_02);
// };
Cmd = "cd $ss;";
Cmd = Cmd + "sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_v7 ";
Cmd = Cmd + JJExec + " " + MMExec + " " + AAExec + ";";
Cmd = Cmd + "sh go.fab.stats.vista.mois_candidate.csh mm aaaa traitement_tot_dep_arr_aerobahn_taxi_time_v7 ";
Cmd = Cmd + JJExec + " " + MMExec + " " + AAExec + ";";
Cmd = Cmd + "sh go.fab.stats.vista.annee.candidate.csh aaaa ";
Cmd = Cmd + AAExec;
Cmd = Cmd + " &";
Min = "1234567";
NumAction = 2;
TabCmd[NumAction] = Cmd;
TabMin[NumAction] = Min;
BtnCell.onclick = function()
{
ExecSSH(TabCmd[NumAction], TabMin[NumAction]);
};
InsertCell.appendChild(BtnCell);
BtnCell.className = "btn btn-warning fas fa-rocket fa-2x center";
InsertCell.classList.add("text-center");
InsertCell.classList.add("CentrageVerticalForce");
InsertCell.classList.add("Table_Largeur_Col6");
// Relance du CRAQ LIGHT
Rel_NumLig = Rel_NumLig + 1;
TitreExec = "CRAQ : Relance du CRAQ LIGHT => sera toujours envoyé à <b>philippe.hurdyk@regis-dgac.net</b>";
TitreExec = TitreExec + "<br />" + "(cd $ss;sh requete_auto_stat_qse_craq.csh philippe.hurdyk@regis-dgac.net jj mm aaaa)";
NomLig = "L" + twoDigit(Rel_NumLig);
NomCell = "C01";
InsertLig = TabRelanceByID.insertRow(-1);
InsertLig.id = NomLig;
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
InsertCell.innerHTML = TitreExec;
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col3");
NomCell = "C02";
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
NomDate = "Rel_date_deb_" + twoDigit(Rel_NumLig)
Rel_NomDate = "<INPUT class='' name='" + NomDate +"' id='" + NomDate+ "' type='text';></INPUT>";
InsertCell.innerHTML = Rel_NomDate;
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col4");
datePickerInit(dayInitAlt_Rel, NomDate, "dd/mm/yy"); //
InsertCell.className = "CentrageVerticalForce";
InsertCell.classList.add("Table_Largeur_Col4");
NomCell = "C03";
InsertCell = InsertLig.insertCell(-1);
InsertCell.id = NomLig + NomCell;
BtnCell = document.createElement("button");
BtnCell.id = "Rel_BTN" + twoDigit(Rel_NumLig);
BtnCell.title = "Exécution : " + TitreExec;
DateExec = $('input[name=' + NomDate + ']').val();
JJExec = DateExec.substr(0, 2);
MMExec = DateExec.substr(3, 2);
AAExec = DateExec.substr(6, 4);
// CmdAExecuter_03 = "cd $ss;";
// CmdAExecuter_03 = CmdAExecuter_03 + "sh requete_auto_stat_qse_craq.csh philippe.hurdyk@regis-dgac.net ";
// CmdAExecuter_03 = CmdAExecuter_03 + JJExec + " " + MMExec + " " + AAExec + ";";
// CmdAExecuter_03 = CmdAExecuter_03 + " &";
// MinutesExec_03 = "1234567";
// BtnCell.onclick = function()
// {
// ExecSSH(CmdAExecuter_03, MinutesExec_03);
// };
Cmd = "cd $ss;";
Cmd = Cmd + "sh requete_auto_stat_qse_craq.csh philippe.hurdyk@regis-dgac.net ";
Cmd = Cmd + JJExec + " " + MMExec + " " + AAExec + ";";
Cmd = Cmd + " &";
Min = "1234567";
NumAction = 3;
TabCmd[NumAction] = Cmd;
TabMin[NumAction] = Min;
BtnCell.onclick = function()
{
ExecSSH(TabCmd[NumAction], TabMin[NumAction]);
};
InsertCell.appendChild(BtnCell);
BtnCell.className = "btn btn-warning fas fa-rocket fa-2x center";
InsertCell.classList.add("text-center");
InsertCell.classList.add("CentrageVerticalForce");
InsertCell.classList.add("Table_Largeur_Col6");
// Relance du CRAQ JOURNALIER
// Relance du CRAQ MENSUEL
// Relance PotAG
console.log("TabCmd[1]="+TabCmd[1]);
console.log("TabCmd[2]="+TabCmd[2]);
console.log("TabCmd[3]="+TabCmd[3]);
}
/*--------------------------------------------------------------------------------------------------------*/
function ExecSSH(P_Commande, P_Minutes)
{
let QuestionExec = "";
QuestionExec = QuestionExec + "ATTENTION !" + G_CRLF + G_CRLF;
QuestionExec = QuestionExec + "Le traitement ne pourra pas être interrompu." + G_CRLF + G_CRLF;
QuestionExec = QuestionExec + "L'action qui sera exécutée est : " + G_CRLF + G_CRLF;
QuestionExec = QuestionExec + P_Commande + G_CRLF + G_CRLF;
QuestionExec = QuestionExec + "";
QuestionExec = QuestionExec + "Veuillez confirmer votre demande S.V.P.";
let Rep = window.confirm(QuestionExec);
if (Rep)
{
QuestionExec = "Le traitement durera : " + P_Minutes + " minutes." + G_CRLF + G_CRLF;
QuestionExec = QuestionExec + "CONFIRMEZ-VOUS SON EXECUTION ?"
Rep = window.confirm(QuestionExec);
if (Rep)
{
sshRun(P_Commande);
}
else
{
alert("Traitement annulé.")
}
}
else
{
alert("Traitement non confirmé => Annulé");
}
} |
Partager