|
|
@@ -120,7 +120,7 @@
|
|
|
<p class="well">{{ t('app_setting.Site URL') }}</p>
|
|
|
|
|
|
<div class="col-xs-offset-3">
|
|
|
- <table class="table">
|
|
|
+ <table class="table settings-table">
|
|
|
<colgroup>
|
|
|
<col class="from-db">
|
|
|
<col class="from-env-vars">
|
|
|
@@ -381,6 +381,32 @@
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ /**
|
|
|
+ * The following script sets the class name 'unused' to the cell in from-env-vars column
|
|
|
+ * when the value of the corresponding cell from the database is not empty.
|
|
|
+ * It is used to indicate that the system does not use a value from the environment variables by setting a css style.
|
|
|
+ *
|
|
|
+ * TODO The following script is duplicated from saml.html. It is desirable to integrate those in the future.
|
|
|
+ */
|
|
|
+ $('.settings-table tbody tr').each(function(_, element) {
|
|
|
+ const inputElemFromDB = $('td:nth-of-type(1) input[type="text"], td:nth-of-type(1) textarea', element);
|
|
|
+ const inputElemFromEnvVars = $('td:nth-of-type(2) input[type="text"], td:nth-of-type(2) textarea', element);
|
|
|
+
|
|
|
+ // initialize
|
|
|
+ addClassToUnusedInputElemFromEnvVars(inputElemFromDB, inputElemFromEnvVars);
|
|
|
+
|
|
|
+ // set keyup event handler
|
|
|
+ inputElemFromDB.keyup(function () { addClassToUnusedInputElemFromEnvVars(inputElemFromDB, inputElemFromEnvVars) });
|
|
|
+ });
|
|
|
+
|
|
|
+ function addClassToUnusedInputElemFromEnvVars(inputElemFromDB, inputElemFromEnvVars) {
|
|
|
+ if (inputElemFromDB.val() === '') {
|
|
|
+ inputElemFromEnvVars.parent().removeClass('unused');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ inputElemFromEnvVars.parent().addClass('unused');
|
|
|
+ }
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
</div>
|