UNPKG

camera.ui

Version:

NVR like user interface for RTSP capable cameras.

1 lines 18.7 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["start"],{"1ae4":function(t,e,r){t.exports=r.p+"img/logo.1e20fc7f.svg"},"20b6":function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return c})),r.d(e,"c",(function(){return u}));var s=r("1da1"),n=(r("96cf"),r("99af"),r("365c")),i="/settings",a="reset",o=function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e,r,s){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n["a"].patch("".concat(i,"/").concat(e).concat(s||""),r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,r,s){return t.apply(this,arguments)}}(),c=function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e,r){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n["a"].get("".concat(i,"/").concat(e).concat(r||""));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),u=function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n["a"].put("".concat(i,"/").concat(a));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},"3a4f":function(t,e,r){},"4bd4":function(t,e,r){"use strict";var s=r("5530"),n=(r("caad"),r("2532"),r("07ac"),r("4de4"),r("d3b7"),r("159b"),r("7db0"),r("58df")),i=r("7e2b"),a=r("3206");e["a"]=Object(n["a"])(i["a"],Object(a["b"])("form")).extend({name:"v-form",provide:function(){return{form:this}},inheritAttrs:!1,props:{disabled:Boolean,lazyValidation:Boolean,readonly:Boolean,value:Boolean},data:function(){return{inputs:[],watchers:[],errorBag:{}}},watch:{errorBag:{handler:function(t){var e=Object.values(t).includes(!0);this.$emit("input",!e)},deep:!0,immediate:!0}},methods:{watchInput:function(t){var e=this,r=function(t){return t.$watch("hasError",(function(r){e.$set(e.errorBag,t._uid,r)}),{immediate:!0})},s={_uid:t._uid,valid:function(){},shouldValidate:function(){}};return this.lazyValidation?s.shouldValidate=t.$watch("shouldValidate",(function(n){n&&(e.errorBag.hasOwnProperty(t._uid)||(s.valid=r(t)))})):s.valid=r(t),s},validate:function(){return 0===this.inputs.filter((function(t){return!t.validate(!0)})).length},reset:function(){this.inputs.forEach((function(t){return t.reset()})),this.resetErrorBag()},resetErrorBag:function(){var t=this;this.lazyValidation&&setTimeout((function(){t.errorBag={}}),0)},resetValidation:function(){this.inputs.forEach((function(t){return t.resetValidation()})),this.resetErrorBag()},register:function(t){this.inputs.push(t),this.watchers.push(this.watchInput(t))},unregister:function(t){var e=this.inputs.find((function(e){return e._uid===t._uid}));if(e){var r=this.watchers.find((function(t){return t._uid===e._uid}));r&&(r.valid(),r.shouldValidate()),this.watchers=this.watchers.filter((function(t){return t._uid!==e._uid})),this.inputs=this.inputs.filter((function(t){return t._uid!==e._uid})),this.$delete(this.errorBag,e._uid)}}},render:function(t){var e=this;return t("form",{staticClass:"v-form",attrs:Object(s["a"])({novalidate:!0},this.attrs$),on:{submit:function(t){return e.$emit("submit",t)}}},this.$slots.default)}})},"6ca0":function(t,e,r){"use strict";r.d(e,"a",(function(){return a})),r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return c})),r.d(e,"d",(function(){return u}));var s=r("1da1"),n=(r("96cf"),r("365c")),i="/users",a=function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n["a"].post(i,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),o=function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e,r){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n["a"].patch("".concat(i,"/").concat(e),r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),c=function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n["a"].get("".concat(i).concat(e||""));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n["a"].delete("".concat(i,"/").concat(e));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},8836:function(t,e,r){},b615:function(t,e,r){"use strict";r("3a4f")},dfd9:function(t,e,r){"use strict";r.r(e);var s=function(){var t=this,e=t.$createElement,s=t._self._c||e;return t.loading?s("div",{staticClass:"tw-flex tw-justify-center tw-items-center page-loading"},[s("v-progress-circular",{attrs:{indeterminate:"",color:"var(--cui-primary)"}})],1):s("div",{staticClass:"tw-w-full tw-flex tw-justify-center tw-items-center",staticStyle:{"min-height":"100vh"}},[s("v-stepper",{staticClass:"start",model:{value:t.e1,callback:function(e){t.e1=e},expression:"e1"}},[s("v-stepper-header",{staticClass:"start-header"},[s("v-stepper-step",{attrs:{complete:t.e1>1,step:"1"}}),s("v-divider"),s("v-stepper-step",{attrs:{complete:t.e1>2,step:"2"}}),s("v-divider"),s("v-stepper-step",{attrs:{step:"3"}})],1),s("v-stepper-items",[s("v-stepper-content",{staticClass:"start-wrapper",attrs:{step:"1"}},[s("v-card",{staticClass:"start-content tw-flex tw-justify-center tw-items-center tw-flex-col",attrs:{height:"320px"}},[s("div",{staticClass:"tw-block"},[s("v-img",{attrs:{src:r("1ae4"),width:"42",height:"50"}})],1),s("h5",{staticClass:"tw-text-xl tw-font-light tw-mt-3"},[t._v(t._s(t.$t("welcome_message")))]),s("h1",{staticClass:"tw-text-4xl tw-font-black tw-leading-7"},[t._v("camera.ui")]),s("div",{staticClass:"tw-mt-5 text-muted tw-text-center tw-text-sm"},[t._v(t._s(t.startMsg1)),s("br"),t._v(t._s(t.startMsg2))])]),s("div",{staticClass:"tw-flex tw-justify-center"},[s("v-btn",{staticClass:"tw-text-white tw-my-5",attrs:{color:"var(--cui-primary)"},on:{click:function(e){t.e1=2}}},[t._v(t._s(t.$t("start")))])],1)],1),s("v-stepper-content",{staticClass:"start-wrapper",attrs:{step:"2"}},[s("v-card",{staticClass:"start-content tw-flex tw-justify-center tw-items-center tw-flex-col",attrs:{height:"320px"}},[t.loadingProgress?s("div",{staticClass:"loading"},[s("v-progress-circular",{attrs:{indeterminate:"",color:"var(--cui-primary)"}})],1):s("v-form",{ref:"form",staticClass:"login-content tw-mt-5 tw-w-full",attrs:{"lazy-validation":""},on:{submit:function(e){return e.preventDefault(),t.change.apply(null,arguments)}},model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[s("span",{staticClass:"login-input-label"},[t._v(t._s(t.$t("username")))]),s("v-text-field",{ref:"name",staticClass:"tw-my-0 login-input tw-text-white",attrs:{required:"",rules:t.rules.username,solo:"","background-color":"rgba(var(--cui-menu-default-rgb), 0.7)",color:"var(--cui-primary)",label:t.$t("username")},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),s("span",{staticClass:"login-input-label"},[t._v(t._s(t.$t("new_password")))]),s("v-text-field",{ref:"password",staticClass:"tw-my-0 login-input",attrs:{required:"",rules:t.rules.password,solo:"","background-color":"rgba(var(--cui-menu-default-rgb), 0.7)",color:"var(--cui-primary)",label:t.$t("password"),type:t.showPassword?"text":"password","append-icon":t.showPassword?t.icons["mdiEye"]:t.icons["mdiEyeOff"]},on:{"click:append":function(e){t.showPassword=!t.showPassword}},model:{value:t.password,callback:function(e){t.password=e},expression:"password"}}),s("span",{staticClass:"login-input-label"},[t._v(t._s(t.$t("new_password_verify")))]),s("v-text-field",{ref:"password2",staticClass:"tw-my-0 login-input",attrs:{required:"",rules:t.rules.password2,solo:"","background-color":"rgba(var(--cui-menu-default-rgb), 0.7)",color:"var(--cui-primary)",label:t.$t("password"),type:t.showPassword2?"text":"password","append-icon":t.showPassword2?t.icons["mdiEye"]:t.icons["mdiEyeOff"]},on:{"click:append":function(e){t.showPassword2=!t.showPassword2}},model:{value:t.password2,callback:function(e){t.password2=e},expression:"password2"}})],1)],1),s("div",{staticClass:"tw-flex tw-justify-center"},[s("v-btn",{staticClass:"tw-text-white tw-my-5",attrs:{color:"var(--cui-primary)"},on:{click:t.change}},[t._v(t._s(t.$t("change")))])],1)],1),s("v-stepper-content",{staticClass:"start-wrapper",attrs:{step:"3"}},[s("v-card",{staticClass:"start-content tw-flex tw-justify-center tw-items-center tw-flex-col",attrs:{height:"320px"}},[s("div",{staticClass:"tw-block"},[s("inline-svg",{attrs:{src:r("db67"),title:"camera.ui","aria-label":"camera.ui",width:"78px",height:"84px"}})],1),s("div",{staticClass:"tw-mt-8 text-muted tw-text-center tw-text-base"},[s("strong",{staticClass:"tw-text-white"},[t._v(t._s(t.endMsg1))]),s("br"),t._v(t._s(t.endMsg2))])]),s("div",{staticClass:"tw-flex tw-justify-center"},[s("v-btn",{staticClass:"tw-text-white tw-my-5",attrs:{color:"var(--cui-primary)"},on:{click:t.signout}},[t._v(t._s(t.$t("signin")))])],1)],1)],1)],1)],1)},n=[],i=r("1da1"),a=(r("96cf"),r("d3b7"),r("ac1f"),r("1276"),r("498a"),r("b0c0"),r("6d5e")),o=r.n(a),c=r("94ed"),u=r("6ca0"),p=r("20b6"),l=r("5cf0"),h=function(t){return new Promise((function(e){return setTimeout(e,t)}))},d={name:"Start",components:{InlineSvg:o.a},data:function(){return{loading:!0,loadingProgress:!1,icons:{mdiEye:c["R"],mdiEyeOff:c["S"]},startMsg1:this.$t("start_info_message").split(" <br>")[0],startMsg2:this.$t("start_info_message").split("<br> ")[1],endMsg1:this.$t("start_end_message").split(" <br>")[0],endMsg2:this.$t("start_end_message").split("<br> ")[1],e1:1,name:"",password:"",password2:"",rules:{username:[],password:[],password2:[]},showPassword:!1,showPassword2:!1,valid:!0}},computed:{currentUser:function(){return this.$store.state.auth.user}},created:function(){var t=this;this.rules={username:[function(e){return!!e&&!!e.trim()||t.$t("username_is_required")},function(e){return"master"!==e||t.$t("invalid_username")}],password:[function(e){return!!e&&!!e.trim()||t.$t("password_is_required")},function(e){return"master"!==e||t.$t("invalid_password")}],password2:[function(e){return e?e===t.password||t.$t("password_not_match"):!t.password||t.$t("password_reenter")}]}},mounted:function(){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function e(){var r,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(l["c"])();case 3:if(r=e.sent,s=r.data.firstStart,s){e.next=7;break}return e.abrupt("return",t.$router.push("/dashboard"));case 7:t.loading=!1,e.next=14;break;case 10:e.prev=10,e.t0=e["catch"](0),console.log(e.t0),t.$toast.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))()},methods:{change:function(){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.loadingProgress=!0,r=t.$refs.form.validate(),!r){e.next=19;break}return e.next=5,h(500);case 5:return e.prev=5,e.next=8,Object(u["b"])(t.currentUser.username,{username:t.name,password:t.password});case 8:return e.next=10,Object(p["a"])("firstStart",{firstStart:!1},"?all=true");case 10:t.$toast.success(t.$t("successfully_changed")),t.e1=3,e.next=19;break;case 14:e.prev=14,e.t0=e["catch"](5),console.log(e.t0),t.$toast.error(e.t0.message),t.e1=1;case 19:t.loadingProgress=!1;case 20:case"end":return e.stop()}}),e,null,[[5,14]])})))()},signout:function(){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("auth/logout");case 2:setTimeout((function(){return t.$router.push("/")}),200);case 3:case"end":return e.stop()}}),e)})))()}}},f=d,v=(r("b615"),r("2877")),m=r("6544"),w=r.n(m),g=r("8336"),b=r("b0af"),_=r("ce7e"),x=r("4bd4"),y=r("adda"),$=r("490a"),C=r("5530"),k=(r("0481"),r("4069"),r("a9e3"),r("4de4"),r("8836"),r("10d2")),j=r("3206"),V=r("a452"),O=r("58df"),R=r("d9bd"),S=Object(O["a"])(k["a"],Object(j["b"])("stepper"),V["a"]),B=S.extend({name:"v-stepper",provide:function(){return{stepClick:this.stepClick,isVertical:this.vertical}},props:{altLabels:Boolean,nonLinear:Boolean,flat:Boolean,vertical:Boolean},data:function(){var t={isBooted:!1,steps:[],content:[],isReverse:!1};return t.internalLazyValue=null!=this.value?this.value:(t[0]||{}).step||1,t},computed:{classes:function(){return Object(C["a"])({"v-stepper--flat":this.flat,"v-stepper--is-booted":this.isBooted,"v-stepper--vertical":this.vertical,"v-stepper--alt-labels":this.altLabels,"v-stepper--non-linear":this.nonLinear},k["a"].options.computed.classes.call(this))},styles:function(){return Object(C["a"])({},k["a"].options.computed.styles.call(this))}},watch:{internalValue:function(t,e){this.isReverse=Number(t)<Number(e),e&&(this.isBooted=!0),this.updateView()}},created:function(){this.$listeners.input&&Object(R["a"])("@input","@change",this)},mounted:function(){this.updateView()},methods:{register:function(t){"v-stepper-step"===t.$options.name?this.steps.push(t):"v-stepper-content"===t.$options.name&&(t.isVertical=this.vertical,this.content.push(t))},unregister:function(t){"v-stepper-step"===t.$options.name?this.steps=this.steps.filter((function(e){return e!==t})):"v-stepper-content"===t.$options.name&&(t.isVertical=this.vertical,this.content=this.content.filter((function(e){return e!==t})))},stepClick:function(t){var e=this;this.$nextTick((function(){return e.internalValue=t}))},updateView:function(){for(var t=this.steps.length;--t>=0;)this.steps[t].toggle(this.internalValue);for(var e=this.content.length;--e>=0;)this.content[e].toggle(this.internalValue,this.isReverse)}},render:function(t){return t(this.tag,{staticClass:"v-stepper",class:this.classes,style:this.styles},this.$slots.default)}}),E=(r("25f0"),r("0789")),P=r("80d2"),I=Object(O["a"])(Object(j["a"])("stepper","v-stepper-content","v-stepper")),A=I.extend().extend({name:"v-stepper-content",inject:{isVerticalProvided:{from:"isVertical"}},props:{step:{type:[Number,String],required:!0}},data:function(){return{height:0,isActive:null,isReverse:!1,isVertical:this.isVerticalProvided}},computed:{computedTransition:function(){var t=this.$vuetify.rtl?!this.isReverse:this.isReverse;return t?E["g"]:E["h"]},styles:function(){return this.isVertical?{height:Object(P["h"])(this.height)}:{}}},watch:{isActive:function(t,e){t&&null==e?this.height="auto":this.isVertical&&(this.isActive?this.enter():this.leave())}},mounted:function(){this.$refs.wrapper.addEventListener("transitionend",this.onTransition,!1),this.stepper&&this.stepper.register(this)},beforeDestroy:function(){this.$refs.wrapper.removeEventListener("transitionend",this.onTransition,!1),this.stepper&&this.stepper.unregister(this)},methods:{onTransition:function(t){this.isActive&&"height"===t.propertyName&&(this.height="auto")},enter:function(){var t=this,e=0;requestAnimationFrame((function(){e=t.$refs.wrapper.scrollHeight})),this.height=0,setTimeout((function(){return t.isActive&&(t.height=e||"auto")}),450)},leave:function(){var t=this;this.height=this.$refs.wrapper.clientHeight,setTimeout((function(){return t.height=0}),10)},toggle:function(t,e){this.isActive=t.toString()===this.step.toString(),this.isReverse=e}},render:function(t){var e={staticClass:"v-stepper__content"},r={staticClass:"v-stepper__wrapper",style:this.styles,ref:"wrapper"};this.isVertical||(e.directives=[{name:"show",value:this.isActive}]);var s=t("div",r,[this.$slots.default]),n=t("div",e,[s]);return t(this.computedTransition,{on:this.$listeners},[n])}}),T=r("9d26"),L=r("a9ad"),M=r("5607"),q=Object(O["a"])(L["a"],Object(j["a"])("stepper","v-stepper-step","v-stepper")),N=q.extend().extend({name:"v-stepper-step",directives:{ripple:M["a"]},inject:["stepClick"],props:{color:{type:String,default:"primary"},complete:Boolean,completeIcon:{type:String,default:"$complete"},editable:Boolean,editIcon:{type:String,default:"$edit"},errorIcon:{type:String,default:"$error"},rules:{type:Array,default:function(){return[]}},step:[Number,String]},data:function(){return{isActive:!1,isInactive:!0}},computed:{classes:function(){return{"v-stepper__step--active":this.isActive,"v-stepper__step--editable":this.editable,"v-stepper__step--inactive":this.isInactive,"v-stepper__step--error error--text":this.hasError,"v-stepper__step--complete":this.complete}},hasError:function(){return this.rules.some((function(t){return!0!==t()}))}},mounted:function(){this.stepper&&this.stepper.register(this)},beforeDestroy:function(){this.stepper&&this.stepper.unregister(this)},methods:{click:function(t){t.stopPropagation(),this.$emit("click",t),this.editable&&this.stepClick(this.step)},genIcon:function(t){return this.$createElement(T["a"],t)},genLabel:function(){return this.$createElement("div",{staticClass:"v-stepper__label"},this.$slots.default)},genStep:function(){var t=!(this.hasError||!this.complete&&!this.isActive)&&this.color;return this.$createElement("span",this.setBackgroundColor(t,{staticClass:"v-stepper__step__step"}),this.genStepContent())},genStepContent:function(){var t=[];return this.hasError?t.push(this.genIcon(this.errorIcon)):this.complete?this.editable?t.push(this.genIcon(this.editIcon)):t.push(this.genIcon(this.completeIcon)):t.push(String(this.step)),t},keyboardClick:function(t){t.keyCode===P["z"].space&&this.click(t)},toggle:function(t){this.isActive=t.toString()===this.step.toString(),this.isInactive=Number(t)<Number(this.step)}},render:function(t){return t("div",{attrs:{tabindex:this.editable?0:-1},staticClass:"v-stepper__step",class:this.classes,directives:[{name:"ripple",value:this.editable}],on:{click:this.click,keydown:this.keyboardClick}},[this.genStep(),this.genLabel()])}}),z=Object(P["j"])("v-stepper__header"),D=Object(P["j"])("v-stepper__items"),F=r("8654"),H=Object(v["a"])(f,s,n,!1,null,"86aed544",null);e["default"]=H.exports;w()(H,{VBtn:g["a"],VCard:b["a"],VDivider:_["a"],VForm:x["a"],VImg:y["a"],VProgressCircular:$["a"],VStepper:B,VStepperContent:A,VStepperHeader:z,VStepperItems:D,VStepperStep:N,VTextField:F["a"]})}}]);