¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -1,264 +1,462 @@
@extends('install.layout')
<div class="has-scrollable-content configuration d-flex flex-column" v-else-if="step === 3 && !appInstalled" v-cloak>
<div class="header overflow-hidden">
<h3>Configuration</h3>
<p class="excerpt">Please configure your application with necessary information and credentials.</p>
</div>
@section('content')
@if (session()->has('error'))
<div class="alert alert-danger fade in alert-dismissable">
{{ session('error') }}
</div>
@endif
<div class="content position-relative flex-grow-1 overflow-hidden">
<simplebar class="scrollable-content position-absolute" data-simplebar-auto-hide="false" ref="configurationContent">
<div
class="alert alert-danger alert-dismissible show fade"
:class="{
'animate__animated animate__headShake': animateAlert
}"
role="alert"
v-if="hasErrorMessage"
>
<span v-html="errorMessage"></span>
<h2>2. Configuration</h2>
<form method="POST" action="{{ route('install.configuration.post') }}" class="form-horizontal">
{{ csrf_field() }}
<div class="box">
<p>Please enter your database connection details.</p>
<div class="configure-form">
<div class="form-group {{ $errors->has('db.host') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="host">Host <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="db[host]" value="{{ old('db.host', '127.0.0.1') }}" id="host" class="form-control" autofocus>
{!! $errors->first('db.host', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('db.port') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="port">Port <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="db[port]" value="{{ old('db.port', '3306') }}" id="port" class="form-control">
{!! $errors->first('db.port', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('db.username') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="db-username">DB Username <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="db[username]" value="{{ old('db.username') }}" id="db-username" class="form-control">
{!! $errors->first('db.username', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="db-password">DB Password</label>
<div class="col-sm-9">
<input type="password" name="db[password]" value="{{ old('db.password') }}" id="db-password" class="form-control">
</div>
</div>
<div class="form-group {{ $errors->has('db.database') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="database">Database <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="db[database]" value="{{ old('db.database') }}" id="database" class="form-control">
{!! $errors->first('db.database', '<span class="help-block">:message</span>') !!}
</div>
</div>
<button
type="button"
class="btn-close"
data-bs-dismiss="alert"
aria-label="Close"
@click="resetErrorMessage"
>
</button>
</div>
</div>
<div class="box">
<p>Please enter a username and password for the administration.</p>
<div class="configure-form">
<div class="form-group {{ $errors->has('admin.first_name') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="admin-first-name">First Name <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="admin[first_name]" value="{{ old('admin.first_name') }}" id="admin-first-name" class="form-control">
{!! $errors->first('admin.first_name', '<span class="help-block">:message</span>') !!}
<form
class="configuration-form form-horizontal"
@input="errors.clear($event.target.name)"
ref="configurationForm"
>
<div class="box overflow-hidden">
<div class="title">
<h5>Database</h5>
</div>
</div>
<div class="form-group {{ $errors->has('admin.last_name') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="admin-last-name">Last Name <span>*</span></label>
<div class="row form-group">
<label for="db_host" class="col-md-3 col-form-label">
Host <span class="required">*</span>
</label>
<div class="col-sm-9">
<input type="text" name="admin[last_name]" value="{{ old('admin.last_name') }}" id="admin-last-name" class="form-control">
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="db_host"
id="db_host"
class="form-control"
v-model="form.db_host"
>
{!! $errors->first('admin.last_name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('admin.email') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="admin-email">Email <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="admin[email]" value="{{ old('admin.email') }}" id="admin-email" class="form-control">
{!! $errors->first('admin.email', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('admin.phone') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="admin-phone">Phone <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="admin[phone]" value="{{ old('admin.phone') }}" id="admin-phone" class="form-control">
{!! $errors->first('admin.phone', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('admin.password') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="admin-password">Password <span>*</span></label>
<div class="col-sm-9">
<input type="password" name="admin[password]" id="admin-password" class="form-control">
{!! $errors->first('admin.password', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="admin-confirm-password">Confirm Password <span>*</span></label>
<div class="col-sm-9">
<input type="password" name="admin[password_confirmation]" id="admin-confirm-password" class="form-control">
</div>
</div>
</div>
</div>
<div class="box">
<p>Please enter your store details.</p>
<div class="configure-form p-b-0">
<div class="form-group {{ $errors->has('store.store_name') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="store-name">Store Name <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="store[store_name]" value="{{ old('store.store_name') }}" id="store-name" class="form-control">
{!! $errors->first('store.store_name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('store.store_email') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="store-email">Store Email <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="store[store_email]" value="{{ old('store.store_email') }}" id="store-email" class="form-control">
{!! $errors->first('store.store_email', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('store.store_phone') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="store-phone">Store Phone <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="store[store_phone]" value="{{ old('store.store_phone') }}" id="store-phone" class="form-control">
{!! $errors->first('store.store_phone', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('store.search_engine') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="store-search-engine">Search Engine <span>*</span></label>
<div class="col-sm-9">
<select name="store[search_engine]" class="form-control custom-select-black" id="store-search-engine">
<option value="mysql" {{ old('store.search_engine') === 'mysql' ? 'selected' : '' }}>
MySQL
</option>
<option value="algolia" {{ old('store.search_engine') === 'algolia' ? 'selected' : '' }}>
Algolia
</option>
<option value="meilisearch" {{ old('store.search_engine') === 'meilisearch' ? 'selected' : '' }}>
MeiliSearch
</option>
</select>
@if ($errors->has('store.search_engine'))
{!! $errors->first('store.search_engine', '<span class="help-block">:message</span>') !!}
@else
<span class="help-block">You cannot change the search engine later.</span>
@endif
</div>
</div>
<div class="{{ old('store.search_engine') === 'algolia' ? '' : 'hide' }}" id="algolia-fields">
<div class="form-group {{ $errors->has('store.algolia_app_id') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="store-algolia-app-id">Algolia Application ID <span>*</span></label>
<div class="col-sm-9">
<input type="text" name="store[algolia_app_id]" value="{{ old('store.algolia_app_id') }}" id="store-algolia-app-id" class="form-control">
{!! $errors->first('store.algolia_app_id', '<span class="help-block">:message</span>') !!}
<span class="invalid-feedback" v-if="errors.has('db_host')">
@{{ errors.get('db_host') }}
</span>
</div>
</div>
<div class="form-group {{ $errors->has('store.algolia_secret') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="store-algolia-secret">Algolia Admin API Key <span>*</span></label>
<div class="row form-group">
<label for="db_port" class="col-md-3 col-form-label">
Port <span class="required">*</span>
</label>
<div class="col-sm-9">
<input type="password" name="store[algolia_secret]" value="{{ old('store.algolia_secret') }}" id="store-algolia-secret" class="form-control">
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="db_port"
id="db_port"
class="form-control"
v-model="form.db_port"
>
{!! $errors->first('store.algolia_secret', '<span class="help-block">:message</span>') !!}
<span class="invalid-feedback" v-if="errors.has('db_port')">
@{{ errors.get('db_port') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="db_username" class="col-md-3 col-form-label">
Username <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="db_username"
id="db_username"
class="form-control"
v-model="form.db_username"
>
<span class="invalid-feedback" v-if="errors.has('db_username')">
@{{ errors.get('db_username') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="db_password" class="col-md-3 col-form-label">
Password
</label>
<div class="col-md-9">
<input
type="password"
autocomplete="off"
name="db_password"
id="db_password"
class="form-control"
v-model="form.db_password"
>
<span class="invalid-feedback" v-if="errors.has('db_password')">
@{{ errors.get('db_password') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="db_database" class="col-md-3 col-form-label">
Database <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="db_database"
id="db_database"
class="form-control"
v-model="form.db_database"
>
<span class="invalid-feedback" v-if="errors.has('db_database')">
@{{ errors.get('db_database') }}
</span>
</div>
</div>
</div>
<div class="{{ old('store.search_engine') === 'meilisearch' ? '' : 'hide' }}" id="meilisearch-fields">
<div class="form-group {{ $errors->has('store.meilisearch_host') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="meilisearch-host">MeiliSearch Host <span>*</span></label>
<div class="box overflow-hidden">
<div class="title">
<h5>Admin</h5>
</div>
<div class="col-sm-9">
<input type="text" name="store[meilisearch_host]" value="{{ old('store.meilisearch_host') }}" id="meilisearch-host" class="form-control">
<div class="row form-group">
<label for="admin_first_name" class="col-md-3 col-form-label">
First Name <span class="required">*</span>
</label>
{!! $errors->first('store.meilisearch_host', '<span class="help-block">:message</span>') !!}
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="admin_first_name"
id="admin_first_name"
class="form-control"
v-model="form.admin_first_name"
>
<span class="invalid-feedback" v-if="errors.has('admin_first_name')">
@{{ errors.get('admin_first_name') }}
</span>
</div>
</div>
<div class="form-group {{ $errors->has('store.meilisearch_key') ? 'has-error': '' }}">
<label class="control-label col-sm-3" for="meilisearch-key">MeiliSearch Key <span>*</span></label>
<div class="row form-group">
<label for="admin_last_name" class="col-md-3 col-form-label">
Last Name <span class="required">*</span>
</label>
<div class="col-sm-9">
<input type="password" name="store[meilisearch_key]" value="{{ old('store.meilisearch_key') }}" id="meilisearch-key" class="form-control">
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="admin_last_name"
id="admin_last_name"
class="form-control"
v-model="form.admin_last_name"
>
{!! $errors->first('store.meilisearch_key', '<span class="help-block">:message</span>') !!}
<span class="invalid-feedback" v-if="errors.has('admin_last_name')">
@{{ errors.get('admin_last_name') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="admin_email" class="col-md-3 col-form-label">
Email <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="email"
autocomplete="off"
name="admin_email"
id="admin_email"
class="form-control"
v-model="form.admin_email"
>
<span class="invalid-feedback" v-if="errors.has('admin_email')">
@{{ errors.get('admin_email') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="admin_phone" class="col-md-3 col-form-label">
Phone <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="admin_phone"
id="admin_phone"
class="form-control"
v-model="form.admin_phone"
>
<span class="invalid-feedback" v-if="errors.has('admin_phone')">
@{{ errors.get('admin_phone') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="admin_password" class="col-md-3 col-form-label">
Password <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="password"
autocomplete="off"
name="admin_password"
id="admin_password"
class="form-control"
v-model="form.admin_password"
>
<span class="invalid-feedback" v-if="errors.has('admin_password')">
@{{ errors.get('admin_password') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="admin_password_confirmation" class="col-md-3 col-form-label">
Confirm Password <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="password"
autocomplete="off"
name="admin_password_confirmation"
id="admin_password_confirmation"
class="form-control"
v-model="form.admin_password_confirmation"
>
<span class="invalid-feedback" v-if="errors.has('admin_password_confirmation')">
@{{ errors.get('admin_password_confirmation') }}
</span>
</div>
</div>
</div>
</div>
</div>
<div class="content-buttons clearfix">
<button type="submit" class="btn btn-primary pull-right install-button">Install</button>
</div>
</form>
@endsection
<div class="box overflow-hidden">
<div class="title">
<h5>Store</h5>
</div>
@push('scripts')
<script>
$('#store-search-engine').on('change', function () {
$('#algolia-fields, #meilisearch-fields').addClass('hide');
<div class="row form-group">
<label for="store_name" class="col-md-3 col-form-label">
Name <span class="required">*</span>
</label>
if (this.value === 'algolia') {
$('#algolia-fields').removeClass('hide');
} else if (this.value === 'meilisearch') {
$('#meilisearch-fields').removeClass('hide');
}
});
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="store_name"
id="store_name"
class="form-control"
v-model="form.store_name"
>
$('.install-button').on('click', function (e) {
var button = $(e.currentTarget);
<span class="invalid-feedback" v-if="errors.has('store_name')">
@{{ errors.get('store_name') }}
</span>
</div>
</div>
button.data('loading-text', button.html())
.addClass('btn-loading')
.button('loading');
});
</script>
@endpush
<div class="row form-group">
<label for="store_email" class="col-md-3 col-form-label">
Email <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="email"
autocomplete="off"
name="store_email"
id="store_email"
class="form-control"
v-model="form.store_email"
>
<span class="invalid-feedback" v-if="errors.has('store_email')">
@{{ errors.get('store_email') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="store_phone" class="col-md-3 col-form-label">
Phone <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="store_phone"
id="store_phone"
class="form-control"
v-model="form.store_phone"
>
<span class="invalid-feedback" v-if="errors.has('store_phone')">
@{{ errors.get('store_phone') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="store_search_engine" class="col-md-3 col-form-label">
Search Engine <span class="required">*</span>
</label>
<div class="col-md-9">
<select
name="store_search_engine"
id="store_search_engine"
class="form-select"
@change="scrollToBottom($event.target.value)"
v-model="form.store_search_engine"
>
<option value="mysql">MySQL</option>
<option value="algolia">Algolia</option>
<option value="meilisearch">Meilisearch</option>
</select>
<span class="invalid-feedback" v-if="errors.has('store_search_engine')">
@{{ errors.get('store_search_engine') }}
</span>
<span class="text-muted" v-else>You cannot change the search engine later.</span>
</div>
</div>
<template v-if="form.store_search_engine === 'algolia'">
<div class="row form-group">
<label for="algolia_app_id" class="col-md-3 col-form-label">
Algolia Application ID <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="algolia_app_id"
id="algolia_app_id"
class="form-control"
v-model="form.algolia_app_id"
>
<span class="invalid-feedback" v-if="errors.has('algolia_app_id')">
@{{ errors.get('algolia_app_id') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="algolia_secret" class="col-md-3 col-form-label">
Algolia Admin API Key <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="password"
autocomplete="off"
name="algolia_secret"
id="algolia_secret"
class="form-control"
v-model="form.algolia_secret"
>
<span class="invalid-feedback" v-if="errors.has('algolia_secret')">
@{{ errors.get('algolia_secret') }}
</span>
</div>
</div>
</template>
<template v-if="form.store_search_engine === 'meilisearch'">
<div class="row form-group">
<label for="meilisearch_host" class="col-md-3 col-form-label">
Meilisearch Host <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="text"
autocomplete="off"
name="meilisearch_host"
id="meilisearch_host"
class="form-control"
v-model="form.meilisearch_host"
>
<span class="invalid-feedback" v-if="errors.has('meilisearch_host')">
@{{ errors.get('meilisearch_host') }}
</span>
</div>
</div>
<div class="row form-group">
<label for="meilisearch_key" class="col-md-3 col-form-label">
Meilisearch Key <span class="required">*</span>
</label>
<div class="col-md-9">
<input
type="password"
autocomplete="off"
name="meilisearch_key"
id="meilisearch_key"
class="form-control"
v-model="form.meilisearch_key"
>
<span class="invalid-feedback" v-if="errors.has('meilisearch_key')">
@{{ errors.get('meilisearch_key') }}
</span>
</div>
</div>
</template>
</div>
</form>
</simplebar>
</div>
</div>