From d646562e4ed1533a3f7d714bf58ce37277f42169 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sat, 28 Aug 2021 06:46:53 -0500 Subject: [PATCH] Dynamic Select setting (#13179) * Dynamic Select setting embeds select2 and uses ajax to call to backend for options poller-group included * fix validation a bit * fix typehint * move minProperties into the select schema * Change dashboard-select to select-dynamic Love deleting code * Change dashboard-select to select-dynamic Love deleting code wire up a few select2 options * fix whitespace * Not a model, just an object * Suggestion from @SourceDoctor autocomplete values of select and select-dynamic Got a little creative with InternalHttpRequest... --- .../Commands/BashCompletionCommand.php | 2 +- app/Console/Commands/InternalHttpRequest.php | 45 +++++++++ .../Traits/CompletesConfigArgument.php | 57 +++++++++++- .../Select/DashboardController.php | 35 +++++-- .../Select/PollerGroupController.php | 66 +++++++++++++ .../Controllers/Select/SelectController.php | 5 +- html/js/app.js | 2 +- html/mix-manifest.json | 2 +- misc/config_definitions.json | 17 +++- misc/config_schema.json | 30 +++++- .../js/components/SettingDashboardSelect.vue | 67 -------------- .../js/components/SettingSelectDynamic.vue | 92 +++++++++++++++++++ routes/web.php | 35 +++---- 13 files changed, 346 insertions(+), 109 deletions(-) create mode 100644 app/Console/Commands/InternalHttpRequest.php create mode 100644 app/Http/Controllers/Select/PollerGroupController.php delete mode 100644 resources/js/components/SettingDashboardSelect.vue create mode 100644 resources/js/components/SettingSelectDynamic.vue diff --git a/app/Console/Commands/BashCompletionCommand.php b/app/Console/Commands/BashCompletionCommand.php index 361e27174f..ef2f08b26f 100644 --- a/app/Console/Commands/BashCompletionCommand.php +++ b/app/Console/Commands/BashCompletionCommand.php @@ -60,7 +60,7 @@ class BashCompletionCommand extends Command if (method_exists($command, 'completeArgument')) { foreach ($input->getArguments() as $name => $value) { if ($current == $value) { - $values = $command->completeArgument($name, $value); + $values = $command->completeArgument($name, $value, $previous); if (! empty($values)) { echo implode(PHP_EOL, $values); diff --git a/app/Console/Commands/InternalHttpRequest.php b/app/Console/Commands/InternalHttpRequest.php new file mode 100644 index 0000000000..bb3af76988 --- /dev/null +++ b/app/Console/Commands/InternalHttpRequest.php @@ -0,0 +1,45 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2021 Tony Murray + * @author Tony Murray + */ + +namespace App\Console\Commands; + +use Illuminate\Foundation\Testing\Concerns\InteractsWithAuthentication; +use Illuminate\Foundation\Testing\Concerns\MakesHttpRequests; + +class InternalHttpRequest +{ + use MakesHttpRequests; + use InteractsWithAuthentication; + + /** + * @var \Illuminate\Contracts\Foundation\Application|mixed + */ + private $app; + + public function __construct() + { + $this->app = app(); + } +} diff --git a/app/Console/Commands/Traits/CompletesConfigArgument.php b/app/Console/Commands/Traits/CompletesConfigArgument.php index 5d94caeb65..9a45442bfb 100644 --- a/app/Console/Commands/Traits/CompletesConfigArgument.php +++ b/app/Console/Commands/Traits/CompletesConfigArgument.php @@ -24,21 +24,70 @@ namespace App\Console\Commands\Traits; +use App\Console\Commands\InternalHttpRequest; +use App\Models\User; use Illuminate\Support\Str; use LibreNMS\Util\DynamicConfig; +use LibreNMS\Util\DynamicConfigItem; trait CompletesConfigArgument { - public function completeArgument($name, $value) + public function completeArgument($name, $value, $previous) { if ($name == 'setting') { - $config = new DynamicConfig(); - - return $config->all()->keys()->filter(function ($setting) use ($value) { + return (new DynamicConfig())->all()->keys()->filter(function ($setting) use ($value) { return Str::startsWith($setting, $value); })->toArray(); + } elseif ($name == 'value') { + $config = (new DynamicConfig())->get($previous); + + switch ($config->getType()) { + case 'select-dynamic': + return $this->suggestionsForSelectDynamic($config, $value); + case 'select': + return $this->suggestionsForSelect($config, $value); + } } return false; } + + protected function suggestionsForSelect(DynamicConfigItem $config, ?string $value): array + { + $options = collect($config['options']); + $keyStartsWith = $options->filter(function ($description, $key) use ($value) { + return Str::startsWith($key, $value); + }); + + // try to see if it matches a value (aka key) + if ($keyStartsWith->isNotEmpty()) { + return $keyStartsWith->keys()->all(); + } + + // last chance to try to find by the description + return $options->filter(function ($description, $key) use ($value) { + return Str::contains($description, $value); + })->keys()->all(); + } + + protected function suggestionsForSelectDynamic(DynamicConfigItem $config, ?string $value): array + { + // need auth to make http request + if ($admin = User::adminOnly()->first()) { + $target = $config['options']['target']; + $data = ['limit' => 10]; + if ($value) { + $data['term'] = $value; // filter in sql + } + + // make "http" request + $results = (new InternalHttpRequest()) + ->actingAs($admin) + ->json('GET', route("ajax.select.$target"), $data)->json('results'); + + return array_column($results, 'id'); + } + + return []; + } } diff --git a/app/Http/Controllers/Select/DashboardController.php b/app/Http/Controllers/Select/DashboardController.php index 20f6d5f6dd..47236df3cb 100644 --- a/app/Http/Controllers/Select/DashboardController.php +++ b/app/Http/Controllers/Select/DashboardController.php @@ -30,36 +30,53 @@ class DashboardController extends SelectController { protected function searchFields($request) { - return ['dashboard_name']; + return ['dashboard_name', 'username']; } /** * Defines the base query for this resource * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder */ protected function baseQuery($request) { return Dashboard::query() ->where('access', '>', 0) - ->with('user') - ->orderBy('user_id') - ->orderBy('dashboard_name'); + ->leftJoin('users', 'dashboards.user_id', 'users.user_id') // left join so we can search username + ->orderBy('dashboards.user_id') + ->orderBy('dashboard_name') + ->select(['dashboard_id', 'username', 'dashboard_name']); } - public function formatItem($dashboard) + /** + * @param object $dashboard + * @return array + */ + public function formatItem($dashboard): array { - /** @var Dashboard $dashboard */ return [ 'id' => $dashboard->dashboard_id, 'text' => $this->describe($dashboard), ]; } - private function describe($dashboard) + public function formatResponse($paginator) { - return "{$dashboard->user->username}: {$dashboard->dashboard_name} (" + if (! request()->has('term')) { + $paginator->prepend((object) ['dashboard_id' => 0]); + } + + return parent::formatResponse($paginator); + } + + private function describe($dashboard): string + { + if ($dashboard->dashboard_id == 0) { + return 'No Default Dashboard'; + } + + return "{$dashboard->username}: {$dashboard->dashboard_name} (" . ($dashboard->access == 1 ? __('read-only') : __('read-write')) . ')'; } } diff --git a/app/Http/Controllers/Select/PollerGroupController.php b/app/Http/Controllers/Select/PollerGroupController.php new file mode 100644 index 0000000000..327360bbb4 --- /dev/null +++ b/app/Http/Controllers/Select/PollerGroupController.php @@ -0,0 +1,66 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2021 Tony Murray + * @author Tony Murray + */ + +namespace App\Http\Controllers\Select; + +use App\Models\PollerGroup; +use Illuminate\Support\Str; + +class PollerGroupController extends SelectController +{ + protected function searchFields($request) + { + return ['group_name', 'descr']; + } + + protected function baseQuery($request) + { + return PollerGroup::query()->select(['id', 'group_name']); + } + + protected function formatResponse($paginator) + { + // prepend the default group, unless filtered out + if ($this->includeGeneral()) { + $general = new PollerGroup; + $general->id = 0; + $general->group_name = 'General'; + $paginator->prepend($general); + } + + return parent::formatResponse($paginator); + } + + private function includeGeneral(): bool + { + if (request()->has('id') && request('id') !== 0) { + return false; + } elseif (request()->has('term') && ! Str::contains('general', strtolower(request('term')))) { + return false; + } + + return true; + } +} diff --git a/app/Http/Controllers/Select/SelectController.php b/app/Http/Controllers/Select/SelectController.php index ba7db47f53..857cdb93fe 100644 --- a/app/Http/Controllers/Select/SelectController.php +++ b/app/Http/Controllers/Select/SelectController.php @@ -51,7 +51,10 @@ abstract class SelectController extends PaginatedAjaxController $this->validate($request, $this->rules()); $limit = $request->get('limit', 50); - $query = $this->search($request->get('term'), $this->baseQuery($request), $this->searchFields($request)); + $query = $this->baseQuery($request)->when($request->has('id'), function ($query) { + return $query->whereKey(request('id')); + }); + $query = $this->search($request->get('term'), $query, $this->searchFields($request)); $this->sort($request, $query); $paginator = $query->simplePaginate($limit); diff --git a/html/js/app.js b/html/js/app.js index bbf97ce9a7..cd5236d505 100644 --- a/html/js/app.js +++ b/html/js/app.js @@ -1 +1 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[773],{1585:(t,e,a)=>{"use strict";var n=a(538),s=a(7152);n.Z.use(s.Z);var i=new s.Z({locale:document.querySelector("html").getAttribute("lang"),fallbackLocale:"en",silentFallbackWarn:!0,silentTranslationWarn:!0,messages:window.vuei18nLocales}),o=a(9010),r=a.n(o),l=a(5081),u=a(9938),c=a.n(u),d=a(7907),p=a.n(d),v=a(9283),m=a(7611),f=a.n(m);a(9147),window.Vue=a(538).Z;var h=a(5642);h.keys().map((function(t){return Vue.component(t.split("/").pop().split(".")[0],h(t).default)})),Vue.use(r()),Vue.use(l.ZP),Vue.component("v-select",c()),Vue.component("multiselect",p()),Vue.use(v.ZP),Vue.use(f()),Vue.filter("ucfirst",(function(t){return t?(t=t.toString()).charAt(0).toUpperCase()+t.slice(1):""}));new Vue({el:"#app",i18n:i})},9147:(t,e,a)=>{window._=a(6486);try{window.Popper=a(8981).Z}catch(t){}window.axios=a(9669),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var n=document.head.querySelector('meta[name="csrf-token"]');n?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=n.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token"),a(7097)},4305:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".accordion-item-trigger-icon[data-v-16b90b68]{transition:transform .2s ease}.accordion-item-trigger.collapsed .accordion-item-trigger-icon[data-v-16b90b68]{transform:rotate(-90deg)}",""]);const i=s},9357:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".disable-events[data-v-d23a875a]{pointer-events:none}",""]);const i=s},9377:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,"#settings-search[data-v-2d230312]{border-radius:4px}#settings-search[data-v-2d230312]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}ul.settings-list[data-v-2d230312]{list-style-type:none}",""]);const i=s},1163:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".tab-content{width:100%}",""]);const i=s},2601:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".setting-container[data-v-5ab9fce1]{margin-bottom:10px}",""]);const i=s},8519:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".input-group[data-v-9d2dd8fa]{margin-bottom:3px}.input-group-addon[data-v-9d2dd8fa]:not(.disabled){cursor:move}",""]);const i=s},7510:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".form-control[data-v-72c868aa]{padding-right:12px}",""]);const i=s},3257:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".input-group[data-v-f290b6f6]{padding-bottom:3px}",""]);const i=s},8377:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,"div[data-v-f45258b0]{color:red}",""]);const i=s},6608:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".expandable[data-v-b42c6d38]{padding:5px;height:30px}.buttons[data-v-b42c6d38]{white-space:nowrap;padding:0 5px}.new-btn-div[data-v-b42c6d38]{margin-bottom:5px}.panel-body[data-v-b42c6d38]{padding:5px 0}",""]);const i=s},1818:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".authlevel[data-v-26c6b91a]{font-size:18px;text-align:left}.fa-minus-circle[data-v-26c6b91a]{cursor:pointer}.snmp3-add-button[data-v-26c6b91a]{margin-top:5px}",""]);const i=s},1505:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".panel.with-nav-tabs .panel-heading[data-v-2ac3a533]{padding:5px 5px 0}.panel.with-nav-tabs .nav-tabs[data-v-2ac3a533]{border-bottom:none}.panel.with-nav-tabs .nav-justified[data-v-2ac3a533]{margin-bottom:-1px}.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:hover{color:#777}.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-2ac3a533]:hover,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:hover{color:#777;background-color:#ddd;border-color:transparent}.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-2ac3a533]:hover{color:#555;background-color:#fff;border-color:#ddd #ddd transparent}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu[data-v-2ac3a533]{background-color:#f5f5f5;border-color:#ddd}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-2ac3a533]{color:#777}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-2ac3a533]:hover{background-color:#ddd}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-2ac3a533]:hover{color:#fff;background-color:#555}",""]);const i=s},9462:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".enter-active[data-v-54390bb4],.leave-active[data-v-54390bb4]{overflow:hidden;transition:height .2s linear}",""]);const i=s},5067:()=>{},4479:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"Accordion",props:{multiple:{type:Boolean,default:!1}},methods:{setActive:function(t){this.$children.forEach((function(e){e.slug()===t&&(e.isActive=!0)}))},activeChanged:function(t){this.multiple||this.$children.forEach((function(e){e.slug()!==t&&(e.isActive=!1)}))}},mounted:function(){this.$on("expanded",this.activeChanged)}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"panel-group",attrs:{role:"tablist"}},[t._t("default")],2)}),[],!1,null,"11dcbcb8",null).exports},2040:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"AccordionItem",props:{name:{type:String,required:!0},text:String,active:Boolean,icon:String},data:function(){return{isActive:this.active}},mounted:function(){window.location.hash===this.hash()&&(this.isActive=!0)},watch:{active:function(t){this.isActive=t},isActive:function(t){this.$parent.$emit(t?"expanded":"collapsed",this.slug())}},methods:{slug:function(){return this.name.toString().toLowerCase().replace(/\s+/g,"-")},hash:function(){return"#"+this.slug()}}};a(4918);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading",attrs:{role:"tab",id:t.slug()}},[a("h4",{staticClass:"panel-title"},[a("a",{staticClass:"accordion-item-trigger",class:{collapsed:!t.isActive},attrs:{role:"button","data-parent":"#accordion","data-href":t.hash()},on:{click:function(e){t.isActive=!t.isActive}}},[a("i",{staticClass:"fa fa-chevron-down accordion-item-trigger-icon"}),t._v(" "),t.icon?a("i",{class:["fa","fa-fw",t.icon]}):t._e(),t._v("\n "+t._s(t.text||t.name)+"\n ")])])]),t._v(" "),a("transition-collapse-height",[t.isActive?a("div",{class:["panel-collapse","collapse",{in:t.isActive}],attrs:{id:t.slug()+"-content",role:"tabpanel"}},[a("div",{staticClass:"panel-body"},[t._t("default")],2)]):t._e()])],1)}),[],!1,null,"16b90b68",null).exports},7360:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"BaseSetting",props:{name:{type:String,required:!0},value:{required:!0},disabled:Boolean,required:Boolean,pattern:String,"update-status":String,options:{}}};const s=(0,a(1900).Z)(n,undefined,undefined,!1,null,null,null).exports},3953:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={mounted:function(){console.log("Component mounted.")}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)}),[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container"},[a("div",{staticClass:"row justify-content-center"},[a("div",{staticClass:"col-md-8"},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[t._v("Example Component")]),t._v(" "),a("div",{staticClass:"card-body"},[t._v("\n I'm an example component.\n ")])])])])])}],!1,null,null,null).exports},1744:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"LibrenmsSetting",props:{setting:{type:Object,required:!0},prefix:{type:String,default:"settings"},id:{required:!1}},data:function(){return{value:this.setting.value,updateStatus:"none",feedback:""}},methods:{persistValue:function(t){var e=this;this.updateStatus="pending",axios.put(route(this.prefix+".update",this.getRouteParams()),{value:t}).then((function(t){e.value=t.data.value,e.$emit("setting-updated",{name:e.setting.name,value:e.value}),e.updateStatus="success",e.feedback="has-success",setTimeout((function(){return e.feedback=""}),3e3)})).catch((function(t){e.feedback="has-error",e.updateStatus="error",toastr.error(t.response.data.message);["text","email","password"].includes(e.setting.type)||(e.value=t.response.data.value,e.$emit("setting-updated",{name:e.setting.name,value:e.value}),setTimeout((function(){return e.feedback=""}),3e3))}))},debouncePersistValue:_.debounce((function(t){this.persistValue(t)}),500),changeValue:function(t){["select","boolean","multiple"].includes(this.setting.type)?this.persistValue(t):this.debouncePersistValue(t),this.value=t},getUnits:function(){var t=this.prefix+".units."+this.setting.units;return this.$te(t)?this.$t(t):this.setting.units},getDescription:function(){var t=this.prefix+".settings."+this.setting.name+".description";return this.$te(t)||this.$te(t,this.$i18n.fallbackLocale)?this.$t(t):this.setting.name},getHelp:function(){var t=this.$t(this.prefix+".settings."+this.setting.name+".help");return this.setting.overridden&&(t+="

"+this.$t(this.prefix+".readonly")),t},hasHelp:function(){var t=this.prefix+".settings."+this.setting.name+".help";return this.$te(t)||this.$te(t,this.$i18n.fallbackLocale)},resetToDefault:function(){var t=this;axios.delete(route(this.prefix+".destroy",this.getRouteParams())).then((function(e){t.value=e.data.value,t.feedback="has-success",setTimeout((function(){return t.feedback=""}),3e3)})).catch((function(e){t.feedback="has-error",setTimeout((function(){return t.feedback=""}),3e3),toastr.error(e.response.data.message)}))},resetToInitial:function(){this.changeValue(this.setting.value)},showResetToDefault:function(){return!this.setting.overridden&&!_.isEqual(this.value,this.setting.default)},showUndo:function(){return!_.isEqual(this.setting.value,this.value)},getRouteParams:function(){var t=[this.setting.name];return this.id&&t.unshift(this.id),t},getComponent:function(){var t="Setting"+this.setting.type.toString().replace(/(-[a-z]|^[a-z])/g,(function(t){return t.toUpperCase().replace("-","")}));return void 0!==Vue.options.components[t]?t:"SettingNull"}}};a(5401);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:["form-group","has-feedback",t.setting.class,t.feedback]},[a("label",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.setting.name},expression:"{ content: setting.name }"}],staticClass:"col-sm-5 control-label",attrs:{for:t.setting.name}},[t._v("\n "+t._s(t.getDescription())+"\n "),t.setting.units?a("span",[t._v("("+t._s(t.getUnits())+")")]):t._e()]),t._v(" "),a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:!!t.setting.disabled&&t.$t(this.prefix+".readonly")},expression:"{ content: setting.disabled ? $t(this.prefix + '.readonly') : false }"}],staticClass:"col-sm-5"},[a(t.getComponent(),{tag:"component",attrs:{value:t.value,name:t.setting.name,pattern:t.setting.pattern,disabled:t.setting.overridden,required:t.setting.required,options:t.setting.options,"update-status":t.updateStatus},on:{input:function(e){return t.changeValue(e)},change:function(e){return t.changeValue(e)}}}),t._v(" "),a("span",{staticClass:"form-control-feedback"})],1),t._v(" "),a("div",{staticClass:"col-sm-2"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.$t("Reset to default")},expression:"{ content: $t('Reset to default') }"}],staticClass:"btn btn-default",class:{"disable-events":!t.showResetToDefault()},style:{opacity:t.showResetToDefault()?1:0},attrs:{type:"button"},on:{click:t.resetToDefault}},[a("i",{staticClass:"fa fa-refresh"})]),t._v(" "),a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.$t("Undo")},expression:"{ content: $t('Undo') }"}],staticClass:"btn btn-primary",class:{"disable-events":!t.showUndo()},style:{opacity:t.showUndo()?1:0},attrs:{type:"button"},on:{click:t.resetToInitial}},[a("i",{staticClass:"fa fa-undo"})]),t._v(" "),t.hasHelp()?a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.getHelp(),trigger:"hover click"},expression:"{content: getHelp(), trigger: 'hover click'}"}],staticClass:"fa fa-fw fa-lg fa-question-circle"}):t._e()])])}),[],!1,null,"d23a875a",null).exports},6365:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==a)return;var n,s,i=[],o=!0,r=!1;try{for(a=a.call(t);!(o=(n=a.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){r=!0,s=t}finally{try{o||null==a.return||a.return()}finally{if(r)throw s}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return s(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"PollerSettings",props:{pollers:Object,settings:Object},data:function(){return{advanced:!1}}};a(5048),a(7717);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v("\n "+t._s(t.$t("Poller Settings"))+"\n "),a("span",{staticClass:"pull-right"},[t._v("Advanced "),a("toggle-button",{model:{value:t.advanced,callback:function(e){t.advanced=e},expression:"advanced"}})],1)])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("vue-tabs",{attrs:{direction:"vertical",type:"pills"}},t._l(t.pollers,(function(e,n){return a("v-tab",{key:n,attrs:{title:e.poller_name}},t._l(t.settings[n],(function(n){return!n.advanced||t.advanced?a("div",{key:n.name,staticClass:"setting-container clearfix"},[a("librenms-setting",{attrs:{prefix:"poller.settings",setting:n,id:e.id}})],1):t._e()})),0)})),1)],1)])}),[],!1,null,"5ab9fce1",null).exports},6935:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>r});var n=a(7360),s=a(9980),i=a.n(s);const o={name:"SettingArray",mixins:[n.default],components:{draggable:i()},data:function(){return{localList:this.value,newItem:""}},methods:{addItem:function(){this.disabled||(this.localList.push(this.newItem),this.$emit("input",this.localList),this.newItem="")},removeItem:function(t){this.disabled||(this.localList.splice(t,1),this.$emit("input",this.localList))},updateItem:function(t,e){this.disabled||this.localList[t]===e||(this.localList[t]=e,this.$emit("input",this.localList))},dragged:function(){this.disabled||this.$emit("input",this.localList)}},watch:{value:function(t){this.localList=t}}};a(7295);const r=(0,a(1900).Z)(o,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:!!t.disabled&&t.$t("settings.readonly"),expression:"disabled ? $t('settings.readonly') : false"}]},[a("draggable",{attrs:{disabled:t.disabled},on:{end:function(e){return t.dragged()}},model:{value:t.localList,callback:function(e){t.localList=e},expression:"localList"}},t._l(t.localList,(function(e,n){return a("div",{staticClass:"input-group"},[a("span",{class:["input-group-addon",t.disabled?"disabled":""]},[t._v(t._s(n+1)+".")]),t._v(" "),a("input",{staticClass:"form-control",attrs:{type:"text",readonly:t.disabled},domProps:{value:e},on:{blur:function(e){return t.updateItem(n,e.target.value)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.updateItem(n,e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn"},[t.disabled?t._e():a("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(e){return t.removeItem(n)}}},[a("i",{staticClass:"fa fa-minus-circle"})])])])})),0),t._v(" "),t.disabled?t._e():a("div",[a("div",{staticClass:"input-group"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newItem,expression:"newItem"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.newItem},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.addItem.apply(null,arguments)},input:function(e){e.target.composing||(t.newItem=e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.addItem}},[a("i",{staticClass:"fa fa-plus-circle"})])])])])],1)}),[],!1,null,"9d2dd8fa",null).exports},4561:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingBoolean",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("toggle-button",{attrs:{name:t.name,value:t.value,sync:!0,required:t.required,disabled:t.disabled},on:{change:function(e){return t.$emit("change",e.value)}}})}),[],!1,null,"ab7ed6ee",null).exports},8189:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingDashboardSelect",mixins:[a(7360).default],data:function(){return{ajaxData:{results:[]},default:{id:0,text:this.$t("No Default Dashboard")}}},mounted:function(){var t=this;axios.get(route("ajax.select.dashboard")).then((function(e){return t.ajaxData=e.data}))},computed:{localOptions:function(){return[this.default].concat(this.ajaxData.results)},selected:function(){var t=this;return 0===this.value?this.default:this.ajaxData.results.find((function(e){return e.id===t.value}))}}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("v-select",{attrs:{options:t.localOptions,label:"text",clearable:!1,value:t.selected,required:t.required,disabled:t.disabled},on:{input:function(e){return t.$emit("input",e.id)}}})}),[],!1,null,"2476e5f8",null).exports},6852:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingDirectory",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"text",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"a44ee658",null).exports},4846:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingEmail",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"email",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"62ce370c",null).exports},9068:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingExecutable",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"text",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"a93fcd56",null).exports},3255:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingInteger",mixins:[a(7360).default],methods:{parseNumber:function(t){var e=parseFloat(t);return isNaN(e)?t:e}}};a(7485);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"number",name:t.name,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){t.$emit("input",t.parseNumber(e.target.value))}}})}),[],!1,null,"72c868aa",null).exports},8300:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingLdapGroups",mixins:[a(7360).default],data:function(){return{localList:Array.isArray(this.value)?{}:this.value,newItem:"",newItemLevel:1,lock:!1}},methods:{addItem:function(){this.$set(this.localList,this.newItem,{level:this.newItemLevel}),this.newItem="",this.newItemLevel=1},removeItem:function(t){this.$delete(this.localList,t)},updateItem:function(t,e){var a=this;this.localList=Object.keys(this.localList).reduce((function(n,s){return n[s===t?e:s]=a.localList[s],n}),{})},updateLevel:function(t,e){this.$set(this.localList,t,{level:e})}},watch:{localList:function(){this.lock?this.lock=!1:this.$emit("input",this.localList)},value:function(){this.lock=!0,this.localList=Array.isArray(this.value)?{}:this.value}}};a(5483);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:!!t.disabled&&t.$t("settings.readonly"),expression:"disabled ? $t('settings.readonly') : false"}],staticClass:"form-inline"},[t._l(t.localList,(function(e,n){return a("div",{staticClass:"input-group"},[a("input",{staticClass:"form-control",attrs:{type:"text",readonly:t.disabled},domProps:{value:n},on:{blur:function(e){return t.updateItem(n,e.target.value)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.updateItem(n,e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn",staticStyle:{width:"0"}}),t._v(" "),a("select",{staticClass:"form-control",on:{change:function(e){return t.updateLevel(n,e.target.value)}}},[a("option",{attrs:{value:"1"},domProps:{selected:1===e.level}},[t._v(t._s(t.$t("Normal")))]),t._v(" "),a("option",{attrs:{value:"5"},domProps:{selected:5===e.level}},[t._v(t._s(t.$t("Global Read")))]),t._v(" "),a("option",{attrs:{value:"10"},domProps:{selected:10===e.level}},[t._v(t._s(t.$t("Admin")))])]),t._v(" "),a("span",{staticClass:"input-group-btn"},[t.disabled?t._e():a("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(e){return t.removeItem(n)}}},[a("i",{staticClass:"fa fa-minus-circle"})])])])})),t._v(" "),t.disabled?t._e():a("div",[a("div",{staticClass:"input-group"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newItem,expression:"newItem"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.newItem},on:{input:function(e){e.target.composing||(t.newItem=e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn",staticStyle:{width:"0"}}),t._v(" "),a("select",{directives:[{name:"model",rawName:"v-model",value:t.newItemLevel,expression:"newItemLevel"}],staticClass:"form-control",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.newItemLevel=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"1"}},[t._v(t._s(t.$t("Normal")))]),t._v(" "),a("option",{attrs:{value:"5"}},[t._v(t._s(t.$t("Global Read")))]),t._v(" "),a("option",{attrs:{value:"10"}},[t._v(t._s(t.$t("Admin")))])]),t._v(" "),a("span",{staticClass:"input-group-btn"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.addItem}},[a("i",{staticClass:"fa fa-plus-circle"})])])])])],2)}),[],!1,null,"f290b6f6",null).exports},6813:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>l});function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==a)return;var n,s,i=[],o=!0,r=!1;try{for(a=a.call(t);!(o=(n=a.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){r=!0,s=t}finally{try{o||null==a.return||a.return()}finally{if(r)throw s}}return i}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingNull",props:["name"]};a(7999);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",[t._v("Invalid type for: "+t._s(t.name))])}),[],!1,null,"f45258b0",null).exports},1915:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingOxidizedMaps",mixins:[a(7360).default],data:function(){return{mapModalIndex:null,mapModalSource:null,mapModalMatchType:null,mapModalMatchValue:null,mapModalTarget:null,mapModalReplacement:null}},methods:{showModal:function(t){this.fillForm(t),this.$modal.show("maps")},submitModal:function(){var t=this.maps,e={target:this.mapModalTarget,source:this.mapModalSource,matchType:this.mapModalMatchType,matchValue:this.mapModalMatchValue,replacement:this.mapModalReplacement};this.mapModalIndex?t[this.mapModalIndex]=e:t.push(e),console.log(t,e),this.updateValue(t)},fillForm:function(t){var e=this.maps.hasOwnProperty(t);this.mapModalIndex=t,this.mapModalSource=e?this.maps[t].source:null,this.mapModalMatchType=e?this.maps[t].matchType:null,this.mapModalMatchValue=e?this.maps[t].matchValue:null,this.mapModalTarget=e?this.maps[t].target:null,this.mapModalReplacement=e?this.maps[t].replacement:null},deleteItem:function(t){var e=this.maps;e.splice(t,1),this.updateValue(e)},updateValue:function(t){var e={};t.forEach((function(t){void 0===e[t.target]&&(e[t.target]={}),void 0===e[t.target][t.source]&&(e[t.target][t.source]=[]);var a={};a[t.matchType]=t.matchValue,a.value=t.replacement,e[t.target][t.source].push(a)})),this.$emit("input",e)},formatSource:function(t,e){return e.hasOwnProperty("regex")?t+" ~ "+e.regex:e.hasOwnProperty("match")?t+" = "+e.match:"invalid"},formatTarget:function(t,e){return t+" > "+(e.hasOwnProperty("value")?e.value:e[t])}},watch:{updateStatus:function(){"success"===this.updateStatus&&this.$modal.hide("maps")}},computed:{maps:function(){var t=this,e=[];return Object.keys(this.value).forEach((function(a){Object.keys(t.value[a]).forEach((function(n){t.value[a][n].forEach((function(t){var s=t.hasOwnProperty("regex")?"regex":"match";e.push({target:a,source:n,matchType:s,matchValue:t[s],replacement:t.hasOwnProperty("value")?t.value:t[a]})}))}))})),e}}};a(7687);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{directives:[{name:"show",rawName:"v-show",value:!t.disabled,expression:"! disabled"}],staticClass:"new-btn-div"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){return t.showModal(null)}}},[a("i",{staticClass:"fa fa-plus"}),t._v(" "+t._s(t.$t("New Map Rule")))])]),t._v(" "),t._l(t.maps,(function(e,n){return a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-body"},[a("div",{staticClass:"col-md-5 expandable"},[a("span",[t._v(t._s(e.source)+" "+t._s("regex"===e.matchType?"~":"=")+" "+t._s(e.matchValue))])]),t._v(" "),a("div",{staticClass:"col-md-4 expandable"},[a("span",[t._v(t._s(e.target)+" < "+t._s(e.replacement))])]),t._v(" "),a("div",{staticClass:"col-md-3 buttons"},[a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:!!t.disabled&&t.$t("settings.readonly"),expression:"disabled ? $t('settings.readonly') : false"}],staticClass:"btn-group"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.$t("Edit"),expression:"$t('Edit')"}],staticClass:"btn btn-sm btn-info",attrs:{type:"button",disabled:t.disabled},on:{click:function(e){return t.showModal(n)}}},[a("i",{staticClass:"fa fa-lg fa-edit"})]),t._v(" "),a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.$t("Delete"),expression:"$t('Delete')"}],staticClass:"btn btn-sm btn-danger",attrs:{type:"button",disabled:t.disabled},on:{click:function(e){return t.deleteItem(n)}}},[a("i",{staticClass:"fa fa-lg fa-remove"})])])])])])})),t._v(" "),a("modal",{attrs:{name:"maps",height:"auto"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("button",{staticClass:"close",attrs:{type:"button"},on:{click:function(e){return t.$modal.hide("maps")}}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]),t._v(" "),a("h4",{staticClass:"modal-title"},[t._v(t._s(t.mapModalIndex?t.$t("Edit Map Rule"):t.$t("New Map Rule")))])]),t._v(" "),a("div",{staticClass:"modal-body"},[a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4 control-label",attrs:{for:"source"}},[t._v("Source")]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.mapModalSource,expression:"mapModalSource"}],staticClass:"form-control",attrs:{id:"source"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.mapModalSource=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"hostname"}},[t._v("hostname")]),t._v(" "),a("option",{attrs:{value:"os"}},[t._v("os")]),t._v(" "),a("option",{attrs:{value:"type"}},[t._v("type")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4",attrs:{for:"match_value"}},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.mapModalMatchType,expression:"mapModalMatchType"}],staticClass:"form-control",attrs:{id:"match_type"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.mapModalMatchType=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"match"}},[t._v("Match (=)")]),t._v(" "),a("option",{attrs:{value:"regex"}},[t._v("Regex (~)")])])]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.mapModalMatchValue,expression:"mapModalMatchValue"}],staticClass:"form-control",attrs:{type:"text",id:"match_value",placeholder:""},domProps:{value:t.mapModalMatchValue},on:{input:function(e){e.target.composing||(t.mapModalMatchValue=e.target.value)}}})])]),t._v(" "),a("div",{staticClass:"form-horizontal",attrs:{role:"form"}},[a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4 control-label",attrs:{for:"target"}},[t._v("Target")]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.mapModalTarget,expression:"mapModalTarget"}],staticClass:"form-control",attrs:{id:"target"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.mapModalTarget=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"os"}},[t._v("os")]),t._v(" "),a("option",{attrs:{value:"group"}},[t._v("group")]),t._v(" "),a("option",{attrs:{value:"ip"}},[t._v("ip")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4 control-label",attrs:{for:"value"}},[t._v("Replacement")]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.mapModalReplacement,expression:"mapModalReplacement"}],staticClass:"form-control",attrs:{type:"text",id:"value",placeholder:""},domProps:{value:t.mapModalReplacement},on:{input:function(e){e.target.composing||(t.mapModalReplacement=e.target.value)}}})])]),t._v(" "),a("div",{staticClass:"form-group"},[a("div",{staticClass:"col-sm-8 col-sm-offset-4"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.submitModal}},[t._v(t._s(t.$t("Submit")))])])])])])])])],2)}),[],!1,null,"b42c6d38",null).exports},5333:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingPassword",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"password",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"452744d4",null).exports},418:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingSelect",mixins:[a(7360).default],methods:{getText:function(t,e){var a="settings.settings.".concat(t,".options.").concat(e);return this.$te(a)?this.$t(a):e}}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("select",{staticClass:"form-control",attrs:{name:t.name,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}},t._l(t.options,(function(e,n){return a("option",{domProps:{value:n,selected:t.value===n,textContent:t._s(t.getText(t.name,e))}})})),0)}),[],!1,null,"a6c05438",null).exports},8562:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingSnmp3auth",mixins:[a(7360).default],data:function(){return{localList:this.value}},methods:{addItem:function(){this.localList.push({authlevel:"noAuthNoPriv",authalgo:"MD5",authname:"",authpass:"",cryptoalgo:"AES",cryptopass:""}),this.$emit("input",this.localList)},removeItem:function(t){this.localList.splice(t,1),this.$emit("input",this.localList)},updateItem:function(t,e,a){this.localList[t][e]=a,this.$emit("input",this.localList)},dragged:function(){this.$emit("input",this.localList)}},watch:{value:function(t){this.localList=t}}};a(7507);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("draggable",{attrs:{disabled:t.disabled},on:{end:function(e){return t.dragged()}},model:{value:t.localList,callback:function(e){t.localList=e},expression:"localList"}},t._l(t.localList,(function(e,n){return a("div",[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(t._s(n+1)+". "),t.disabled?t._e():a("span",{staticClass:"pull-right text-danger",on:{click:function(e){return t.removeItem(n)}}},[a("i",{staticClass:"fa fa-minus-circle"})])])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("form",{on:{onsubmit:function(t){t.preventDefault()}}},[a("div",{staticClass:"form-group"},[a("div",{staticClass:"col-sm-12"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.authlevel,expression:"item.authlevel"}],staticClass:"form-control",attrs:{id:"authlevel",disabled:t.disabled},on:{change:[function(a){var n=Array.prototype.filter.call(a.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(e,"authlevel",a.target.multiple?n:n[0])},function(e){return t.updateItem(n,e.target.id,e.target.value)}]}},[a("option",{attrs:{value:"noAuthNoPriv"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.level.noAuthNoPriv"))}}),t._v(" "),a("option",{attrs:{value:"authNoPriv"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.level.authNoPriv"))}}),t._v(" "),a("option",{attrs:{value:"authPriv"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.level.authPriv"))}})])])]),t._v(" "),a("fieldset",{directives:[{name:"show",rawName:"v-show",value:"auth"===e.authlevel.toString().substring(0,4),expression:"item.authlevel.toString().substring(0, 4) === 'auth'"}],attrs:{name:"algo",disabled:t.disabled}},[a("legend",{staticClass:"h4",domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.auth"))}}),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"authalgo"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authalgo"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.authalgo,expression:"item.authalgo"}],staticClass:"form-control",attrs:{id:"authalgo",name:"authalgo"},on:{change:[function(a){var n=Array.prototype.filter.call(a.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(e,"authalgo",a.target.multiple?n:n[0])},function(e){return t.updateItem(n,e.target.id,e.target.value)}]}},[a("option",{attrs:{value:"MD5"}},[t._v("MD5")]),t._v(" "),a("option",{attrs:{value:"SHA"}},[t._v("SHA")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"authname"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authname"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("input",{staticClass:"form-control",attrs:{type:"text",id:"authname"},domProps:{value:e.authname},on:{input:function(e){return t.updateItem(n,e.target.id,e.target.value)}}})])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"authpass"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authpass"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("input",{staticClass:"form-control",attrs:{type:"text",id:"authpass"},domProps:{value:e.authpass},on:{input:function(e){return t.updateItem(n,e.target.id,e.target.value)}}})])])]),t._v(" "),a("fieldset",{directives:[{name:"show",rawName:"v-show",value:"authPriv"===e.authlevel,expression:"item.authlevel === 'authPriv'"}],attrs:{name:"crypt",disabled:t.disabled}},[a("legend",{staticClass:"h4",domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.crypto"))}}),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"cryptoalgo"}},[t._v("Cryptoalgo")]),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.cryptoalgo,expression:"item.cryptoalgo"}],staticClass:"form-control",attrs:{id:"cryptoalgo"},on:{change:[function(a){var n=Array.prototype.filter.call(a.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(e,"cryptoalgo",a.target.multiple?n:n[0])},function(e){return t.updateItem(n,e.target.id,e.target.value)}]}},[a("option",{attrs:{value:"AES"}},[t._v("AES")]),t._v(" "),a("option",{attrs:{value:"DES"}},[t._v("DES")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"cryptopass"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authpass"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("input",{staticClass:"form-control",attrs:{type:"text",id:"cryptopass"},domProps:{value:e.cryptopass},on:{input:function(e){return t.updateItem(n,e.target.id,e.target.value)}}})])])])])])])])})),0),t._v(" "),t.disabled?t._e():a("div",{staticClass:"row snmp3-add-button"},[a("div",{staticClass:"col-sm-12"},[a("button",{staticClass:"btn btn-primary",on:{click:function(e){return t.addItem()}}},[a("i",{staticClass:"fa fa-plus-circle"}),t._v(" "+t._s(t.$t("New")))])])])],1)}),[],!1,null,"26c6b91a",null).exports},2383:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingText",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"text",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"8426bf9c",null).exports},1891:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"Tab",props:{name:{required:!0},text:String,selected:{type:Boolean,default:!1},icon:String},data:function(){return{isActive:this.selected}}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],staticClass:"tab-pane",attrs:{role:"tabpanel",id:t.name}},[t._t("default")],2)}),[],!1,null,"1af9694b",null).exports},1267:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"Tabs",props:{selected:String},data:function(){return{tabs:[],activeTab:null}},created:function(){this.tabs=this.$children},mounted:function(){this.activeTab=this.selected},watch:{selected:function(t){this.activeTab=t},activeTab:function(t){this.tabs.forEach((function(e){return e.isActive=e.name===t})),this.$emit("tab-selected",t)}}};a(8776);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"panel with-nav-tabs panel-default"},[a("div",{staticClass:"panel-heading"},[a("ul",{staticClass:"nav nav-tabs",attrs:{role:"tablist"}},[t._l(t.tabs,(function(e){return a("li",{key:e.name,class:{active:e.isActive},attrs:{role:"presentation"}},[a("a",{attrs:{role:"tab","aria-controls":e.name},on:{click:function(a){t.activeTab=e.name}}},[e.icon?a("i",{class:["fa","fa-fw",e.icon]}):t._e(),t._v("\n "+t._s(e.text||e.name)+" \n ")])])})),t._v(" "),a("li",{staticClass:"pull-right"},[t._t("header")],2)],2)]),t._v(" "),a("div",{staticClass:"panel-body"},[t._t("default")],2)])])}),[],!1,null,"2ac3a533",null).exports},2153:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"TransitionCollapseHeight",methods:{beforeEnter:function(t){requestAnimationFrame((function(){t.style.height||(t.style.height="0px"),t.style.display=null}))},enter:function(t){requestAnimationFrame((function(){requestAnimationFrame((function(){t.style.height=t.scrollHeight+"px"}))}))},afterEnter:function(t){t.style.height=null},beforeLeave:function(t){requestAnimationFrame((function(){t.style.height||(t.style.height=t.offsetHeight+"px")}))},leave:function(t){requestAnimationFrame((function(){requestAnimationFrame((function(){t.style.height="0px"}))}))},afterLeave:function(t){t.style.height=null}}};a(7277);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("transition",{attrs:{"enter-active-class":"enter-active","leave-active-class":"leave-active"},on:{"before-enter":t.beforeEnter,enter:t.enter,"after-enter":t.afterEnter,"before-leave":t.beforeLeave,leave:t.leave,"after-leave":t.afterLeave}},[t._t("default")],2)}),[],!1,null,"54390bb4",null).exports},4918:(t,e,a)=>{var n=a(4305);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("ba7e430c",n,!0,{})},5401:(t,e,a)=>{var n=a(9357);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("026db811",n,!0,{})},2332:(t,e,a)=>{var n=a(9377);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("7dccde0d",n,!0,{})},5048:(t,e,a)=>{var n=a(1163);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("7003dc96",n,!0,{})},7717:(t,e,a)=>{var n=a(2601);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("cffc3992",n,!0,{})},7295:(t,e,a)=>{var n=a(8519);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("f8a9ea68",n,!0,{})},7485:(t,e,a)=>{var n=a(7510);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("6c130ca0",n,!0,{})},5483:(t,e,a)=>{var n=a(3257);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("c7cf40de",n,!0,{})},7999:(t,e,a)=>{var n=a(8377);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("75c80366",n,!0,{})},7687:(t,e,a)=>{var n=a(6608);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("487459c0",n,!0,{})},7507:(t,e,a)=>{var n=a(1818);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("48b1e482",n,!0,{})},8776:(t,e,a)=>{var n=a(1505);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("63a0052f",n,!0,{})},7277:(t,e,a)=>{var n=a(9462);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("e98ec022",n,!0,{})},5642:(t,e,a)=>{var n={"./components/Accordion.vue":4479,"./components/AccordionItem.vue":2040,"./components/BaseSetting.vue":7360,"./components/ExampleComponent.vue":3953,"./components/LibrenmsSetting.vue":1744,"./components/LibrenmsSettings.vue":6365,"./components/PollerSettings.vue":142,"./components/SettingArray.vue":6935,"./components/SettingBoolean.vue":4561,"./components/SettingDashboardSelect.vue":8189,"./components/SettingDirectory.vue":6852,"./components/SettingEmail.vue":4846,"./components/SettingExecutable.vue":9068,"./components/SettingInteger.vue":3255,"./components/SettingLdapGroups.vue":8300,"./components/SettingMultiple.vue":6813,"./components/SettingNull.vue":4461,"./components/SettingOxidizedMaps.vue":1915,"./components/SettingPassword.vue":5333,"./components/SettingSelect.vue":418,"./components/SettingSnmp3auth.vue":8562,"./components/SettingText.vue":2383,"./components/Tab.vue":1891,"./components/Tabs.vue":1267,"./components/TransitionCollapseHeight.vue":2153};function s(t){var e=i(t);return a(e)}function i(t){if(!a.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}s.keys=function(){return Object.keys(n)},s.resolve=i,t.exports=s,s.id=5642}},t=>{"use strict";var e=e=>t(t.s=e);t.O(0,[170,898],(()=>(e(1585),e(5067))));t.O()}]); \ No newline at end of file +(self.webpackChunk=self.webpackChunk||[]).push([[773],{1585:(t,e,a)=>{"use strict";var n=a(538),s=a(7152);n.Z.use(s.Z);var i=new s.Z({locale:document.querySelector("html").getAttribute("lang"),fallbackLocale:"en",silentFallbackWarn:!0,silentTranslationWarn:!0,messages:window.vuei18nLocales}),o=a(9010),r=a.n(o),l=a(5081),u=a(9938),c=a.n(u),d=a(7907),p=a.n(d),v=a(9283),m=a(7611),f=a.n(m);a(9147),window.Vue=a(538).Z;var h=a(5642);h.keys().map((function(t){return Vue.component(t.split("/").pop().split(".")[0],h(t).default)})),Vue.use(r()),Vue.use(l.ZP),Vue.component("v-select",c()),Vue.component("multiselect",p()),Vue.use(v.ZP),Vue.use(f()),Vue.filter("ucfirst",(function(t){return t?(t=t.toString()).charAt(0).toUpperCase()+t.slice(1):""}));new Vue({el:"#app",i18n:i})},9147:(t,e,a)=>{window._=a(6486);try{window.Popper=a(8981).Z}catch(t){}window.axios=a(9669),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var n=document.head.querySelector('meta[name="csrf-token"]');n?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=n.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token"),a(7097)},4305:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".accordion-item-trigger-icon[data-v-16b90b68]{transition:transform .2s ease}.accordion-item-trigger.collapsed .accordion-item-trigger-icon[data-v-16b90b68]{transform:rotate(-90deg)}",""]);const i=s},9357:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".disable-events[data-v-d23a875a]{pointer-events:none}",""]);const i=s},9377:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,"#settings-search[data-v-2d230312]{border-radius:4px}#settings-search[data-v-2d230312]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}ul.settings-list[data-v-2d230312]{list-style-type:none}",""]);const i=s},1163:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".tab-content{width:100%}",""]);const i=s},2601:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".setting-container[data-v-5ab9fce1]{margin-bottom:10px}",""]);const i=s},8519:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".input-group[data-v-9d2dd8fa]{margin-bottom:3px}.input-group-addon[data-v-9d2dd8fa]:not(.disabled){cursor:move}",""]);const i=s},7510:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".form-control[data-v-72c868aa]{padding-right:12px}",""]);const i=s},3257:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".input-group[data-v-f290b6f6]{padding-bottom:3px}",""]);const i=s},8377:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,"div[data-v-f45258b0]{color:red}",""]);const i=s},6608:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".expandable[data-v-b42c6d38]{padding:5px;height:30px}.buttons[data-v-b42c6d38]{white-space:nowrap;padding:0 5px}.new-btn-div[data-v-b42c6d38]{margin-bottom:5px}.panel-body[data-v-b42c6d38]{padding:5px 0}",""]);const i=s},1818:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".authlevel[data-v-26c6b91a]{font-size:18px;text-align:left}.fa-minus-circle[data-v-26c6b91a]{cursor:pointer}.snmp3-add-button[data-v-26c6b91a]{margin-top:5px}",""]);const i=s},1505:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".panel.with-nav-tabs .panel-heading[data-v-2ac3a533]{padding:5px 5px 0}.panel.with-nav-tabs .nav-tabs[data-v-2ac3a533]{border-bottom:none}.panel.with-nav-tabs .nav-justified[data-v-2ac3a533]{margin-bottom:-1px}.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:hover{color:#777}.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-2ac3a533]:hover,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-2ac3a533]:hover{color:#777;background-color:#ddd;border-color:transparent}.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-2ac3a533]:hover{color:#555;background-color:#fff;border-color:#ddd #ddd transparent}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu[data-v-2ac3a533]{background-color:#f5f5f5;border-color:#ddd}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-2ac3a533]{color:#777}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-2ac3a533]:hover{background-color:#ddd}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-2ac3a533],.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-2ac3a533]:focus,.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-2ac3a533]:hover{color:#fff;background-color:#555}",""]);const i=s},9462:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>i});var n=a(3645),s=a.n(n)()((function(t){return t[1]}));s.push([t.id,".enter-active[data-v-54390bb4],.leave-active[data-v-54390bb4]{overflow:hidden;transition:height .2s linear}",""]);const i=s},5067:()=>{},4479:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"Accordion",props:{multiple:{type:Boolean,default:!1}},methods:{setActive:function(t){this.$children.forEach((function(e){e.slug()===t&&(e.isActive=!0)}))},activeChanged:function(t){this.multiple||this.$children.forEach((function(e){e.slug()!==t&&(e.isActive=!1)}))}},mounted:function(){this.$on("expanded",this.activeChanged)}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"panel-group",attrs:{role:"tablist"}},[t._t("default")],2)}),[],!1,null,"11dcbcb8",null).exports},2040:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"AccordionItem",props:{name:{type:String,required:!0},text:String,active:Boolean,icon:String},data:function(){return{isActive:this.active}},mounted:function(){window.location.hash===this.hash()&&(this.isActive=!0)},watch:{active:function(t){this.isActive=t},isActive:function(t){this.$parent.$emit(t?"expanded":"collapsed",this.slug())}},methods:{slug:function(){return this.name.toString().toLowerCase().replace(/\s+/g,"-")},hash:function(){return"#"+this.slug()}}};a(4918);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading",attrs:{role:"tab",id:t.slug()}},[a("h4",{staticClass:"panel-title"},[a("a",{staticClass:"accordion-item-trigger",class:{collapsed:!t.isActive},attrs:{role:"button","data-parent":"#accordion","data-href":t.hash()},on:{click:function(e){t.isActive=!t.isActive}}},[a("i",{staticClass:"fa fa-chevron-down accordion-item-trigger-icon"}),t._v(" "),t.icon?a("i",{class:["fa","fa-fw",t.icon]}):t._e(),t._v("\n "+t._s(t.text||t.name)+"\n ")])])]),t._v(" "),a("transition-collapse-height",[t.isActive?a("div",{class:["panel-collapse","collapse",{in:t.isActive}],attrs:{id:t.slug()+"-content",role:"tabpanel"}},[a("div",{staticClass:"panel-body"},[t._t("default")],2)]):t._e()])],1)}),[],!1,null,"16b90b68",null).exports},7360:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"BaseSetting",props:{name:{type:String,required:!0},value:{required:!0},disabled:Boolean,required:Boolean,pattern:String,"update-status":String,options:{}}};const s=(0,a(1900).Z)(n,undefined,undefined,!1,null,null,null).exports},3953:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={mounted:function(){console.log("Component mounted.")}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)}),[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container"},[a("div",{staticClass:"row justify-content-center"},[a("div",{staticClass:"col-md-8"},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[t._v("Example Component")]),t._v(" "),a("div",{staticClass:"card-body"},[t._v("\n I'm an example component.\n ")])])])])])}],!1,null,null,null).exports},1744:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"LibrenmsSetting",props:{setting:{type:Object,required:!0},prefix:{type:String,default:"settings"},id:{required:!1}},data:function(){return{value:this.setting.value,updateStatus:"none",feedback:""}},methods:{persistValue:function(t){var e=this;this.updateStatus="pending",axios.put(route(this.prefix+".update",this.getRouteParams()),{value:t}).then((function(t){e.value=t.data.value,e.$emit("setting-updated",{name:e.setting.name,value:e.value}),e.updateStatus="success",e.feedback="has-success",setTimeout((function(){return e.feedback=""}),3e3)})).catch((function(t){e.feedback="has-error",e.updateStatus="error",toastr.error(t.response.data.message);["text","email","password"].includes(e.setting.type)||(e.value=t.response.data.value,e.$emit("setting-updated",{name:e.setting.name,value:e.value}),setTimeout((function(){return e.feedback=""}),3e3))}))},debouncePersistValue:_.debounce((function(t){this.persistValue(t)}),500),changeValue:function(t){["select","boolean","multiple"].includes(this.setting.type)?this.persistValue(t):this.debouncePersistValue(t),this.value=t},getUnits:function(){var t=this.prefix+".units."+this.setting.units;return this.$te(t)?this.$t(t):this.setting.units},getDescription:function(){var t=this.prefix+".settings."+this.setting.name+".description";return this.$te(t)||this.$te(t,this.$i18n.fallbackLocale)?this.$t(t):this.setting.name},getHelp:function(){var t=this.$t(this.prefix+".settings."+this.setting.name+".help");return this.setting.overridden&&(t+="

"+this.$t(this.prefix+".readonly")),t},hasHelp:function(){var t=this.prefix+".settings."+this.setting.name+".help";return this.$te(t)||this.$te(t,this.$i18n.fallbackLocale)},resetToDefault:function(){var t=this;axios.delete(route(this.prefix+".destroy",this.getRouteParams())).then((function(e){t.value=e.data.value,t.feedback="has-success",setTimeout((function(){return t.feedback=""}),3e3)})).catch((function(e){t.feedback="has-error",setTimeout((function(){return t.feedback=""}),3e3),toastr.error(e.response.data.message)}))},resetToInitial:function(){this.changeValue(this.setting.value)},showResetToDefault:function(){return!this.setting.overridden&&!_.isEqual(this.value,this.setting.default)},showUndo:function(){return!_.isEqual(this.setting.value,this.value)},getRouteParams:function(){var t=[this.setting.name];return this.id&&t.unshift(this.id),t},getComponent:function(){var t="Setting"+this.setting.type.toString().replace(/(-[a-z]|^[a-z])/g,(function(t){return t.toUpperCase().replace("-","")}));return void 0!==Vue.options.components[t]?t:"SettingNull"}}};a(5401);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:["form-group","has-feedback",t.setting.class,t.feedback]},[a("label",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.setting.name},expression:"{ content: setting.name }"}],staticClass:"col-sm-5 control-label",attrs:{for:t.setting.name}},[t._v("\n "+t._s(t.getDescription())+"\n "),t.setting.units?a("span",[t._v("("+t._s(t.getUnits())+")")]):t._e()]),t._v(" "),a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:!!t.setting.disabled&&t.$t(this.prefix+".readonly")},expression:"{ content: setting.disabled ? $t(this.prefix + '.readonly') : false }"}],staticClass:"col-sm-5"},[a(t.getComponent(),{tag:"component",attrs:{value:t.value,name:t.setting.name,pattern:t.setting.pattern,disabled:t.setting.overridden,required:t.setting.required,options:t.setting.options,"update-status":t.updateStatus},on:{input:function(e){return t.changeValue(e)},change:function(e){return t.changeValue(e)}}}),t._v(" "),a("span",{staticClass:"form-control-feedback"})],1),t._v(" "),a("div",{staticClass:"col-sm-2"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.$t("Reset to default")},expression:"{ content: $t('Reset to default') }"}],staticClass:"btn btn-default",class:{"disable-events":!t.showResetToDefault()},style:{opacity:t.showResetToDefault()?1:0},attrs:{type:"button"},on:{click:t.resetToDefault}},[a("i",{staticClass:"fa fa-refresh"})]),t._v(" "),a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.$t("Undo")},expression:"{ content: $t('Undo') }"}],staticClass:"btn btn-primary",class:{"disable-events":!t.showUndo()},style:{opacity:t.showUndo()?1:0},attrs:{type:"button"},on:{click:t.resetToInitial}},[a("i",{staticClass:"fa fa-undo"})]),t._v(" "),t.hasHelp()?a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.getHelp(),trigger:"hover click"},expression:"{content: getHelp(), trigger: 'hover click'}"}],staticClass:"fa fa-fw fa-lg fa-question-circle"}):t._e()])])}),[],!1,null,"d23a875a",null).exports},6365:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==a)return;var n,s,i=[],o=!0,r=!1;try{for(a=a.call(t);!(o=(n=a.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){r=!0,s=t}finally{try{o||null==a.return||a.return()}finally{if(r)throw s}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return s(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"PollerSettings",props:{pollers:Object,settings:Object},data:function(){return{advanced:!1}}};a(5048),a(7717);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v("\n "+t._s(t.$t("Poller Settings"))+"\n "),a("span",{staticClass:"pull-right"},[t._v("Advanced "),a("toggle-button",{model:{value:t.advanced,callback:function(e){t.advanced=e},expression:"advanced"}})],1)])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("vue-tabs",{attrs:{direction:"vertical",type:"pills"}},t._l(t.pollers,(function(e,n){return a("v-tab",{key:n,attrs:{title:e.poller_name}},t._l(t.settings[n],(function(n){return!n.advanced||t.advanced?a("div",{key:n.name,staticClass:"setting-container clearfix"},[a("librenms-setting",{attrs:{prefix:"poller.settings",setting:n,id:e.id}})],1):t._e()})),0)})),1)],1)])}),[],!1,null,"5ab9fce1",null).exports},6935:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>r});var n=a(7360),s=a(9980),i=a.n(s);const o={name:"SettingArray",mixins:[n.default],components:{draggable:i()},data:function(){return{localList:this.value,newItem:""}},methods:{addItem:function(){this.disabled||(this.localList.push(this.newItem),this.$emit("input",this.localList),this.newItem="")},removeItem:function(t){this.disabled||(this.localList.splice(t,1),this.$emit("input",this.localList))},updateItem:function(t,e){this.disabled||this.localList[t]===e||(this.localList[t]=e,this.$emit("input",this.localList))},dragged:function(){this.disabled||this.$emit("input",this.localList)}},watch:{value:function(t){this.localList=t}}};a(7295);const r=(0,a(1900).Z)(o,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:!!t.disabled&&t.$t("settings.readonly"),expression:"disabled ? $t('settings.readonly') : false"}]},[a("draggable",{attrs:{disabled:t.disabled},on:{end:function(e){return t.dragged()}},model:{value:t.localList,callback:function(e){t.localList=e},expression:"localList"}},t._l(t.localList,(function(e,n){return a("div",{staticClass:"input-group"},[a("span",{class:["input-group-addon",t.disabled?"disabled":""]},[t._v(t._s(n+1)+".")]),t._v(" "),a("input",{staticClass:"form-control",attrs:{type:"text",readonly:t.disabled},domProps:{value:e},on:{blur:function(e){return t.updateItem(n,e.target.value)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.updateItem(n,e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn"},[t.disabled?t._e():a("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(e){return t.removeItem(n)}}},[a("i",{staticClass:"fa fa-minus-circle"})])])])})),0),t._v(" "),t.disabled?t._e():a("div",[a("div",{staticClass:"input-group"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newItem,expression:"newItem"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.newItem},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.addItem.apply(null,arguments)},input:function(e){e.target.composing||(t.newItem=e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.addItem}},[a("i",{staticClass:"fa fa-plus-circle"})])])])])],1)}),[],!1,null,"9d2dd8fa",null).exports},4561:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingBoolean",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("toggle-button",{attrs:{name:t.name,value:t.value,sync:!0,required:t.required,disabled:t.disabled},on:{change:function(e){return t.$emit("change",e.value)}}})}),[],!1,null,"ab7ed6ee",null).exports},6852:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingDirectory",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"text",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"a44ee658",null).exports},4846:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingEmail",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"email",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"62ce370c",null).exports},9068:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingExecutable",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"text",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"a93fcd56",null).exports},3255:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingInteger",mixins:[a(7360).default],methods:{parseNumber:function(t){var e=parseFloat(t);return isNaN(e)?t:e}}};a(7485);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"number",name:t.name,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){t.$emit("input",t.parseNumber(e.target.value))}}})}),[],!1,null,"72c868aa",null).exports},8300:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingLdapGroups",mixins:[a(7360).default],data:function(){return{localList:Array.isArray(this.value)?{}:this.value,newItem:"",newItemLevel:1,lock:!1}},methods:{addItem:function(){this.$set(this.localList,this.newItem,{level:this.newItemLevel}),this.newItem="",this.newItemLevel=1},removeItem:function(t){this.$delete(this.localList,t)},updateItem:function(t,e){var a=this;this.localList=Object.keys(this.localList).reduce((function(n,s){return n[s===t?e:s]=a.localList[s],n}),{})},updateLevel:function(t,e){this.$set(this.localList,t,{level:e})}},watch:{localList:function(){this.lock?this.lock=!1:this.$emit("input",this.localList)},value:function(){this.lock=!0,this.localList=Array.isArray(this.value)?{}:this.value}}};a(5483);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:!!t.disabled&&t.$t("settings.readonly"),expression:"disabled ? $t('settings.readonly') : false"}],staticClass:"form-inline"},[t._l(t.localList,(function(e,n){return a("div",{staticClass:"input-group"},[a("input",{staticClass:"form-control",attrs:{type:"text",readonly:t.disabled},domProps:{value:n},on:{blur:function(e){return t.updateItem(n,e.target.value)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.updateItem(n,e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn",staticStyle:{width:"0"}}),t._v(" "),a("select",{staticClass:"form-control",on:{change:function(e){return t.updateLevel(n,e.target.value)}}},[a("option",{attrs:{value:"1"},domProps:{selected:1===e.level}},[t._v(t._s(t.$t("Normal")))]),t._v(" "),a("option",{attrs:{value:"5"},domProps:{selected:5===e.level}},[t._v(t._s(t.$t("Global Read")))]),t._v(" "),a("option",{attrs:{value:"10"},domProps:{selected:10===e.level}},[t._v(t._s(t.$t("Admin")))])]),t._v(" "),a("span",{staticClass:"input-group-btn"},[t.disabled?t._e():a("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(e){return t.removeItem(n)}}},[a("i",{staticClass:"fa fa-minus-circle"})])])])})),t._v(" "),t.disabled?t._e():a("div",[a("div",{staticClass:"input-group"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newItem,expression:"newItem"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.newItem},on:{input:function(e){e.target.composing||(t.newItem=e.target.value)}}}),t._v(" "),a("span",{staticClass:"input-group-btn",staticStyle:{width:"0"}}),t._v(" "),a("select",{directives:[{name:"model",rawName:"v-model",value:t.newItemLevel,expression:"newItemLevel"}],staticClass:"form-control",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.newItemLevel=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"1"}},[t._v(t._s(t.$t("Normal")))]),t._v(" "),a("option",{attrs:{value:"5"}},[t._v(t._s(t.$t("Global Read")))]),t._v(" "),a("option",{attrs:{value:"10"}},[t._v(t._s(t.$t("Admin")))])]),t._v(" "),a("span",{staticClass:"input-group-btn"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.addItem}},[a("i",{staticClass:"fa fa-plus-circle"})])])])])],2)}),[],!1,null,"f290b6f6",null).exports},6813:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>l});function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==a)return;var n,s,i=[],o=!0,r=!1;try{for(a=a.call(t);!(o=(n=a.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){r=!0,s=t}finally{try{o||null==a.return||a.return()}finally{if(r)throw s}}return i}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingNull",props:["name"]};a(7999);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",[t._v("Invalid type for: "+t._s(t.name))])}),[],!1,null,"f45258b0",null).exports},1915:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingOxidizedMaps",mixins:[a(7360).default],data:function(){return{mapModalIndex:null,mapModalSource:null,mapModalMatchType:null,mapModalMatchValue:null,mapModalTarget:null,mapModalReplacement:null}},methods:{showModal:function(t){this.fillForm(t),this.$modal.show("maps")},submitModal:function(){var t=this.maps,e={target:this.mapModalTarget,source:this.mapModalSource,matchType:this.mapModalMatchType,matchValue:this.mapModalMatchValue,replacement:this.mapModalReplacement};this.mapModalIndex?t[this.mapModalIndex]=e:t.push(e),console.log(t,e),this.updateValue(t)},fillForm:function(t){var e=this.maps.hasOwnProperty(t);this.mapModalIndex=t,this.mapModalSource=e?this.maps[t].source:null,this.mapModalMatchType=e?this.maps[t].matchType:null,this.mapModalMatchValue=e?this.maps[t].matchValue:null,this.mapModalTarget=e?this.maps[t].target:null,this.mapModalReplacement=e?this.maps[t].replacement:null},deleteItem:function(t){var e=this.maps;e.splice(t,1),this.updateValue(e)},updateValue:function(t){var e={};t.forEach((function(t){void 0===e[t.target]&&(e[t.target]={}),void 0===e[t.target][t.source]&&(e[t.target][t.source]=[]);var a={};a[t.matchType]=t.matchValue,a.value=t.replacement,e[t.target][t.source].push(a)})),this.$emit("input",e)},formatSource:function(t,e){return e.hasOwnProperty("regex")?t+" ~ "+e.regex:e.hasOwnProperty("match")?t+" = "+e.match:"invalid"},formatTarget:function(t,e){return t+" > "+(e.hasOwnProperty("value")?e.value:e[t])}},watch:{updateStatus:function(){"success"===this.updateStatus&&this.$modal.hide("maps")}},computed:{maps:function(){var t=this,e=[];return Object.keys(this.value).forEach((function(a){Object.keys(t.value[a]).forEach((function(n){t.value[a][n].forEach((function(t){var s=t.hasOwnProperty("regex")?"regex":"match";e.push({target:a,source:n,matchType:s,matchValue:t[s],replacement:t.hasOwnProperty("value")?t.value:t[a]})}))}))})),e}}};a(7687);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{directives:[{name:"show",rawName:"v-show",value:!t.disabled,expression:"! disabled"}],staticClass:"new-btn-div"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){return t.showModal(null)}}},[a("i",{staticClass:"fa fa-plus"}),t._v(" "+t._s(t.$t("New Map Rule")))])]),t._v(" "),t._l(t.maps,(function(e,n){return a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-body"},[a("div",{staticClass:"col-md-5 expandable"},[a("span",[t._v(t._s(e.source)+" "+t._s("regex"===e.matchType?"~":"=")+" "+t._s(e.matchValue))])]),t._v(" "),a("div",{staticClass:"col-md-4 expandable"},[a("span",[t._v(t._s(e.target)+" < "+t._s(e.replacement))])]),t._v(" "),a("div",{staticClass:"col-md-3 buttons"},[a("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:!!t.disabled&&t.$t("settings.readonly"),expression:"disabled ? $t('settings.readonly') : false"}],staticClass:"btn-group"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.$t("Edit"),expression:"$t('Edit')"}],staticClass:"btn btn-sm btn-info",attrs:{type:"button",disabled:t.disabled},on:{click:function(e){return t.showModal(n)}}},[a("i",{staticClass:"fa fa-lg fa-edit"})]),t._v(" "),a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.$t("Delete"),expression:"$t('Delete')"}],staticClass:"btn btn-sm btn-danger",attrs:{type:"button",disabled:t.disabled},on:{click:function(e){return t.deleteItem(n)}}},[a("i",{staticClass:"fa fa-lg fa-remove"})])])])])])})),t._v(" "),a("modal",{attrs:{name:"maps",height:"auto"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("button",{staticClass:"close",attrs:{type:"button"},on:{click:function(e){return t.$modal.hide("maps")}}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]),t._v(" "),a("h4",{staticClass:"modal-title"},[t._v(t._s(t.mapModalIndex?t.$t("Edit Map Rule"):t.$t("New Map Rule")))])]),t._v(" "),a("div",{staticClass:"modal-body"},[a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4 control-label",attrs:{for:"source"}},[t._v("Source")]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.mapModalSource,expression:"mapModalSource"}],staticClass:"form-control",attrs:{id:"source"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.mapModalSource=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"hostname"}},[t._v("hostname")]),t._v(" "),a("option",{attrs:{value:"os"}},[t._v("os")]),t._v(" "),a("option",{attrs:{value:"type"}},[t._v("type")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4",attrs:{for:"match_value"}},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.mapModalMatchType,expression:"mapModalMatchType"}],staticClass:"form-control",attrs:{id:"match_type"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.mapModalMatchType=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"match"}},[t._v("Match (=)")]),t._v(" "),a("option",{attrs:{value:"regex"}},[t._v("Regex (~)")])])]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.mapModalMatchValue,expression:"mapModalMatchValue"}],staticClass:"form-control",attrs:{type:"text",id:"match_value",placeholder:""},domProps:{value:t.mapModalMatchValue},on:{input:function(e){e.target.composing||(t.mapModalMatchValue=e.target.value)}}})])]),t._v(" "),a("div",{staticClass:"form-horizontal",attrs:{role:"form"}},[a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4 control-label",attrs:{for:"target"}},[t._v("Target")]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.mapModalTarget,expression:"mapModalTarget"}],staticClass:"form-control",attrs:{id:"target"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.mapModalTarget=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"os"}},[t._v("os")]),t._v(" "),a("option",{attrs:{value:"group"}},[t._v("group")]),t._v(" "),a("option",{attrs:{value:"ip"}},[t._v("ip")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-4 control-label",attrs:{for:"value"}},[t._v("Replacement")]),t._v(" "),a("div",{staticClass:"col-sm-8"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.mapModalReplacement,expression:"mapModalReplacement"}],staticClass:"form-control",attrs:{type:"text",id:"value",placeholder:""},domProps:{value:t.mapModalReplacement},on:{input:function(e){e.target.composing||(t.mapModalReplacement=e.target.value)}}})])]),t._v(" "),a("div",{staticClass:"form-group"},[a("div",{staticClass:"col-sm-8 col-sm-offset-4"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.submitModal}},[t._v(t._s(t.$t("Submit")))])])])])])])])],2)}),[],!1,null,"b42c6d38",null).exports},5333:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingPassword",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"password",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"452744d4",null).exports},418:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingSelect",mixins:[a(7360).default],methods:{getText:function(t,e){var a="settings.settings.".concat(t,".options.").concat(e);return this.$te(a)?this.$t(a):e}}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("select",{staticClass:"form-control",attrs:{name:t.name,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}},t._l(t.options,(function(e,n){return a("option",{domProps:{value:n,selected:t.value===n,textContent:t._s(t.getText(t.name,e))}})})),0)}),[],!1,null,"a6c05438",null).exports},6906:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingSelectDynamic",mixins:[a(7360).default],data:function(){return{select2:null}},watch:{value:function(t){this.select2.val(t).trigger("change")}},computed:{settings:function(){return{theme:"bootstrap",dropdownAutoWidth:!0,width:"auto",allowClear:Boolean(this.options.allowClear),placeholder:this.options.placeholder,ajax:{url:route("ajax.select."+this.options.target).toString(),delay:250,data:this.options.callback}}}},mounted:function(){var t=this;axios.get(route("ajax.select."+this.options.target),{params:{id:this.value}}).then((function(e){e.data.results.forEach((function(e){e.id==t.value&&t.select2.append(new Option(e.text,e.id,!0,!0)).trigger("change")}))})),this.select2=$(this.$el).find("select").select2(this.settings)},beforeDestroy:function(){this.select2.select2("destroy")}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("select",{staticClass:"form-control",attrs:{name:t.name,required:t.required,disabled:t.disabled},domProps:{value:t.value}})])}),[],!1,null,"7fc37dc1",null).exports},8562:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingSnmp3auth",mixins:[a(7360).default],data:function(){return{localList:this.value}},methods:{addItem:function(){this.localList.push({authlevel:"noAuthNoPriv",authalgo:"MD5",authname:"",authpass:"",cryptoalgo:"AES",cryptopass:""}),this.$emit("input",this.localList)},removeItem:function(t){this.localList.splice(t,1),this.$emit("input",this.localList)},updateItem:function(t,e,a){this.localList[t][e]=a,this.$emit("input",this.localList)},dragged:function(){this.$emit("input",this.localList)}},watch:{value:function(t){this.localList=t}}};a(7507);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("draggable",{attrs:{disabled:t.disabled},on:{end:function(e){return t.dragged()}},model:{value:t.localList,callback:function(e){t.localList=e},expression:"localList"}},t._l(t.localList,(function(e,n){return a("div",[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(t._s(n+1)+". "),t.disabled?t._e():a("span",{staticClass:"pull-right text-danger",on:{click:function(e){return t.removeItem(n)}}},[a("i",{staticClass:"fa fa-minus-circle"})])])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("form",{on:{onsubmit:function(t){t.preventDefault()}}},[a("div",{staticClass:"form-group"},[a("div",{staticClass:"col-sm-12"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.authlevel,expression:"item.authlevel"}],staticClass:"form-control",attrs:{id:"authlevel",disabled:t.disabled},on:{change:[function(a){var n=Array.prototype.filter.call(a.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(e,"authlevel",a.target.multiple?n:n[0])},function(e){return t.updateItem(n,e.target.id,e.target.value)}]}},[a("option",{attrs:{value:"noAuthNoPriv"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.level.noAuthNoPriv"))}}),t._v(" "),a("option",{attrs:{value:"authNoPriv"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.level.authNoPriv"))}}),t._v(" "),a("option",{attrs:{value:"authPriv"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.level.authPriv"))}})])])]),t._v(" "),a("fieldset",{directives:[{name:"show",rawName:"v-show",value:"auth"===e.authlevel.toString().substring(0,4),expression:"item.authlevel.toString().substring(0, 4) === 'auth'"}],attrs:{name:"algo",disabled:t.disabled}},[a("legend",{staticClass:"h4",domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.auth"))}}),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"authalgo"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authalgo"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.authalgo,expression:"item.authalgo"}],staticClass:"form-control",attrs:{id:"authalgo",name:"authalgo"},on:{change:[function(a){var n=Array.prototype.filter.call(a.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(e,"authalgo",a.target.multiple?n:n[0])},function(e){return t.updateItem(n,e.target.id,e.target.value)}]}},[a("option",{attrs:{value:"MD5"}},[t._v("MD5")]),t._v(" "),a("option",{attrs:{value:"SHA"}},[t._v("SHA")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"authname"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authname"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("input",{staticClass:"form-control",attrs:{type:"text",id:"authname"},domProps:{value:e.authname},on:{input:function(e){return t.updateItem(n,e.target.id,e.target.value)}}})])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"authpass"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authpass"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("input",{staticClass:"form-control",attrs:{type:"text",id:"authpass"},domProps:{value:e.authpass},on:{input:function(e){return t.updateItem(n,e.target.id,e.target.value)}}})])])]),t._v(" "),a("fieldset",{directives:[{name:"show",rawName:"v-show",value:"authPriv"===e.authlevel,expression:"item.authlevel === 'authPriv'"}],attrs:{name:"crypt",disabled:t.disabled}},[a("legend",{staticClass:"h4",domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.crypto"))}}),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"cryptoalgo"}},[t._v("Cryptoalgo")]),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.cryptoalgo,expression:"item.cryptoalgo"}],staticClass:"form-control",attrs:{id:"cryptoalgo"},on:{change:[function(a){var n=Array.prototype.filter.call(a.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(e,"cryptoalgo",a.target.multiple?n:n[0])},function(e){return t.updateItem(n,e.target.id,e.target.value)}]}},[a("option",{attrs:{value:"AES"}},[t._v("AES")]),t._v(" "),a("option",{attrs:{value:"DES"}},[t._v("DES")])])])]),t._v(" "),a("div",{staticClass:"form-group"},[a("label",{staticClass:"col-sm-3 control-label",attrs:{for:"cryptopass"},domProps:{textContent:t._s(t.$t("settings.settings.snmp.v3.fields.authpass"))}}),t._v(" "),a("div",{staticClass:"col-sm-9"},[a("input",{staticClass:"form-control",attrs:{type:"text",id:"cryptopass"},domProps:{value:e.cryptopass},on:{input:function(e){return t.updateItem(n,e.target.id,e.target.value)}}})])])])])])])])})),0),t._v(" "),t.disabled?t._e():a("div",{staticClass:"row snmp3-add-button"},[a("div",{staticClass:"col-sm-12"},[a("button",{staticClass:"btn btn-primary",on:{click:function(e){return t.addItem()}}},[a("i",{staticClass:"fa fa-plus-circle"}),t._v(" "+t._s(t.$t("New")))])])])],1)}),[],!1,null,"26c6b91a",null).exports},2383:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"SettingText",mixins:[a(7360).default]};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"form-control",attrs:{type:"text",name:t.name,pattern:t.pattern,required:t.required,disabled:t.disabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.value)}}})}),[],!1,null,"8426bf9c",null).exports},1891:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"Tab",props:{name:{required:!0},text:String,selected:{type:Boolean,default:!1},icon:String},data:function(){return{isActive:this.selected}}};const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],staticClass:"tab-pane",attrs:{role:"tabpanel",id:t.name}},[t._t("default")],2)}),[],!1,null,"1af9694b",null).exports},1267:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"Tabs",props:{selected:String},data:function(){return{tabs:[],activeTab:null}},created:function(){this.tabs=this.$children},mounted:function(){this.activeTab=this.selected},watch:{selected:function(t){this.activeTab=t},activeTab:function(t){this.tabs.forEach((function(e){return e.isActive=e.name===t})),this.$emit("tab-selected",t)}}};a(8776);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"panel with-nav-tabs panel-default"},[a("div",{staticClass:"panel-heading"},[a("ul",{staticClass:"nav nav-tabs",attrs:{role:"tablist"}},[t._l(t.tabs,(function(e){return a("li",{key:e.name,class:{active:e.isActive},attrs:{role:"presentation"}},[a("a",{attrs:{role:"tab","aria-controls":e.name},on:{click:function(a){t.activeTab=e.name}}},[e.icon?a("i",{class:["fa","fa-fw",e.icon]}):t._e(),t._v("\n "+t._s(e.text||e.name)+" \n ")])])})),t._v(" "),a("li",{staticClass:"pull-right"},[t._t("header")],2)],2)]),t._v(" "),a("div",{staticClass:"panel-body"},[t._t("default")],2)])])}),[],!1,null,"2ac3a533",null).exports},2153:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});const n={name:"TransitionCollapseHeight",methods:{beforeEnter:function(t){requestAnimationFrame((function(){t.style.height||(t.style.height="0px"),t.style.display=null}))},enter:function(t){requestAnimationFrame((function(){requestAnimationFrame((function(){t.style.height=t.scrollHeight+"px"}))}))},afterEnter:function(t){t.style.height=null},beforeLeave:function(t){requestAnimationFrame((function(){t.style.height||(t.style.height=t.offsetHeight+"px")}))},leave:function(t){requestAnimationFrame((function(){requestAnimationFrame((function(){t.style.height="0px"}))}))},afterLeave:function(t){t.style.height=null}}};a(7277);const s=(0,a(1900).Z)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("transition",{attrs:{"enter-active-class":"enter-active","leave-active-class":"leave-active"},on:{"before-enter":t.beforeEnter,enter:t.enter,"after-enter":t.afterEnter,"before-leave":t.beforeLeave,leave:t.leave,"after-leave":t.afterLeave}},[t._t("default")],2)}),[],!1,null,"54390bb4",null).exports},4918:(t,e,a)=>{var n=a(4305);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("ba7e430c",n,!0,{})},5401:(t,e,a)=>{var n=a(9357);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("026db811",n,!0,{})},2332:(t,e,a)=>{var n=a(9377);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("7dccde0d",n,!0,{})},5048:(t,e,a)=>{var n=a(1163);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("7003dc96",n,!0,{})},7717:(t,e,a)=>{var n=a(2601);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("cffc3992",n,!0,{})},7295:(t,e,a)=>{var n=a(8519);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("f8a9ea68",n,!0,{})},7485:(t,e,a)=>{var n=a(7510);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("6c130ca0",n,!0,{})},5483:(t,e,a)=>{var n=a(3257);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("c7cf40de",n,!0,{})},7999:(t,e,a)=>{var n=a(8377);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("75c80366",n,!0,{})},7687:(t,e,a)=>{var n=a(6608);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("487459c0",n,!0,{})},7507:(t,e,a)=>{var n=a(1818);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("48b1e482",n,!0,{})},8776:(t,e,a)=>{var n=a(1505);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("63a0052f",n,!0,{})},7277:(t,e,a)=>{var n=a(9462);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,a(5346).Z)("e98ec022",n,!0,{})},5642:(t,e,a)=>{var n={"./components/Accordion.vue":4479,"./components/AccordionItem.vue":2040,"./components/BaseSetting.vue":7360,"./components/ExampleComponent.vue":3953,"./components/LibrenmsSetting.vue":1744,"./components/LibrenmsSettings.vue":6365,"./components/PollerSettings.vue":142,"./components/SettingArray.vue":6935,"./components/SettingBoolean.vue":4561,"./components/SettingDirectory.vue":6852,"./components/SettingEmail.vue":4846,"./components/SettingExecutable.vue":9068,"./components/SettingInteger.vue":3255,"./components/SettingLdapGroups.vue":8300,"./components/SettingMultiple.vue":6813,"./components/SettingNull.vue":4461,"./components/SettingOxidizedMaps.vue":1915,"./components/SettingPassword.vue":5333,"./components/SettingSelect.vue":418,"./components/SettingSelectDynamic.vue":6906,"./components/SettingSnmp3auth.vue":8562,"./components/SettingText.vue":2383,"./components/Tab.vue":1891,"./components/Tabs.vue":1267,"./components/TransitionCollapseHeight.vue":2153};function s(t){var e=i(t);return a(e)}function i(t){if(!a.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}s.keys=function(){return Object.keys(n)},s.resolve=i,t.exports=s,s.id=5642}},t=>{"use strict";var e=e=>t(t.s=e);t.O(0,[170,898],(()=>(e(1585),e(5067))));t.O()}]); \ No newline at end of file diff --git a/html/mix-manifest.json b/html/mix-manifest.json index c57180443d..371d146171 100644 --- a/html/mix-manifest.json +++ b/html/mix-manifest.json @@ -1,5 +1,5 @@ { - "/js/app.js": "/js/app.js?id=a6bdef835406a9a4e138", + "/js/app.js": "/js/app.js?id=a3b972f53d547c6c17ba", "/js/manifest.js": "/js/manifest.js?id=1514baaea419f38abb7d", "/css/app.css": "/css/app.css?id=996b9e3da0c3ab98067e", "/js/vendor.js": "/js/vendor.js?id=ccca9695062f1f68aaa8", diff --git a/misc/config_definitions.json b/misc/config_definitions.json index 73d8b62ef3..2715bf45e2 100644 --- a/misc/config_definitions.json +++ b/misc/config_definitions.json @@ -1309,10 +1309,16 @@ }, "default_poller_group": { "default": 0, - "type": "integer", + "type": "select-dynamic", "group": "poller", "section": "distributed", - "order": 3 + "order": 3, + "options": { + "target": "poller-group" + }, + "validate": { + "value": "integer|zero_or_exists:poller_groups,id" + } }, "distributed_poller_memcached_host": { "default": "example.net", @@ -5439,9 +5445,12 @@ "group": "webui", "section": "dashboard", "order": 0, - "type": "dashboard-select", + "type": "select-dynamic", + "options": { + "target": "dashboard" + }, "validate": { - "value": "zero_or_exists:dashboards,dashboard_id" + "value": "integer|zero_or_exists:dashboards,dashboard_id" } }, "webui.dynamic_graphs": { diff --git a/misc/config_schema.json b/misc/config_schema.json index 58a8c72a0e..0be8bf96fa 100644 --- a/misc/config_schema.json +++ b/misc/config_schema.json @@ -27,8 +27,7 @@ "type": "integer" }, "options": { - "type": "object", - "minProperties": 2 + "type": "object" }, "units": { "type": "string" @@ -67,7 +66,31 @@ "additionalProperties": false, "anyOf": [ { - "properties": { "type": {"const": "select"} }, + "properties": { + "type": {"const": "select"}, + "options": { + "type": "object", + "minProperties": 2 + } + }, + "required": ["options"] + }, + { + "properties": { + "type": {"const": "select-dynamic"}, + "options": { + "type": "object", + "properties": { + "allowClear": {"type": "boolean"}, + "callback": {"type": "string"}, + "placeholder": {"type": "string"}, + "target": {"type": "string"} + }, + "minProperties": 1, + "required": ["target"], + "additionalProperties": false + } + }, "required": ["options"] }, { @@ -84,7 +107,6 @@ "color", "float", "graph", - "dashboard-select", "snmp3auth", "ldap-groups", "ad-groups", diff --git a/resources/js/components/SettingDashboardSelect.vue b/resources/js/components/SettingDashboardSelect.vue deleted file mode 100644 index 6dcae0c913..0000000000 --- a/resources/js/components/SettingDashboardSelect.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - diff --git a/resources/js/components/SettingSelectDynamic.vue b/resources/js/components/SettingSelectDynamic.vue new file mode 100644 index 0000000000..a02b358c45 --- /dev/null +++ b/resources/js/components/SettingSelectDynamic.vue @@ -0,0 +1,92 @@ + + + + + + + diff --git a/routes/web.php b/routes/web.php index 32bc19da11..1c07e5fcce 100644 --- a/routes/web.php +++ b/routes/web.php @@ -103,24 +103,25 @@ Route::group(['middleware' => ['auth'], 'guard' => 'auth'], function () { // js select2 data controllers Route::group(['prefix' => 'select', 'namespace' => 'Select'], function () { - Route::get('application', 'ApplicationController'); - Route::get('bill', 'BillController'); + Route::get('application', 'ApplicationController')->name('ajax.select.application'); + Route::get('bill', 'BillController')->name('ajax.select.bill'); Route::get('dashboard', 'DashboardController')->name('ajax.select.dashboard'); - Route::get('device', 'DeviceController'); - Route::get('device-field', 'DeviceFieldController'); - Route::get('device-group', 'DeviceGroupController'); - Route::get('port-group', 'PortGroupController'); - Route::get('eventlog', 'EventlogController'); - Route::get('graph', 'GraphController'); - Route::get('graph-aggregate', 'GraphAggregateController'); - Route::get('graylog-streams', 'GraylogStreamsController'); - Route::get('syslog', 'SyslogController'); - Route::get('location', 'LocationController'); - Route::get('munin', 'MuninPluginController'); - Route::get('service', 'ServiceController'); - Route::get('template', 'ServiceTemplateController'); - Route::get('port', 'PortController'); - Route::get('port-field', 'PortFieldController'); + Route::get('device', 'DeviceController')->name('ajax.select.device'); + Route::get('device-field', 'DeviceFieldController')->name('ajax.select.device-field'); + Route::get('device-group', 'DeviceGroupController')->name('ajax.select.device-group'); + Route::get('port-group', 'PortGroupController')->name('ajax.select.port-group'); + Route::get('eventlog', 'EventlogController')->name('ajax.select.eventlog'); + Route::get('graph', 'GraphController')->name('ajax.select.graph'); + Route::get('graph-aggregate', 'GraphAggregateController')->name('ajax.select.graph-aggregate'); + Route::get('graylog-streams', 'GraylogStreamsController')->name('ajax.select.graylog-streams'); + Route::get('syslog', 'SyslogController')->name('ajax.select.syslog'); + Route::get('location', 'LocationController')->name('ajax.select.location'); + Route::get('munin', 'MuninPluginController')->name('ajax.select.munin'); + Route::get('service', 'ServiceController')->name('ajax.select.service'); + Route::get('template', 'ServiceTemplateController')->name('ajax.select.template'); + Route::get('poller-group', 'PollerGroupController')->name('ajax.select.poller-group'); + Route::get('port', 'PortController')->name('ajax.select.port'); + Route::get('port-field', 'PortFieldController')->name('ajax.select.port-field'); }); // jquery bootgrid data controllers