Skip to content

Commit ac13f5d

Browse files
committed
Fix a bunch of design inconsistencies and horrible code on server boxes
1 parent a9fda52 commit ac13f5d

File tree

3 files changed

+38
-35
lines changed

3 files changed

+38
-35
lines changed

resources/assets/scripts/components/dashboard/Dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default Vue.component('dashboard', {
108108
/>
109109
</div>
110110
<div v-if="this.loading" class="my-4 animate fadein">
111-
<div class="text-center h-16">
111+
<div class="text-center h-16 my-20">
112112
<span class="spinner spinner-xl spinner-thick blue"></span>
113113
</div>
114114
</div>

resources/assets/scripts/components/dashboard/ServerBox.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ export default Vue.component('server-box', {
156156
},
157157

158158
template: `
159-
<div class="server-card-container">
160-
<div class="server-card animated-fade-in hover:shadow-md">
161-
<div class="content h-32 relative">
162-
<router-link :to="link">
159+
<div class="server-card-container animated-fade-in">
160+
<div>
161+
<div class="server-card">
162+
<router-link :to="link" class="block">
163163
<h2 class="text-xl flex flex-row items-center mb-2">
164164
<div class="identifier-icon select-none" :class="{
165-
'bg-grey-500': status === '',
165+
'bg-neutral-400': status === '',
166166
'bg-red-500': status === 'offline',
167167
'bg-green-500': status === 'online'
168168
}">
@@ -171,21 +171,24 @@ export default Vue.component('server-box', {
171171
{{ server.name }}
172172
</h2>
173173
</router-link>
174-
<div class="text-neutral-800 font-normal text-sm">
175-
<p v-if="server.description.length" class="pb-1">{{ server.description }}</p>
176-
177-
<div class="absolute pin-b pin-l p-4 w-full">
178-
<span class="font-semibold text-indigo">{{ server.node }}</span>
179-
<span class="float-right text-neutral-600 font-light">{{ server.allocation.ip }}:{{ server.allocation.port }}</span>
174+
<div class="flex-1 py-3">
175+
<p v-if="server.description.length" class="text-neutral-500 text-sm">{{ server.description }}</p>
176+
</div>
177+
<div class="flex flex-none pt-2">
178+
<div class="flex-1">
179+
<span class="font-semibold text-cyan-800">{{ server.node }}</span>
180+
</div>
181+
<div>
182+
<span class="text-neutral-300">{{ server.allocation.ip }}:{{ server.allocation.port }}</span>
180183
</div>
181184
</div>
182185
</div>
183186
<div class="footer p-4 text-sm">
184187
<div class="inline-block pr-2">
185-
<div class="pillbox bg-green-500"><span class="select-none">MEM:</span> {{ memory }} Mb</div>
188+
<div class="pillbox bg-neutral-700"><span class="select-none">MEM:</span> {{ memory }} Mb</div>
186189
</div>
187190
<div class="inline-block">
188-
<div class="pillbox bg-primary-500"><span class="select-none">CPU:</span> {{ cpu }} %</div>
191+
<div class="pillbox bg-neutral-700"><span class="select-none">CPU:</span> {{ cpu }} %</div>
189192
</div>
190193
</div>
191194
</div>

resources/assets/styles/components/miscellaneous.css

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ code {
5353
* Flex boxes for server listing on user dashboard.
5454
*/
5555
.server-card-container {
56-
@apply .mb-4;
57-
58-
@screen smx {
59-
@apply .w-full;
60-
}
56+
@apply .mb-4 .w-full;
6157

6258
@screen md {
6359
@apply .w-1/2 .pr-4;
@@ -78,27 +74,31 @@ code {
7874
@apply .pr-0;
7975
}
8076
}
81-
}
8277

83-
.server-card {
84-
@apply .block .no-underline .shadow;
85-
transition: all 100ms ease-in;
78+
& > div {
79+
@apply .flex .flex-col .h-full;
80+
transition: box-shadow 150ms ease-in;
8681

87-
& .identifier-icon {
88-
@apply .inline-block .rounded-full .text-white .text-center .leading-none .justify-center .w-8 .h-8 .mr-2 .flex .flex-row .items-center;
82+
&:hover {
83+
@apply .shadow-md;
84+
}
8985
}
9086

91-
& a, & a:visited {
92-
@apply .no-underline .text-neutral-900;
93-
}
87+
& > div > .server-card {
88+
@apply .flex .flex-1 .flex-col .p-4 .border .border-t-4 .border-neutral-100 .bg-white;
89+
transition: all 100ms ease-in;
90+
91+
& .identifier-icon {
92+
@apply .select-none .inline-block .rounded-full .text-white .text-center .leading-none .justify-center .w-8 .h-8 .mr-2 .flex .flex-row .items-center;
93+
}
9494

95-
& > .content {
96-
@apply .border .border-neutral-400 .bg-white .no-underline .block .text-black .p-4;
97-
border-top: 4px solid config('colors.neutral-400') !important;
95+
& a, & a:visited {
96+
@apply .no-underline .text-neutral-800;
97+
}
9898
}
9999

100-
& > .footer {
101-
@apply .border .border-neutral-400 .border-t-0 .bg-neutral-50;
100+
& > div > .footer {
101+
@apply .border .border-neutral-100 .border-t-0 .bg-neutral-50 .shadow-inner;
102102
}
103103
}
104104

@@ -110,11 +110,11 @@ code {
110110
@apply .w-full .my-4;
111111

112112
& > input[type="text"] {
113-
@apply .w-full .p-3 .rounded .border .text-neutral-800;
113+
@apply .w-full .p-4 .rounded .border .border-neutral-200 .text-neutral-500;
114114
transition: border 150ms ease-in;
115115

116116
&:focus {
117-
@apply .border-primary-400;
117+
@apply .border-primary-500;
118118
}
119119
}
120120
}

0 commit comments

Comments
 (0)