oracle? nope

This commit is contained in:
Roman 2021-03-31 13:59:02 +02:00
parent 11e83028c5
commit 0df60ddd96
4 changed files with 30 additions and 31 deletions

@ -234,7 +234,7 @@ namespace Documents\Install {
$missingInputs[] = "Type"; $missingInputs[] = "Type";
} }
$supportedTypes = array("mysql", "postgres"); # , "oracle", "postgres"); $supportedTypes = array("mysql", "postgres");
if(!$success) { if(!$success) {
$msg = "Please fill out the following inputs:<br>" . $msg = "Please fill out the following inputs:<br>" .
$this->createUnorderedList($missingInputs); $this->createUnorderedList($missingInputs);
@ -590,7 +590,7 @@ namespace Documents\Install {
"title" => "Database configuration", "title" => "Database configuration",
"form" => array( "form" => array(
array("title" => "Database Type", "name" => "type", "type" => "select", "required" => true, "items" => array( array("title" => "Database Type", "name" => "type", "type" => "select", "required" => true, "items" => array(
"mysql" => "MySQL", "oracle" => "Oracle", "postgres" => "PostgreSQL" "mysql" => "MySQL", "postgres" => "PostgreSQL"
)), )),
array("title" => "Username", "name" => "username", "type" => "text", "required" => true), array("title" => "Username", "name" => "username", "type" => "text", "required" => true),
array("title" => "Password", "name" => "password", "type" => "password"), array("title" => "Password", "name" => "password", "type" => "password"),

@ -435,9 +435,6 @@ abstract class SQL {
$sql = new MySQL($connectionData); $sql = new MySQL($connectionData);
} else if ($type === "postgres") { } else if ($type === "postgres") {
$sql = new PostgreSQL($connectionData); $sql = new PostgreSQL($connectionData);
/*} else if ($type === "oracle") {
// $sql = new OracleSQL($connectionData);
*/
} else { } else {
return "Unknown database type"; return "Unknown database type";
} }

2
js/files.min.js vendored

File diff suppressed because one or more lines are too long

@ -4,8 +4,8 @@ const SUCCESFULL = 2;
const ERROR = 3; const ERROR = 3;
function setState(state) { function setState(state) {
var li = $("#currentStep"); let li = $("#currentStep");
var icon, color, text; let icon, color, text;
switch (state) { switch (state) {
case PENDING: case PENDING:
@ -44,23 +44,25 @@ function getCurrentStep() {
function sendRequest(params, done) { function sendRequest(params, done) {
setState(PENDING); setState(PENDING);
var success = false; let success = false;
$("#status").hide(); let statusBox = $("#status");
statusBox.hide();
$.post("/index.php", params, function(data) { $.post("/index.php", params, function(data) {
if(data.success || data.step != getCurrentStep()) { if(data.success || data.step !== getCurrentStep()) {
success = true; success = true;
window.location.reload(); window.location.reload();
} else { } else {
setState(ERROR); setState(ERROR);
$("#status").addClass("alert-danger"); statusBox.addClass("alert-danger");
$("#status").html("An error occurred during intallation: " + data.msg); statusBox.html("An error occurred during intallation: " + data.msg);
$("#status").show(); statusBox.show();
} }
}, "json").fail(function() { }, "json").fail(function() {
setState(ERROR); setState(ERROR);
$("#status").addClass("alert-danger"); statusBox.addClass("alert-danger");
$("#status").html("An error occurred during intallation. Try <a href=\"/index.php\">restarting the process</a>."); statusBox.html("An error occurred during intallation. Try <a href=\"/index.php\">restarting the process</a>.");
$("#status").show(); statusBox.show();
}).always(function() { }).always(function() {
if(done) done(success); if(done) done(success);
}); });
@ -79,12 +81,13 @@ $(document).ready(function() {
$("#btnSubmit").click(function() { $("#btnSubmit").click(function() {
params = { }; params = { };
var textBefore = $("#btnSubmit").text(); let submitButton = $("#btnSubmit");
$("#btnSubmit").prop("disabled", true); let textBefore = submitButton.text();
$("#btnSubmit").html("Submitting… <i class=\"fas fa-spinner fa-spin\">"); submitButton.prop("disabled", true);
submitButton.html("Submitting… <i class=\"fas fa-spinner fa-spin\">");
$("#installForm .form-control").each(function() { $("#installForm .form-control").each(function() {
var type = $(this).attr("type") ?? $(this).prop("tagName").toLowerCase(); let type = $(this).attr("type") ?? $(this).prop("tagName").toLowerCase();
var name = $(this).attr("name"); let name = $(this).attr("name");
if(type === "text") { if(type === "text") {
params[name] = $(this).val().trim(); params[name] = $(this).val().trim();
} else if(type === "password" || type === "number") { } else if(type === "password" || type === "number") {
@ -95,8 +98,8 @@ $(document).ready(function() {
}).promise().done(function() { }).promise().done(function() {
sendRequest(params, function(success) { sendRequest(params, function(success) {
if(!success) { if(!success) {
$("#btnSubmit").prop("disabled",false); submitButton.prop("disabled",false);
$("#btnSubmit").text(textBefore); submitButton.text(textBefore);
} else { } else {
setState(SUCCESFULL); setState(SUCCESFULL);
} }
@ -135,17 +138,16 @@ $(document).ready(function() {
}); });
// DATABASE PORT // DATABASE PORT
var prevPort = $("#port").val(); let prevPort = $("#port").val();
var prevDbms = $("#type option:selected").val(); let prevDbms = $("#type option:selected").val();
function updateDefaultPort() { function updateDefaultPort() {
var defaultPorts = { let defaultPorts = {
"mysql": 3306, "mysql": 3306,
"postgres": 5432, "postgres": 5432
"oracle": 1521
}; };
var curDbms = $("#type option:selected").val(); let curDbms = $("#type option:selected").val();
if(defaultPorts[prevDbms] == prevPort) { if(defaultPorts[prevDbms] === prevPort) {
$("#port").val(defaultPorts[curDbms]); $("#port").val(defaultPorts[curDbms]);
} }
} }