diff --git a/app/Models/Device.php b/app/Models/Device.php index 96cdc756c1..cf539ec7b4 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -464,6 +464,17 @@ class Device extends BaseModel ]); } + public function scopeWhereAttributeDisabled(Builder $query, string $attribute): Builder + { + return $query->leftJoin('devices_attribs', function (JoinClause $query) use ($attribute) { + $query->on('devices.device_id', 'devices_attribs.device_id') + ->where('devices_attribs.attrib_type', $attribute); + })->where(function (Builder $query) { + $query->whereNull('devices_attribs.attrib_value') + ->orWhere('devices_attribs.attrib_value', '!=', 'true'); + }); + } + public function scopeWhereUptime($query, $uptime, $modifier = '<') { return $query->where([ @@ -472,17 +483,9 @@ class Device extends BaseModel ]); } - public function scopeCanPing(Builder $query) + public function scopeCanPing(Builder $query): Builder { - return $query->where('disabled', 0) - ->leftJoin('devices_attribs', function (JoinClause $query) { - $query->on('devices.device_id', 'devices_attribs.device_id') - ->where('devices_attribs.attrib_type', 'override_icmp_disable'); - }) - ->where(function (Builder $query) { - $query->whereNull('devices_attribs.attrib_value') - ->orWhere('devices_attribs.attrib_value', '!=', 'true'); - }); + return $this->scopeWhereAttributeDisabled($query->where('disabled', 0), 'override_icmp_disable'); } public function scopeHasAccess($query, User $user) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 469563db3c..6b896c7692 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -143,11 +143,24 @@ class AppServiceProvider extends ServiceProvider $ip = substr($value, 0, strpos($value, '/') ?: strlen($value)); // allow prefixes too return IP::isValid($ip) || Validate::hostname($value); - }, __('The :attribute must a valid IP address/network or hostname.')); + }); Validator::extend('is_regex', function ($attribute, $value) { return @preg_match($value, '') !== false; - }, __(':attribute is not a valid regular expression')); + }); + + Validator::extend('keys_in', function ($attribute, $value, $parameters, $validator) { + $extra_keys = is_array($value) ? array_diff(array_keys($value), $parameters) : []; + + $validator->addReplacer('keys_in', function ($message, $attribute, $rule, $parameters) use ($extra_keys) { + return str_replace( + [':extra', ':values'], + [implode(',', $extra_keys), implode(',', $parameters)], + $message); + }); + + return is_array($value) && empty($extra_keys); + }); Validator::extend('zero_or_exists', function ($attribute, $value, $parameters, $validator) { if ($value === 0) { @@ -157,6 +170,6 @@ class AppServiceProvider extends ServiceProvider $validator = Validator::make([$attribute => $value], [$attribute => 'exists:' . implode(',', $parameters)]); return $validator->passes(); - }, __('validation.exists')); + }, trans('validation.exists')); } } diff --git a/doc/Extensions/Oxidized.md b/doc/Extensions/Oxidized.md index 7d558fd1bd..32ecd6e680 100644 --- a/doc/Extensions/Oxidized.md +++ b/doc/Extensions/Oxidized.md @@ -33,16 +33,16 @@ working Oxidized setup which is already taking config snapshots for your devices. When you have that, you only need the following config to enable the display of device configs within the device page itself: -```php -$config['oxidized']['enabled'] = TRUE; -$config['oxidized']['url'] = 'http://127.0.0.1:8888'; +```bash +lnms config:set oxidized.enabled true +lnms config:set oxidized.url http://127.0.0.1:8888 ``` LibreNMS supports config versioning if Oxidized does. This is known to work with the git output module. -```php -$config['oxidized']['features']['versioning'] = true; +```bash +lnms config:set oxidized.features.versioning true ``` Oxidized supports various ways to utilise credentials to login to @@ -52,14 +52,14 @@ supports sending groups back to Oxidized so that you can then define group credentials within Oxidized. To enable this support please switch on 'Enable the return of groups to Oxidized': -```php -$config['oxidized']['group_support'] = true; +```bash +lnms config:set oxidized.group_support true ``` You can set a default group that devices will fall back to with: -```php -$config['oxidized']['default_group'] = 'default'; +```bash +lnms config:set oxidized.default_group default ``` # SELinux @@ -101,11 +101,10 @@ time. LibreNMS is able to reload the Oxidized list of nodes, each time a device is added to LibreNMS. To do so, edit the option in Global Settings>External Settings>Oxidized Integration or add the following -to your config.php. - -```php -$config['oxidized']['reload_nodes'] = true; +to your config. +```bash +lnms config:set oxidized.reload_nodes true ``` # Creating overrides @@ -121,38 +120,56 @@ Matching of hosts can be done using `hostname`, `sysname`, `os`, key and value, or a 'regex' key and value. The order of matching is: - `hostname` -- `sysname` +- `sysName` - `sysDescr` - `hardware` - `os` - `location` - `ip` -To match on the device hostnames or sysnames that contain 'lon-sw' or -if the location contains 'London' then you would place the following -within config.php: +To match on the device hostnames or sysNames that contain 'lon-sw' or +if the location contains 'London' then you would set the following: -```php -$config['oxidized']['maps']['group']['hostname'][] = array('regex' => '/^lon-sw/', 'group' => 'london-switches'); -$config['oxidized']['maps']['group']['sysname'][] = array('regex' => '/^lon-sw/', 'group' => 'london-switches'); -$config['oxidized']['maps']['group']['location'][] = array('regex' => '/london/', 'group' => 'london-switches'); +```bash +lnms config:set oxidized.maps.group.hostname.+ '{"regex": "/^lon-sw/", "value": "london-switches"}' +lnms config:set oxidized.maps.group.sysName.+ '{"regex": "/^lon-sw/", "value": "london-switches"}' +lnms config:set oxidized.maps.group.location.+ '{"regex": "/london/", "value": "london-switches"}' ``` To match on a device os of edgeos then please use the following: -```php -$config['oxidized']['maps']['group']['os'][] = array('match' => 'edgeos', 'group' => 'wireless'); +```bash +lnms config:set oxidized.maps.group.os.+ '{"match": "edgeos", "value": "wireless"}' ``` -Matching on OS requires system name of the OS. For example, 'match' => -'RouterOS' will not work, while 'match' => 'routeros' will. +Matching on OS requires system name of the OS. For example, "match": "RouterOS" +will not work, while "match": "routeros" will. -To override the IP Oxidized uses to poll the device, you can add the -following within config.php: +To edit an existing map, you must use the index to override it. -```php -$config['oxidized']['maps']['ip']['sysname'][] = array('regex' => '/^my.node/', 'ip' => '192.168.1.10'); -$config['oxidized']['maps']['ip']['sysname'][] = array('match' => 'my-other.node', 'ip' => '192.168.1.20'); +```bash +lnms config:get oxidized.maps.os.os +array ( + 0 => + array ( + 'match' => 'airos-af-ltu', + 'value' => 'airfiber', + ), + 1 => + array ( + 'match' => 'airos-af', + 'value' => 'airfiber', + ), +) + +lnms config:set oxidized.maps.os.os.1 '{"match": "airos-af", "value": "something-else"}' +``` + +To override the IP Oxidized uses to poll the device, set the following: + +```bash +lnms config:set oxidized.maps.ip.sysName.+ '{"regex": "/^my.node/", "value": "192.168.1.10"}' +lnms config:set oxidized.maps.ip.sysName.+ '{"match": "my-other.node", "value": "192.168.1.20"}' ``` This allows extending the configuration further by providing a @@ -160,16 +177,16 @@ completely flexible model for custom flags and settings, for example, below shows the ability to add an ssh_proxy host within Oxidized simply by adding the below to your configuration: -```php -$config['oxidized']['maps']['ssh_proxy']['sysname'][] = array('regex' => '/^my.node/', 'ssh_proxy' => 'my-ssh-gateway.node'); +```bash +lnms config:set oxidized.maps.ssh_proxy.sysName.+ '{"regex": "/^my.node/", "value": "my-ssh-gateway.node"}' ``` Or of course, any custom value that could be needed or wanted can be applied, for example, setting a "myAttribute" to "Super cool value" for any configured and enabled "routeros" device. -```php -$config['oxidized']['maps']['myAttribute']['os'][] = array('match' => 'routeros', 'myAttribute' => 'Super cool value'); +```bash +lnms config:set oxidized.maps.myAttribute.os.+ '{"match": "routeros", "value": "Super cool value"}' ``` Verify the return of groups by querying the API: @@ -195,11 +212,11 @@ you can edit those devices in Device -> Edit -> Misc and enable "Exclude from Oxidized?" It's also possible to exclude certain device types and OS' from being -output via the API. This is currently only possible via config.php: +output via the API. -```php -$config['oxidized']['ignore_types'] = array('server','power'); -$config['oxidized']['ignore_os'] = array('linux','windows'); +```bash +lnms config:set oxidized.ignore_types '["server", "power"]' +lnms config:set oxidized.ignore_os '["linux", "windows"]' ``` # Trigger configuration backups diff --git a/html/css/dark.css b/html/css/dark.css index 2048a9adc2..e1f5d361b4 100644 --- a/html/css/dark.css +++ b/html/css/dark.css @@ -1,6 +1,3 @@ - body { - background: #333; - } .fa-nav-icons { color: #bfc0c0; } @@ -186,7 +183,7 @@ } small { font-size: 80%; - color: #FFF; + color: #FFF; } sub, sup { @@ -7212,3 +7209,7 @@ .vis-legend-text { color: black; } + +.expandable:hover span { + background-color: #2e3338; +} diff --git a/html/css/styles.css b/html/css/styles.css index 79af9e6754..f3d56787f9 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -2388,3 +2388,18 @@ label { .logon-message { white-space: pre-wrap; } + +.expandable { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.expandable:hover { + overflow: visible; +} +.expandable:hover span { + position: relative; + background-color: white; + padding: 2px 3px 2px 0; + z-index: 5; +} diff --git a/html/js/app.js b/html/js/app.js index b4bd4d0a1e..bac289534e 100644 --- a/html/js/app.js +++ b/html/js/app.js @@ -1 +1 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[773],{1585:(t,e,n)=>{"use strict";var a=n(538),s=n(7152);a.Z.use(s.Z);var i=new s.Z({locale:document.querySelector("html").getAttribute("lang"),fallbackLocale:"en",silentFallbackWarn:!0,silentTranslationWarn:!0,messages:window.vuei18nLocales}),r=n(9010),o=n.n(r),l=n(8314),c=n(9938),u=n.n(c),d=n(7907),p=n.n(d),v=n(9283);n(9147),window.Vue=n(538).Z;var f=n(6106);f.keys().map((function(t){return Vue.component(t.split("/").pop().split(".")[0],f(t).default)})),Vue.use(o()),Vue.use(l.ZP),Vue.component("v-select",u()),Vue.component("multiselect",p()),Vue.use(v.ZP),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,n)=>{window._=n(6486);try{window.Popper=n(8981).Z}catch(t){}window.axios=n(9669),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var a=document.head.querySelector('meta[name="csrf-token"]');a?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=a.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token"),n(7097)},3234:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".accordion-item-trigger-icon[data-v-af5cb116]{transition:transform .2s ease}.accordion-item-trigger.collapsed .accordion-item-trigger-icon[data-v-af5cb116]{transform:rotate(-90deg)}",""]);const i=s},6203:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,"#settings-search[data-v-0db2ec2e]{border-radius:4px}#settings-search[data-v-0db2ec2e]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}ul.settings-list[data-v-0db2ec2e]{list-style-type:none}",""]);const i=s},1163:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".tab-content{width:100%}",""]);const i=s},9389:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".setting-container[data-v-64edb5ca]{margin-bottom:10px}",""]);const i=s},7014:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".input-group[data-v-6182757a]{margin-bottom:3px}.input-group-addon[data-v-6182757a]:not(.disabled){cursor:move}",""]);const i=s},5731:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".form-control[data-v-685cdc22]{padding-right:12px}",""]);const i=s},6777:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".input-group[data-v-946d0f4c]{padding-bottom:3px}",""]);const i=s},115:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,"div[data-v-e69e1a5e]{color:red}",""]);const i=s},5558:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".authlevel[data-v-2e6100d1]{font-size:18px;text-align:left}.fa-minus-circle[data-v-2e6100d1]{cursor:pointer}.snmp3-add-button[data-v-2e6100d1]{margin-top:5px}",""]);const i=s},8842:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".panel.with-nav-tabs .panel-heading[data-v-6072cc1c]{padding:5px 5px 0}.panel.with-nav-tabs .nav-tabs[data-v-6072cc1c]{border-bottom:none}.panel.with-nav-tabs .nav-justified[data-v-6072cc1c]{margin-bottom:-1px}.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-6072cc1c],.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-6072cc1c]:focus,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-6072cc1c]:hover{color:#777}.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-6072cc1c],.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-6072cc1c]:focus,.with-nav-tabs.panel-default .nav-tabs>.open>a[data-v-6072cc1c]:hover,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-6072cc1c]:focus,.with-nav-tabs.panel-default .nav-tabs>li>a[data-v-6072cc1c]:hover{color:#777;background-color:#ddd;border-color:transparent}.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-6072cc1c],.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-6072cc1c]:focus,.with-nav-tabs.panel-default .nav-tabs>li.active>a[data-v-6072cc1c]:hover{color:#555;background-color:#fff;border-color:#ddd #ddd transparent}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu[data-v-6072cc1c]{background-color:#f5f5f5;border-color:#ddd}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-6072cc1c]{color:#777}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-6072cc1c]:focus,.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>li>a[data-v-6072cc1c]:hover{background-color:#ddd}.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-6072cc1c],.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-6072cc1c]:focus,.with-nav-tabs.panel-default .nav-tabs>li.dropdown .dropdown-menu>.active>a[data-v-6072cc1c]:hover{color:#fff;background-color:#555}",""]);const i=s},2401:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(3645),s=n.n(a)()((function(t){return t[1]}));s.push([t.id,".enter-active[data-v-00169edd],.leave-active[data-v-00169edd]{overflow:hidden;transition:height .2s linear}",""]);const i=s},5067:()=>{},7939:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});const a={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,n(1900).Z)(a,(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,"7626d1af",null).exports},2749:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});const a={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()}}};var s=n(3379),i=n.n(s),r=n(3234),o={insert:"head",singleton:!1};i()(r.Z,o);r.Z.locals;const l=(0,n(1900).Z)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel panel-default"},[n("div",{staticClass:"panel-heading",attrs:{role:"tab",id:t.slug()}},[n("h4",{staticClass:"panel-title"},[n("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}}},[n("i",{staticClass:"fa fa-chevron-down accordion-item-trigger-icon"}),t._v(" "),t.icon?n("i",{class:["fa","fa-fw",t.icon]}):t._e(),t._v("\n "+t._s(t.text||t.name)+"\n ")])])]),t._v(" "),n("transition-collapse-height",[t.isActive?n("div",{class:["panel-collapse","collapse",{in:t.isActive}],attrs:{id:t.slug()+"-content",role:"tabpanel"}},[n("div",{staticClass:"panel-body"},[t._t("default")],2)]):t._e()])],1)}),[],!1,null,"af5cb116",null).exports},7360:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});const a={name:"BaseSetting",props:{name:{type:String,required:!0},value:{required:!0},disabled:Boolean,required:Boolean,pattern:String,options:{}}};const s=(0,n(1900).Z)(a,undefined,undefined,!1,null,null,null).exports},3953:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});const a={mounted:function(){console.log("Component mounted.")}};const s=(0,n(1900).Z)(a,(function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)}),[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container"},[n("div",{staticClass:"row justify-content-center"},[n("div",{staticClass:"col-md-8"},[n("div",{staticClass:"card"},[n("div",{staticClass:"card-header"},[t._v("Example Component")]),t._v(" "),n("div",{staticClass:"card-body"},[t._v("\n I'm an example component.\n ")])])])])])}],!1,null,null,null).exports},8585:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});const a={name:"LibrenmsSetting",props:{setting:{type:Object,required:!0},prefix:{type:String,default:"settings"},id:{required:!1}},data:function(){return{value:this.setting.value,feedback:""}},methods:{persistValue:function(t){var e=this;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.feedback="has-success",setTimeout((function(){return e.feedback=""}),3e3)})).catch((function(t){e.feedback="has-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"}}};const s=(0,n(1900).Z)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["form-group","has-feedback",t.setting.class,t.feedback]},[n("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?n("span",[t._v("("+t._s(t.getUnits())+")")]):t._e()]),t._v(" "),n("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"},[n(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},on:{input:function(e){return t.changeValue(e)},change:function(e){return t.changeValue(e)}}}),t._v(" "),n("span",{staticClass:"form-control-feedback"})],1),t._v(" "),n("div",{staticClass:"col-sm-2"},[n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.$t("Reset to default")},expression:"{ content: $t('Reset to default') }"}],staticClass:"btn btn-default",style:{opacity:t.showResetToDefault()?1:0},attrs:{type:"button"},on:{click:t.resetToDefault}},[n("i",{staticClass:"fa fa-refresh"})]),t._v(" "),n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.$t("Undo")},expression:"{ content: $t('Undo') }"}],staticClass:"btn btn-primary",style:{opacity:t.showUndo()?1:0},attrs:{type:"button"},on:{click:t.resetToInitial}},[n("i",{staticClass:"fa fa-undo"})]),t._v(" "),t.hasHelp()?n("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,"55ffb6ad",null).exports},7302:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],a=!0,s=!1,i=void 0;try{for(var r,o=t[Symbol.iterator]();!(a=(r=o.next()).done)&&(n.push(r.value),!e||n.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==o.return||o.return()}finally{if(s)throw i}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))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 n=0,a=new Array(e);n
"+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"}}};var s=a(3379),i=a.n(s),o=a(9357),r={insert:"head",singleton:!1};i()(o.Z,r);o.Z.locals;const l=(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},7792:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>c});function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var a=[],n=!0,s=!1,i=void 0;try{for(var o,r=t[Symbol.iterator]();!(n=(o=r.next()).done)&&(a.push(o.value),!e||a.length!==e);n=!0);}catch(t){s=!0,i=t}finally{try{n||null==r.return||r.return()}finally{if(s)throw i}}return a}(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{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},6390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},619:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},2385:t=>{t.exports=function(t){return this.__data__.has(t)}},1814:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},61:(t,e,n)=>{var r=n(6560),i=n(1275)(r);t.exports=i},1275:t=>{var e=Date.now;t.exports=function(t){var n=0,r=0;return function(){var i=e(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},7465:(t,e,n)=>{var r=n(8407);t.exports=function(){this.__data__=new r,this.size=0}},3779:t=>{t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},7599:t=>{t.exports=function(t){return this.__data__.get(t)}},4758:t=>{t.exports=function(t){return this.__data__.has(t)}},4309:(t,e,n)=>{var r=n(8407),i=n(7071),o=n(3369);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},346:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},5703:t=>{t.exports=function(t){return function(){return t}}},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},6557:t=>{t.exports=function(t){return t}},5694:(t,e,n)=>{var r=n(9454),i=n(7005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),i=n(1780);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},9246:(t,e,n)=>{var r=n(8612),i=n(7005);t.exports=function(t){return i(t)&&r(t)}},4144:(t,e,n)=>{t=n.nmd(t);var r=n(5639),i=n(5062),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},8446:(t,e,n)=>{var r=n(939);t.exports=function(t,e){return r(t,e)}},3560:(t,e,n)=>{var r=n(4239),i=n(3218);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),i=n(5924),o=n(7005),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},6719:(t,e,n)=>{var r=n(8749),i=n(1717),o=n(1167),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},3674:(t,e,n)=>{var r=n(4636),i=n(280),o=n(8612);t.exports=function(t){return o(t)?r(t):i(t)}},1704:(t,e,n)=>{var r=n(4636),i=n(313),o=n(8612);t.exports=function(t){return o(t)?r(t,!0):i(t)}},6486:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=16,c=32,l=64,f=128,p=256,d=1/0,h=9007199254740991,v=NaN,g=4294967295,m=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",c],["partialRight",l],["rearg",p]],y="[object Arguments]",b="[object Array]",_="[object Boolean]",w="[object Date]",x="[object Error]",O="[object Function]",S="[object GeneratorFunction]",C="[object Map]",T="[object Number]",k="[object Object]",E="[object Promise]",$="[object RegExp]",A="[object Set]",j="[object String]",D="[object Symbol]",L="[object WeakMap]",P="[object ArrayBuffer]",I="[object DataView]",N="[object Float32Array]",M="[object Float64Array]",F="[object Int8Array]",R="[object Int16Array]",B="[object Int32Array]",V="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",U="[object Uint32Array]",W=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,Y=RegExp(K.source),J=RegExp(X.source),Z=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nt=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ot=RegExp(it.source),at=/^\s+|\s+$/g,st=/^\s+/,ut=/\s+$/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,ft=/,? & /,pt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dt=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,bt=/^0o[0-7]+$/i,_t=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xt=/($^)/,Ot=/['\n\r\u2028\u2029\\]/g,St="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ct="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",kt="A-Z\\xc0-\\xd6\\xd8-\\xde",Et="\\ufe0e\\ufe0f",$t="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="['’]",jt="[\\ud800-\\udfff]",Dt="["+$t+"]",Lt="["+St+"]",Pt="\\d+",It="[\\u2700-\\u27bf]",Nt="["+Tt+"]",Mt="[^\\ud800-\\udfff"+$t+Pt+Ct+Tt+kt+"]",Ft="\\ud83c[\\udffb-\\udfff]",Rt="[^\\ud800-\\udfff]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",zt="["+kt+"]",Ht="(?:"+Nt+"|"+Mt+")",Ut="(?:"+zt+"|"+Mt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gt="(?:"+Lt+"|"+Ft+")"+"?",Kt="[\\ufe0e\\ufe0f]?",Xt=Kt+Gt+("(?:\\u200d(?:"+[Rt,Bt,Vt].join("|")+")"+Kt+Gt+")*"),Yt="(?:"+[It,Bt,Vt].join("|")+")"+Xt,Jt="(?:"+[Rt+Lt+"?",Lt,Bt,Vt,jt].join("|")+")",Zt=RegExp(At,"g"),Qt=RegExp(Lt,"g"),te=RegExp(Ft+"(?="+Ft+")|"+Jt+Xt,"g"),ee=RegExp([zt+"?"+Nt+"+"+Wt+"(?="+[Dt,zt,"$"].join("|")+")",Ut+"+"+qt+"(?="+[Dt,zt+Ht,"$"].join("|")+")",zt+"?"+Ht+"+"+Wt,zt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Yt].join("|"),"g"),ne=RegExp("[\\u200d\\ud800-\\udfff"+St+Et+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ie=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ae={};ae[N]=ae[M]=ae[F]=ae[R]=ae[B]=ae[V]=ae[z]=ae[H]=ae[U]=!0,ae[y]=ae[b]=ae[P]=ae[_]=ae[I]=ae[w]=ae[x]=ae[O]=ae[C]=ae[T]=ae[k]=ae[$]=ae[A]=ae[j]=ae[L]=!1;var se={};se[y]=se[b]=se[P]=se[I]=se[_]=se[w]=se[N]=se[M]=se[F]=se[R]=se[B]=se[C]=se[T]=se[k]=se[$]=se[A]=se[j]=se[D]=se[V]=se[z]=se[H]=se[U]=!0,se[x]=se[O]=se[L]=!1;var ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ce=parseFloat,le=parseInt,fe="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,pe="object"==typeof self&&self&&self.Object===Object&&self,de=fe||pe||Function("return this")(),he=e&&!e.nodeType&&e,ve=he&&t&&!t.nodeType&&t,ge=ve&&ve.exports===he,me=ge&&fe.process,ye=function(){try{var t=ve&&ve.require&&ve.require("util").types;return t||me&&me.binding&&me.binding("util")}catch(t){}}(),be=ye&&ye.isArrayBuffer,_e=ye&&ye.isDate,we=ye&&ye.isMap,xe=ye&&ye.isRegExp,Oe=ye&&ye.isSet,Se=ye&&ye.isTypedArray;function Ce(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Te(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1},Gn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Kn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Tn||Gn),string:new qn}},Kn.prototype.delete=function(t){var e=lo(this,t).delete(t);return this.size-=e?1:0,e},Kn.prototype.get=function(t){return lo(this,t).get(t)},Kn.prototype.has=function(t){return lo(this,t).has(t)},Kn.prototype.set=function(t,e){var n=lo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(t){return this.__data__.set(t,a),this},Xn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Gn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Gn){var r=n.__data__;if(!Tn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(t,e),this.size=n.size,this};var dr=Pi(wr),hr=Pi(xr,!0);function vr(t,e){var n=!0;return dr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function gr(t,e,n){for(var r=-1,o=t.length;++r