@appscode/design-system 2.6.14 → 2.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.6.14",
3
+ "version": "2.6.15",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -4,3 +4,11 @@ export interface SelectedClusterType {
4
4
  provider: string;
5
5
  location: string;
6
6
  }
7
+
8
+ export interface SwitchCluster {
9
+ name: string;
10
+ displayName: string;
11
+ provider: string;
12
+ location?: string;
13
+ status?: string;
14
+ }
@@ -1,13 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import { defineAsyncComponent, ref, watch } from "vue";
3
- import type { SelectedClusterType } from "../../types/cluster";
3
+ import type { SwitchCluster } from "../../types/cluster";
4
+ import Badge from "../badge-tags/Badge.vue";
4
5
 
5
6
  const Multiselect = defineAsyncComponent(() => import("vue-multiselect"));
6
7
 
7
8
  interface Props {
8
9
  sidebarCollapsed?: boolean;
9
10
  mouseHover?: boolean;
10
- clusterOptions?: Array<SelectedClusterType>;
11
+ clusterOptions?: Array<SwitchCluster>;
11
12
  modelValue?: string;
12
13
  }
13
14
 
@@ -20,7 +21,7 @@ const props = withDefaults(defineProps<Props>(), {
20
21
 
21
22
  const emit = defineEmits(["update:modelValue"]);
22
23
 
23
- const selectedCluster = ref<SelectedClusterType | null>(null);
24
+ const selectedCluster = ref<SwitchCluster | null>(null);
24
25
  const selectedClusterName = ref<null | string>(null);
25
26
 
26
27
  const getProviderIcon = (provider: string) => {
@@ -100,15 +101,23 @@ watch(
100
101
  </div>
101
102
  </template>
102
103
  <template #option="props">
103
- <div class="is-flex is-align-items-center">
104
+ <div class="is-flex is-align-items-center is-fullwidth" :class="{ 'is-disabled': props.option?.$isDisabled }">
104
105
  <img
105
106
  class="mr-15"
106
107
  :src="getProviderIcon(props.option.provider)"
107
108
  onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
108
109
  alt="No cluster selected"
109
110
  />
110
- <div>
111
- <p>{{ props.option.displayName }}</p>
111
+ <div class="is-fullwidth">
112
+ <p class="is-flex is-justify-content-space-between is-fullwidth">
113
+ <span>{{ props.option.displayName }}</span>
114
+ <badge
115
+ v-if="props.option?.$isDisabled"
116
+ modifierClasses="is-warning is-outlined"
117
+ :label="props.option?.status || 'Not Available'"
118
+ >
119
+ </badge>
120
+ </p>
112
121
  <p class="location">{{ props.option.location }}</p>
113
122
  </div>
114
123
  </div>
@@ -49,7 +49,7 @@ watch(
49
49
  <img :src="icon" alt="icon" />
50
50
  </span>
51
51
  <strong>{{ title }}</strong>
52
- <span v-if="id === 'claim'" class="badge is-primary whats-new-rel">NEW</span>
52
+ <span v-if="id === 'claim'" class="badge is-primary whats-new-rel ml-8">NEW</span>
53
53
  </router-link>
54
54
  </li>
55
55
  </template>