6 $monLibrary= dirname(__FILE__) .
"/../library";
7 $sharedLibrary= dirname(__FILE__) .
"/../../shared/library";
8 require_once(
"$monLibrary/cu_top.i");
9 require_once(
"$monLibrary/ck_hticket.i");
10 require_once(
"$monLibrary/monitorView.i");
11 require_once(
"$sharedLibrary/commonJsFunctions.i");
13 if (!CheckPerm($link, $Hu, basename($_SERVER[
'SCRIPT_NAME']), $_SERVER[
'REMOTE_ADDR'])) {
16 header(
"Location: /hcuadm/hcu_noperm.prg");
21 $dataFile=
"cutrustdetail.data";
22 $dataPath=
"/hcuadm/$dataFile";
25 dms_import_v2($DATA_PARAMETERS,
"TOP_LEVEL", array(
"user_name" =>
"string"));
26 $cu= strtoupper($DATA_PARAMETERS[
"TOP_LEVEL"][
"user_name"]);
27 printMonitorPageTop(
"Home CU Services", $homecuKendoVersion, $cloudfrontDomainName);
35 .k-grid tbody .k-button {
36 min-width: 20px !important;
39 #defaultValueGrid thead { 43 #defaultValueGrid tbody tr { 47 #defaultValueGrid .k-grid-customDelete { 52 .k-pager-numbers.k-reset {
53 font-family: Arial, Helvetica, sans-serif !important;
54 font-size: 10pt !important;
55 font-style: normal !important;
56 font-variant: normal !important;
57 font-weight: normal !important;
66 margin-top: 4px !important;
67 height: 15px !important;
68 width: 15px !important;
71 .k-link.k-pager-nav .k-icon {
75 .k-pager-nav .k-icon {
88 border-color: rgb(204, 204, 204);
89 background-color: rgb(238, 238, 238);
91 color: rgb(51, 131, 187) !important;
93 font-family:
'Trebuchet MS',
'Lucida Grande', Verdana, Arial, sans-serif;
98 #deleteDialogWindow .message { 102 #deleteDialogWindow .k-edit-buttons { 107 <script type=
"text/javascript">
111 getErrorsAreShownFunction();
112 getSetupDeleteConfirmDialogFunction();
113 getAddMinifiedActionStyleFunction();
114 getEscapeHTMLFunction();
115 getShowSQLFunction($showSQL);
116 getSetupValidatorInGridFunction();
117 getUseValidatorInGridFunction();
118 getShowWaitFunctions();
125 var serverOptions= [];
126 var serviceUpdateOptions= [];
127 var initialized=
false;
128 var initializeDDLs=
"Y";
130 var grid= $(
"#grid").kendoGrid({
134 url:
"<?php echo $dataPath; ?>?operation=readServerSettings",
139 url:
"<?php echo $dataPath; ?>?operation=addServerSetting",
144 url:
"<?php echo $dataPath; ?>?operation=updateServerSetting",
148 parameterMap:
function(data, type) {
151 return {initializeDDLs: initializeDDLs};
152 else if (type =
"create")
160 property: {type:
"string"},
161 value: {type:
"string"},
162 text: {type:
"string"},
163 message: {type:
"string"}
166 parse:
function (data) {
170 if (data.operation ==
"read")
172 if (initializeDDLs ==
"Y")
174 defaultsDDL= data.defaultsDDL;
175 serverOptions= data.serverOptions;
176 serviceUpdateOptions= data.serviceUpdateOptions;
180 gridData= data.record;
184 gridData= grid.dataSource.data();
187 showSQL(data, append);
189 if (errorsAreShown(data,
"formValidateMainDiv"))
190 $(
"#invalidRequestServerSide").val(
true);
193 $(
"#invalidRequestServerSide").val(
false);
194 var limitedDefaultsDDL= [];
196 for (var i=0; i!= gridData.length; i++)
198 lookup[gridData[i].property]=
true;
200 for (var i=0; i!= defaultsDDL.length; i++)
202 if (typeof(lookup[defaultsDDL[i].property]) ==
"undefined")
203 limitedDefaultsDDL.push(defaultsDDL[i]);
206 if (limitedDefaultsDDL.length == 0)
207 $(
"#grid .k-grid-add").hide();
209 $(
"#grid .k-grid-add").show();
214 sort: {field:
"property", dir:
"asc"}
217 {command: [{name:
"edit", text:
""}, {name:
"customDelete", text:
"", iconClass:
"k-icon k-i-delete"}], width:
"100px"},
218 {field:
"property", title:
"Property"},
219 {field:
"text", title:
"Value"},
220 {field:
"message", title:
"Offline Message"}
222 toolbar: [{name:
"create", text:
""}, {name:
"serviceUpdate", text:
"Service Update"}],
225 template: kendo.template($(
"#popupTemplate").html()),
229 title:
"<span class='gridWindowTitle'>Add Service Property</span>",
235 setupValidatorInGrid(e,
false);
237 var valueDDL= $(
"#valueDDL").kendoDropDownList({
241 dataTextField:
"text",
242 dataValueField:
"value",
243 change:
function () {
244 e.model.value= this.value();
245 e.model.text= this.text();
248 }).data(
"kendoDropDownList");
252 $(
".gridWindowTitle").text(
"Add Service Property");
253 $(
"#propertyLabel").
remove();
255 e.model.value= valueDDL.value();
256 e.model.text= valueDDL.text();
258 var limitedDefaultsDDL= [];
260 var data= grid.dataSource.data();
261 for (var i=0; i!= data.length; i++)
263 lookup[data[i].property]=
true;
265 for (var i=0; i!= defaultsDDL.length; i++)
267 if (typeof(lookup[defaultsDDL[i].property]) ==
"undefined")
268 limitedDefaultsDDL.push(defaultsDDL[i]);
270 var propertyDDL= $(
"#propertyDDL").kendoDropDownList({
272 data: limitedDefaultsDDL,
277 property: {type:
"string"},
278 defaultValue: {type:
"string"},
279 defaultMessage: {type:
"string"}
284 filter:
"startswith",
285 dataTextField:
"property",
286 dataValueField:
"property",
287 dataBound:
function () {
288 var dataItem= this.dataItem();
289 if (typeof(dataItem) !=
"undefined")
291 valueDDL.value(dataItem.defaultValue);
292 $(
"[name='message']").text(dataItem.defaultMessage);
293 e.model.value= dataItem.defaultValue;
294 e.model.message= dataItem.defaultMessage;
295 e.model.text= valueDDL.text();
296 e.model.property= this.value();
299 change:
function () {
300 var dataItem= this.dataItem();
301 if (typeof(dataItem) !=
"undefined")
303 valueDDL.value(dataItem.defaultValue);
304 $(
"[name='message']").text(dataItem.defaultMessage);
305 e.model.value= dataItem.defaultValue;
306 e.model.message= dataItem.defaultMessage;
307 e.model.text= valueDDL.text();
308 e.model.property= this.value();
311 }).data(
"kendoDropDownList");
315 $(
".gridWindowTitle").text(
"Edit Service Property");
316 $(
"#propertyDDL").
remove();
318 valueDDL.value(e.model.value);
322 useValidatorInGrid(e,
false);
324 dataBound:
function (e) {
328 addMinifiedActionStyle(
"#grid",
true);
331 setupDeleteConfirmDialog(
"<?php echo $dataPath; ?>?operation=removeServerSetting",
"#grid",
"property",
"deleteDialogWindow",
function () { $(
"#grid .k-grid-add").show(); });
333 }).data(
"kendoGrid");
335 $(
"#grid .k-grid-serviceUpdate").click(
function () {
336 openServiceUpdateModal(serviceUpdateOptions);
342 function openServiceUpdateModal(serviceUpdateOptions)
344 var serviceUpdateModal= $(
"#serviceUpdateModal").data(
"kendoWindow");
345 var ddl= $(
"#updateAllDDL").data(
"kendoDropDownList");
346 if (serviceUpdateModal ==
null)
348 serviceUpdateModal= $(
"<div id='serviceUpdateModal'></div>").kendoWindow({
350 template: kendo.template($(
"#serviceUpdateTemplate").html())
353 title:
"Service Update",
359 }).data(
"kendoWindow");
361 ddl= $(
"#updateAllDDL").kendoDropDownList({
363 data: serviceUpdateOptions
365 filter:
"startswith",
366 dataTextField:
"text",
367 dataValueField:
"value" 368 }).data(
"kendoDropDownList");
370 $(
"#serviceUpdateModal .updateBtn").click(
function () {
372 $.post(
"<?php echo $dataPath; ?>?operation=serviceUpdate", {isTurnOff: ddl.value()},
function (data) {
375 if (!errorsAreShown(data,
"formValidateMainDiv"))
376 $(
"#grid").data(
"kendoGrid").dataSource.read();
379 serviceUpdateModal.close();
383 $(
"#serviceUpdateModal .cancelBtn").click(
function () {
384 serviceUpdateModal.close();
389 serviceUpdateModal.open().center();
393 function initAccordion()
395 var accordion= $(
"#accordion").kendoPanelBar({}).data(
"kendoPanelBar");
396 $(
".insertList:eq(0)").html($(
"#list1Template").html());
397 $(
".insertList:eq(1)").html($(
"#list2Template").html());
401 $(document).ready(
function () {
407 <script
id=
"deleteConfirmTemplate" type=
"text/x-kendo-template">
408 <div
class=
"k-edit-form-container">
409 <div
class=
"container_12">
410 <div
class=
"grid_12 message">Are you sure that you want to
delete?
412 <div
class=
"k-edit-buttons k-state-default">
413 <a
class=
"k-button k-button-icontext deleteConfirmContinueBtn" href=
"\#">
414 <span
class=
"k-icon k-i-check"></span>
417 <a
class=
"k-button k-button-icontext deleteConfirmCancelBtn" href=
"\#">
418 <span
class=
"k-icon k-i-cancel"></span>
424 <script
id=
"serviceUpdateTemplate" type=
"text/x-kendo-template">
425 <div
class=
"k-edit-form-container">
426 <div
class=
"container_12">
427 <div
class=
"grid_12">
428 <div
class=
"grid_4 alpha">
429 <label>Update All:</label>
432 <div
id=
"updateAllDDL"></div>
436 <div
class=
"k-edit-buttons k-state-default" style=
"width:320px;">
437 <a
class=
"k-button k-button-icontext updateBtn" href=
"\#">
438 <span
class=
"k-icon k-i-check"></span>
441 <a
class=
"k-button k-button-icontext cancelBtn" href=
"\#">
442 <span
class=
"k-icon k-i-cancel"></span>
448 <script
id=
"popupTemplate" type=
"text/x-kendo-template">
449 <div
id=
"formValidatePopupDiv" class=
"homecu-formStatus k-block k-error-colored" style=
"display:none;"></div>
450 <form
id=
"popupForm" class=
"popupForm" data-role=
"validator" novalidate>
451 <div
class=
"container_12">
452 <div
class=
"grid_12">
453 <div
class=
"grid_4 alpha">
457 <div
id=
"propertyLabel">#:
property #</div>
458 <div
id=
"propertyDDL"></div>
461 <div
class=
"grid_12">
462 <div
class=
"grid_4 alpha">
463 <label>Value:</label>
466 <div
id=
"valueDDL"></div>
469 <div
class=
"grid_12">
470 <div
class=
"grid_4 alpha">
471 <label>Message:</label>
474 <textarea name=
"message"></textarea>
480 <script
id=
"list1Template" type=
"text/x-kendo-template">
484 <p>This will have no affect on the status of the services.</p>
488 <p>This will
set any service, NOT
set to Offline (Stay Down), to Active.</p>
492 <p>This will
set any service,
set to Active, to Offline (Auto Up).</p>
496 <script
id=
"list2Template" type=
"text/x-kendo-template">
503 <p>This option marks the service as Active, and the hcu_checkService will
return a
true. Meaning the service should be on-line.</p>
506 <h4>Offline (Auto Up)</h4>
507 <p>This option marks the service as offline, and the hcu_checkService will
return a
false, and the service is considered offline.
508 However,
if the HOMECUSERVICE update above is used and the status is
set to On. Then
this service will change to Active.</p>
511 <h4>Offline (Stay Down)</h4>
512 <p>This option marks the service as offline, and the hcu_checkService will
return a
false, and the service is considered offline.
513 However, changing the HOMECUSERVICE update above will have no affect on
this servce.</p>
518 <h3>Offline Message</h3>
519 <p>If you want a custom message
for this service
while it is offline, you can
set the message here. This message is returned from the hcu_checkServiceMsg
function when specifying the service.
520 Entering a value in
this field creates a {SERVICE}_MSG entry in the cutrustdetail settings array with the
string you enter.</p>
525 <?php printMonitorPageMiddle(
"Home CU Services"); ?>
527 <div
id=
'hideSubmitWait' style=
'position:relative; left:-2000px;top:-2000px;'>
528 <div
id=
'homecuSubmitWait' class=
'k-block' >
529 <div
class=
'k-loading-image'></div>
532 <input type=
"hidden" id=
"invalidRequestClientSide">
533 <input type=
"hidden" id=
"invalidRequestServerSide">
534 <div
class=
"container_12">
535 <div
class=
"grid_12">
536 <div
class=
"grid_7 alpha omega">
538 <li>What does
this do 542 This page will allow you to turn off all or a select service
for the individual server.<br/>
543 Each server has their own service settings and need to be configured separately.<br/>
552 <h2>How to turn on/off ALL services
for this server.</h2></br>
553 On the HOMECUSERVICE row click on the
'edit' link.<br/>
554 A form with the following options appears<br/>
555 <span
class=
"insertList"></span>
557 <h2>How to turn on/off per server.</h2></br>
558 On the HOMECUSERVICE row click on the
'expand' link on the left.<br/>
559 A table will expand with all the services setup on the server.<br/>
560 When you find the row you are looking
for, click on the
'edit' link. If you don
't find the service click 'Add
new record
'<br/> 561 <span style='color: #770000;
'>NOTE *** The list will not include any service ending in _MSG, these codes are reserved for storing the offline message</span> 562 <span class="insertList"></span> 569 <div class="grid_12"> 572 <div class="grid_12"> 573 <div class="grid_7 alpha omega"> 574 <div id="sqlOutput"></div> 577 <div class="grid_12"> 578 <div class="grid_7 alpha omega"> 579 <div id="formValidateMainDiv" class="k-block k-error-colored" style="display:none;"></div> 582 <div class="grid_12"> 583 <div class="grid_7 alpha omega"> 584 <div id="grid" style="width:100%"></div> 589 <?php printMonitorPageBottom(); ?>