Skip to content

Commit d8bd71f

Browse files
Added a button to reset the status page icon to the default (#6533)
2 parents 6d01cf0 + 480695f commit d8bd71f

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

src/lang/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,5 +1223,6 @@
12231223
"labelDomainNameExpiryNotification": "Domain Name Expiry Notification",
12241224
"domainExpiryDescription": "Trigger notification when domain names expires in:",
12251225
"minimumIntervalWarning": "Intervals below 20 seconds may result in poor performance.",
1226-
"lowIntervalWarning": "Are you sure want to set the interval value below 20 seconds? Performance may be degraded, particularly if there are a large number of monitors."
1226+
"lowIntervalWarning": "Are you sure want to set the interval value below 20 seconds? Performance may be degraded, particularly if there are a large number of monitors.",
1227+
"imageResetConfirmation": "Image reset to default"
12271228
}

src/pages/StatusPage.vue

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@
138138
<h1 class="mb-4 title-flex">
139139
<!-- Logo -->
140140
<span class="logo-wrapper" @click="showImageCropUploadMethod">
141+
<button v-if="editMode" type="button" class="p-0 bg-transparent border-0 small-reset-btn reset-top-left" @click.stop="resetToDefaultImage">
142+
<font-awesome-icon icon="times" class="text-danger" />
143+
</button>
141144
<img :src="logoURL" alt class="logo me-2" :class="logoClass" />
142145
<font-awesome-icon v-if="enableEditMode" class="icon-upload" icon="upload" />
143146
</span>
@@ -962,6 +965,20 @@ export default {
962965
}
963966
},
964967
968+
/**
969+
* Reset logo image to default (public/icon.svg)
970+
* @returns {void}
971+
*/
972+
resetToDefaultImage() {
973+
if (! this.editMode) {
974+
return;
975+
}
976+
977+
this.imgDataUrl = "/icon.svg";
978+
this.config.icon = this.imgDataUrl;
979+
toast.success(this.$t("imageResetConfirmation"));
980+
},
981+
965982
/**
966983
* Create an incident for this status page
967984
* @returns {void}
@@ -1181,6 +1198,58 @@ footer {
11811198
cursor: pointer;
11821199
box-shadow: 0 15px 70px rgba(0, 0, 0, 0.9);
11831200
}
1201+
1202+
/* Reset button placed at top-left of the logo */
1203+
.reset-top-left {
1204+
position: absolute;
1205+
top: 0;
1206+
left: -15px;
1207+
z-index: 2;
1208+
width: 20px;
1209+
height: 20px;
1210+
display: inline-flex;
1211+
align-items: center;
1212+
justify-content: center;
1213+
border-radius: 50%;
1214+
background: white;
1215+
border: none;
1216+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
1217+
cursor: pointer;
1218+
padding: 0;
1219+
transition: transform $easing-in 0.18s, box-shadow $easing-in 0.18s, background-color $easing-in 0.18s;
1220+
transform-origin: center;
1221+
1222+
&:hover {
1223+
background-color: rgba(0, 0, 0, 0.06);
1224+
transform: scale(1.18);
1225+
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
1226+
}
1227+
1228+
&:hover ~ .icon-upload {
1229+
transform: none !important;
1230+
}
1231+
}
1232+
1233+
.small-reset-btn {
1234+
transition: transform $easing-in 0.18s, box-shadow $easing-in 0.18s, background-color $easing-in 0.18s;
1235+
font-size: 18px;
1236+
width: 18px;
1237+
height: 18px;
1238+
padding: 0;
1239+
display: inline-flex;
1240+
align-items: center;
1241+
justify-content: center;
1242+
border-radius: 50%;
1243+
background: transparent;
1244+
border: none;
1245+
cursor: pointer;
1246+
1247+
&:hover {
1248+
background-color: rgba(0, 0, 0, 0.04);
1249+
transform: scale(1.18);
1250+
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
1251+
}
1252+
}
11841253
}
11851254
11861255
.logo {

0 commit comments

Comments
 (0)