mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-01-31 09:03:19 +08:00
2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[866],{200:function(e,t,n){n(5331)},213:function(e,t,n){n(5331),n(9104)},670:function(e,t,n){n(5331),n(9648),n(9104),n(5970)},797:function(e,t,n){n.d(t,{A:function(){return o}});n(4114),n(4979);var a=n(5507),i=n(1219),s=n(6915);async function o(e,t={}){const n=a.A.getters.credentials||btoa("unset:unset");t.headers={...t.headers,Authorization:`Basic ${n}`},t.credentials="include";const o=await fetch(e,t);return 401===o.status&&(i.nk.error("认证状态错误,请重新登录"),s.A.push("/adminLogin")),o}},3597:function(e,t,n){n(5331)},4318:function(){},5970:function(e,t,n){n(5331)},6011:function(e,t,n){n.d(t,{A:function(){return v}});var a=n(6768),i=n(5130),s=n(4232);const o={id:"themeMaskAdmin"},r=["cx","cy","r"],l=["r"],c=["opacity"];function u(e,t,n,u,d,g){const m=(0,a.g2)("font-awesome-icon");return(0,a.uX)(),(0,a.CE)("div",{id:"themeToggle",onClick:t[0]||(t[0]=(...e)=>g.handleToggleClick&&g.handleToggleClick(...e))},[(0,a.bF)(i.eB,{name:"icon-fade",mode:"out-in"},{default:(0,a.k6)(()=>[d.isAuto?((0,a.uX)(),(0,a.Wv)(m,{key:"auto-mode",icon:"circle-half-stroke",class:"auto-icon",style:{"font-size":"1.3em",color:"var(--admin-theme-toggle-color)"}})):((0,a.uX)(),(0,a.CE)("svg",{key:"sun-moon",class:(0,s.C4)(["theme_toggle_svg",{dark:d.isDark}]),width:"1.3em",height:"1.3em",viewBox:"0 0 24 24",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",stroke:"currentColor"},[(0,a.Lk)("mask",o,[t[1]||(t[1]=(0,a.Lk)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"},null,-1)),(0,a.Lk)("circle",{class:"theme_toggle_circle1",fill:"black",cx:d.isDark?"50%":"100%",cy:d.isDark?"23%":"0%",r:d.isDark?"9":"5"},null,8,r)]),(0,a.Lk)("circle",{class:"theme_toggle_circle2",cx:"12",cy:"12",r:d.isDark?"9":"5",mask:"url(#themeMaskAdmin)"},null,8,l),(0,a.Lk)("g",{class:"theme_toggle_g",stroke:"currentColor",opacity:d.isDark?0:1},[...t[2]||(t[2]=[(0,a.Lk)("line",{x1:"12",y1:"1",x2:"12",y2:"3"},null,-1),(0,a.Lk)("line",{x1:"12",y1:"21",x2:"12",y2:"23"},null,-1),(0,a.Lk)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"},null,-1),(0,a.Lk)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"},null,-1),(0,a.Lk)("line",{x1:"1",y1:"12",x2:"3",y2:"12"},null,-1),(0,a.Lk)("line",{x1:"21",y1:"12",x2:"23",y2:"12"},null,-1),(0,a.Lk)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"},null,-1),(0,a.Lk)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"},null,-1)])],8,c)],2))]),_:1})])}var d={name:"ToggleDark",data(){return{isDark:this.$store.getters.useDarkMode,isAuto:!this.$store.getters.cusDarkMode}},methods:{handleToggleClick(){this.isAuto?(this.isDark=!1,this.isAuto=!1,this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!1)):this.isDark?(this.isAuto=!0,this.$store.commit("setCusDarkMode",!1)):(this.isDark=!0,this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!0))}}},g=n(1241);const m=(0,g.A)(d,[["render",u],["__scopeId","data-v-4c6ec90c"]]);var h=m,k=n(2086);n(5331),n(670),n(8830),n(3597);const p={class:"tabs"},b={class:"tabs-dropdown-link"};function y(e,t,n,i,o,r){const l=(0,a.g2)("font-awesome-icon"),c=k.c6,u=k.Iy,d=k.dW,g=h;return(0,a.uX)(),(0,a.CE)("div",p,[(0,a.Lk)("span",{class:"title",onClick:t[0]||(t[0]=(...e)=>r.refreshDashboard&&r.refreshDashboard(...e))},[(0,a.bF)(l,{icon:r.iconName,class:"fa-images"},null,8,["icon"]),(0,a.eW)(" "+(0,s.v_)(r.titleName),1)]),(0,a.bF)(d,{onCommand:r.handleTabClick,class:"tabs-dropdown",role:"navigation",onVisibleChange:r.handleDropdownVisible,"popper-class":"tabs-dropdown-popper"},{dropdown:(0,a.k6)(()=>[(0,a.bF)(u,null,{default:(0,a.k6)(()=>["dashboard"!==n.activeTab?((0,a.uX)(),(0,a.Wv)(c,{key:0,command:"dashboard"},{default:(0,a.k6)(()=>[(0,a.bF)(l,{icon:"images",style:{"margin-right":"5px",width:"16px"}}),t[1]||(t[1]=(0,a.eW)(" 文件管理 ",-1))]),_:1})):(0,a.Q3)("",!0),"customerConfig"!==n.activeTab?((0,a.uX)(),(0,a.Wv)(c,{key:1,command:"customerConfig"},{default:(0,a.k6)(()=>[(0,a.bF)(l,{icon:"user-cog",style:{"margin-right":"5px",width:"16px"}}),t[2]||(t[2]=(0,a.eW)(" 用户管理 ",-1))]),_:1})):(0,a.Q3)("",!0),"systemConfig"!==n.activeTab?((0,a.uX)(),(0,a.Wv)(c,{key:2,command:"systemConfig"},{default:(0,a.k6)(()=>[(0,a.bF)(l,{icon:"cogs",style:{"margin-right":"5px",width:"16px"}}),t[3]||(t[3]=(0,a.eW)(" 系统设置 ",-1))]),_:1})):(0,a.Q3)("",!0),(0,a.bF)(c,{command:""},{default:(0,a.k6)(()=>[(0,a.bF)(l,{icon:"upload",style:{"margin-right":"5px",width:"16px"}}),t[4]||(t[4]=(0,a.eW)(" 文件上传 ",-1))]),_:1})]),_:1})]),default:(0,a.k6)(()=>[(0,a.Lk)("span",b,[(0,a.bF)(l,{icon:"bars",class:"tabs-arrow"})])]),_:1},8,["onCommand","onVisibleChange"]),(0,a.bF)(g)])}n(4114);var f={name:"DashboardTabs",props:{activeTab:{type:String,default:"dashboard"}},components:{AdminToggleDark:h},computed:{titleName(){return"dashboard"===this.activeTab?"文件管理":"customerConfig"===this.activeTab?"用户管理":"systemConfig"===this.activeTab?"系统设置":"上传页面"},iconName(){return"dashboard"===this.activeTab?"images":"customerConfig"===this.activeTab?"user-cog":"systemConfig"===this.activeTab?"cogs":"upload"}},methods:{refreshDashboard(){location.reload()},handleTabClick(e){this.$router.push(`/${e}`)},handleDropdownVisible(e){const t=document.querySelector(".tabs-dropdown-link");e?t.classList.add("rotate-up"):t.classList.remove("rotate-up")}}};const I=(0,g.A)(f,[["render",y],["__scopeId","data-v-4673d77a"]]);var v=I},6808:function(e,t,n){n(5331),n(8785),n(200),n(5970),n(9104)},7128:function(e,t,n){n(5331),n(4318)},7835:function(e,t,n){e.exports=n.p+"img/background-light.f17603bc.jpg"},8075:function(e,t,n){n(5331)},8351:function(e,t,n){e.exports=n.p+"img/background.ea1b7ee7.jpg"},8450:function(e,t,n){n(5331)},8736:function(e,t,n){n(5331)},8785:function(e,t,n){n(5331)},8830:function(e,t,n){n(5331)},8903:function(e,t,n){var a=n(8401);t.A={data(){return{bingWallPaperIndex:0,customWallPaperIndex:0,backgroundInterval:null,backgroundInitParams:null}},computed:{...(0,a.L8)(["userConfig","bingWallPapers","useDarkMode"]),bkInterval(){return this.userConfig?.bkInterval||3e3},bkOpacity(){return this.userConfig?.bkOpacity||1},backgroundImagesTemplate(){return'\n <img id="bg1" class="background-image1" alt="Background Image"/>\n <img id="bg2" class="background-image2" alt="Background Image"/>\n '},backgroundImagesStyles(){return"\n .background-image1 {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;\n filter: var(--background-image-filter, brightness(1));\n }\n .background-image2 {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;\n filter: var(--background-image-filter, brightness(1));\n }\n "}},watch:{useDarkMode(e,t){e!==t&&this.backgroundInitParams&&this.$nextTick(()=>{this.smoothThemeTransition(this.backgroundInitParams.configKey,this.backgroundInitParams.containerSelector,this.backgroundInitParams.useDefaultBackground,this.backgroundInitParams.autoCreateElements)})}},mounted(){this.injectBackgroundStyles()},beforeUnmount(){this.backgroundInterval&&clearInterval(this.backgroundInterval),this.clearBackgroundImages(!0),this.removeBackgroundStyles()},methods:{injectBackgroundStyles(){const e="background-manager-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=this.backgroundImagesStyles,document.head.appendChild(t)}},removeBackgroundStyles(){const e="background-manager-styles",t=document.getElementById(e);t&&t.remove()},createBackgroundElements(e){if(!e)return void console.warn("未提供有效的容器元素");if(document.getElementById("bg1")||document.getElementById("bg2"))return;const t=document.createElement("img");t.id="bg1",t.className="background-image1",t.alt="Background Image";const n=document.createElement("img");n.id="bg2",n.className="background-image2",n.alt="Background Image",e.insertBefore(t,e.firstChild),e.insertBefore(n,e.firstChild)},initializeBackground(e,t=".login",n=!1,a=!1){if(this.backgroundInitParams={configKey:e,containerSelector:t,useDefaultBackground:n,autoCreateElements:a},a){const e=document.querySelector(t);!e||document.getElementById("bg1")&&document.getElementById("bg2")||this.createBackgroundElements(e)}const i=document.getElementById("bg1"),s=document.getElementById("bg2");if(!i||!s)return void console.warn("背景图元素 #bg1 或 #bg2 未找到,请确保页面中包含这些元素或启用 autoCreateElements");const o=this.userConfig?.[e];"bing"===o?this.setupBingWallpaper(i,s,t):Array.isArray(o)&&o.length>1?this.setupCustomWallpaperCarousel(i,s,o,t):Array.isArray(o)&&1===o.length?this.setupSingleCustomWallpaper(i,o[0],t):n&&this.setupDefaultWallpaper(i,t)},setupBingWallpaper(e,t,n){this.$store.dispatch("fetchBingWallPapers").then(()=>{0!==this.bingWallPapers.length&&(this.loadBackgroundImage(e,this.bingWallPapers[this.bingWallPaperIndex]?.url,n),this.backgroundInterval=setInterval(()=>{this.switchBingWallpaper(e,t)},this.bkInterval))})},setupCustomWallpaperCarousel(e,t,n,a){this.loadBackgroundImage(e,n[this.customWallPaperIndex],a),this.backgroundInterval=setInterval(()=>{this.switchCustomWallpaper(e,t,n)},this.bkInterval)},setupSingleCustomWallpaper(e,t,n){this.loadBackgroundImage(e,t,n)},setupDefaultWallpaper(e,t){const a=this.useDarkMode,i=n(a?8351:7835);this.loadBackgroundImage(e,i,t)},loadBackgroundImage(e,t,n){e.src=t,e.onload=()=>{e.style.opacity=this.bkOpacity;const t=document.querySelector(n);t&&(t.style.background="transparent")}},switchBingWallpaper(e,t){if(0===this.bingWallPapers.length)return;const n=0!=e.style.opacity?e:t,a=0!=e.style.opacity?t:e;n.style.opacity=0,this.bingWallPaperIndex=(this.bingWallPaperIndex+1)%this.bingWallPapers.length,a.src=this.bingWallPapers[this.bingWallPaperIndex]?.url,a.onload=()=>{a.style.opacity=this.bkOpacity}},switchCustomWallpaper(e,t,n){const a=0!=e.style.opacity?e:t,i=0!=e.style.opacity?t:e;a.style.opacity=0,this.customWallPaperIndex=(this.customWallPaperIndex+1)%n.length,i.src=n[this.customWallPaperIndex],i.onload=()=>{i.style.opacity=this.bkOpacity}},clearBackgroundInterval(){this.backgroundInterval&&(clearInterval(this.backgroundInterval),this.backgroundInterval=null)},clearBackgroundImages(e=!1){const t=document.getElementById("bg1"),n=document.getElementById("bg2");e?(t&&(t.style.transition="none",t.style.opacity=0,t.src="",setTimeout(()=>{t&&(t.style.transition="opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1)")},50)),n&&(n.style.transition="none",n.style.opacity=0,n.src="",setTimeout(()=>{n&&(n.style.transition="opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1)")},50))):(t&&(t.style.opacity=0,setTimeout(()=>{t&&(t.src="")},800)),n&&(n.style.opacity=0,setTimeout(()=>{n&&(n.src="")},800)))},smoothThemeTransition(e,t=".login",a=!1,i=!1){const s=this.userConfig?.[e];if(!a||void 0!==s)return void this.reinitializeBackground(e,t,a,i);const o=document.getElementById("bg1"),r=document.getElementById("bg2");if(!o||!r)return void this.reinitializeBackground(e,t,a,i);const l=0!=o.style.opacity?o:r,c=0!=o.style.opacity?r:o,u=this.useDarkMode,d=n(u?8351:7835),g=new Image;g.onload=()=>{c.src=d,c.onload=()=>{l.style.opacity=0,setTimeout(()=>{c.style.opacity=this.bkOpacity;const e=document.querySelector(t);e&&(e.style.background="transparent")},50)}},g.onerror=()=>{console.warn("主题背景图预加载失败,回退到直接切换"),this.reinitializeBackground(e,t,a,i)},g.src=d},reinitializeBackground(e,t=".login",n=!1,a=!1){this.clearBackgroundInterval(),this.clearBackgroundImages(!0),this.bingWallPaperIndex=0,this.customWallPaperIndex=0,setTimeout(()=>{this.initializeBackground(e,t,n,a)},100)}}}},9104:function(e,t,n){n(5331)}}]);
|
|
//# sourceMappingURL=866.5e45788b.js.map
|