From 395a2860e7d239cc8ed02a3cb4f40588fe770823 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 5 Sep 2018 22:55:59 -0700 Subject: [PATCH] Start working on a better design for the server boxes on the dashboard --- .../components/dashboard/Dashboard.vue | 6 +- .../components/dashboard/ServerBox.vue | 61 ++++++++++--------- .../assets/styles/components/animations.css | 4 ++ .../styles/components/miscellaneous.css | 37 ++++++++--- 4 files changed, 67 insertions(+), 41 deletions(-) diff --git a/resources/assets/scripts/components/dashboard/Dashboard.vue b/resources/assets/scripts/components/dashboard/Dashboard.vue index 5f0cb55b7..7769e1926 100644 --- a/resources/assets/scripts/components/dashboard/Dashboard.vue +++ b/resources/assets/scripts/components/dashboard/Dashboard.vue @@ -16,11 +16,11 @@ - + diff --git a/resources/assets/scripts/components/dashboard/ServerBox.vue b/resources/assets/scripts/components/dashboard/ServerBox.vue index 4f9e0ec7b..d2d6f3955 100644 --- a/resources/assets/scripts/components/dashboard/ServerBox.vue +++ b/resources/assets/scripts/components/dashboard/ServerBox.vue @@ -1,39 +1,38 @@ @@ -57,6 +56,7 @@ cpu: 0, memory: 0, status: '', + link: { name: 'server', params: { id: this.server.identifier }}, }; }, @@ -101,6 +101,7 @@ * Poll the API for changes every 10 seconds when the component is mounted. */ mounted: function () { + console.log(this.server); this.$options.dataGetTimeout = window.setInterval(() => { this.getResourceUse(); }, 10000); diff --git a/resources/assets/styles/components/animations.css b/resources/assets/styles/components/animations.css index a3daa6722..8312978f7 100644 --- a/resources/assets/styles/components/animations.css +++ b/resources/assets/styles/components/animations.css @@ -4,6 +4,10 @@ } } +.animated-fade-in { + animation: fadein 500ms; +} + .fade-enter-active { animation: fadein 500ms; } diff --git a/resources/assets/styles/components/miscellaneous.css b/resources/assets/styles/components/miscellaneous.css index 48ae381b9..99dc5658e 100644 --- a/resources/assets/styles/components/miscellaneous.css +++ b/resources/assets/styles/components/miscellaneous.css @@ -52,27 +52,48 @@ code { /** * Flex boxes for server listing on user dashboard. */ -.server-box { - @apply .block .pb-4 .no-underline; +.server-card { + @apply .block .no-underline .shadow; @screen smx { @apply .w-full; } @screen md { - @apply .w-1/3 .pr-4; + @apply .w-1/3 .mr-4; &:nth-of-type(3n) { - padding-right: 0; + @apply .mr-0; } } - & > .content { - @apply .border .border-grey-light .bg-white .rounded .p-4 .justify-between .leading-normal .no-underline .block .text-black; + & .identifier-icon { + @apply .inline-block .rounded-full .text-white .text-center .leading-none .justify-center .w-8 .h-8 .mr-2 .flex .flex-row .items-center; + } - &:visited { - @apply .text-black; + & .pillbox { + @apply .rounded-full .px-2 .py-1 .text-white .font-medium .leading-none .text-xs; + } + + & a, & a:visited { + @apply .no-underline .text-grey-darkest; + } + + & > .content { + @apply .border .border-grey-light .bg-white .no-underline .block .text-black .p-4; + border-top: 4px solid config('colors.grey-light') !important; + + &.is-online { + border-top-color: config('colors.green') !important; } + + &.is-offline { + border-top-color: config('colors.red') !important; + } + } + + & > .footer { + @apply .border .border-grey-light .border-t-0 .bg-grey-lightest; } }