Files
vuefilemanager/public/js/chunks/settings-storage.js
2022-02-01 11:36:25 +01:00

1 line
11 KiB
JavaScript
Vendored

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[915],{7756:(t,e,a)=>{a.d(e,{Z:()=>o});var r=a(3645),s=a.n(r)()((function(t){return t[1]}));s.push([t.id,".label[data-v-65eb31b6]{align-items:center;display:flex}.label .label-dot[data-v-65eb31b6]{border-radius:8px;display:block;flex:none;height:8px;margin-right:10px;width:8px}.label .label-dot.success[data-v-65eb31b6]{background:#0abb87}.label .label-dot.danger[data-v-65eb31b6]{background:#fd397a}.label .label-dot.warning[data-v-65eb31b6]{background:#ffb822}.label .label-dot.info[data-v-65eb31b6]{background:#5578eb}.label .label-dot.primary[data-v-65eb31b6]{background:red}.label .label-dot.purple[data-v-65eb31b6]{background:#9d66fe}.label .label-dot.secondary[data-v-65eb31b6]{background:#e1e1ef}.label .label-title[data-v-65eb31b6]{font-size:16px;font-weight:700}",""]);const o=s},5031:(t,e,a)=>{a.d(e,{Z:()=>o});var r=a(3645),s=a.n(r)()((function(t){return t[1]}));s.push([t.id,".chart-progress.success[data-v-1996acd4]{background:#0abb87;box-shadow:0 3px 10px rgba(10,187,135,.5)}.chart-progress.danger[data-v-1996acd4]{background:#fd397a;box-shadow:0 3px 10px rgba(253,57,122,.5)}.chart-progress.warning[data-v-1996acd4]{background:#ffb822;box-shadow:0 3px 10px rgba(255,184,34,.5)}.chart-progress.info[data-v-1996acd4]{background:#5578eb;box-shadow:0 3px 10px rgba(85,120,235,.5)}.chart-progress.purple[data-v-1996acd4]{background:#9d66fe;box-shadow:0 3px 10px rgba(157,102,254,.5)}.chart-progress.secondary[data-v-1996acd4]{background:#e1e1ef;box-shadow:0 3px 10px rgba(225,225,239,.5)}.dark .chart-progress.secondary[data-v-1996acd4]{background:#282a2f!important;box-shadow:0 3px 10px rgba(40,42,47,.5)!important}",""]);const o=s},3469:(t,e,a)=>{a.d(e,{Z:()=>o});var r=a(3645),s=a.n(r)()((function(t){return t[1]}));s.push([t.id,"",""]);const o=s},1776:(t,e,a)=>{a.d(e,{Z:()=>u});const r={name:"DotLabel",props:["color","title"]};var s=a(3379),o=a.n(s),n=a(7756),l={insert:"head",singleton:!1};o()(n.Z,l);n.Z.locals;var i=a(1900);const c={name:"ProgressLine",props:["data"],components:{DotLabel:(0,i.Z)(r,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"label"},[a("span",{class:["label-dot",t.color]}),t._v(" "),a("b",{staticClass:"label-title"},[t._v("\n "+t._s(t.title)+"\n ")])])}),[],!1,null,"65eb31b6",null).exports}};var d=a(5031),b={insert:"head",singleton:!1};o()(d.Z,b);d.Z.locals;const u=(0,i.Z)(c,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"flex items-center mb-4 rounded dark:bg-2x-dark-foreground bg-light-300 h-2.5"},t._l(t.data,(function(e,r){return a("div",{key:r,staticClass:"chart-wrapper",style:{width:(e.progress>1?e.progress:0)+"%"}},[1===t.data.length?a("span",{staticClass:"chart-progress w-full h-2.5 block",class:[{"border-r-2 dark:border-gray-800 border-white rounded-tl-lg rounded-bl-lg":e.progress<100,"border-none rounded-lg":e.progress>=100},e.color]}):t._e(),t._v(" "),t.data.length>1&&e.progress>0?a("span",{staticClass:"chart-progress w-full h-2.5 block",class:[{"rounded-tl-lg rounded-bl-lg border-r-2 dark:border-gray-800 border-white":0===r,"border-r-2 dark:border-gray-800 border-white":r<t.data.length-1,"rounded-tr-lg rounded-br-lg":r===t.data.length-1},e.color]}):t._e()])})),0),t._v(" "),a("footer",{staticClass:"flex items-center w-full overflow-x-auto"},t._l(t.data,(function(t,e){return a("DotLabel",{key:e,staticClass:"mr-5",attrs:{color:t.color,title:t.title}})})),1)])}),[],!1,null,"1996acd4",null).exports},6589:(t,e,a)=>{a.d(e,{Z:()=>o});var r=a(9101);const s={name:"FormLabel",props:["icon"],components:{UsersIcon:r.oyc,CreditCardIcon:r.ciH,DollarSignIcon:r.bkH,SmartphoneIcon:r.BEV,HardDriveIcon:r.zvn,BarChartIcon:r.eJP,SettingsIcon:r.ewm,FileTextIcon:r.zPP,ShieldIcon:r.b7C,FrownIcon:r.eFi,Edit2Icon:r.me4,BellIcon:r.Dkj,KeyIcon:r._m8}};const o=(0,a(1900).Z)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"flex items-center mb-8"},[t.icon?t._e():a("edit-2-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}),t._v(" "),"frown"===t.icon?a("frown-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"file-text"===t.icon?a("file-text-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"dollar"===t.icon?a("dollar-sign-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"credit-card"===t.icon?a("credit-card-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"bar-chart"===t.icon?a("bar-chart-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"settings"===t.icon?a("settings-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"hard-drive"===t.icon?a("hard-drive-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"smartphone"===t.icon?a("smartphone-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"shield"===t.icon?a("shield-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"bell"===t.icon?a("bell-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"key"===t.icon?a("key-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"users"===t.icon?a("users-icon",{staticClass:"mr-3 vue-feather text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),a("b",{staticClass:"font-bold dark:text-gray-200 sm:text-lg text-md"},[t._t("default")],2)],1)}),[],!1,null,null,null).exports},6116:(t,e,a)=>{a.d(e,{Z:()=>i});const r={name:"PageTab",props:["isLoading"],components:{Spinner:a(5462).Z}};var s=a(3379),o=a.n(s),n=a(3469),l={insert:"head",singleton:!1};o()(n.Z,l);n.Z.locals;const i=(0,a(1900).Z)(r,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page-tab"},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.isLoading,expression:"isLoading"}],attrs:{id:"loader"}},[a("Spinner")],1),t._v(" "),t._t("default")],2)}),[],!1,null,"9ad56666",null).exports},7181:(t,e,a)=>{a.d(e,{Z:()=>n});const r={name:"Bar",props:["bar"],data:function(){return{isVisible:!1}}};var s=a(1900);const o={name:"BarChart",props:["color","data"],components:{Bar:(0,s.Z)(r,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"2xl:w-3 lg:w-2 block lg:mr-2 relative cursor-pointer",style:{height:t.bar.percentage+"%"},on:{mouseover:function(e){t.isVisible=!0},mouseleave:function(e){t.isVisible=!1}}},[t.isVisible?a("div",{staticClass:"absolute transform -translate-y-full -translate-x-1/2 -top-4 ml-1.5 dark:bg-white bg-gray-800 rounded-lg shadow-lg py-2 px-3 z-10"},[a("b",{staticClass:"dark:text-gray-800 text-white text-xs whitespace-nowrap block mb-2"},[t._v("\n\t\t\t"+t._s(t.bar.created_at)+"\n\t\t")]),t._v(" "),a("div",{staticClass:"flex items-center pb-1"},[a("span",{staticClass:"w-3 h-3 block bg-theme mr-2 rounded"}),t._v(" "),a("b",{staticClass:"dark:text-gray-800 text-white text-xs whitespace-nowrap"},[t._v("\n\t\t\t\t"+t._s(t.bar.amount)+"\n\t\t\t")])]),t._v(" "),t._m(0)]):t._e(),t._v(" "),a("span",{staticClass:"bg-theme w-full h-full block rounded-lg"})])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"w-5 overflow-hidden inline-block absolute -bottom-2.5 left-0 right-0 mx-auto"},[e("div",{staticClass:"h-3 w-3 dark:bg-white bg-gray-800 -rotate-45 transform origin-top-left"})])}],!1,null,null,null).exports},computed:{ghostLength:function(){return 45-this.data.length}}};const n=(0,s.Z)(o,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"lg:flex lg:items-end lg:justify-between grid grid-flow-col lg:gap-0 sm:gap-2 gap-1 items-end sm:h-28 h-20"},[t._l(t.data,(function(t,e){return a("Bar",{key:e,attrs:{bar:t}})})),t._v(" "),t._l(t.ghostLength,(function(e,r){return t.ghostLength>0?a("span",{key:r,staticClass:"2xl:w-3 lg:w-2 block lg:mr-2 relative cursor-pointer dark:bg-gray-800 bg-gray-100",style:{height:"7%"}}):t._e()}))],2)}),[],!1,null,null,null).exports},8353:(t,e,a)=>{a.r(e),a.d(e,{default:()=>g});var r=a(1776),s=a(6589),o=a(6116),n=a(9669),l=a.n(n),i=a(7181),c=a(629);function d(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function b(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const u={name:"Storage",components:{BarChart:i.Z,ProgressLine:r.Z,FormLabel:s.Z,PageTab:o.Z},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?d(Object(a),!0).forEach((function(e){b(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):d(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},(0,c.Se)(["config"])),data:function(){return{isLoading:!0,distribution:void 0,storage:void 0}},created:function(){var t=this;l().get("/api/user/storage").then((function(e){t.distribution=t.$mapStorageUsage(e.data),t.storage=e.data,t.isLoading=!1}))}};const g=(0,a(1900).Z)(u,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("PageTab",[t.distribution?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"hard-drive"}},[t._v("\n "+t._s(t.$t("Storage Usage"))+"\n ")]),t._v(" "),a("b",{staticClass:"sm:text-3xl text-2xl font-extrabold -mt-3 block"},[t._v("\n\t\t\t\t"+t._s(t.storage.data.attributes.used)+"\n\t\t\t")]),t._v(" "),"fixed"===t.config.subscriptionType||"none"===t.config.subscriptionType&&t.config.storageLimit?a("b",{staticClass:"mt-0.5 block text-sm text-gray-400"},[t._v("\n\t\t\t\t"+t._s(t.$t("Total of"))+" "+t._s(t.storage.data.attributes.capacity)+" "+t._s(t.$t("Used"))+"\n\t\t\t")]):t._e(),t._v(" "),a("ProgressLine",{staticClass:"mt-5",attrs:{data:t.distribution}})],1):t._e(),t._v(" "),t.distribution?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"hard-drive"}},[t._v("\n "+t._s(t.$t("Upload"))+"\n ")]),t._v(" "),a("b",{staticClass:"sm:text-3xl text-2xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t\t\t"+t._s(t.storage.data.meta.traffic.upload)+"\n\t\t\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-5"},[t._v("\n\t\t\t\t"+t._s(t.$t("In last 45 days"))+"\n\t\t\t")]),t._v(" "),a("BarChart",{attrs:{data:t.storage.data.meta.traffic.chart.upload,color:"#FFBD2D"}})],1):t._e(),t._v(" "),t.distribution?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"hard-drive"}},[t._v("\n "+t._s(t.$t("Download"))+"\n ")]),t._v(" "),a("b",{staticClass:"sm:text-3xl text-2xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t\t\t"+t._s(t.storage.data.meta.traffic.download)+"\n\t\t\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-5"},[t._v("\n\t\t\t\t"+t._s(t.$t("In last 45 days"))+"\n\t\t\t")]),t._v(" "),a("BarChart",{attrs:{data:t.storage.data.meta.traffic.chart.download,color:"#9d66fe"}})],1):t._e()])}),[],!1,null,null,null).exports}}]);