pleroma/priv/static/adminfe/static/js/chunk-55a2.a1fd0cc3.js
2022-11-22 23:53:01 +01:00

2 lines
8 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-55a2"],{Pybv:function(t,e,s){},eeKe:function(t,e,s){},jRBl:function(t,e,s){"use strict";s("Pybv")},pGDl:function(t,e,s){"use strict";s.r(e);var a=s("ExVU"),r={name:"ChatMessage",props:{message:{type:Object,required:!0},author:{type:Object,required:!0},page:{type:Number,required:!1,default:0}},data:function(){return{}},methods:{propertyExists:function(t,e){return t[e]},parseTimestamp:function(t){return a.DateTime.fromISO(t).toFormat("yyyy-MM-dd HH:mm")},deleteMessage:function(){var t=this;this.$confirm("Are you sure you want to delete this message?","Warning",{confirmButtonText:"OK",cancelButtonText:"Cancel",type:"warning"}).then(function(){t.$store.dispatch("DeleteMessage",{chat_id:t.message.chat_id,message_id:t.message.id}),t.$message({type:"success",message:"Delete completed"})}).catch(function(){t.$message({type:"info",message:"Delete canceled"})})},handleRouteChange:function(){this.$router.push({name:"UsersShow",params:{id:this.author.id}})}}},n=(s("yAu3"),s("KHd+")),i=Object(n.a)(r,function(){var t=this,e=t._self._c;return t.message.deleted?t._e():e("el-card",{staticClass:"message-card"},[e("div",{attrs:{slot:"header"},slot:"header"},[e("div",{staticClass:"message-header"},[e("div",{staticClass:"message-meta"},[t.propertyExists(t.author,"id")?e("router-link",{staticClass:"router-link",attrs:{to:{name:"UsersShow",params:{id:t.author.id}}},nativeOn:{click:function(t){t.stopPropagation()}}},[e("div",{staticClass:"message-author"},[t.propertyExists(t.author,"avatar")?e("img",{staticClass:"message-author-avatar-img",attrs:{src:t.author.avatar}}):t._e(),t._v(" "),t.propertyExists(t.author,"username")?e("span",{staticClass:"message-author-name"},[t._v(t._s(t.author.username))]):e("span",[t.propertyExists(t.author,"username")?e("span",{staticClass:"message-author-name"},[t._v("\n "+t._s(t.author.username)+"\n ")]):e("span",{staticClass:"message-author-name deactivated"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")])])])]):t._e(),t._v(" "),e("span",{staticClass:"message-timestamp"},[t._v(t._s(t.parseTimestamp(t.message.created_at)))])],1),t._v(" "),e("div",{staticClass:"message-actions"},[e("el-dropdown",{attrs:{trigger:"click"},nativeOn:{click:function(t){t.stopPropagation()}}},[e("el-button",{staticClass:"status-actions-button",attrs:{plain:"",size:"small",icon:"el-icon-edit"}},[t._v("\n "+t._s(t.$t("reports.messageModeration"))),e("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{nativeOn:{click:function(e){return t.deleteMessage()}}},[t._v("\n "+t._s(t.$t("reports.deleteMessage"))+"\n ")]),t._v(" "),e("el-dropdown-item",{nativeOn:{click:function(e){return t.handleRouteChange()}}},[t._v("\n "+t._s(t.$t("users.moderateUser"))+"\n ")])],1)],1)],1)])]),t._v(" "),e("div",{staticClass:"message-body"},[e("span",{staticClass:"message-content",domProps:{innerHTML:t._s(t.message.content)}}),t._v(" "),t.message.attachment?e("div",{staticClass:"image"},[e("img",{attrs:{src:t.message.attachment.preview_url}})]):t._e()])])},[],!1,null,null,null).exports,o={name:"ChatShow",components:{RebootButton:s("rIUS").a,ChatMessage:i},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device},isTablet:function(){return"tablet"===this.$store.state.app.device},allLoaded:function(){return this.$store.state.chat.allLoaded},buttonLoading:function(){return this.$store.state.chat.buttonLoading},loading:function(){return this.$store.state.chat.loading},chat:function(){return this.$store.state.chat.fetchedChat},chatMessages:function(){return this.$store.state.chat.fetchedChatMessages}},beforeMount:function(){this.$store.dispatch("HandlePageChange",null),this.$store.dispatch("NeedReboot"),this.$store.dispatch("GetNodeInfo"),this.$store.dispatch("FetchChat",this.$route.params.id),this.$store.dispatch("FetchChatMessages",this.$route.params.id)},methods:{propertyExists:function(t,e){return t[e]},getAuthor:function(t){var e=this.chat.sender,s=this.chat.receiver;return t===e.id?e:s},handleLoadMore:function(){var t=this.chatMessages.pop().id;this.$store.dispatch("HandlePageChange",t),this.$store.dispatch("FetchChatMessages",this.$route.params.id)}}},c=(s("jRBl"),Object(n.a)(o,function(){var t=this,e=t._self._c;return t.loading?t._e():e("div",{staticClass:"chat-show-container"},[e("header",{staticClass:"chat-page-header"},[e("h1",[t._v("\n "+t._s(t.$t("chats.chatHistory"))+":\n ")]),t._v(" "),e("div",{staticClass:"chat-card-participants"},[e("div",{staticClass:"chat-particiants-sender"},[e("div",{staticClass:"avatar-name-container"},[t.propertyExists(t.chat.sender,"avatar")?e("el-avatar",{attrs:{src:t.chat.sender.avatar,size:"large"}}):t._e(),t._v(" "),t.propertyExists(t.chat.sender,"display_name")?e("h1",{staticClass:"particiant-display-name"},[t._v(t._s(t.chat.sender.display_name))]):e("h1",{staticClass:"particiant-display-name invalid"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")]),t._v(" "),t.propertyExists(t.chat.sender,"url")?e("a",{attrs:{href:t.chat.sender.url,target:"_blank"}},[e("i",{staticClass:"el-icon-top-right",attrs:{title:t.$t("userProfile.openAccountInInstance")}})]):t._e()],1)]),t._v(" "),e("div",{staticClass:"chat-particiants-receiver"},[e("div",{staticClass:"avatar-name-container"},[t.propertyExists(t.chat.receiver,"avatar")?e("el-avatar",{attrs:{src:t.chat.receiver.avatar,size:"large"}}):t._e(),t._v(" "),t.propertyExists(t.chat.receiver,"display_name")?e("h1",{staticClass:"particiant-display-name"},[t._v(t._s(t.chat.receiver.display_name))]):e("h1",{staticClass:"particiant-display-name invalid"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")]),t._v(" "),t.propertyExists(t.chat.receiver,"url")?e("a",{attrs:{href:t.chat.receiver.url,target:"_blank"}},[e("i",{staticClass:"el-icon-top-right",attrs:{title:t.$t("userProfile.openAccountInInstance")}})]):t._e()],1)])])]),t._v(" "),t.isMobile?e("div",{staticClass:"chat-page-header-container"},[e("header",{staticClass:"chat-page-header"},[e("div",{staticClass:"avatar-name-container"}),t._v(" "),e("reboot-button")],1)]):t._e(),t._v(" "),e("div",{staticClass:"chat-messages-container"},[t.loading?t._e():e("el-timeline",{staticClass:"messages"},[t._l(t.chatMessages,function(s){return e("el-timeline-item",{key:s.id},[e("chat-message",{attrs:{message:s,author:t.getAuthor(s.account_id)}})],1)}),t._v(" "),0===t.chatMessages.length?e("p",{staticClass:"no-messages"},[t._v(t._s(t.$t("userProfile.noMessages")))]):t._e(),t._v(" "),20===t.chatMessages.length?e("div",{staticClass:"statuses-pagination"},[t.allLoaded?e("el-button",{attrs:{icon:"el-icon-check",circle:""}}):e("el-button",{attrs:{loading:t.buttonLoading},on:{click:t.handleLoadMore}},[t._v(t._s(t.$t("statuses.loadMore")))])],1):t._e()],2)],1)])},[],!1,null,null,null));e.default=c.exports},rIUS:function(t,e,s){"use strict";var a=s("yXPU"),r=s.n(a),n=s("o0o1"),i=s.n(n),o=s("mSNy"),c={name:"RebootButton",computed:{needReboot:function(){return this.$store.state.app.needReboot}},methods:{restartApp:function(){var t=this;return r()(i.a.mark(function e(){return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$store.dispatch("RestartApplication");case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return");case 8:t.$message({type:"success",message:o.a.t("settings.restartSuccess")});case 9:case"end":return e.stop()}},e,null,[[0,5]])}))()}}},l=s("KHd+"),h=Object(l.a)(c,function(){var t=this._self._c;return this.needReboot?t("el-tooltip",{attrs:{content:this.$t("settings.restartApp"),placement:"bottom-end"}},[t("el-button",{staticClass:"reboot-button",attrs:{type:"warning"},on:{click:this.restartApp}},[t("span",[t("i",{staticClass:"el-icon-refresh"}),this._v("\n "+this._s(this.$t("settings.instanceReboot"))+"\n ")])])],1):this._e()},[],!1,null,null,null);e.a=h.exports},yAu3:function(t,e,s){"use strict";s("eeKe")}}]);
//# sourceMappingURL=chunk-55a2.a1fd0cc3.js.map