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";
}
$supportedTypes = array("mysql", "postgres"); # , "oracle", "postgres");
$supportedTypes = array("mysql", "postgres");
if(!$success) {
$msg = "Please fill out the following inputs:<br>" .
$this->createUnorderedList($missingInputs);
@ -590,7 +590,7 @@ namespace Documents\Install {
"title" => "Database configuration",
"form" => 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" => "Password", "name" => "password", "type" => "password"),

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