@appscode/design-system 1.0.43-alpha.78 → 1.0.43-alpha.79
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
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<img
|
|
4
4
|
width="40"
|
|
5
5
|
:src="getProviderIcon(selectedCluster && selectedCluster.provider)"
|
|
6
|
-
|
|
6
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
7
|
+
alt="provider-icon"
|
|
7
8
|
/>
|
|
8
9
|
</div>
|
|
9
10
|
<multiselect
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
v-model="selectedCluster"
|
|
12
13
|
placeholder="Selected Cluster"
|
|
13
14
|
label="name"
|
|
14
|
-
track-by="
|
|
15
|
+
track-by="name"
|
|
15
16
|
:options="options"
|
|
16
17
|
:allow-empty="false"
|
|
17
18
|
deselectLabel=""
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
<div class="is-flex is-align-items-center">
|
|
23
24
|
<img
|
|
24
25
|
:src="getProviderIcon(props.option.provider)"
|
|
26
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
25
27
|
alt="No cluster selected"
|
|
26
28
|
/><span
|
|
27
29
|
><span>{{ props.option.displayName }}</span></span
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
<img
|
|
34
36
|
class="mr-15"
|
|
35
37
|
:src="getProviderIcon(props.option.provider)"
|
|
38
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
36
39
|
alt="No cluster selected"
|
|
37
40
|
/>
|
|
38
41
|
<div>
|
|
@@ -45,7 +48,6 @@
|
|
|
45
48
|
</template>
|
|
46
49
|
|
|
47
50
|
<script>
|
|
48
|
-
import { mapGetters } from "vuex";
|
|
49
51
|
export default {
|
|
50
52
|
props: {
|
|
51
53
|
sidebarCollapsed: {
|
|
@@ -60,14 +62,14 @@ export default {
|
|
|
60
62
|
type: String,
|
|
61
63
|
default: "",
|
|
62
64
|
},
|
|
63
|
-
|
|
64
|
-
type:
|
|
65
|
-
default:
|
|
65
|
+
clusterOptions: {
|
|
66
|
+
type: Array,
|
|
67
|
+
default: [],
|
|
66
68
|
},
|
|
67
69
|
value: {
|
|
68
|
-
type:
|
|
69
|
-
default:
|
|
70
|
-
}
|
|
70
|
+
type: String,
|
|
71
|
+
default: "",
|
|
72
|
+
}
|
|
71
73
|
},
|
|
72
74
|
|
|
73
75
|
components: {
|
|
@@ -77,31 +79,11 @@ export default {
|
|
|
77
79
|
data() {
|
|
78
80
|
return {
|
|
79
81
|
selectedCluster: null,
|
|
80
|
-
|
|
82
|
+
selectedClusterName: null,
|
|
81
83
|
options: [],
|
|
82
84
|
};
|
|
83
85
|
},
|
|
84
86
|
|
|
85
|
-
computed: {
|
|
86
|
-
selectClusterOptions() {
|
|
87
|
-
return this.clusters
|
|
88
|
-
.filter(
|
|
89
|
-
(cluster) =>
|
|
90
|
-
cluster.status.phase === "Connected" ||
|
|
91
|
-
cluster.status.phase === "PrivateConnected"
|
|
92
|
-
)
|
|
93
|
-
.map((cluster) => {
|
|
94
|
-
return {
|
|
95
|
-
name: cluster.spec.name,
|
|
96
|
-
displayName: cluster.spec.displayName,
|
|
97
|
-
provider: cluster.spec.provider,
|
|
98
|
-
uid: cluster.spec.uid,
|
|
99
|
-
location: cluster.spec.location,
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
|
|
105
87
|
methods: {
|
|
106
88
|
async checkStatus(clusterName) {
|
|
107
89
|
try {
|
|
@@ -113,57 +95,43 @@ export default {
|
|
|
113
95
|
return false;
|
|
114
96
|
}
|
|
115
97
|
},
|
|
116
|
-
async getClusters() {
|
|
117
|
-
if (this.username) {
|
|
118
|
-
const url = `/clusters/${this.username}`;
|
|
119
|
-
|
|
120
|
-
try {
|
|
121
|
-
const resp = await this.$axios.get(url);
|
|
122
|
-
this.clusters = (resp.data && resp.data.items) || [];
|
|
123
|
-
|
|
124
|
-
// preselect the cluster
|
|
125
|
-
const selectedCluster = this.clusters.find(
|
|
126
|
-
(cluster) => cluster.spec.name === this.$route.params.cluster
|
|
127
|
-
);
|
|
128
|
-
this.selectedCluster = {
|
|
129
|
-
name: selectedCluster.spec.name,
|
|
130
|
-
displayName: selectedCluster.spec.displayName,
|
|
131
|
-
provider: selectedCluster.spec.provider,
|
|
132
|
-
uid: selectedCluster.spec.uid,
|
|
133
|
-
location: selectedCluster.spec.location,
|
|
134
|
-
};
|
|
135
|
-
} catch (e) {
|
|
136
|
-
console.log(e);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
98
|
|
|
141
99
|
getProviderIcon(provider) {
|
|
142
|
-
return
|
|
100
|
+
return `https://cdn.appscode.com/images/cloud-provider-icons/${provider}.png`;
|
|
143
101
|
},
|
|
144
102
|
},
|
|
145
103
|
|
|
146
|
-
created() {
|
|
147
|
-
this.getClusters();
|
|
148
|
-
},
|
|
149
|
-
|
|
150
104
|
watch: {
|
|
151
105
|
value: {
|
|
152
|
-
deep: true,
|
|
153
106
|
immediate: true,
|
|
154
107
|
handler(n) {
|
|
155
|
-
this.
|
|
108
|
+
this.selectedClusterName = n;
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
selectedCluster: {
|
|
112
|
+
deep: true,
|
|
113
|
+
handler(n) {
|
|
114
|
+
this.selectedClusterName = n.name;
|
|
156
115
|
},
|
|
157
116
|
},
|
|
158
|
-
|
|
117
|
+
selectedClusterName(n) {
|
|
118
|
+
this.$emit("input", n);
|
|
119
|
+
},
|
|
120
|
+
clusterOptions: {
|
|
159
121
|
deep: true,
|
|
160
122
|
immediate: true,
|
|
161
123
|
async handler(list) {
|
|
162
124
|
this.options = [];
|
|
125
|
+
|
|
163
126
|
if (list) {
|
|
164
127
|
list.forEach(async (item) => {
|
|
165
128
|
const resp = await this.checkStatus(item.name);
|
|
166
|
-
if (resp)
|
|
129
|
+
if (resp) {
|
|
130
|
+
this.options.push(item);
|
|
131
|
+
if(item.name === this.selectedClusterName) {
|
|
132
|
+
this.selectedCluster = item;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
167
135
|
});
|
|
168
136
|
}
|
|
169
137
|
},
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<img
|
|
4
4
|
width="40"
|
|
5
5
|
:src="getProviderIcon(selectedCluster && selectedCluster.provider)"
|
|
6
|
-
|
|
6
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
7
|
+
alt="provider-icon"
|
|
7
8
|
/>
|
|
8
9
|
</div>
|
|
9
10
|
<multiselect
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
v-model="selectedCluster"
|
|
12
13
|
placeholder="Selected Cluster"
|
|
13
14
|
label="name"
|
|
14
|
-
track-by="
|
|
15
|
+
track-by="name"
|
|
15
16
|
:options="options"
|
|
16
17
|
:allow-empty="false"
|
|
17
18
|
deselectLabel=""
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
<div class="is-flex is-align-items-center">
|
|
23
24
|
<img
|
|
24
25
|
:src="getProviderIcon(props.option.provider)"
|
|
26
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
25
27
|
alt="No cluster selected"
|
|
26
28
|
/><span
|
|
27
29
|
><span>{{ props.option.displayName }}</span></span
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
<img
|
|
34
36
|
class="mr-15"
|
|
35
37
|
:src="getProviderIcon(props.option.provider)"
|
|
38
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
36
39
|
alt="No cluster selected"
|
|
37
40
|
/>
|
|
38
41
|
<div>
|
|
@@ -60,14 +63,14 @@ export default defineComponent({
|
|
|
60
63
|
type: String,
|
|
61
64
|
default: "",
|
|
62
65
|
},
|
|
63
|
-
|
|
64
|
-
type:
|
|
65
|
-
default:
|
|
66
|
+
clusterOptions: {
|
|
67
|
+
type: Array,
|
|
68
|
+
default: [],
|
|
66
69
|
},
|
|
67
70
|
value: {
|
|
68
|
-
type:
|
|
69
|
-
default:
|
|
70
|
-
}
|
|
71
|
+
type: String,
|
|
72
|
+
default: "",
|
|
73
|
+
}
|
|
71
74
|
},
|
|
72
75
|
|
|
73
76
|
components: {
|
|
@@ -77,31 +80,11 @@ export default defineComponent({
|
|
|
77
80
|
data() {
|
|
78
81
|
return {
|
|
79
82
|
selectedCluster: null,
|
|
80
|
-
|
|
83
|
+
selectedClusterName: null,
|
|
81
84
|
options: [],
|
|
82
85
|
};
|
|
83
86
|
},
|
|
84
87
|
|
|
85
|
-
computed: {
|
|
86
|
-
selectClusterOptions() {
|
|
87
|
-
return this.clusters
|
|
88
|
-
.filter(
|
|
89
|
-
(cluster) =>
|
|
90
|
-
cluster.status.phase === "Connected" ||
|
|
91
|
-
cluster.status.phase === "PrivateConnected"
|
|
92
|
-
)
|
|
93
|
-
.map((cluster) => {
|
|
94
|
-
return {
|
|
95
|
-
name: cluster.spec.name,
|
|
96
|
-
displayName: cluster.spec.displayName,
|
|
97
|
-
provider: cluster.spec.provider,
|
|
98
|
-
uid: cluster.spec.uid,
|
|
99
|
-
location: cluster.spec.location,
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
|
|
105
88
|
methods: {
|
|
106
89
|
async checkStatus(clusterName) {
|
|
107
90
|
try {
|
|
@@ -113,57 +96,43 @@ export default defineComponent({
|
|
|
113
96
|
return false;
|
|
114
97
|
}
|
|
115
98
|
},
|
|
116
|
-
async getClusters() {
|
|
117
|
-
if (this.username) {
|
|
118
|
-
const url = `/clusters/${this.username}`;
|
|
119
|
-
|
|
120
|
-
try {
|
|
121
|
-
const resp = await this.$axios.get(url);
|
|
122
|
-
this.clusters = (resp.data && resp.data.items) || [];
|
|
123
|
-
|
|
124
|
-
// preselect the cluster
|
|
125
|
-
const selectedCluster = this.clusters.find(
|
|
126
|
-
(cluster) => cluster.spec.name === this.$route.params.cluster
|
|
127
|
-
);
|
|
128
|
-
this.selectedCluster = {
|
|
129
|
-
name: selectedCluster.spec.name,
|
|
130
|
-
displayName: selectedCluster.spec.displayName,
|
|
131
|
-
provider: selectedCluster.spec.provider,
|
|
132
|
-
uid: selectedCluster.spec.uid,
|
|
133
|
-
location: selectedCluster.spec.location,
|
|
134
|
-
};
|
|
135
|
-
} catch (e) {
|
|
136
|
-
console.log(e);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
99
|
|
|
141
100
|
getProviderIcon(provider) {
|
|
142
|
-
return
|
|
101
|
+
return `https://cdn.appscode.com/images/cloud-provider-icons/${provider}.png`;
|
|
143
102
|
},
|
|
144
103
|
},
|
|
145
104
|
|
|
146
|
-
created() {
|
|
147
|
-
this.getClusters();
|
|
148
|
-
},
|
|
149
|
-
|
|
150
105
|
watch: {
|
|
151
106
|
value: {
|
|
152
|
-
deep: true,
|
|
153
107
|
immediate: true,
|
|
154
108
|
handler(n) {
|
|
155
|
-
this.
|
|
109
|
+
this.selectedClusterName = n;
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
selectedCluster: {
|
|
113
|
+
deep: true,
|
|
114
|
+
handler(n) {
|
|
115
|
+
this.selectedClusterName = n.name;
|
|
156
116
|
},
|
|
157
117
|
},
|
|
158
|
-
|
|
118
|
+
selectedClusterName(n) {
|
|
119
|
+
this.$emit("input", n);
|
|
120
|
+
},
|
|
121
|
+
clusterOptions: {
|
|
159
122
|
deep: true,
|
|
160
123
|
immediate: true,
|
|
161
124
|
async handler(list) {
|
|
162
125
|
this.options = [];
|
|
126
|
+
|
|
163
127
|
if (list) {
|
|
164
128
|
list.forEach(async (item) => {
|
|
165
129
|
const resp = await this.checkStatus(item.name);
|
|
166
|
-
if (resp)
|
|
130
|
+
if (resp) {
|
|
131
|
+
this.options.push(item);
|
|
132
|
+
if(item.name === this.selectedClusterName) {
|
|
133
|
+
this.selectedCluster = item;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
167
136
|
});
|
|
168
137
|
}
|
|
169
138
|
},
|