mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #2685 from aynsix/PHRAS-2155-graphic-installer-elastic-step
PHRAS-2155 graphic installer - add elastic step
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Alchemy\Phrasea\Controller;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Core\Configuration\StructureTemplate;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\ElasticsearchOptions;
|
||||
use Alchemy\Phrasea\Setup\RequirementCollectionInterface;
|
||||
use Alchemy\Phrasea\Setup\Requirements\BinariesRequirements;
|
||||
use Alchemy\Phrasea\Setup\Requirements\FilesystemRequirements;
|
||||
@@ -82,6 +83,7 @@ class SetupController extends Controller
|
||||
'locale' => $this->app['locale'],
|
||||
'available_locales' => Application::getAvailableLanguages(),
|
||||
'available_templates' => $st->getNames(),
|
||||
'elasticOptions' => ElasticsearchOptions::fromArray([]),
|
||||
'warnings' => $warnings,
|
||||
'error' => $request->query->get('error'),
|
||||
'current_servername' => $request->getScheme() . '://' . $request->getHttpHost() . '/',
|
||||
@@ -106,6 +108,20 @@ class SetupController extends Controller
|
||||
$appbox_name = $request->request->get('ab_name');
|
||||
$databox_name = $request->request->get('db_name');
|
||||
|
||||
$elastic_settings = $request->request->get('elasticsearch_settings');
|
||||
|
||||
$elastic_settings = [
|
||||
'host' => (string) $elastic_settings['host'],
|
||||
'port' => (int) $elastic_settings['port'],
|
||||
'index' => (string) (isset($elastic_settings['index_name']) ? $elastic_settings['index_name'] : ''),
|
||||
'shards' => (int) $elastic_settings['shards'],
|
||||
'replicas' => (int) $elastic_settings['replicas'],
|
||||
'minScore' => (int) $elastic_settings['min_score'],
|
||||
'highlight' => (bool) (isset($elastic_settings['highlight']) ? $elastic_settings['highlight'] : false)
|
||||
];
|
||||
|
||||
$elastic_settings = ElasticsearchOptions::fromArray($elastic_settings);
|
||||
|
||||
try {
|
||||
$abInfo = [
|
||||
'host' => $database_host,
|
||||
@@ -181,6 +197,12 @@ class SetupController extends Controller
|
||||
|
||||
$this->app->getAuthenticator()->openAccount($user);
|
||||
|
||||
if(empty($elastic_settings->getHost())){
|
||||
$elastic_settings = ElasticsearchOptions::fromArray([]);
|
||||
}
|
||||
|
||||
$this->app['conf']->set(['main', 'search-engine', 'options'], $elastic_settings->toArray());
|
||||
|
||||
return $this->app->redirectPath('admin', [
|
||||
'section' => 'taskmanager',
|
||||
'notice' => 'install_success',
|
||||
|
@@ -375,7 +375,7 @@
|
||||
<div class="PNB10 wrapper_left">
|
||||
<div class="PNB10 section_title">
|
||||
<h2>
|
||||
1/5 {{ 'Executables externes' | trans }}
|
||||
1/6 {{ 'Executables externes' | trans }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="PNB10" style="top:50px;overflow-x:hidden;">
|
||||
@@ -440,7 +440,7 @@
|
||||
<div class="wrapper">
|
||||
<div class="PNB10 wrapper_left">
|
||||
<div class="PNB10 section_title">
|
||||
<h2>2/5
|
||||
<h2>2/6
|
||||
{{ 'Creation de votre compte' | trans }}
|
||||
</h2>
|
||||
</div>
|
||||
@@ -536,7 +536,7 @@
|
||||
<div class="PNB10 wrapper_left">
|
||||
<div class="PNB10 section_title">
|
||||
<h2>
|
||||
3/5
|
||||
3/6
|
||||
{% trans %}setup::Configuration de la base de compte ApplicationBox{% endtrans %}
|
||||
</h2>
|
||||
</div>
|
||||
@@ -637,13 +637,78 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="steps">
|
||||
<div class="wrapper">
|
||||
<div class="PNB10 wrapper_left">
|
||||
<div class="PNB10 section_title">
|
||||
<h2>4/6
|
||||
{{ 'SearchEngine settings' | trans }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="PNB10" style="top:50px;overflow-x:hidden;">
|
||||
<table class="main_content_wrapper">
|
||||
<tr>
|
||||
<td>
|
||||
<table class="main_content_table">
|
||||
<tr>
|
||||
<td><label>{{ 'ElasticSearch server host' | trans }}</label></td>
|
||||
<td><input class="" type="text" name="elasticsearch_settings[host]" value="{{ elasticOptions.host }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>{{ 'ElasticSearch service port' | trans }}</label></td>
|
||||
<td><input class="" type="number" name="elasticsearch_settings[port]" value="{{ elasticOptions.port }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>{{ 'Use an existing index' | trans }}</label></td>
|
||||
<td><input class="" type="checkbox" name="elasticsearch_settings[use_existing_index]" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>{{ 'ElasticSearch index name' | trans }}</label></td>
|
||||
<td><input class="" disabled="disabled" type="text" name="elasticsearch_settings[index_name]" value="{{ elasticOptions.indexName }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>{{ 'Number of shards' | trans }}</label></td>
|
||||
<td><input class="" type="number" name="elasticsearch_settings[shards]" value="{{ elasticOptions.shards }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>{{ 'Number of replicas' | trans }}</label></td>
|
||||
<td><input class="" type="number" name="elasticsearch_settings[replicas]" value="{{ elasticOptions.replicas }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>{{ 'Thesaurus Min score' | trans }}</label></td>
|
||||
<td><input class="" type="number" name="elasticsearch_settings[min_score]" value="{{ elasticOptions.minScore }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>{{ 'Activate highlight' | trans }}</label></td>
|
||||
<td><input class="" type="checkbox" name="elasticsearch_settings[highlight]" value="{{ elasticOptions.highlight }}" {% if elasticOptions.highlight %} checked="checked" {% endif %}/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="previous">{{ 'boutton::precedent' | trans }}</button>
|
||||
</td>
|
||||
<td style="text-align:right;">
|
||||
<button class="next">{{ 'boutton::suivant' | trans }}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="steps">
|
||||
<div class="wrapper">
|
||||
<div class="PNB10 wrapper_left">
|
||||
<div class="PNB10 section_title">
|
||||
<h2>4/5
|
||||
<h2>5/6
|
||||
{{ 'setup::Configuration des repertoires de stockage' | trans }}
|
||||
</h2>
|
||||
</div>
|
||||
@@ -702,7 +767,7 @@
|
||||
<div class="wrapper">
|
||||
<div class="PNB10 wrapper_left">
|
||||
<div class="PNB10 section_title">
|
||||
<h2>5/5
|
||||
<h2>6/6
|
||||
{% trans %}setup::Configuration de la base de stockage DataBox{% endtrans %}
|
||||
</h2>
|
||||
</div>
|
||||
@@ -739,7 +804,7 @@
|
||||
<td>
|
||||
<select name="db_template" class="databox_creation_input">
|
||||
{% for name in available_templates %}
|
||||
<option value="{{ name|escape('js') }}">{{ name }}</option>
|
||||
<option value="{{ name|escape }}">{{ name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
@@ -58,7 +58,7 @@
|
||||
<tr style="vertical-align:bottom;">
|
||||
<td>
|
||||
<h1>
|
||||
PHRASEANET
|
||||
Phraseanet
|
||||
<span class="version_name">{{ app['phraseanet.version'].getName() }}</span>
|
||||
<span class="version_number">- v{{ app['phraseanet.version'].getNumber() }}</span>
|
||||
</h1>
|
||||
|
Reference in New Issue
Block a user