mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add service templates
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateServicesTemplateTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('services_template', function (Blueprint $table) {
|
||||
$table->increments('service_template_id');
|
||||
$table->unsignedInteger('device_group_id')->index();
|
||||
$table->text('service_template_ip');
|
||||
$table->string('service_template_type');
|
||||
$table->text('service_template_desc');
|
||||
$table->text('service_template_param');
|
||||
$table->boolean('service_template_ignore');
|
||||
$table->tinyInteger('service_template_status')->default(0);
|
||||
$table->unsignedInteger('service_template_changed')->default(0);
|
||||
$table->text('service_message');
|
||||
$table->boolean('service_disabled')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('services_template');
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ if (!Auth::user()->hasGlobalAdmin()) {
|
||||
if (Auth::user()->hasGlobalAdmin()) {
|
||||
$updated = '1';
|
||||
|
||||
$service_id = add_service($vars['device'], $vars['type'], $vars['descr'], $vars['ip'], $vars['params'], 0);
|
||||
$service_id = add_service($vars['device'], $vars['type'], $vars['descr'], $vars['ip'], $vars['params'], $vars['service_template_id'], 0);
|
||||
if ($service_id) {
|
||||
$message .= $message_break.'Service added ('.$service_id.')!';
|
||||
$message_break .= '<br />';
|
||||
|
||||
Reference in New Issue
Block a user