nextcloud/dist/dashboard-main.js

3 lines
51 KiB
JavaScript
Raw Permalink Normal View History

/*! For license information please see dashboard-main.js.LICENSE.txt */
(()=>{"use strict";var e,n={53226:(e,n,a)=>{var i=a(20144),s=a(79753),o=a(77958),r=a(79954),l=a(4820),d=a(10861),c=a.n(d),p=a(9980),u=a.n(p),A=a(70110),h=a.n(A),g=a(73229);const b={data(){return{isMobile:this._isMobile()}},beforeMount(){window.addEventListener("resize",this._onResize)},beforeDestroy(){window.removeEventListener("resize",this._onResize)},methods:{_onResize(){this.isMobile=this._isMobile()},_isMobile:()=>document.documentElement.clientWidth<768}};var m=a(15961),v=a(80419);const f={name:"ApiDashboardWidget",components:{NcAvatar:m.Xn,NcDashboardWidget:m.YJ,NcDashboardWidgetItem:m._2,NcEmptyContent:m.SL,NcButton:m.P2,CheckIcon:v.default},props:{widget:{type:[Object,void 0],default:void 0},data:{type:[Object,void 0],default:void 0},loading:{type:Boolean,required:!0}},computed:{items(){var t,e;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.items)&&void 0!==t?t:[]},emptyContentMessage(){var t,e;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.emptyContentMessage)&&void 0!==t?t:""},halfEmptyContentMessage(){var t,e;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.halfEmptyContentMessage)&&void 0!==t?t:""},newButton(){var t,e;return null===(t=this.widget)||void 0===t||null===(e=t.buttons)||void 0===e?void 0:e.find((t=>"new"===t.type))},moreButton(){var t,e;return null===(t=this.widget)||void 0===t||null===(e=t.buttons)||void 0===e?void 0:e.find((t=>"more"===t.type))},setupButton(){var t,e;return null===(t=this.widget)||void 0===t||null===(e=t.buttons)||void 0===e?void 0:e.find((t=>"setup"===t.type))},showMoreLabel(){var t;return null===(t=this.moreButton)||void 0===t?void 0:t.text},showMoreUrl(){var t;return null===(t=this.moreButton)||void 0===t?void 0:t.link}}};var C=a(51900);const x=(0,C.Z)(f,(function(){var t=this,e=t._self._c;return e("NcDashboardWidget",{attrs:{items:t.items,"show-more-label":t.showMoreLabel,"show-more-url":t.showMoreUrl,loading:t.loading,"show-items-and-empty-content":!!t.halfEmptyContentMessage,"half-empty-content-message":t.halfEmptyContentMessage},scopedSlots:t._u([{key:"default",fn:function(n){let{item:a}=n;return[e("NcDashboardWidgetItem",{attrs:{"target-url":a.link,"overlay-icon-url":a.overlayIconUrl?a.overlayIconUrl:"","main-text":a.title,"sub-text":a.subtitle},scopedSlots:t._u([{key:"avatar",fn:function(){return[a.iconUrl?[e("NcAvatar",{attrs:{size:44,url:a.iconUrl}})]:t._e()]},proxy:!0}],null,!0)})]}},{key:"empty-content",fn:function(){return[0===t.items.length?e("NcEmptyContent",{attrs:{description:t.emptyContentMessage},scopedSlots:t._u([{key:"icon",fn:function(){return[t.emptyContentMessage?e("CheckIcon",{attrs:{size:65}}):t._e()]},proxy:!0},{key:"action",fn:function(){return[t.setupButton?e("NcButton",{attrs:{href:t.setupButton.link}},[t._v("\n\t\t\t\t\t"+t._s(t.setupButton.text)+"\n\t\t\t\t")]):t._e()]},proxy:!0}],null,!1,4172361897)}):t._e()]},proxy:!0}])})}),[],!1,null,"d91c9686",null).exports;var w=a(25108);const y=(0,r.j)("dashboard","panels"),k=(0,r.j)("dashboard","firstRun"),_={weather:{text:t("dashboard","Weather"),icon:"icon-weather-status"},status:{text:t("dashboard","Status"),icon:"icon-user-status-online"}},S={name:"DashboardApp",components:{ApiDashboardWidget:x,NcButton:c(),Draggable:u(),NcModal:h(),Pencil:g.default},mixins:[b],data(){var t,e;return{isAdmin:(0,o.ts)().isAdmin,timer:new Date,registeredStatus:[],callbacks:{},callbacksStatus:{},allCallbacksStatus:{},statusInfo:_,enabledStatuses:(0,r.j)("dashboard","statuses"),panels:y,firstRun:k,displayName:null===(t=(0,o.ts)())||void 0===t?void 0:t.displayName,uid:null===(e=(0,o.ts)())||void 0===e?void 0:e.uid,layout:(0,r.j)("dashboard","layout").filter((t=>y[t])),modal:!1,appStoreUrl:(0,s.generateUrl)("/settings/apps/dashboard"),statuses:{},apiWidgets:[],apiWidgetItems:{},loadingItems:!0}},computed:{greeting(){const e=this.timer.getHours();let n;n=e>=22||e<5?"night":e>=18?"evening":e>=12?"afternoon":"morning";const a={morning:{generic:t("dashboard","Good morning"),withName:t("dashboard","Good morning, {name}",{name:this.displayName},void 0,{escape:!1})},afternoon:{generic:t("dashboar
//# sourceMappingURL=dashboard-main.js.map?v=5fb0a8d03322f96d4adf