Skip to content

Commit

Permalink
Merge pull request #1962 from slntopp/dev-fixes
Browse files Browse the repository at this point in the history
Dev fixes
  • Loading branch information
SazukinPavel authored Jan 16, 2025
2 parents 8585ff7 + 7338508 commit f0a1d09
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
4 changes: 4 additions & 0 deletions admin-ui/src/components/ServicesProvider/info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ const plansParams = computed(() => {
type.push("ione-vpn");
}
if (provider.value.type === "empty") {
type.push("vpn");
}
return {
showDeleted: false,
excludeUuids: relatedPlans.value?.map((p) => p.uuid) || [],
Expand Down
1 change: 1 addition & 0 deletions admin-ui/src/components/showcases_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<icon-title-preview
type="nocloud"
:icon="item.icon"
:color="item.meta.iconColor"
:title="item.title"
/>
</template>
Expand Down
3 changes: 2 additions & 1 deletion admin-ui/src/components/ui/iconTitlePreview.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="d-flex justify-space-between" style="width: 100%">
<span>{{ title }}</span>
<nocloud-icon :type="type" :icon="icon" />
<nocloud-icon :color="color" :type="type" :icon="icon" />
</div>
</template>

Expand All @@ -15,6 +15,7 @@ export default {
type: {},
title: { type: String, default: "none" },
icon: { type: String, default: "" },
color: { type: String, default: "" },
},
};
</script>
Expand Down
14 changes: 11 additions & 3 deletions admin-ui/src/components/ui/nocloudIcon.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<template>
<v-icon class="ml-2" v-if="isMdi">{{ `mdi-${iconName}` }}</v-icon>
<ant-icon v-else-if="isAnt" class="ml-2" :name="iconName" />
<v-icon :style="{ fill: color }" :color="color" class="ml-2" v-if="isMdi">{{
`mdi-${iconName}`
}}</v-icon>
<ant-icon
:style="{ fill: color }"
v-else-if="isAnt"
class="ml-2"
:name="iconName"
/>
<img
v-else-if="iconName && !loadedError"
width="22px"
height="22px"
:src="iconName"
/>
<ant-icon v-else class="ml-2" :name="icon" />
<ant-icon :style="{ fill: color }" v-else class="ml-2" :name="icon" />
</template>

<script setup>
Expand All @@ -18,6 +25,7 @@ const props = defineProps({
type: { type: String, default: "mdi" },
title: { type: String, default: "none" },
icon: { type: String, default: "" },
color: { type: String, default: "" },
});
const { type, icon } = toRefs(props);
Expand Down
11 changes: 9 additions & 2 deletions admin-ui/src/views/ShowcaseCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
@input:value="showcase.icon = $event"
/>
</v-col>
<v-col cols="2">
<color-picker label="Color" v-model="showcase.meta.iconColor" />
</v-col>
<v-col cols="3">
<v-autocomplete
clearable
Expand Down Expand Up @@ -128,6 +131,7 @@ import { useStore } from "@/store";
import api from "@/api";
import { useRouter } from "vue-router/composables";
import LocationsAutocomplete from "@/components/ui/locationsAutocomplete.vue";
import ColorPicker from "@/components/ui/colorPicker.vue";
const props = defineProps({
realShowcase: {},
Expand Down Expand Up @@ -167,6 +171,7 @@ const showcase = ref({
public: true,
meta: {
type: "",
iconColor: "",
},
});
Expand Down Expand Up @@ -371,7 +376,9 @@ const fetchPlans = async () => {
try {
await Promise.all(
showcase.value.items.map(async ({ servicesProvider: sp }) => {
showcase.value.items.map(async (item) => {
let sp = item.servicesProvider;
try {
if (sp && !plansBySpMap.value.has(sp)) {
plansBySpMap.value.set(
Expand All @@ -396,7 +403,7 @@ const fetchPlans = async () => {
}
};
watch(showcase.value.items, fetchPlans);
watch(() => showcase.value.items, fetchPlans,{deep:true});
</script>
<style scoped lang="scss">
Expand Down

0 comments on commit f0a1d09

Please sign in to comment.