Skip to content

Commit

Permalink
Merge pull request #1101 from slntopp/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SazukinPavel authored Sep 12, 2023
2 parents 46a9230 + 29c7fe0 commit 769f801
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 110 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v4.2.1
with:
context: .
file: Dockerfile
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v4.2.1
id: build
with:
context: .
Expand Down
37 changes: 17 additions & 20 deletions admin-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
app
permanent
:color="asideColor"
style="position: relative; height: 100%"
:mini-variant="isMenuMinimize"
>
<router-link to="/">
Expand Down Expand Up @@ -312,13 +311,7 @@
<v-spacer></v-spacer>
</v-app-bar>

<v-main
:class="{
main: true,
menuClosed: isMenuMinimize,
menuOpen: !isMenuMinimize,
}"
>
<v-main>
<router-view />
</v-main>
<app-snackbar />
Expand Down Expand Up @@ -470,18 +463,22 @@ export default {
</style>
<style lang="scss">
.v-application--wrap{
display: flex;
flex-direction: row;
max-width: unset;
::-webkit-scrollbar {
width: 8px;
height: 8px;
border: none;
border-radius: unset;
}
::-webkit-scrollbar-track {
background: transparent;
}
.main {
padding: 64px 0px 0px 0px !important;
&.menuClosed {
max-width: calc(100vw - 70px);
}
&.menuOpen {
max-width: calc(100vw - 260px)
}
::-webkit-scrollbar-thumb {
background: #000033;
}
::-webkit-scrollbar-thumb:hover {
background: #c921c9;
}
</style>
30 changes: 20 additions & 10 deletions admin-ui/src/components/historyTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,38 @@ const getServiceProvider = (uuid) => {
const getFilterItems = async () => {
const { unique } = await api.logging.count({});
const actionItems = unique.actions.map((a) => ({ title: a, uuid: a }));
const scopeItems = unique.scopes.map((a) => ({ title: a, uuid: a }));
store.commit("appSearch/pushVariant", {
key: "action",
value: {
items: unique.actions.map((a) => ({ title: a, uuid: a })),
items: actionItems,
isArray: true,
key: "action",
title: "Action",
},
});
store.commit("appSearch/pushVariant", {
key: "scope",
value: {
items: unique.scopes.map((s) => ({ title: s, uuid: s })),
isArray: true,
items: scopeItems,
key: "scope",
title: "Scopes",
},
});
if (Object.keys(store.getters["appSearch/customParams"]).length === 0) {
const hiddenActions = ["monitoring", "regions"];
const defaultCustomParams = [];
actionItems.forEach(({ title, uuid }) => {
if (!hiddenActions.includes(title)) {
defaultCustomParams.push({ title, value: uuid });
}
});
store.commit("appSearch/setCustomParams", { action: defaultCustomParams });
}
};
const isLoading = computed(() => {
Expand All @@ -237,14 +253,8 @@ const requestOptions = computed(() => ({
field: options.value.sortBy[0],
sort: options.value.sortBy[0] && options.value.sortDesc[0] ? "DESC" : "ASC",
filters: {
action:
(searchParams.value.action?.value && [
searchParams.value.action?.value,
]) ||
undefined,
scope:
(searchParams.value.scope?.value && [searchParams.value.scope?.value]) ||
undefined,
action: searchParams.value.action?.map(({ value }) => value) || undefined,
scope: searchParams.value.scope?.map(({ value }) => value) || undefined,
path: path.value || undefined,
},
}));
Expand Down
21 changes: 18 additions & 3 deletions admin-ui/src/components/modules/virtual/instanceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,25 @@
/>
</v-col>
<v-col cols="6">
<v-select
<v-autocomplete
label="product"
:value="instance.product"
v-if="products.length > 0"
:items="products"
item-text="key"
item-value="key"
@change="setValue('product', $event)"
/>
>
<template v-slot:item="{ item }">
<div
style="width: 100%"
class="d-flex justify-space-between align-center"
>
<span>{{ item.key }}</span>
<span class="ml-4">{{ item.title }}</span>
</div>
</template>
</v-autocomplete>
</v-col>
</v-row>
</v-card>
Expand Down Expand Up @@ -63,7 +75,10 @@ export default {
changeBilling(val) {
this.bilingPlan = this.plans.list.find((p) => p.uuid === val);
if (this.bilingPlan) {
this.products = Object.keys(this.bilingPlan.products);
this.products = Object.keys(this.bilingPlan.products).map((key) => ({
key,
title: this.bilingPlan.products[key].title,
}));
}
this.setValue("billing_plan", this.bilingPlan);
},
Expand Down
6 changes: 3 additions & 3 deletions admin-ui/src/components/plan/cpanelPrices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default {
{ text: "lve_pmem", value: "lve_pmem" },
{ text: "Period", value: "period", width: 220 },
{ text: "Price", value: "price", width: 150 },
{ text: "Sell", value: "enabled" },
{ text: "Enabled", value: "enabled" },
],
}),
methods: {
Expand Down Expand Up @@ -140,7 +140,7 @@ export default {
model: item.name,
bandwidth: item.BWLIMIT || undefined,
ssd: item.QUOTA || undefined,
email: item.MAX_EMAILACCT_QUOTA || undefined,
email: item.MAX_EMAILACCT_QUOTA || undefined,
mysql: item.MAXSQL || undefined,
websites: 1 + +item.MAXADDON || undefined,
},
Expand All @@ -158,7 +158,7 @@ export default {
});
this.showSnackbarSuccess({ message: "Plan save successfully" });
} catch (e) {
console.log(e)
console.log(e);
this.showSnackbarError({ message: "Error on save plan" });
} finally {
this.isSaveLoading = false;
Expand Down
9 changes: 8 additions & 1 deletion admin-ui/src/components/search/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,16 @@ export default {
}
if (localStorage.getItem(val)) {
const savedValue = JSON.parse(localStorage.getItem(val));
const savedValueWithoutEmptys = {};
Object.keys(savedValue).forEach((key) => {
if (Object.keys(savedValue[key]).length > 0) {
savedValueWithoutEmptys[key] = savedValue[key];
}
});
this.$store.commit(
"appSearch/setCustomParams",
JSON.parse(localStorage.getItem(val))
savedValueWithoutEmptys
);
}
},
Expand Down
43 changes: 21 additions & 22 deletions admin-ui/src/components/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,23 @@
</v-list>
</v-menu>
</template>
<!-- if show select show v-checkbox all, and dont hide v-checkbox on every row-->
<!-- Else hide v-checkbox all and hide checkboxes on every row-->

<template v-slot:[`header.data-table-select`]="{ props, on }">
<div class="d-flex">
<v-simple-checkbox
v-if="showSelect"
v-bind="props"
v-on="on"
></v-simple-checkbox>

<template v-if="!showSelect" v-slot:[`item.data-table-select`]>
<div></div>
</template>

<template v-if="footerError.length > 0" v-slot:footer>
<v-toolbar class="mt-2" color="error" dark flat>
<v-toolbar-title class="subheading">
{{ footerError }}
</v-toolbar-title>
</v-toolbar>
</template>

<template
v-slot:[`footer.page-text`]="{ pageStart, pageStop, itemsLength }"
>
<div class="d-flex align-center">
<v-dialog
@click:outside="changeFiltres"
max-width="60%"
Expand Down Expand Up @@ -162,19 +169,11 @@
<v-icon @click="resetFilter" size="23" class="mr-1s"
>mdi-filter-remove</v-icon
>
<span class="ml-3">
{{ pageStart }}-{{ pageStop }} of {{ itemsLength }}
</span>
</div>
</template>
<template v-if="!showSelect" v-slot:[`item.data-table-select`]>
<div></div>
</template>

<template v-if="footerError.length > 0" v-slot:footer>
<v-toolbar class="mt-2" color="error" dark flat>
<v-toolbar-title class="subheading">
{{ footerError }}
</v-toolbar-title>
</v-toolbar>
</template>
</components>
</template>

Expand Down Expand Up @@ -614,4 +613,4 @@ export default {
color: salmon;
background-color: rgb(13, 16, 60);
}
</style>
</style>
10 changes: 5 additions & 5 deletions admin-ui/src/store/appSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
state.searchName = "";
},
pushVariant(state, { key, value }) {
state.variants[key] = value;
state.variants = { ...state.variants, [key]: value };
},
resetSearchParams(state) {
state.searchParam = "";
Expand Down Expand Up @@ -64,8 +64,8 @@ export default {
param(state) {
return state.searchParam;
},
customSearchParam(state){
return state.customParams.searchParam?.value
customSearchParam(state) {
return state.customParams.searchParam?.value;
},
variants(state) {
const variants = { ...state.variants };
Expand All @@ -78,8 +78,8 @@ export default {
return state.searchName + "_search";
},
customParams(state) {
const params={...state.customParams}
delete params['searchParam']
const params = { ...state.customParams };
delete params["searchParam"];
return params;
},
},
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/src/views/Accounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default {
return this.$store.getters["currencies/default"];
},
currencies() {
return this.$store.getters["currencies/all"];
return this.$store.getters["currencies/all"].filter((c) => c !== "NCU");
},
},
mounted() {
Expand Down
Loading

0 comments on commit 769f801

Please sign in to comment.