Skip to content

Commit 9be0f8a

Browse files
authored
fix(monitor-list): cannot display monitor name in full width (louislam#7076)
1 parent 2c6dcbb commit 9be0f8a

File tree

5 files changed

+182
-25
lines changed

5 files changed

+182
-25
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
extends: [
1111
"eslint:recommended",
1212
"plugin:vue/vue3-recommended",
13+
"plugin:vue-scoped-css/vue3-recommended",
1314
"plugin:jsdoc/recommended-error",
1415
"prettier", // Disables ESLint formatting rules that conflict with Prettier
1516
],
@@ -42,6 +43,7 @@ module.exports = {
4243
"vue/require-component-is": "off", // not allow is="style" https://github.com/vuejs/eslint-plugin-vue/issues/462#issuecomment-430234675
4344
"vue/attribute-hyphenation": "off", // This change noNL to "no-n-l" unexpectedly
4445
"vue/multi-word-component-names": "off",
46+
"vue-scoped-css/no-unused-selector": "warn",
4547
curly: "error",
4648
"no-var": "error",
4749
"no-throw-literal": "error",

package-lock.json

Lines changed: 163 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"scripts": {
1313
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
14-
"lint:js-prod": "npm run lint:js -- --max-warnings 0",
14+
"lint:js-prod": "npm run lint:js",
1515
"lint-fix:js": "eslint --ext \".js,.vue\" --fix --ignore-path .gitignore .",
1616
"lint:style": "stylelint \"**/*.{vue,css,scss}\" --ignore-path .gitignore",
1717
"lint-fix:style": "stylelint \"**/*.{vue,css,scss}\" --fix --ignore-path .gitignore",
@@ -189,6 +189,7 @@
189189
"eslint-config-prettier": "^10.1.8",
190190
"eslint-plugin-jsdoc": "~46.4.6",
191191
"eslint-plugin-vue": "~8.7.1",
192+
"eslint-plugin-vue-scoped-css": "~2.7.2",
192193
"favico.js": "~0.3.10",
193194
"get-port-please": "^3.2.0",
194195
"node-ssh": "~13.1.0",

src/components/MonitorList.vue

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,6 @@ export default {
739739
}
740740
}
741741
742-
.actions-row {
743-
display: flex;
744-
align-items: center;
745-
}
746-
747742
.selection-controls {
748743
margin-top: 5px;
749744
display: flex;
@@ -822,10 +817,6 @@ export default {
822817
transition: none !important;
823818
}
824819
825-
.monitor-item {
826-
width: 100%;
827-
}
828-
829820
.tags {
830821
margin-top: 4px;
831822
padding-left: 67px;
@@ -834,11 +825,6 @@ export default {
834825
gap: 0;
835826
}
836827
837-
.bottom-style {
838-
padding-left: 67px;
839-
margin-top: 5px;
840-
}
841-
842828
@media (max-width: 549px), (min-width: 770px) and (max-width: 1149px), (min-width: 1200px) and (max-width: 1499px) {
843829
.selection-controls {
844830
.selected-count {

src/components/MonitorListItem.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@
2323

2424
<router-link :to="monitorURL(monitor.id)" class="item" :class="{ disabled: !monitor.active }">
2525
<div class="row">
26-
<div
27-
class="col-9 col-xl-6 small-padding d-flex gap-2 align-items-center"
28-
:class="{
29-
'monitor-item': $root.userHeartbeatBar == 'bottom' || $root.userHeartbeatBar == 'none',
30-
}"
31-
>
26+
<div class="small-padding d-flex gap-2 align-items-center" :class="monitorStyle">
3227
<div class="me-1">
3328
<Uptime :monitor="monitor" type="24" :pill="true" />
3429
</div>
@@ -167,6 +162,15 @@ export default {
167162
marginLeft: `${20 * this.depth}px`,
168163
};
169164
},
165+
monitorStyle() {
166+
const isFullWidth = this.$root.userHeartbeatBar === "bottom" || this.$root.userHeartbeatBar === "none";
167+
const c = {};
168+
if (!isFullWidth) {
169+
c["col-9"] = true;
170+
c["col-xl-6"] = true;
171+
}
172+
return c;
173+
},
170174
},
171175
watch: {
172176
isSelectMode() {
@@ -329,10 +333,6 @@ export default {
329333
padding-right: 5px !important;
330334
}
331335
332-
// .monitor-item {
333-
// width: 100%;
334-
// }
335-
336336
.tags {
337337
margin-top: 4px;
338338
padding-left: 4px;
@@ -390,4 +390,9 @@ export default {
390390
cursor: grabbing;
391391
}
392392
}
393+
394+
.bottom-style {
395+
margin-left: -10px;
396+
margin-top: 5px;
397+
}
393398
</style>

0 commit comments

Comments
 (0)