mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-26 22:19:43 -08:00
[status page] fix logo url
This commit is contained in:
parent
0a5a6e6a4b
commit
ad1bb93730
|
@ -3,10 +3,10 @@
|
||||||
<!-- Logo & Title -->
|
<!-- Logo & Title -->
|
||||||
<h1 class="mb-4">
|
<h1 class="mb-4">
|
||||||
<!-- Logo -->
|
<!-- Logo -->
|
||||||
<div class="logo-wrapper" @click="showImageCropUploadMethod">
|
<span class="logo-wrapper" @click="showImageCropUploadMethod">
|
||||||
<img :src="imgDataUrl" alt class="logo me-2" :class="logoClass" />
|
<img :src="logoURL" alt class="logo me-2" :class="logoClass" />
|
||||||
<font-awesome-icon v-if="enableEditMode" class="icon-upload" icon="upload" />
|
<font-awesome-icon v-if="enableEditMode" class="icon-upload" icon="upload" />
|
||||||
</div>
|
</span>
|
||||||
|
|
||||||
<!-- Uploader -->
|
<!-- Uploader -->
|
||||||
<!-- url="/api/status-page/upload-logo" -->
|
<!-- url="/api/status-page/upload-logo" -->
|
||||||
|
@ -241,10 +241,19 @@ export default {
|
||||||
imgDataUrl: "/icon.svg",
|
imgDataUrl: "/icon.svg",
|
||||||
loadedTheme: false,
|
loadedTheme: false,
|
||||||
loadedData: false,
|
loadedData: false,
|
||||||
|
baseURL: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
|
logoURL() {
|
||||||
|
if (this.imgDataUrl.startsWith("data:")) {
|
||||||
|
return this.imgDataUrl;
|
||||||
|
} else {
|
||||||
|
return this.baseURL + this.imgDataUrl;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the monitor is added to public list, which will not be in this list.
|
* If the monitor is added to public list, which will not be in this list.
|
||||||
*/
|
*/
|
||||||
|
@ -379,6 +388,12 @@ export default {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Special handle for dev
|
||||||
|
const env = process.env.NODE_ENV;
|
||||||
|
if (env === "development" || localStorage.dev === "dev") {
|
||||||
|
this.baseURL = location.protocol + "//" + location.hostname + ":3001";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
axios.get("/api/status-page/config").then((res) => {
|
axios.get("/api/status-page/config").then((res) => {
|
||||||
|
@ -386,13 +401,6 @@ export default {
|
||||||
|
|
||||||
if (this.config.logo) {
|
if (this.config.logo) {
|
||||||
this.imgDataUrl = this.config.logo;
|
this.imgDataUrl = this.config.logo;
|
||||||
|
|
||||||
// Special handle for dev
|
|
||||||
const env = process.env.NODE_ENV;
|
|
||||||
if (env === "development" || localStorage.dev === "dev") {
|
|
||||||
let baseURL = location.protocol + "//" + location.hostname + ":3001";
|
|
||||||
this.imgDataUrl = baseURL + this.imgDataUrl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue