Global search: search device display (#13583)

* Global search: search device display
Add display field to search (also port_desc_descr, portName, and bgpPeerDescr)
Rewrite backend
update typeahead bundle
update devices and ports indexes
reduce some port field sizes so we can index them

* Style fixes

* remove nonsense
This commit is contained in:
Tony Murray
2021-12-06 09:12:24 -06:00
committed by GitHub
parent 29328b2e9a
commit a95efd6d2a
32 changed files with 539 additions and 456 deletions

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ChangePortsTextFieldsToVarchar extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ports', function (Blueprint $table) {
$table->string('ifAlias')->change();
$table->string('ifType', 64)->change();
$table->string('ifPhysAddress', 64)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ports', function (Blueprint $table) {
$table->text('ifAlias')->change();
$table->text('ifType')->change();
$table->text('ifPhysAddress')->change();
});
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ImproveDevicesSearchIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('devices', function (Blueprint $table) {
$table->index(['hostname', 'sysName', 'display']);
$table->dropIndex('devices_hostname_index');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('devices', function (Blueprint $table) {
$table->index('hostname');
$table->dropIndex('devices_hostname_sysname_display_index');
});
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ImprovePortsSearchIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ports', function (Blueprint $table) {
$table->index(['ifAlias', 'port_descr_descr', 'portName']);
$table->index(['ifDescr', 'ifName']);
$table->dropIndex('ports_ifdescr_index');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ports', function (Blueprint $table) {
$table->index('ifDescr');
$table->dropIndex('ports_ifalias_port_descr_descr_portname_index');
$table->dropIndex('ports_ifdescr_ifname_index');
});
}
}