import{_ as c,z as D,D as m,A as x,c as i,a as o,b as t,t as S,m as l,y as u,f as p,d as n,F as $,i as w,h as r,w as I}from"./index-BQYwwrw6.js";import{P}from"./peersDefaultSettingsInput-De2pvmfF.js";import{A as k,a as A,D as y,b as C,c as V,d as F,e as T,_ as L}from"./dashboardEmailSettings-p_Bw0Z58.js";import{D as R,a as W}from"./dashboardSettingsWireguardConfigurationAutostart-cyw0vUzN.js";import{L as U}from"./localeText-C3GiyveB.js";import"./dayjs.min-CzHDLgWx.js";import"./vue-datepicker-g3vsoQR2.js";const B={name:"dashboardSettingsInputIPAddressAndPort",props:{},setup(){const e=m(),s=`input_${x()}`;return{store:e,uuid:s}},data(){return{app_ip:"",app_port:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.app_ip=this.store.Configuration.Server.app_ip,this.app_port=this.store.Configuration.Server.app_port},methods:{async useValidation(){this.changed&&await D("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},e=>{e.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=e.message)})}}},G={class:"invalid-feedback d-block mt-0"},N={class:"row"},E={class:"form-group mb-2 col-sm"},M=["for"],j=["id"],z={class:"form-group col-sm"},K=["for"],q=["id"];function H(e,s,h,_,b,f){return o(),i("div",null,[t("div",G,S(this.invalidFeedback),1),t("div",N,[t("div",E,[t("label",{for:"app_ip_"+this.uuid,class:"text-muted mb-1"},[...s[2]||(s[2]=[t("strong",null,[t("small",null,"Dashboard IP Address")],-1)])],8,M),l(t("input",{type:"text",class:"form-control mb-2",id:"app_ip_"+this.uuid,"onUpdate:modelValue":s[0]||(s[0]=a=>this.app_ip=a)},null,8,j),[[u,this.app_ip]]),s[3]||(s[3]=t("div",{class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block"},[t("small",null,[t("i",{class:"bi bi-exclamation-triangle-fill me-2"}),t("code",null,"0.0.0.0"),p(" means it can be access by anyone with your server IP Address.")])],-1))]),t("div",z,[t("label",{for:"app_port_"+this.uuid,class:"text-muted mb-1"},[...s[4]||(s[4]=[t("strong",null,[t("small",null,"Dashboard Port")],-1)])],8,K),l(t("input",{type:"text",class:"form-control mb-2",id:"app_port_"+this.uuid,"onUpdate:modelValue":s[1]||(s[1]=a=>this.app_port=a)},null,8,q),[[u,this.app_port]])])]),s[5]||(s[5]=t("button",{class:"btn btn-success btn-sm fw-bold rounded-3"},[t("i",{class:"bi bi-floppy-fill me-2"}),p("Update Dashboard Settings & Restart ")],-1))])}const J=c(B,[["render",H]]),O={name:"settings",components:{DashboardEmailSettings:L,DashboardSettingsWireguardConfigurationAutostart:W,DashboardIPPortInput:T,DashboardLanguage:F,LocaleText:U,AccountSettingsMFA:V,DashboardAPIKeys:C,DashboardSettingsInputIPAddressAndPort:J,DashboardTheme:y,DashboardSettingsInputWireguardConfigurationPath:R,AccountSettingsInputPassword:A,AccountSettingsInputUsername:k,PeersDefaultSettingsInput:P},setup(){return{dashboardConfigurationStore:m()}},data(){return{activeTab:"WGDashboard",tabs:[{id:"",title:"WGDashboard Settings"},{id:"peers_settings",title:"Peers Settings"},{id:"wireguard_settings",title:"WireGuard Configuration Settings"}]}}},Q={class:"mt-md-5 mt-3 text-body mb-3"},X={class:"container-md d-flex flex-column gap-3"},Y={class:"border-bottom pb-3"},Z={class:"nav nav-pills nav-justified align-items-center gap-2"},tt={class:"nav-item"},st={class:"my-2"};function et(e,s,h,_,b,f){const a=r("LocaleText"),g=r("RouterLink"),v=r("RouterView");return o(),i("div",Q,[t("div",X,[t("div",Y,[t("ul",Z,[(o(!0),i($,null,w(this.tabs,d=>(o(),i("li",tt,[n(g,{to:{name:d.title},class:"nav-link rounded-3","exact-active-class":"active",role:"button"},{default:I(()=>[t("h6",st,[n(a,{t:d.title},null,8,["t"])])]),_:2},1032,["to"])]))),256))])]),n(v)])])}const ut=c(O,[["render",et]]);export{ut as default};
