From e7e8cbaa822781bb70d4e3baf1741f93fd986ca6 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 12 Sep 2023 13:39:17 +0400 Subject: [PATCH 01/88] fix all types --- admin-ui/src/views/InstanceCreate.vue | 6 ++++-- admin-ui/src/views/Instances.vue | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/admin-ui/src/views/InstanceCreate.vue b/admin-ui/src/views/InstanceCreate.vue index 9e5be093d..932b67a9e 100644 --- a/admin-ui/src/views/InstanceCreate.vue +++ b/admin-ui/src/views/InstanceCreate.vue @@ -264,10 +264,12 @@ export default { const types = require.context( "@/components/modules/", true, - /serviceCreate\.vue$/ + /instanceCreate\.vue$/ ); types.keys().forEach((key) => { - const matched = key.match(/\.\/([A-Za-z0-9-_,\s]*)\/serviceCreate\.vue/i); + const matched = key.match( + /\.\/([A-Za-z0-9-_,\s]*)\/instanceCreate\.vue/i + ); if (matched && matched.length > 1) { const type = matched[1]; this.typeItems.push(type); diff --git a/admin-ui/src/views/Instances.vue b/admin-ui/src/views/Instances.vue index e2e106ef1..b0873a15e 100644 --- a/admin-ui/src/views/Instances.vue +++ b/admin-ui/src/views/Instances.vue @@ -263,11 +263,13 @@ export default { const types = require.context( "@/components/modules/", true, - /serviceCreate\.vue$/ + /instanceCreate\.vue$/ ); types.keys().forEach((key) => { - const matched = key.match(/\.\/([A-Za-z0-9-_,\s]*)\/serviceCreate\.vue/i); + const matched = key.match( + /\.\/([A-Za-z0-9-_,\s]*)\/instanceCreate\.vue/i + ); if (matched && matched.length > 1) { this.allTypes.push(matched[1]); } From 8f6853c084038c692ec34151fe652390e0878095 Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Tue, 12 Sep 2023 13:07:30 +0300 Subject: [PATCH 02/88] Fix merge conflict --- go.mod | 2 +- go.sum | 4 ++-- pkg/billing/records.go | 48 +++++++++++++++++++++++++++++++++++------- pkg/graph/records.go | 20 ++++++++++++++++++ 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index b9b3fa24f..9df0a1b7a 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 github.com/rabbitmq/amqp091-go v1.8.1 github.com/rs/cors v1.10.0 - github.com/slntopp/nocloud-proto v0.0.0-20230906151231-bea1cc083598 + github.com/slntopp/nocloud-proto v0.0.0-20230912095707-1bb19975b685 github.com/spf13/viper v1.16.0 github.com/stoewer/go-strcase v1.3.0 github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 diff --git a/go.sum b/go.sum index a5562073c..d98cd0270 100644 --- a/go.sum +++ b/go.sum @@ -202,8 +202,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/slntopp/nocloud-proto v0.0.0-20230906151231-bea1cc083598 h1:qsp3aJqjT0pqRXILkji6hfnXxZe0whvWHqbpJH3nIik= -github.com/slntopp/nocloud-proto v0.0.0-20230906151231-bea1cc083598/go.mod h1:7A1kZNGXKKLhEnt2ELeb1e1XgeyAUkCpgxjyg/Vn5vg= +github.com/slntopp/nocloud-proto v0.0.0-20230912095707-1bb19975b685 h1:z55krMEmUcSgmnb3szZBhuqGdxEwcuLa0BcUotG/AO0= +github.com/slntopp/nocloud-proto v0.0.0-20230912095707-1bb19975b685/go.mod h1:HY6zAuqFtnMRWY2uSvpvyBioOOk3iGl0qUdAxOhja0k= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= diff --git a/pkg/billing/records.go b/pkg/billing/records.go index 00e377e10..38083a715 100644 --- a/pkg/billing/records.go +++ b/pkg/billing/records.go @@ -411,11 +411,27 @@ func (s *BillingServiceServer) GetInstancesReportsCount(ctx context.Context, req func (s *BillingServiceServer) GetRecordsReports(ctx context.Context, req *pb.GetRecordsReportsRequest) (*pb.GetRecordsReportsResponse, error) { requestor := ctx.Value(nocloud.NoCloudAccount).(string) - ns := driver.NewDocumentID(schema.NAMESPACES_COL, schema.ROOT_NAMESPACE_KEY) + if req.Account != nil || req.Service != nil { + if req.Account != nil { + acc := *req.Account + node := driver.NewDocumentID(schema.ACCOUNTS_COL, acc) + if !graph.HasAccess(ctx, s.db, requestor, node, access.Level_ADMIN) { + return nil, status.Error(codes.PermissionDenied, "Not enough Access Rights") + } + } - ok := graph.HasAccess(ctx, s.db, requestor, ns, access.Level_ROOT) - if !ok { - return nil, status.Error(codes.PermissionDenied, "Permission denied") + if req.Service != nil { + srv := *req.Account + node := driver.NewDocumentID(schema.ACCOUNTS_COL, srv) + if !graph.HasAccess(ctx, s.db, requestor, node, access.Level_ADMIN) { + return nil, status.Error(codes.PermissionDenied, "Not enough Access Rights") + } + } + } else { + ns := driver.NewDocumentID(schema.NAMESPACES_COL, schema.ROOT_NAMESPACE_KEY) + if ok := graph.HasAccess(ctx, s.db, requestor, ns, access.Level_ROOT); !ok { + return nil, status.Error(codes.PermissionDenied, "Permission denied") + } } return s.records.GetRecordsReports(ctx, req) @@ -424,11 +440,27 @@ func (s *BillingServiceServer) GetRecordsReports(ctx context.Context, req *pb.Ge func (s *BillingServiceServer) GetRecordsReportsCount(ctx context.Context, req *pb.GetRecordsReportsCountRequest) (*pb.GetReportsCountResponse, error) { requestor := ctx.Value(nocloud.NoCloudAccount).(string) - ns := driver.NewDocumentID(schema.NAMESPACES_COL, schema.ROOT_NAMESPACE_KEY) + if req.Account != nil || req.Service != nil { + if req.Account != nil { + acc := *req.Account + node := driver.NewDocumentID(schema.ACCOUNTS_COL, acc) + if !graph.HasAccess(ctx, s.db, requestor, node, access.Level_ADMIN) { + return nil, status.Error(codes.PermissionDenied, "Not enough Access Rights") + } + } - ok := graph.HasAccess(ctx, s.db, requestor, ns, access.Level_ROOT) - if !ok { - return nil, status.Error(codes.PermissionDenied, "Permission denied") + if req.Service != nil { + srv := *req.Account + node := driver.NewDocumentID(schema.ACCOUNTS_COL, srv) + if !graph.HasAccess(ctx, s.db, requestor, node, access.Level_ADMIN) { + return nil, status.Error(codes.PermissionDenied, "Not enough Access Rights") + } + } + } else { + ns := driver.NewDocumentID(schema.NAMESPACES_COL, schema.ROOT_NAMESPACE_KEY) + if ok := graph.HasAccess(ctx, s.db, requestor, ns, access.Level_ROOT); !ok { + return nil, status.Error(codes.PermissionDenied, "Permission denied") + } } res, err := s.records.GetRecordsReportsCount(ctx, req) diff --git a/pkg/graph/records.go b/pkg/graph/records.go index 7a425e437..2b0cf5b65 100644 --- a/pkg/graph/records.go +++ b/pkg/graph/records.go @@ -189,6 +189,16 @@ func (ctrl *RecordsController) GetRecordsReports(ctx context.Context, req *pb.Ge "@records": schema.RECORDS_COL, } + if req.Account != nil { + query += ` FILTER t.account == @acc` + params["acc"] = req.GetAccount() + } + + if req.Service != nil { + query += ` FILTER t.service == @srv` + params["srv"] = req.GetService() + } + if req.From != nil { query += " FILTER record.exec >= @from" params["from"] = req.GetFrom() @@ -272,6 +282,16 @@ func (ctrl *RecordsController) GetRecordsReportsCount(ctx context.Context, req * "@records": schema.RECORDS_COL, } + if req.Account != nil { + query += ` FILTER t.account == @acc` + params["acc"] = req.GetAccount() + } + + if req.Service != nil { + query += ` FILTER t.service == @srv` + params["srv"] = req.GetService() + } + if req.From != nil { query += " FILTER record.exec >= @from" params["from"] = req.GetFrom() From 04aeeb7efa3dc12bbfaeb7d0321b272884b8810c Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 12 Sep 2023 14:41:13 +0400 Subject: [PATCH 03/88] add accountId to instance create --- admin-ui/src/views/InstanceCreate.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/admin-ui/src/views/InstanceCreate.vue b/admin-ui/src/views/InstanceCreate.vue index 932b67a9e..85cca3db0 100644 --- a/admin-ui/src/views/InstanceCreate.vue +++ b/admin-ui/src/views/InstanceCreate.vue @@ -74,6 +74,7 @@ @set-meta="meta = $event" :instance="instance" :plans="plans" + :account-id="accountId" :plan-rules="planRules" :sp-uuid="serviceProviderId" :is="templates[type] ?? templates.custom" From d3ade890d44affd8f56e9c502710ffb10fb5d05d Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 12 Sep 2023 14:41:40 +0400 Subject: [PATCH 04/88] add openai instance create,sp create, instance billing --- .../components/modules/openai/billingInfo.vue | 213 ++++++++++++++++++ .../modules/openai/instanceCreate.vue | 83 +++++++ .../modules/openai/serviceProviders.vue | 117 ++++++++++ 3 files changed, 413 insertions(+) create mode 100644 admin-ui/src/components/modules/openai/billingInfo.vue create mode 100644 admin-ui/src/components/modules/openai/instanceCreate.vue create mode 100644 admin-ui/src/components/modules/openai/serviceProviders.vue diff --git a/admin-ui/src/components/modules/openai/billingInfo.vue b/admin-ui/src/components/modules/openai/billingInfo.vue new file mode 100644 index 000000000..b8f29235f --- /dev/null +++ b/admin-ui/src/components/modules/openai/billingInfo.vue @@ -0,0 +1,213 @@ + + + + + diff --git a/admin-ui/src/components/modules/openai/instanceCreate.vue b/admin-ui/src/components/modules/openai/instanceCreate.vue new file mode 100644 index 000000000..e115e7701 --- /dev/null +++ b/admin-ui/src/components/modules/openai/instanceCreate.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/admin-ui/src/components/modules/openai/serviceProviders.vue b/admin-ui/src/components/modules/openai/serviceProviders.vue new file mode 100644 index 000000000..bcc437f7e --- /dev/null +++ b/admin-ui/src/components/modules/openai/serviceProviders.vue @@ -0,0 +1,117 @@ + + + From 9de7683591b3d74bd6f327cb638c4fe55aa7c26d Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 12 Sep 2023 14:41:53 +0400 Subject: [PATCH 05/88] add openai to change prices --- admin-ui/src/components/instance/controls.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin-ui/src/components/instance/controls.vue b/admin-ui/src/components/instance/controls.vue index 355f51bdc..393889af0 100644 --- a/admin-ui/src/components/instance/controls.vue +++ b/admin-ui/src/components/instance/controls.vue @@ -114,8 +114,9 @@ export default { ...this.copyTemplate.billingPlan, title, products: { - [this.product]: - this.copyTemplate.billingPlan.products[this.product], + [this.product]: this.product + ? this.copyTemplate.billingPlan.products[this.product] + : undefined, }, public: false, }; @@ -308,6 +309,7 @@ export default { switch (type) { case "virtual": + case "openai": case "ione": { return (item) => { let planTitle = `IND_${this.sp.title}_${ From c25b30565c4db7834fbc3108a849858978483d12 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 12 Sep 2023 15:42:57 +0400 Subject: [PATCH 06/88] make menu open on hover --- admin-ui/src/App.vue | 408 +++++++++++++++++++++++-------------------- 1 file changed, 223 insertions(+), 185 deletions(-) diff --git a/admin-ui/src/App.vue b/admin-ui/src/App.vue index 60c6c70ad..87e91051f 100644 --- a/admin-ui/src/App.vue +++ b/admin-ui/src/App.vue @@ -43,7 +43,7 @@ - +
- - mdi-view-dashboard-variant - - - - {{ navTitle("Dashboard") }} - - - - - - mdi-account-multiple - - - - {{ navTitle("Accounts") }} - - - - - - mdi-form-textbox - - - - {{ - navTitle("Groups (NameSpaces)") - }} - - - - - - mdi-alien - - - - {{ navTitle("Services") }} - - - - - - mdi-server - - - - {{ navTitle("Instances") }} - - - - - - mdi-database-marker - - - - {{ - navTitle("Services Providers") - }} - - - - - - mdi-store-search - - - - {{ navTitle("Showcases") }} - - - - BILLING - - - - mdi-script-text - - - - {{ - navTitle("Price Models") - }} - - - - - - mdi-abacus - - - - {{ - navTitle("Transactions") - }} - - - - - - mdi-cash - - - - {{ navTitle("Currencies") }} - - - - - - mdi-chart-gantt - - - - {{ navTitle("Reports") }} - - - - PLUGINS - - - - mdi-{{ plugin.icon }} - - - - {{ navTitle(plugin.title) }} - - - - SYSTEM - - - - mdi-chat - - - - {{ navTitle("Chats") }} - - - - - - mdi-history - - - - {{ navTitle("Event log") }} - - - - - - mdi-dns - - - - {{ navTitle("DNS manager") }} - - - - - - mdi-cogs - - - - {{ navTitle("Settings") }} - - +
+ + + mdi-view-dashboard-variant + + + + {{ navTitle("Dashboard") }} + + + + + + mdi-account-multiple + + + + {{ navTitle("Accounts") }} + + + + + + mdi-form-textbox + + + + {{ + navTitle("Groups (NameSpaces)") + }} + + + + + + mdi-alien + + + + {{ navTitle("Services") }} + + + + + + mdi-server + + + + {{ navTitle("Instances") }} + + + + + + mdi-database-marker + + + + {{ + navTitle("Services Providers") + }} + + + + + + mdi-store-search + + + + {{ navTitle("Showcases") }} + + + + BILLING + + + + mdi-script-text + + + + {{ + navTitle("Price Models") + }} + + + + + + mdi-abacus + + + + {{ + navTitle("Transactions") + }} + + + + + + mdi-cash + + + + {{ + navTitle("Currencies") + }} + + + + + + mdi-chart-gantt + + + + {{ navTitle("Reports") }} + + + + PLUGINS + + + + mdi-{{ plugin.icon }} + + + + {{ + navTitle(plugin.title) + }} + + + + SYSTEM + + + + mdi-chat + + + + {{ navTitle("Chats") }} + + + + + + mdi-history + + + + {{ navTitle("Event log") }} + + + + + + mdi-dns + + + + {{ + navTitle("DNS manager") + }} + + + + + + mdi-cogs + + + + {{ navTitle("Settings") }} + + +
@@ -321,6 +332,7 @@ export default { components: { AppSnackbar, balance, appSearch, languages }, data: () => ({ isMenuMinimize: true, + isMouseOnMenu: false, easterEgg: false, config, navTitles: config.navTitles ?? {}, @@ -344,6 +356,30 @@ export default { return title; }, + configureHoverOnMenu() { + document + .getElementById("drawer-menu-hover") + .addEventListener("mouseenter", () => { + if (this.isMenuMinimize) { + this.isMouseOnMenu = true; + setTimeout(() => { + if (this.isMouseOnMenu) { + this.isMenuMinimize = false; + } + }, 500); + } + }); + document + .getElementById("drawer-menu-hover") + .addEventListener("mouseleave", () => { + if (this.isMouseOnMenu) { + this.isMouseOnMenu = false; + setTimeout(() => { + this.isMenuMinimize = true; + }, 500); + } + }); + }, }, computed: { isLoggedIn() { @@ -437,6 +473,8 @@ export default { mounted() { this.onResize(); window.addEventListener("resize", this.onResize, { passive: true }); + + this.configureHoverOnMenu(); }, watch: { isLoggedIn(newVal) { From 6cb2a6a8473fa346ba2cbfe0c5255b22f659446a Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 12 Sep 2023 15:45:57 +0400 Subject: [PATCH 07/88] move servecis down showcases --- admin-ui/src/App.vue | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/admin-ui/src/App.vue b/admin-ui/src/App.vue index 87e91051f..c59698b5e 100644 --- a/admin-ui/src/App.vue +++ b/admin-ui/src/App.vue @@ -92,22 +92,6 @@ - - - mdi-alien - - - - {{ navTitle("Services") }} - - - mdi-server @@ -143,6 +127,22 @@ + + + mdi-alien + + + + {{ navTitle("Services") }} + + + BILLING From 6cfe6e0f64a1af64a756a80051fbd3c45e7d905f Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Tue, 12 Sep 2023 15:21:53 +0300 Subject: [PATCH 08/88] Add login event --- pkg/registry/accounts.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/registry/accounts.go b/pkg/registry/accounts.go index 7f0df6ca2..9a152d10e 100644 --- a/pkg/registry/accounts.go +++ b/pkg/registry/accounts.go @@ -17,6 +17,7 @@ package registry import ( "context" + elpb "github.com/slntopp/nocloud-proto/events_logging" "github.com/slntopp/nocloud/pkg/nocloud/sessions" "time" @@ -366,6 +367,21 @@ func (s *AccountsServiceServer) Token(ctx context.Context, request *accountspb.T return nil, status.Error(codes.Internal, "Failed to issue token") } + var event = &elpb.Event{ + Entity: schema.ACCOUNTS_COL, + Uuid: requestor.(string), + Scope: "database", + Action: "login", + Rc: 0, + Requestor: requestor.(string), + Ts: time.Now().Unix(), + Snapshot: &elpb.Snapshot{ + Diff: "", + }, + } + + nocloud.Log(log, event) + return &accountspb.TokenResponse{Token: token_string}, nil } From d558327945e61583e079d1027d7c04a28269e4d6 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 12 Sep 2023 17:08:50 +0400 Subject: [PATCH 09/88] add multilanguage title --- admin-ui/src/components/showcase/promo.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/admin-ui/src/components/showcase/promo.vue b/admin-ui/src/components/showcase/promo.vue index c50a2f967..1ca6efaf3 100644 --- a/admin-ui/src/components/showcase/promo.vue +++ b/admin-ui/src/components/showcase/promo.vue @@ -26,6 +26,11 @@ @@ -151,7 +158,7 @@ export default { value: this.searchParam, title: this.searchParam, isArray, - full: false, + temporary: true, }, }); } @@ -165,13 +172,17 @@ export default { }, setEntity(index) { const item = this.searchItems[index]; + if (item.isSelect) { + return; + } + const variant = this.variants[this.selectedGroupKey] || this.variants[item?.key]; const key = variant?.key || this.selectedGroupKey; if (variant?.isArray) { this.customParams[key]?.forEach((i) => { - if (!i.full) { + if (i.temporary) { this.$store.commit("appSearch/deleteCustomParam", { ...i, key }); } }); @@ -183,7 +194,6 @@ export default { value: item[variant.itemKey || "uuid"], title: item[variant.itemTitle || "title"], isArray: variant.isArray, - full: true, }, }); @@ -233,17 +243,27 @@ export default { return "group"; }, searchItems() { - return ( - this.variants[this.selectedGroupKey]?.items.filter( - (i) => - !this.searchParam || - i.title.toLowerCase().includes(this.searchParam.toLowerCase()) - ) || - Object.keys(this.variants).map((key) => ({ - key, - title: this.variants[key]?.title || key, - })) - ); + if (this.variants[this.selectedGroupKey]?.items) { + return this.variants[this.selectedGroupKey]?.items + .filter( + (i) => + !this.searchParam || + i.title.toLowerCase().includes(this.searchParam.toLowerCase()) + ) + .map((p) => ({ + ...p, + isSelect: !!this.customParamsValues.find( + (cp) => cp.value === p.uuid + ), + })) + .sort((x, y) => + x.isSelect === y.isSelect ? 0 : x.isSelect ? 1 : -1 + ); + } + return Object.keys(this.variants).map((key) => ({ + key, + title: this.variants[key]?.title || key, + })); }, customParamsValues() { const values = []; From 3693b18580abe5d1a638e6c159f371e74d5da409 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Wed, 13 Sep 2023 13:23:19 +0400 Subject: [PATCH 16/88] fix api --- admin-ui/src/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-ui/src/api.js b/admin-ui/src/api.js index 621b3185b..41233c8e5 100644 --- a/admin-ui/src/api.js +++ b/admin-ui/src/api.js @@ -1,6 +1,6 @@ import Api from "nocloudjsrest"; import vuex from "@/store/index.js"; -const api = new Api("http://localhost/http://api.nocloud.ione-cloud.net", 8624); +const api = new Api(); api.axios.interceptors.response.use( (response) => response, From 02a290d783a938846753674753395f9d871b51ae Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Wed, 13 Sep 2023 13:35:02 +0300 Subject: [PATCH 17/88] Fix --- pkg/registry/namespaces.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/registry/namespaces.go b/pkg/registry/namespaces.go index b637da768..2d51f6729 100644 --- a/pkg/registry/namespaces.go +++ b/pkg/registry/namespaces.go @@ -17,6 +17,7 @@ package registry import ( "context" + "fmt" "github.com/arangodb/go-driver" pb "github.com/slntopp/nocloud-proto/registry" @@ -129,7 +130,7 @@ func (s *NamespacesServiceServer) Join(ctx context.Context, request *namespacesp err = s.ctrl.Join(ctx, acc, ns, level, roles.DEFAULT) if err != nil { s.log.Debug("Error while joining account", zap.Error(err)) - return nil, status.Error(codes.Internal, "Error while joining account") + return nil, status.Error(codes.Internal, fmt.Sprintf("Error while joining account. %s", err.Error())) } return &namespacespb.JoinResponse{Result: true}, nil } From f0e3800777063e94ae6172715dee35a5eb63c75a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:15:17 +0200 Subject: [PATCH 18/88] Bump docker/login-action from 2.2.0 to 3.0.0 (#1107) Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2.2.0...v3.0.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c80238446..0e7b2f99d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: images: ${{ env.REGISTRY }}/slntopp/nocloud/base - name: Log in to the Container registry - uses: docker/login-action@v2.2.0 + uses: docker/login-action@v3.0.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -113,7 +113,7 @@ jobs: images: ${{ env.REGISTRY }}/slntopp/nocloud/${{matrix.tag}} - name: Log in to the Container registry - uses: docker/login-action@v2.2.0 + uses: docker/login-action@v3.0.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} From 3f7d29d69980330118ef8e25fa1750d26af62aa0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:15:31 +0200 Subject: [PATCH 19/88] Bump docker/build-push-action from 4.2.1 to 5.0.0 (#1108) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.2.1 to 5.0.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4.2.1...v5.0.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e7b2f99d..4c6d2f41f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v4.2.1 + uses: docker/build-push-action@v5.0.0 with: context: . file: Dockerfile @@ -120,7 +120,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v4.2.1 + uses: docker/build-push-action@v5.0.0 id: build with: context: . From 96cad4912f63cbacc01d5b75726f2a75b54a0551 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:15:44 +0200 Subject: [PATCH 20/88] Bump docker/metadata-action from 4.6.0 to 5.0.0 (#1109) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.6.0 to 5.0.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md) - [Commits](https://github.com/docker/metadata-action/compare/v4.6.0...v5.0.0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c6d2f41f..afb17d49f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4.6.0 + uses: docker/metadata-action@v5.0.0 with: tags: type=raw,value=${{env.IMAGE_TAG}} images: ${{ env.REGISTRY }}/slntopp/nocloud/base @@ -107,7 +107,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4.6.0 + uses: docker/metadata-action@v5.0.0 with: tags: type=raw,value=${{env.IMAGE_TAG}} images: ${{ env.REGISTRY }}/slntopp/nocloud/${{matrix.tag}} From 048cf88babbcd14588dbe9d230dd7662e65edfc4 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Wed, 13 Sep 2023 19:03:26 +0400 Subject: [PATCH 21/88] add plan shortcat --- admin-ui/src/components/instance/info.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/admin-ui/src/components/instance/info.vue b/admin-ui/src/components/instance/info.vue index f5a819f18..77f57c838 100644 --- a/admin-ui/src/components/instance/info.vue +++ b/admin-ui/src/components/instance/info.vue @@ -97,6 +97,13 @@ label="Service provider" /> + + + @@ -224,6 +231,9 @@ export default { sp() { return this.servicesProviders?.find((sp) => sp?.uuid == this.template.sp); }, + plan() { + return this.template.billingPlan; + }, additionalInstanceInfoComponent() { return () => import(`@/components/modules/${this.type}/additionalInstanceInfo.vue`); From 09ac1bab8a5ca3e2cab5df2358f5d5123305322e Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Wed, 13 Sep 2023 19:12:57 +0400 Subject: [PATCH 22/88] fix no plans --- admin-ui/src/views/PlansCreate.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/admin-ui/src/views/PlansCreate.vue b/admin-ui/src/views/PlansCreate.vue index 971a974fc..679c61f11 100644 --- a/admin-ui/src/views/PlansCreate.vue +++ b/admin-ui/src/views/PlansCreate.vue @@ -466,9 +466,7 @@ export default { }, computed: { searchParam() { - return this.$store.getters[ - "appSearch/customParams" - ]?.searchParam?.value.toLowerCase(); + return this.$store.getters["appSearch/customSearchParam"]?.toLowerCase(); }, template() { const type = this.plan.kind === "DYNAMIC" ? "resources" : "products"; @@ -489,7 +487,7 @@ export default { return document.documentElement.clientWidth; }, productsHide() { - const hidden = ["ovh", "goget", "acronis",'cpanel']; + const hidden = ["ovh", "goget", "acronis", "cpanel"]; return hidden.some((h) => this.plan.type.includes(h)); }, filteredProducts() { @@ -501,7 +499,7 @@ export default { Object.keys(this.plan.products).forEach((key) => { if (key === this.searchParam) { filtered[key] = this.plan.products[key]; - return + return; } if ( From 92fab22fe4e34536f7b6ac5985dd889abd7a9079 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Wed, 13 Sep 2023 19:27:30 +0400 Subject: [PATCH 23/88] fix cpanel plans & add custom sorter nad name --- admin-ui/src/components/plan/cpanelPrices.vue | 54 ++++++++++++------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/admin-ui/src/components/plan/cpanelPrices.vue b/admin-ui/src/components/plan/cpanelPrices.vue index 49b4320ba..ac7c73e4a 100644 --- a/admin-ui/src/components/plan/cpanelPrices.vue +++ b/admin-ui/src/components/plan/cpanelPrices.vue @@ -3,7 +3,7 @@ + + @@ -49,7 +55,7 @@ export default { isPricesLoading: false, isSaveLoading: false, headers: [ - { text: "name", value: "name" }, + { text: "name", value: "name", width: "220px" }, { text: "BWLIMIT", value: "BWLIMIT" }, { text: "CGI", value: "CGI" }, { text: "CPMOD", value: "CPMOD" }, @@ -77,6 +83,7 @@ export default { { text: "lve_nproc", value: "lve_nproc" }, { text: "lve_cpu", value: "lve_cpu" }, { text: "lve_pmem", value: "lve_pmem" }, + { text: "Sorter", value: "sorter" }, { text: "Period", value: "period", width: 220 }, { text: "Price", value: "price", width: 150 }, { text: "Enabled", value: "enabled" }, @@ -103,8 +110,10 @@ export default { this.prices = res.meta.pkg.map((el) => { const price = { ...el }; const product = this.template.products[el.name]; + price.key = el.name; price.price = product?.price || 0; price.period = product?.period || 0; + price.sorter = product?.sorter || 0; price.enabled = !!product; const date = new Date(price.period * 1000); const time = date.toUTCString().split(" "); @@ -131,30 +140,39 @@ export default { }); } - return (this.products[item.name] = { - title: item.name, - kind: "PREPAID", - price: item.price, - period: getTimestamp(item.period), - resources: { - model: item.name, - bandwidth: item.BWLIMIT || undefined, - ssd: item.QUOTA || undefined, - email: item.MAX_EMAILACCT_QUOTA || undefined, - mysql: item.MAXSQL || undefined, - websites: 1 + +item.MAXADDON || undefined, - }, - }); + return; } - this.products[item.name] = undefined; + this.products[item.key] = undefined; }, async savePrices() { + const products = {}; + + this.prices + .filter((p) => p.enabled) + .forEach((item) => { + products[item.key] = { + title: item.name, + kind: "PREPAID", + price: item.price, + period: getTimestamp(item.period), + sorter: item.sorter, + resources: { + model: item.name, + bandwidth: item.BWLIMIT || undefined, + ssd: item.QUOTA || undefined, + email: item.MAX_EMAILACCT_QUOTA || undefined, + mysql: item.MAXSQL || undefined, + websites: 1 + +item.MAXADDON || undefined, + }, + }; + }); + this.isSaveLoading = true; try { await api.plans.update(this.template.uuid, { ...this.template, - products: this.products, + products, }); this.showSnackbarSuccess({ message: "Plan save successfully" }); } catch (e) { From fb5580bf1400bc73ccb42cae6683160b3519018c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 12:46:44 +0200 Subject: [PATCH 24/88] Bump WillAbides/setup-go-faster from 1.10.1 to 1.11.0 (#1112) Bumps [WillAbides/setup-go-faster](https://github.com/willabides/setup-go-faster) from 1.10.1 to 1.11.0. - [Release notes](https://github.com/willabides/setup-go-faster/releases) - [Commits](https://github.com/willabides/setup-go-faster/compare/v1.10.1...v1.11.0) --- updated-dependencies: - dependency-name: WillAbides/setup-go-faster dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0bd7b4c97..3dd1f66f9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -23,7 +23,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: WillAbides/setup-go-faster@v1.10.1 + uses: WillAbides/setup-go-faster@v1.11.0 with: go-version: 1.19 - name: Static Check From 504891e7966002dc85725bd85acdb2646e0ffcca Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Thu, 14 Sep 2023 16:35:34 +0400 Subject: [PATCH 25/88] fix openai vars --- .../components/modules/openai/serviceProviders.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/admin-ui/src/components/modules/openai/serviceProviders.vue b/admin-ui/src/components/modules/openai/serviceProviders.vue index bcc437f7e..444d1168e 100644 --- a/admin-ui/src/components/modules/openai/serviceProviders.vue +++ b/admin-ui/src/components/modules/openai/serviceProviders.vue @@ -85,7 +85,7 @@ export default { if (this.fields[input].type === "secrets") { newSecrets[input] = data; } else { - newVars[input] = { default: data }; + newVars[input] = { value: { default: data } }; } this.$emit(`change:secrets`, newSecrets); @@ -102,15 +102,11 @@ export default { } }); }, - setVarsValueDefault(vars, fieldName, isChange, data) { - vars[fieldName] = { - value: { - default: isChange ? JSON.parse(data) : this.getValue(fieldName), - }, - }; - }, getValue(fieldName) { - return this.secrets[fieldName]; + if (this.fields[fieldName].type === "secrets") { + return this.secrets[fieldName]; + } + return this.vars[fieldName]?.value?.default; }, }, }; From bed36dad08d033b040c9beb737610c4f5fbb1de1 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Thu, 14 Sep 2023 18:30:33 +0400 Subject: [PATCH 26/88] fix no menu events --- admin-ui/src/App.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-ui/src/App.vue b/admin-ui/src/App.vue index c59698b5e..eae0e2804 100644 --- a/admin-ui/src/App.vue +++ b/admin-ui/src/App.vue @@ -359,7 +359,7 @@ export default { configureHoverOnMenu() { document .getElementById("drawer-menu-hover") - .addEventListener("mouseenter", () => { + ?.addEventListener("mouseenter", () => { if (this.isMenuMinimize) { this.isMouseOnMenu = true; setTimeout(() => { @@ -371,7 +371,7 @@ export default { }); document .getElementById("drawer-menu-hover") - .addEventListener("mouseleave", () => { + ?.addEventListener("mouseleave", () => { if (this.isMouseOnMenu) { this.isMouseOnMenu = false; setTimeout(() => { From 1ed745df2f69fd8125f13b563f5b85d57b264e10 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Thu, 14 Sep 2023 18:35:38 +0400 Subject: [PATCH 27/88] add prices to ovh billingInfo --- .../src/components/modules/ovh/billingInfo.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/admin-ui/src/components/modules/ovh/billingInfo.vue b/admin-ui/src/components/modules/ovh/billingInfo.vue index 61ad91802..f3e4a0f60 100644 --- a/admin-ui/src/components/modules/ovh/billingInfo.vue +++ b/admin-ui/src/components/modules/ovh/billingInfo.vue @@ -22,6 +22,7 @@ @@ -57,6 +58,7 @@ @@ -65,6 +67,7 @@ @@ -73,6 +76,7 @@ @@ -80,10 +84,16 @@ Total instance price - {{ isBasePricesLoading ? "Loading..." : totalBasePrice }} + + {{ + isBasePricesLoading + ? "Loading..." + : [totalBasePrice, "PLN"].join(" ") + }} +
- {{ totalNewPrice?.toFixed(2) }} + {{ [totalNewPrice?.toFixed(2), defaultCurrency].join(" ") }}
{{ [accountTotalNewPrice, accountCurrency].join(" ") }} @@ -149,6 +159,8 @@ const accountTotalNewPrice = computed(() => toAccountPrice(totalNewPrice.value) ); +const defaultCurrency = computed(() => store.getters["currencies/default"]); + const setTotalNewPrice = () => { totalNewPrice.value = +pricesItems.value .reduce((acc, i) => +i.price + acc, 0) From cd646f820c18685785c6cd6dd3bbc11541cc2f02 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Thu, 14 Sep 2023 18:37:15 +0400 Subject: [PATCH 28/88] add hideble prices in ovh billing info --- .../components/modules/ovh/billingInfo.vue | 121 ++++++++++-------- 1 file changed, 67 insertions(+), 54 deletions(-) diff --git a/admin-ui/src/components/modules/ovh/billingInfo.vue b/admin-ui/src/components/modules/ovh/billingInfo.vue index f3e4a0f60..ee2f5946f 100644 --- a/admin-ui/src/components/modules/ovh/billingInfo.vue +++ b/admin-ui/src/components/modules/ovh/billingInfo.vue @@ -46,60 +46,73 @@
- - - - - - + + + Prices + + + + + + + + + + + Date: Thu, 14 Sep 2023 18:47:50 +0400 Subject: [PATCH 29/88] merge price & account price in ovh billing info --- .../components/modules/ovh/billingInfo.vue | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/admin-ui/src/components/modules/ovh/billingInfo.vue b/admin-ui/src/components/modules/ovh/billingInfo.vue index ee2f5946f..aa3d2dbfd 100644 --- a/admin-ui/src/components/modules/ovh/billingInfo.vue +++ b/admin-ui/src/components/modules/ovh/billingInfo.vue @@ -63,23 +63,25 @@ :headers="pricesHeaders" :items="pricesItems" > - - From 3eb398393ec87bae5d72fd5201ac85e3bfad0599 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Fri, 15 Sep 2023 11:23:48 +0400 Subject: [PATCH 41/88] add account price --- .../src/components/dialogs/editPriceModel.vue | 53 +++++++++++++++---- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/admin-ui/src/components/dialogs/editPriceModel.vue b/admin-ui/src/components/dialogs/editPriceModel.vue index 661f1031f..6b3d80cea 100644 --- a/admin-ui/src/components/dialogs/editPriceModel.vue +++ b/admin-ui/src/components/dialogs/editPriceModel.vue @@ -3,7 +3,7 @@ persistent :value="value" @input="emit('input', value)" - max-width="60%" + max-width="80%" > Change price model @@ -20,7 +20,7 @@ - + - + - - + + + + + @@ -59,11 +72,25 @@ import { toRefs, ref, computed, onMounted, watch } from "vue"; import api from "@/api"; import { getBillingPeriod } from "@/functions"; - -const props = defineProps(["template", "service", "value", "plans"]); +import useRate from "@/hooks/useRate"; +import { useStore } from "@/store"; + +const props = defineProps([ + "template", + "service", + "value", + "plans", + "accountRate", + "accountCurrency", +]); const emit = defineEmits(["refresh", "input"]); -const { template, plans, service } = toRefs(props); +const { convertFrom } = useRate(); + +const { template, plans, service, accountRate, accountCurrency } = + toRefs(props); + +const store = useStore(); const isChangePMLoading = ref(false); const plan = ref({}); @@ -134,6 +161,14 @@ const isChangeBtnDisabled = computed(() => { const fullProduct = computed(() => plan.value?.products?.[product.value]); +const accountPrice = computed(() => + accountRate.value + ? convertFrom(fullProduct.value.price, accountRate.value) + : 0 +); + +const defaultCurrency = computed(() => store.getters["currencies/default"]); + const productBillingPeriod = computed(() => { return getBillingPeriod(fullProduct.value?.period); }); @@ -198,4 +233,4 @@ const setProduct = () => { watch(plans, setPlan); - + \ No newline at end of file From 9bfdd683cef1e558449ba82bd4a47f495cfeba2f Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Fri, 15 Sep 2023 11:24:06 +0400 Subject: [PATCH 42/88] add account price to change plan dialog --- admin-ui/src/components/modules/ione/billingInfo.vue | 2 ++ admin-ui/src/components/modules/ovh/billingInfo.vue | 2 ++ admin-ui/src/components/modules/virtual/billingInfo.vue | 2 ++ 3 files changed, 6 insertions(+) diff --git a/admin-ui/src/components/modules/ione/billingInfo.vue b/admin-ui/src/components/modules/ione/billingInfo.vue index 14c53f954..5179cf814 100644 --- a/admin-ui/src/components/modules/ione/billingInfo.vue +++ b/admin-ui/src/components/modules/ione/billingInfo.vue @@ -146,6 +146,8 @@ :billing-plan="billingPlan" /> diff --git a/admin-ui/src/components/modules/virtual/billingInfo.vue b/admin-ui/src/components/modules/virtual/billingInfo.vue index 25792b159..d876d5931 100644 --- a/admin-ui/src/components/modules/virtual/billingInfo.vue +++ b/admin-ui/src/components/modules/virtual/billingInfo.vue @@ -94,6 +94,8 @@ @refresh="emit('refresh')" /> Date: Fri, 15 Sep 2023 11:41:03 +0400 Subject: [PATCH 43/88] fix original product --- .../src/components/dialogs/editPriceModel.vue | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/admin-ui/src/components/dialogs/editPriceModel.vue b/admin-ui/src/components/dialogs/editPriceModel.vue index 6b3d80cea..7bb7cd47d 100644 --- a/admin-ui/src/components/dialogs/editPriceModel.vue +++ b/admin-ui/src/components/dialogs/editPriceModel.vue @@ -104,16 +104,35 @@ onMounted(() => { const tariffs = computed(() => { const tariffs = []; Object.keys(plan.value?.products || {}).forEach((key) => { - if ( - plan.value.products[key]?.price > instanceTariffPrice.value || - (plan.value.uuid === template.value.billingPlan.uuid && - instanceTariffPrice.value === plan.value.products[key]?.price) - ) + if (plan.value.products[key]?.price > instanceTariffPrice.value) tariffs.push({ ...plan.value.products[key], key }); }); + + if (plan.value?.uuid === template.value.billingPlan.uuid) { + tariffs.push({ + ...plan.value.products[originalProduct.value], + key: originalProduct.value, + }); + } return tariffs; }); +const originalProduct = computed(() => { + switch (template.value.type) { + case "ovh": { + return ( + template.value.config.duration + " " + template.value.config.planCode + ); + } + case "ione": + case "virtual": { + return template.value.product; + } + } + + return null; +}); + const availablePlans = computed(() => { const availablePlans = []; @@ -162,7 +181,7 @@ const isChangeBtnDisabled = computed(() => { const fullProduct = computed(() => plan.value?.products?.[product.value]); const accountPrice = computed(() => - accountRate.value + accountRate.value && fullProduct.value?.price ? convertFrom(fullProduct.value.price, accountRate.value) : 0 ); @@ -233,4 +252,4 @@ const setProduct = () => { watch(plans, setPlan); - \ No newline at end of file + From 46170de89219d1383ffb0b5ef423df609845c346 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Fri, 15 Sep 2023 13:27:20 +0400 Subject: [PATCH 44/88] add select by billing period --- .../src/components/dialogs/editPriceModel.vue | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/admin-ui/src/components/dialogs/editPriceModel.vue b/admin-ui/src/components/dialogs/editPriceModel.vue index 7bb7cd47d..089b2d668 100644 --- a/admin-ui/src/components/dialogs/editPriceModel.vue +++ b/admin-ui/src/components/dialogs/editPriceModel.vue @@ -20,27 +20,27 @@ + + + - - - @@ -48,7 +48,7 @@ @@ -95,10 +95,12 @@ const store = useStore(); const isChangePMLoading = ref(false); const plan = ref({}); const product = ref({}); +const selectedPeriod = ref(""); onMounted(() => { setPlan(); setProduct(); + selectedPeriod.value = billingPeriods.value[originalProduct.value]; }); const tariffs = computed(() => { @@ -117,6 +119,34 @@ const tariffs = computed(() => { return tariffs; }); +const filteredTariffs = computed(() => { + return tariffs.value.filter( + (t) => billingPeriods.value[t.key] === selectedPeriod.value + ); +}); + +const billingPeriods = computed(() => { + const billingPeriods = {}; + + tariffs.value.forEach((t) => { + billingPeriods[t.key] = getBillingPeriod(t?.period); + }); + + return billingPeriods; +}); + +const uniqueBillingPeriods = computed(() => { + const unique = new Map(); + Object.keys(billingPeriods.value).forEach((k) => { + unique.set(billingPeriods.value[k], billingPeriods.value[k]); + }); + return [...unique.values()]; +}); + +const isSelectedPlanAvailable = computed(() => + filteredTariffs.value.find((t) => product.value === t.key) +); + const originalProduct = computed(() => { switch (template.value.type) { case "ovh": { @@ -188,10 +218,6 @@ const accountPrice = computed(() => const defaultCurrency = computed(() => store.getters["currencies/default"]); -const productBillingPeriod = computed(() => { - return getBillingPeriod(fullProduct.value?.period); -}); - const changePM = () => { const planCode = product.value.slice(4).toLowerCase().replace(" ", "-"); const tempService = JSON.parse(JSON.stringify(service.value)); @@ -250,6 +276,9 @@ const setProduct = () => { }; watch(plans, setPlan); +watch(plan, () => { + selectedPeriod.value = uniqueBillingPeriods.value[0]; +}); From 648faeba60944152338b0a93c077d0e43a92a3bd Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Fri, 15 Sep 2023 13:28:54 +0400 Subject: [PATCH 45/88] add max email quota --- admin-ui/src/components/plan/cpanelPrices.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/admin-ui/src/components/plan/cpanelPrices.vue b/admin-ui/src/components/plan/cpanelPrices.vue index ac7c73e4a..f986c8d55 100644 --- a/admin-ui/src/components/plan/cpanelPrices.vue +++ b/admin-ui/src/components/plan/cpanelPrices.vue @@ -73,6 +73,7 @@ export default { { text: "MAXSUB", value: "MAXSUB" }, { text: "MAX_DEFER_FAIL_PERCENTAGE", value: "MAX_DEFER_FAIL_PERCENTAGE" }, { text: "MAX_EMAIL_PER_HOUR", value: "MAX_EMAIL_PER_HOUR" }, + { text: "MAX_EMAILACCT_QUOTA", value: "MAX_EMAILACCT_QUOTA" }, { text: "QUOTA", value: "QUOTA" }, { text: "lve_cpu", value: "lve_cpu" }, { text: "lve_ep", value: "lve_ep" }, From 5312b383e12b3fb7c4e06bfc7aa5ccf2805dd058 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:36:21 +0200 Subject: [PATCH 46/88] Bump go.uber.org/zap from 1.25.0 to 1.26.0 (#1116) Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9df0a1b7a..178ff8e24 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/stoewer/go-strcase v1.3.0 github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 github.com/wI2L/jsondiff v0.4.0 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 golang.org/x/crypto v0.13.0 google.golang.org/grpc v1.58.0 google.golang.org/protobuf v1.31.0 diff --git a/go.sum b/go.sum index d98cd0270..7cd4c5719 100644 --- a/go.sum +++ b/go.sum @@ -48,7 +48,6 @@ github.com/arangodb/go-driver v1.6.0/go.mod h1:HQmdGkvNMVBTE3SIPSQ8T/ZddC6iwNsfM github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2LcQBbxd0ZFdbGSyRKTYMZCfBbw/pMJFOk1g= github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -254,8 +253,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= From 5c5fd96deba15b813d68813a664c2b3c5e67440d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:37:04 +0200 Subject: [PATCH 47/88] Bump google.golang.org/grpc from 1.58.0 to 1.58.1 (#1115) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.0 to 1.58.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.58.0...v1.58.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 178ff8e24..e5f70116a 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/wI2L/jsondiff v0.4.0 go.uber.org/zap v1.26.0 golang.org/x/crypto v0.13.0 - google.golang.org/grpc v1.58.0 + google.golang.org/grpc v1.58.1 google.golang.org/protobuf v1.31.0 ) diff --git a/go.sum b/go.sum index 7cd4c5719..40dec8f4a 100644 --- a/go.sum +++ b/go.sum @@ -549,8 +549,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From e533e297716e94fdb45248da898ada0676e69894 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Fri, 15 Sep 2023 15:21:47 +0400 Subject: [PATCH 48/88] add delete param by click --- admin-ui/src/components/search/search.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/admin-ui/src/components/search/search.vue b/admin-ui/src/components/search/search.vue index 2ae791783..fab4f25a5 100644 --- a/admin-ui/src/components/search/search.vue +++ b/admin-ui/src/components/search/search.vue @@ -172,14 +172,18 @@ export default { }, setEntity(index) { const item = this.searchItems[index]; - if (item.isSelect) { - return; - } - const variant = this.variants[this.selectedGroupKey] || this.variants[item?.key]; const key = variant?.key || this.selectedGroupKey; + if (item.isSelect) { + return this.$store.commit("appSearch/deleteCustomParam", { + isArray: variant.isArray, + key, + value: item.uuid, + }); + } + if (variant?.isArray) { this.customParams[key]?.forEach((i) => { if (i.temporary) { From a6b3bb1c0bd5f5e30f1a7387020e5cad4e6bbd86 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Mon, 18 Sep 2023 19:26:02 +0400 Subject: [PATCH 49/88] move servecis down dns --- admin-ui/src/App.vue | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/admin-ui/src/App.vue b/admin-ui/src/App.vue index eae0e2804..e1b86753e 100644 --- a/admin-ui/src/App.vue +++ b/admin-ui/src/App.vue @@ -127,22 +127,6 @@
- - - mdi-alien - - - - {{ navTitle("Services") }} - - - BILLING @@ -244,6 +228,22 @@ + + + mdi-alien + + + + {{ navTitle("Services") }} + + + mdi-cogs From fabc82bf06be351de6d735cf8b86871b98f02dbc Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Mon, 18 Sep 2023 19:28:24 +0400 Subject: [PATCH 50/88] add domain to cpanel instance card --- .../modules/cpanel/additionalInstanceInfo.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 admin-ui/src/components/modules/cpanel/additionalInstanceInfo.vue diff --git a/admin-ui/src/components/modules/cpanel/additionalInstanceInfo.vue b/admin-ui/src/components/modules/cpanel/additionalInstanceInfo.vue new file mode 100644 index 000000000..8aeefdbf0 --- /dev/null +++ b/admin-ui/src/components/modules/cpanel/additionalInstanceInfo.vue @@ -0,0 +1,17 @@ + + + + + From 6a3ac21ec0f1b69ed26b61450f7d89b31192e0c2 Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Mon, 18 Sep 2023 19:19:23 +0300 Subject: [PATCH 51/88] Set universal oauth2 credentials --- pkg/credentials/credentials.go | 37 +++++++++----------- pkg/credentials/oauth2.go | 60 ++++++++++++++++++++++++++++++++ pkg/credentials/oauth2_github.go | 58 ------------------------------ pkg/credentials/oauth2_google.go | 58 ------------------------------ 4 files changed, 76 insertions(+), 137 deletions(-) create mode 100644 pkg/credentials/oauth2.go delete mode 100644 pkg/credentials/oauth2_github.go delete mode 100644 pkg/credentials/oauth2_google.go diff --git a/pkg/credentials/credentials.go b/pkg/credentials/credentials.go index f8faea686..4263a08b6 100644 --- a/pkg/credentials/credentials.go +++ b/pkg/credentials/credentials.go @@ -18,6 +18,7 @@ package credentials import ( "context" "errors" + "strings" "github.com/arangodb/go-driver" accountspb "github.com/slntopp/nocloud-proto/registry/accounts" @@ -65,15 +66,13 @@ type Credentials interface { } func Determine(auth_type string) (cred Credentials, ok bool) { - switch auth_type { - case "standard": + switch { + case auth_type == "standard": return &StandardCredentials{}, true - case "whmcs": + case auth_type == "whmcs": return &WHMCSCredentials{}, true - case "oauth2-google": - return &OAuth2GoogleCredentials{}, true - case "oauth2-github": - return &OAuth2GithubCredentials{}, true + case strings.HasPrefix(auth_type, "oauth2"): + return &OAuth2Credentials{}, true default: return nil, false } @@ -81,15 +80,13 @@ func Determine(auth_type string) (cred Credentials, ok bool) { func Find(ctx context.Context, db driver.Database, log *zap.Logger, auth_type string, args ...string) (cred Credentials, err error) { var ok bool - switch auth_type { - case "standard": + switch { + case auth_type == "standard": cred = &StandardCredentials{Username: args[0]} - case "whmcs": + case auth_type == "whmcs": cred = &WHMCSCredentials{Email: args[0]} - case "oauth2-google": - cred = &OAuth2GoogleCredentials{Email: args[0]} - case "oauth2-github": - cred = &OAuth2GithubCredentials{Login: args[0]} + case strings.HasPrefix(auth_type, "oauth2"): + cred = &OAuth2Credentials{AuthField: args[0], AuthValue: args[1]} default: return nil, errors.New("unknown auth type") } @@ -111,15 +108,13 @@ func Find(ctx context.Context, db driver.Database, log *zap.Logger, auth_type st func MakeCredentials(credentials *accountspb.Credentials, log *zap.Logger) (Credentials, error) { var cred Credentials var err error - switch credentials.Type { - case "standard": + switch { + case credentials.Type == "standard": cred, err = NewStandardCredentials(credentials.Data) - case "whmcs": + case credentials.Type == "whmcs": cred, err = NewWHMCSCredentials(credentials.Data) - case "oauth2-google": - cred, err = NewOAuth2GoogleCredentials(credentials.Data) - case "oauth2-github": - cred, err = NewOAuth2GithubCredentials(credentials.Data) + case strings.HasPrefix(credentials.Type, "oauth2"): + cred, err = NewOAuth2Credentials(credentials.Data) default: return nil, errors.New("auth type is wrong") } diff --git a/pkg/credentials/oauth2.go b/pkg/credentials/oauth2.go new file mode 100644 index 000000000..b8b4af9e9 --- /dev/null +++ b/pkg/credentials/oauth2.go @@ -0,0 +1,60 @@ +package credentials + +import ( + "context" + "fmt" + "github.com/arangodb/go-driver" + "github.com/slntopp/nocloud/pkg/nocloud/schema" + "go.uber.org/zap" +) + +type OAuth2Credentials struct { + AuthField string `json:"auth_field"` + AuthValue string `json:"auth_value"` + + log *zap.Logger + driver.DocumentMeta +} + +func NewOAuth2Credentials(data []string) (Credentials, error) { + if len(data) < 2 { + return nil, fmt.Errorf("some credentials data is missing, expected data length to be 2, got: %d", len(data)) + } + field, value := data[0], data[1] + return &OAuth2Credentials{AuthField: field, AuthValue: value}, nil +} + +func (*OAuth2Credentials) Type() string { + return "oauth2-github" +} + +// Authorize method for StandardCredentials assumes that args consist of username and password stored at 0 and 1 accordingly +func (cred *OAuth2Credentials) Authorize(args ...string) bool { + return cred.AuthField == args[0] && cred.AuthValue == args[1] +} + +func (cred *OAuth2Credentials) SetLogger(log *zap.Logger) { + cred.log = log.Named("OAuth2") + cred.log.Debug("Logger is now set") +} + +func (cred *OAuth2Credentials) Find(ctx context.Context, db driver.Database) bool { + query := `FOR cred IN @@credentials FILTER cred[@field] == @value RETURN cred` + c, err := db.Query(ctx, query, map[string]interface{}{ + "field": cred.AuthField, + "value": cred.AuthValue, + "@credentials": schema.CREDENTIALS_COL, + }) + if err != nil { + return false + } + defer c.Close() + + _, err = c.ReadDocument(ctx, &cred) + return err == nil +} + +func (cred *OAuth2Credentials) FindByKey(ctx context.Context, col driver.Collection, key string) error { + _, err := col.ReadDocument(ctx, key, cred) + return err +} diff --git a/pkg/credentials/oauth2_github.go b/pkg/credentials/oauth2_github.go deleted file mode 100644 index 3adbcf588..000000000 --- a/pkg/credentials/oauth2_github.go +++ /dev/null @@ -1,58 +0,0 @@ -package credentials - -import ( - "context" - "errors" - "github.com/arangodb/go-driver" - "github.com/slntopp/nocloud/pkg/nocloud/schema" - "go.uber.org/zap" -) - -type OAuth2GithubCredentials struct { - Login string `json:"login"` - - log *zap.Logger - driver.DocumentMeta -} - -func NewOAuth2GithubCredentials(data []string) (Credentials, error) { - if len(data) < 1 { - return nil, errors.New("empty Credentials") - } - login := data[0] - return &OAuth2GithubCredentials{Login: login}, nil -} - -func (*OAuth2GithubCredentials) Type() string { - return "oauth2-github" -} - -// Authorize method for StandardCredentials assumes that args consist of username and password stored at 0 and 1 accordingly -func (cred *OAuth2GithubCredentials) Authorize(args ...string) bool { - return cred.Login == args[0] -} - -func (cred *OAuth2GithubCredentials) SetLogger(log *zap.Logger) { - cred.log = log.Named("OAuth2Github") - cred.log.Debug("Logger is now set") -} - -func (cred *OAuth2GithubCredentials) Find(ctx context.Context, db driver.Database) bool { - query := `FOR cred IN @@credentials FILTER cred.login == @login RETURN cred` - c, err := db.Query(ctx, query, map[string]interface{}{ - "login": cred.Login, - "@credentials": schema.CREDENTIALS_COL, - }) - if err != nil { - return false - } - defer c.Close() - - _, err = c.ReadDocument(ctx, &cred) - return err == nil -} - -func (cred *OAuth2GithubCredentials) FindByKey(ctx context.Context, col driver.Collection, key string) error { - _, err := col.ReadDocument(ctx, key, cred) - return err -} diff --git a/pkg/credentials/oauth2_google.go b/pkg/credentials/oauth2_google.go deleted file mode 100644 index 286eb6680..000000000 --- a/pkg/credentials/oauth2_google.go +++ /dev/null @@ -1,58 +0,0 @@ -package credentials - -import ( - "context" - "errors" - "github.com/arangodb/go-driver" - "github.com/slntopp/nocloud/pkg/nocloud/schema" - "go.uber.org/zap" -) - -type OAuth2GoogleCredentials struct { - Email string `json:"email"` - - log *zap.Logger - driver.DocumentMeta -} - -func NewOAuth2GoogleCredentials(data []string) (Credentials, error) { - if len(data) < 1 { - return nil, errors.New("empty Credentials") - } - email := data[0] - return &OAuth2GoogleCredentials{Email: email}, nil -} - -func (*OAuth2GoogleCredentials) Type() string { - return "oauth2-google" -} - -// Authorize method for StandardCredentials assumes that args consist of username and password stored at 0 and 1 accordingly -func (cred *OAuth2GoogleCredentials) Authorize(args ...string) bool { - return cred.Email == args[0] -} - -func (cred *OAuth2GoogleCredentials) SetLogger(log *zap.Logger) { - cred.log = log.Named("OAuth2Google") - cred.log.Debug("Logger is now set") -} - -func (cred *OAuth2GoogleCredentials) Find(ctx context.Context, db driver.Database) bool { - query := `FOR cred IN @@credentials FILTER cred.email == @email RETURN cred` - c, err := db.Query(ctx, query, map[string]interface{}{ - "email": cred.Email, - "@credentials": schema.CREDENTIALS_COL, - }) - if err != nil { - return false - } - defer c.Close() - - _, err = c.ReadDocument(ctx, &cred) - return err == nil -} - -func (cred *OAuth2GoogleCredentials) FindByKey(ctx context.Context, col driver.Collection, key string) error { - _, err := col.ReadDocument(ctx, key, cred) - return err -} From 1e107070b1adad0d7c609eabf125b34aa922ef6b Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Mon, 18 Sep 2023 20:03:09 +0300 Subject: [PATCH 52/88] Complete bitrix handler --- pkg/oauth2/config/config.go | 5 ++ pkg/oauth2/handlers/bitrix.go | 135 ++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 pkg/oauth2/handlers/bitrix.go diff --git a/pkg/oauth2/config/config.go b/pkg/oauth2/config/config.go index 6d134d878..6b6055534 100644 --- a/pkg/oauth2/config/config.go +++ b/pkg/oauth2/config/config.go @@ -25,6 +25,11 @@ type OAuth2Config struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` RedirectURL string `json:"redirect_url"` + AuthURL string `json:"auth_url"` + TokenURL string `json:"token_url"` + StateString string `json:"state_string"` + UserInfoURL string `json:"user_info_url"` + AuthField string `json:"auth_field"` } func Config() (map[string]OAuth2Config, error) { diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go new file mode 100644 index 000000000..803f92e25 --- /dev/null +++ b/pkg/oauth2/handlers/bitrix.go @@ -0,0 +1,135 @@ +package handlers + +import ( + "context" + "encoding/json" + "fmt" + "github.com/gorilla/mux" + "github.com/slntopp/nocloud-proto/registry" + "github.com/slntopp/nocloud-proto/registry/accounts" + "github.com/slntopp/nocloud/pkg/nocloud/auth" + "github.com/slntopp/nocloud/pkg/nocloud/schema" + "github.com/slntopp/nocloud/pkg/oauth2/config" + "golang.org/x/oauth2" + "google.golang.org/grpc/metadata" + "io" + "net/http" + "time" +) + +type BitrixHandler struct{} + +type UserInfo struct { + Result []map[string]interface{} `json:"result"` +} + +func (g *BitrixHandler) Setup(router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { + oauth2Config := &oauth2.Config{ + ClientID: cfg.ClientID, + ClientSecret: cfg.ClientSecret, + RedirectURL: cfg.RedirectURL, + Endpoint: oauth2.Endpoint{ + AuthURL: cfg.AuthURL, + TokenURL: cfg.TokenURL, + }, + } + + stateString := cfg.StateString + userInfoUrl := cfg.UserInfoURL + field := cfg.AuthField + + router.Handle("/oauth/bitrix/login", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + url := oauth2Config.AuthCodeURL(stateString) + http.Redirect(w, r, url, http.StatusTemporaryRedirect) + })) + router.Handle("/oauth/bitrix/checkout", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + state, code := r.FormValue("state"), r.FormValue("code") + + if state != stateString { + return + } + + token, err := oauth2Config.Exchange(context.Background(), code) + if err != nil { + return + } + + response, err := http.Get(fmt.Sprintf("%s/rest/user.current.json?auth=%s", userInfoUrl, token.AccessToken)) + + defer response.Body.Close() + body, err := io.ReadAll(response.Body) + + var userInfo = UserInfo{} + err = json.Unmarshal(body, &userInfo) + if err != nil { + return + } + + if userInfo.Result == nil { + return + } + + if len(userInfo.Result) != 1 { + return + } + + user := userInfo.Result[0] + value := user[field].(string) + + name := user["NAME"].(string) + last_name := user["LAST_NAME"].(string) + + rootToken, err := auth.MakeToken(schema.ROOT_ACCOUNT_KEY) + if err != nil { + return + } + + ctx := metadata.AppendToOutgoingContext(context.Background(), "authorization", "bearer "+rootToken) + + resp, err := regClient.Token(ctx, &accounts.TokenRequest{ + Auth: &accounts.Credentials{ + Type: "oauth2-github", + Data: []string{ + field, + value, + }, + }, + Exp: int32(time.Now().Unix() + int64(time.Hour.Seconds()*2160)), + }) + if err != nil { + _, err = regClient.Create(ctx, &accounts.CreateRequest{ + Title: fmt.Sprintf("%s %s", name, last_name), + Namespace: schema.ROOT_NAMESPACE_KEY, + Auth: &accounts.Credentials{ + Type: "oauth2-bitrix", + Data: []string{ + field, + value, + }, + }, + }) + if err != nil { + return + } + resp, err = regClient.Token(ctx, &accounts.TokenRequest{ + Auth: &accounts.Credentials{ + Type: "oauth2-github", + Data: []string{ + field, + value, + }, + }, + Exp: int32(time.Now().Unix() + int64(time.Hour.Seconds()*2160)), + }) + if err != nil { + return + } + } + + res := map[string]string{ + "token": resp.GetToken(), + } + marshal, _ := json.Marshal(res) + w.Write(marshal) + })) +} From cfebea16ed415bb026b3c2ed85bfc0efb9d1f3a2 Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Mon, 18 Sep 2023 20:13:13 +0300 Subject: [PATCH 53/88] Fix handlers --- pkg/oauth2/handlers/bitrix.go | 4 ++-- pkg/oauth2/handlers/github.go | 3 +++ pkg/oauth2/handlers/google.go | 3 +++ pkg/oauth2/handlers/handlers.go | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go index 803f92e25..70a0d43f9 100644 --- a/pkg/oauth2/handlers/bitrix.go +++ b/pkg/oauth2/handlers/bitrix.go @@ -17,13 +17,13 @@ import ( "time" ) -type BitrixHandler struct{} +type BitrixOauthHandler struct{} type UserInfo struct { Result []map[string]interface{} `json:"result"` } -func (g *BitrixHandler) Setup(router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { +func (g *BitrixOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { oauth2Config := &oauth2.Config{ ClientID: cfg.ClientID, ClientSecret: cfg.ClientSecret, diff --git a/pkg/oauth2/handlers/github.go b/pkg/oauth2/handlers/github.go index 90f029ca4..efda6894f 100644 --- a/pkg/oauth2/handlers/github.go +++ b/pkg/oauth2/handlers/github.go @@ -51,6 +51,7 @@ func (g *GithubOauthHandler) successHandler(regClient registry.AccountsServiceCl Auth: &accounts.Credentials{ Type: "oauth2-github", Data: []string{ + "login", *user.Login, }, }, @@ -63,6 +64,7 @@ func (g *GithubOauthHandler) successHandler(regClient registry.AccountsServiceCl Auth: &accounts.Credentials{ Type: "oauth2-github", Data: []string{ + "login", *user.Login, }, }, @@ -74,6 +76,7 @@ func (g *GithubOauthHandler) successHandler(regClient registry.AccountsServiceCl Auth: &accounts.Credentials{ Type: "oauth2-github", Data: []string{ + "login", *user.Login, }, }, diff --git a/pkg/oauth2/handlers/google.go b/pkg/oauth2/handlers/google.go index da609d611..255f9d88f 100644 --- a/pkg/oauth2/handlers/google.go +++ b/pkg/oauth2/handlers/google.go @@ -51,6 +51,7 @@ func (g *GoogleOauthHandler) successHandler(regClient registry.AccountsServiceCl Auth: &accounts.Credentials{ Type: "oauth2-google", Data: []string{ + "email", user.Email, }, }, @@ -63,6 +64,7 @@ func (g *GoogleOauthHandler) successHandler(regClient registry.AccountsServiceCl Auth: &accounts.Credentials{ Type: "oauth2-google", Data: []string{ + "email", user.Email, }, }, @@ -74,6 +76,7 @@ func (g *GoogleOauthHandler) successHandler(regClient registry.AccountsServiceCl Auth: &accounts.Credentials{ Type: "oauth2-google", Data: []string{ + "email", user.Email, }, }, diff --git a/pkg/oauth2/handlers/handlers.go b/pkg/oauth2/handlers/handlers.go index 6b9d8fdf9..382c1d8f5 100644 --- a/pkg/oauth2/handlers/handlers.go +++ b/pkg/oauth2/handlers/handlers.go @@ -16,6 +16,8 @@ func GetOAuthHandler(handlerType string) OAuthHandler { return &GoogleOauthHandler{} case "github": return &GithubOauthHandler{} + case "bitrix": + return &BitrixOauthHandler{} default: return nil } From 33670433593e34108c8d753e8b9c90749e08a50e Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Tue, 19 Sep 2023 11:51:46 +0300 Subject: [PATCH 54/88] Add logging --- pkg/oauth2/handlers/bitrix.go | 9 ++++++++- pkg/oauth2/handlers/github.go | 11 ++++++++--- pkg/oauth2/handlers/google.go | 11 ++++++++--- pkg/oauth2/handlers/handlers.go | 3 ++- pkg/oauth2/main.go | 2 +- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go index 70a0d43f9..b0bef50b5 100644 --- a/pkg/oauth2/handlers/bitrix.go +++ b/pkg/oauth2/handlers/bitrix.go @@ -10,6 +10,7 @@ import ( "github.com/slntopp/nocloud/pkg/nocloud/auth" "github.com/slntopp/nocloud/pkg/nocloud/schema" "github.com/slntopp/nocloud/pkg/oauth2/config" + "go.uber.org/zap" "golang.org/x/oauth2" "google.golang.org/grpc/metadata" "io" @@ -23,7 +24,7 @@ type UserInfo struct { Result []map[string]interface{} `json:"result"` } -func (g *BitrixOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { +func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { oauth2Config := &oauth2.Config{ ClientID: cfg.ClientID, ClientSecret: cfg.ClientSecret, @@ -46,11 +47,13 @@ func (g *BitrixOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, state, code := r.FormValue("state"), r.FormValue("code") if state != stateString { + log.Debug("State string not equal to state", zap.String("state", state), zap.String("stateString", stateString)) return } token, err := oauth2Config.Exchange(context.Background(), code) if err != nil { + log.Error("Failed to get token from exchange", zap.Error(err)) return } @@ -62,6 +65,7 @@ func (g *BitrixOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, var userInfo = UserInfo{} err = json.Unmarshal(body, &userInfo) if err != nil { + log.Error("Failed unmarshal body", zap.Error(err)) return } @@ -81,6 +85,7 @@ func (g *BitrixOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, rootToken, err := auth.MakeToken(schema.ROOT_ACCOUNT_KEY) if err != nil { + log.Error("Failed create token", zap.Error(err)) return } @@ -109,6 +114,7 @@ func (g *BitrixOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, }, }) if err != nil { + log.Error("Failed create account", zap.Error(err)) return } resp, err = regClient.Token(ctx, &accounts.TokenRequest{ @@ -122,6 +128,7 @@ func (g *BitrixOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, Exp: int32(time.Now().Unix() + int64(time.Hour.Seconds()*2160)), }) if err != nil { + log.Error("Failed get token", zap.Error(err)) return } } diff --git a/pkg/oauth2/handlers/github.go b/pkg/oauth2/handlers/github.go index efda6894f..d9675b5e3 100644 --- a/pkg/oauth2/handlers/github.go +++ b/pkg/oauth2/handlers/github.go @@ -11,6 +11,7 @@ import ( "github.com/slntopp/nocloud/pkg/nocloud/auth" "github.com/slntopp/nocloud/pkg/nocloud/schema" "github.com/slntopp/nocloud/pkg/oauth2/config" + "go.uber.org/zap" "golang.org/x/oauth2" "golang.org/x/oauth2/github" "google.golang.org/grpc/metadata" @@ -20,7 +21,7 @@ import ( type GithubOauthHandler struct{} -func (g *GithubOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { +func (g *GithubOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { oauth2Config := &oauth2.Config{ ClientID: cfg.ClientID, ClientSecret: cfg.ClientSecret, @@ -30,18 +31,20 @@ func (g *GithubOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, stateConfig := gologin.DefaultCookieConfig router.Handle("/oauth/github/login", github_gologin.StateHandler(stateConfig, github_gologin.LoginHandler(oauth2Config, nil))) - router.Handle("/oauth/github/checkout", github_gologin.StateHandler(stateConfig, github_gologin.CallbackHandler(oauth2Config, g.successHandler(regClient), nil))) + router.Handle("/oauth/github/checkout", github_gologin.StateHandler(stateConfig, github_gologin.CallbackHandler(oauth2Config, g.successHandler(log, regClient), nil))) } -func (g *GithubOauthHandler) successHandler(regClient registry.AccountsServiceClient) http.Handler { +func (g *GithubOauthHandler) successHandler(log *zap.Logger, regClient registry.AccountsServiceClient) http.Handler { return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { user, err := github_gologin.UserFromContext(request.Context()) if err != nil { + log.Error("Failed to get user from ctx", zap.Error(err)) return } token, err := auth.MakeToken(schema.ROOT_ACCOUNT_KEY) if err != nil { + log.Error("Failed to create token", zap.Error(err)) return } @@ -70,6 +73,7 @@ func (g *GithubOauthHandler) successHandler(regClient registry.AccountsServiceCl }, }) if err != nil { + log.Error("Failed to create account", zap.Error(err)) return } response, err = regClient.Token(ctx, &accounts.TokenRequest{ @@ -83,6 +87,7 @@ func (g *GithubOauthHandler) successHandler(regClient registry.AccountsServiceCl Exp: int32(time.Now().Unix() + int64(time.Hour.Seconds()*2160)), }) if err != nil { + log.Error("Failed to get token", zap.Error(err)) return } } diff --git a/pkg/oauth2/handlers/google.go b/pkg/oauth2/handlers/google.go index 255f9d88f..6ed9091e9 100644 --- a/pkg/oauth2/handlers/google.go +++ b/pkg/oauth2/handlers/google.go @@ -11,6 +11,7 @@ import ( "github.com/slntopp/nocloud/pkg/nocloud/auth" "github.com/slntopp/nocloud/pkg/nocloud/schema" "github.com/slntopp/nocloud/pkg/oauth2/config" + "go.uber.org/zap" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/grpc/metadata" @@ -20,7 +21,7 @@ import ( type GoogleOauthHandler struct{} -func (g *GoogleOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { +func (g *GoogleOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { oauth2Config := &oauth2.Config{ ClientID: cfg.ClientID, ClientSecret: cfg.ClientSecret, @@ -30,18 +31,20 @@ func (g *GoogleOauthHandler) Setup(router *mux.Router, cfg config.OAuth2Config, stateConfig := gologin.DefaultCookieConfig router.Handle("/oauth/google/login", google_gologin.StateHandler(stateConfig, google_gologin.LoginHandler(oauth2Config, nil))) - router.Handle("/oauth/google/checkout", google_gologin.StateHandler(stateConfig, google_gologin.CallbackHandler(oauth2Config, g.successHandler(regClient), nil))) + router.Handle("/oauth/google/checkout", google_gologin.StateHandler(stateConfig, google_gologin.CallbackHandler(oauth2Config, g.successHandler(log, regClient), nil))) } -func (g *GoogleOauthHandler) successHandler(regClient registry.AccountsServiceClient) http.Handler { +func (g *GoogleOauthHandler) successHandler(log *zap.Logger, regClient registry.AccountsServiceClient) http.Handler { return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { user, err := google_gologin.UserFromContext(request.Context()) if err != nil { + log.Error("Failed to get user from ctx", zap.Error(err)) return } token, err := auth.MakeToken(schema.ROOT_ACCOUNT_KEY) if err != nil { + log.Error("Failed to create token", zap.Error(err)) return } @@ -70,6 +73,7 @@ func (g *GoogleOauthHandler) successHandler(regClient registry.AccountsServiceCl }, }) if err != nil { + log.Error("Failed to create account", zap.Error(err)) return } response, err = regClient.Token(ctx, &accounts.TokenRequest{ @@ -83,6 +87,7 @@ func (g *GoogleOauthHandler) successHandler(regClient registry.AccountsServiceCl Exp: int32(time.Now().Unix() + int64(time.Hour.Seconds()*2160)), }) if err != nil { + log.Error("Failed to get token", zap.Error(err)) return } } diff --git a/pkg/oauth2/handlers/handlers.go b/pkg/oauth2/handlers/handlers.go index 382c1d8f5..f7b2867b8 100644 --- a/pkg/oauth2/handlers/handlers.go +++ b/pkg/oauth2/handlers/handlers.go @@ -4,10 +4,11 @@ import ( "github.com/gorilla/mux" "github.com/slntopp/nocloud-proto/registry" "github.com/slntopp/nocloud/pkg/oauth2/config" + "go.uber.org/zap" ) type OAuthHandler interface { - Setup(*mux.Router, config.OAuth2Config, registry.AccountsServiceClient) + Setup(*zap.Logger, *mux.Router, config.OAuth2Config, registry.AccountsServiceClient) } func GetOAuthHandler(handlerType string) OAuthHandler { diff --git a/pkg/oauth2/main.go b/pkg/oauth2/main.go index 74ffd8793..b3ffc93f3 100644 --- a/pkg/oauth2/main.go +++ b/pkg/oauth2/main.go @@ -41,7 +41,7 @@ func (s *OAuth2Server) registerOAuthHandlers() { continue } - handler.Setup(s.router, conf, s.registryClient) + handler.Setup(s.log.Named(key), s.router, conf, s.registryClient) } } From bc6b023a9ca41b5911fc3dfffc8775192616c9bc Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Tue, 19 Sep 2023 11:54:31 +0300 Subject: [PATCH 55/88] Fix errors --- pkg/oauth2/handlers/bitrix.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go index b0bef50b5..79a707767 100644 --- a/pkg/oauth2/handlers/bitrix.go +++ b/pkg/oauth2/handlers/bitrix.go @@ -59,9 +59,19 @@ func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg conf response, err := http.Get(fmt.Sprintf("%s/rest/user.current.json?auth=%s", userInfoUrl, token.AccessToken)) + if err != nil { + log.Error("Failed to make request", zap.Error(err)) + return + } + defer response.Body.Close() body, err := io.ReadAll(response.Body) + if err != nil { + log.Error("Failed to read body", zap.Error(err)) + return + } + var userInfo = UserInfo{} err = json.Unmarshal(body, &userInfo) if err != nil { From 7152e60b65da94934ff4ac81daa969b76c06d6a2 Mon Sep 17 00:00:00 2001 From: 639852 Date: Tue, 19 Sep 2023 15:48:01 +0400 Subject: [PATCH 56/88] - Fixed authorization in user app --- admin-ui/package.json | 3 +- admin-ui/src/components/instance/info.vue | 1 + admin-ui/src/components/instances_table.vue | 1 + .../src/components/ui/iconsAutocomplete.vue | 21 +- .../src/components/ui/loginInAccountIcon.vue | 8 +- admin-ui/yarn.lock | 454 +++++++++++------- 6 files changed, 314 insertions(+), 174 deletions(-) diff --git a/admin-ui/package.json b/admin-ui/package.json index 0c4b35278..cf4a8a11c 100644 --- a/admin-ui/package.json +++ b/admin-ui/package.json @@ -8,7 +8,8 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@ant-design/icons-vue": "^4.0.6", + "@ant-design/icons": "^2.0.0", + "@ant-design/icons-vue": "^2.0.0", "@sardinefish/asn1": "^1.0.4", "ansi-regex": "^6.0.1", "apexcharts": "^3.41.1", diff --git a/admin-ui/src/components/instance/info.vue b/admin-ui/src/components/instance/info.vue index 77f57c838..1d3d0e8f2 100644 --- a/admin-ui/src/components/instance/info.vue +++ b/admin-ui/src/components/instance/info.vue @@ -76,6 +76,7 @@ diff --git a/admin-ui/src/components/instances_table.vue b/admin-ui/src/components/instances_table.vue index 771942afa..c8774311e 100644 --- a/admin-ui/src/components/instances_table.vue +++ b/admin-ui/src/components/instances_table.vue @@ -26,6 +26,7 @@
diff --git a/admin-ui/src/components/ui/iconsAutocomplete.vue b/admin-ui/src/components/ui/iconsAutocomplete.vue index 54da67c2a..7b1e82f1c 100644 --- a/admin-ui/src/components/ui/iconsAutocomplete.vue +++ b/admin-ui/src/components/ui/iconsAutocomplete.vue @@ -9,12 +9,12 @@ @input="emits('input:value', $event)" > @@ -22,6 +22,7 @@ diff --git a/admin-ui/src/components/ui/loginInAccountIcon.vue b/admin-ui/src/components/ui/loginInAccountIcon.vue index 24b66f412..4e37c8452 100644 --- a/admin-ui/src/components/ui/loginInAccountIcon.vue +++ b/admin-ui/src/components/ui/loginInAccountIcon.vue @@ -6,7 +6,7 @@ import api from "@/api"; import { useStore } from "@/store"; -const props = defineProps(["uuid", "instanceId"]); +const props = defineProps(["uuid", "instanceId", "type"]); const store = useStore(); const loginHandler = () => { @@ -16,9 +16,9 @@ const loginHandler = () => { api.settings.get(["app"]).then((res) => { const win = window.open(JSON.parse(res.app).url); - setTimeout(() => { - win.postMessage({ token, uuid: props.instanceId }, "*"); - }, 300); + window.addEventListener('message', () => { + win.postMessage({ token, uuid: props.instanceId, type: props.type }, "*"); + }); }); }) .catch((e) => { diff --git a/admin-ui/yarn.lock b/admin-ui/yarn.lock index 2571a5ec7..2d7bd9caf 100644 --- a/admin-ui/yarn.lock +++ b/admin-ui/yarn.lock @@ -31,21 +31,18 @@ dependencies: tinycolor2 "^1.4.1" -"@ant-design/icons-svg@^4.0.0": - version "4.3.0" - resolved "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.3.0.tgz" - integrity sha512-WOgvdH/1Wl8Z7VXigRbCa5djO14zxrNTzvrAQzhWiBQtEKT0uTc8K1ltjKZ8U1gPn/wXhMA8/jE39SJl0WNxSg== - -"@ant-design/icons-vue@^4.0.6": - version "4.0.6" - resolved "https://registry.npmjs.org/@ant-design/icons-vue/-/icons-vue-4.0.6.tgz" - integrity sha512-nOrvzlOrjNEqE1KK5B+aZa3gWQMFIHHaSYFVjHiCgNGgnx05oLMKu7+Bc2ylLaSRuJ+/+PfU2qZan5QdJwFzBA== +"@ant-design/icons-vue@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@ant-design/icons-vue/-/icons-vue-2.0.0.tgz" + integrity sha512-2c0QQE5hL4N48k5NkPG5sdpMl9YnvyNhf0U7YkdZYDlLnspoRU7vIA0UK9eHBs6OpFLcJB6o8eJrIl2ajBskPg== dependencies: "@ant-design/colors" "^3.1.0" - "@ant-design/icons-svg" "^4.0.0" - classnames "^2.2.6" - insert-css "^2.0.0" - lodash "^4.17.15" + babel-runtime "^6.26.0" + +"@ant-design/icons@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@ant-design/icons/-/icons-2.0.0.tgz" + integrity sha512-N4h0v9TbAkzobiDrPNF5LMLbBoR+VdlXJX7RFbZS33lar6Pff37wIF1xJHzTYSZZmE6THSYGmSlEsHQJHx0pJg== "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.22.5": version "7.22.5" @@ -59,7 +56,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz" integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== -"@babel/core@^7.12.16": +"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.0", "@babel/core@^7.12.0", "@babel/core@^7.12.16", "@babel/core@^7.13.0", "@babel/core@^7.4.0-0": version "7.22.9" resolved "https://registry.npmjs.org/@babel/core/-/core-7.22.9.tgz" integrity sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w== @@ -992,7 +989,7 @@ "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" -"@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.0": +"@discoveryjs/json-ext@^0.5.0", "@discoveryjs/json-ext@0.5.7": version "0.5.7" resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== @@ -1087,16 +1084,16 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/sourcemap-codec@1.4.14": - version "1.4.14" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.15" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@1.4.14": + version "1.4.14" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.18" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz" @@ -1132,7 +1129,7 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": +"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== @@ -1521,7 +1518,7 @@ resolved "https://registry.npmjs.org/@vue/cli-plugin-vuex/-/cli-plugin-vuex-5.0.8.tgz" integrity sha512-HSYWPqrunRE5ZZs8kVwiY6oWcn95qf/OQabwLfprhdpFWAGtLStShjsGED2aDpSSeGAskQETrtR/5h7VqgIlBA== -"@vue/cli-service@~5.0.7": +"@vue/cli-service@^3.0.0 || ^4.0.0 || ^5.0.0-0", "@vue/cli-service@~5.0.7": version "5.0.8" resolved "https://registry.npmjs.org/@vue/cli-service/-/cli-service-5.0.8.tgz" integrity sha512-nV7tYQLe7YsTtzFrfOMIHc5N2hp5lHG2rpYr0aNja9rNljdgcPZLyQRb2YRivTHqTv7lI962UXFURcpStHgyFw== @@ -1641,7 +1638,7 @@ resolved "https://registry.npmjs.org/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz" integrity sha512-Iu8Tbg3f+emIIMmI2ycSI8QcEuAUgPTgHwesDU1eKMLE4YC/c/sFbGc70QgMq31ijRftV0R7vCm9co6rldCeOA== -"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": +"@webassemblyjs/ast@^1.11.5", "@webassemblyjs/ast@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz" integrity sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q== @@ -1742,7 +1739,7 @@ "@webassemblyjs/wasm-gen" "1.11.6" "@webassemblyjs/wasm-parser" "1.11.6" -"@webassemblyjs/wasm-parser@1.11.6", "@webassemblyjs/wasm-parser@^1.11.5": +"@webassemblyjs/wasm-parser@^1.11.5", "@webassemblyjs/wasm-parser@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz" integrity sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ== @@ -1810,7 +1807,7 @@ acorn-walk@^8.0.0, acorn-walk@^8.0.2, acorn-walk@^8.2.0: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.0.4, acorn@^8.0.5, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.9.0: +"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8, acorn@^8.0.4, acorn@^8.0.5, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.9.0: version "8.10.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -1839,7 +1836,7 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.12.4, ajv@^6.12.5, ajv@^6.9.1: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1849,7 +1846,17 @@ ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.9.0: +ajv@^8.0.0: + version "8.12.0" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz" + integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +ajv@^8.8.2, ajv@^8.9.0: version "8.12.0" resolved "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -1901,7 +1908,14 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -1921,7 +1935,7 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -apexcharts@^3.41.1: +apexcharts@^3.26.0, apexcharts@^3.41.1: version "3.41.1" resolved "https://registry.npmjs.org/apexcharts/-/apexcharts-3.41.1.tgz" integrity sha512-kta8fhXrfZYqW7K9kF7FqZ6imQaC6moyRgcUZjwIky/oeHVVISSN/2rjUIvZXnwxWHiSdDHMqLy+TqJhB4DXFA== @@ -1943,16 +1957,16 @@ argparse@^2.0.1: resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" - integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== - array-flatten@^2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + array-union@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" @@ -2505,7 +2519,7 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.3, browserslist@^4.21.4, browserslist@^4.21.5, browserslist@^4.21.9: +browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.3, browserslist@^4.21.4, browserslist@^4.21.5, browserslist@^4.21.9, "browserslist@>= 4.21.0": version "4.21.10" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz" integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== @@ -2630,7 +2644,15 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^4.1.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2638,7 +2660,15 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.3: +chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@^3.5.3, "chokidar@>=3.0.0 <4.0.0": version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -2663,11 +2693,6 @@ ci-info@^1.5.0: resolved "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz" integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== -classnames@^2.2.6: - version "2.3.2" - resolved "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz" - integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw== - clean-css@^5.2.2: version "5.3.2" resolved "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz" @@ -2757,16 +2782,16 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + colord@^2.9.1: version "2.9.3" resolved "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz" @@ -2891,9 +2916,9 @@ core-js@^2.4.0: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.32.1, core-js@^3.8.3: - version "3.32.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.32.1.tgz#a7d8736a3ed9dd05940c3c4ff32c591bb735be77" - integrity sha512-lqufgNn9NLnESg5mQeYsxQP5w7wrViSj0jr/kv6ECQiByzQkrn1MKvV0L3acttpDqfQrHLwr2KCMgX5b8X+lyQ== + version "3.32.2" + resolved "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz" + integrity sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ== core-util-is@~1.0.0: version "1.0.3" @@ -2945,7 +2970,7 @@ css-declaration-sorter@^6.3.1: resolved "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.0.tgz" integrity sha512-jDfsatwWMWN0MODAFuHszfjphEXfNw9JUAhmY4pLu3TyTU+ohUpsbVtbU+1MZn4a47D9kqh03i4eyOm+74+zew== -css-loader@^6.5.0: +css-loader@*, css-loader@^6.5.0: version "6.7.4" resolved "https://registry.npmjs.org/css-loader/-/css-loader-6.7.4.tgz" integrity sha512-0Y5uHtK5BswfaGJ+jrO+4pPg1msFBc0pwPIE1VqfpmVn6YbDfYfXMj8rfd7nt+4goAhJueO+H/I40VWJfcP1mQ== @@ -3073,7 +3098,7 @@ de-indent@^1.0.2: resolved "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz" integrity sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg== -debug@2.6.9, debug@^2.6.8: +debug@^2.6.8: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -3094,6 +3119,13 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: dependencies: ms "2.1.2" +debug@2.6.9: + version "2.6.9" + resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + decache@^4.6.0: version "4.6.1" resolved "https://registry.npmjs.org/decache/-/decache-4.6.1.tgz" @@ -3150,16 +3182,16 @@ define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: has-property-descriptors "^1.0.0" object-keys "^1.1.1" -depd@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - depd@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +depd@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + destroy@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz" @@ -3363,15 +3395,15 @@ eslint-plugin-vue@^9.17.0: vue-eslint-parser "^9.3.1" xml-name-validator "^4.0.0" -eslint-scope@5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== +eslint-scope@^7.1.1: + version "7.2.2" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: esrecurse "^4.3.0" - estraverse "^4.1.1" + estraverse "^5.2.0" -eslint-scope@^7.1.1, eslint-scope@^7.2.2: +eslint-scope@^7.2.2: version "7.2.2" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz" integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== @@ -3379,12 +3411,25 @@ eslint-scope@^7.1.1, eslint-scope@^7.2.2: esrecurse "^4.3.0" estraverse "^5.2.0" +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: +eslint-visitor-keys@^3.3.0: + version "3.4.1" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz" + integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== + +eslint-visitor-keys@^3.4.1: version "3.4.1" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz" integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== @@ -3405,7 +3450,7 @@ eslint-webpack-plugin@^3.1.0: normalize-path "^3.0.0" schema-utils "^4.0.0" -eslint@^8.47.0: +"eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^6.2.0 || ^7.0.0 || ^8.0.0", "eslint@^7.0.0 || ^8.0.0", "eslint@^7.5.0 || ^8.0.0", eslint@^8.47.0, eslint@>=6.0.0, eslint@>=7.5.0: version "8.47.0" resolved "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz" integrity sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q== @@ -3476,7 +3521,12 @@ estraverse@^4.1.1: resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0, estraverse@^5.2.0: +estraverse@^5.1.0: + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +estraverse@^5.2.0: version "5.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -3695,7 +3745,15 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@^4.0.0, find-up@^4.1.0: +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-up@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3764,11 +3822,6 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" @@ -3816,7 +3869,7 @@ get-stream@^6.0.0: resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-parent@^5.1.2, glob-parent@~5.1.2: +glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -3830,6 +3883,13 @@ glob-parent@^6.0.1, glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz" @@ -4035,6 +4095,16 @@ http-deceiver@^1.2.7: resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz" integrity sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw== +http-errors@~1.6.2: + version "1.6.3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz" + integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + http-errors@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz" @@ -4046,16 +4116,6 @@ http-errors@2.0.0: statuses "2.0.1" toidentifier "1.0.1" -http-errors@~1.6.2: - version "1.6.3" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz" - integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - http-parser-js@>=0.5.1: version "0.5.8" resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz" @@ -4137,7 +4197,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@2, inherits@2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4147,11 +4207,6 @@ inherits@2.0.3: resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== -insert-css@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/insert-css/-/insert-css-2.0.0.tgz" - integrity sha512-xGq5ISgcUP5cvGkS2MMFLtPDBtrtQPSFfC6gA6U8wHKqfjTIMZLZNxOItQnoSjdOzlXOLU/yD32RKC4SvjNbtA== - interpret@^1.0.0: version "1.4.0" resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" @@ -4169,16 +4224,16 @@ invariant@^2.2.2: dependencies: loose-envify "^1.0.0" -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - ipaddr.js@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz" integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng== +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + is-arguments@^1.0.4: version "1.1.1" resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz" @@ -4563,7 +4618,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: +lodash@^4.17.14, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -4599,7 +4654,15 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" -lru-cache@^4.0.1, lru-cache@^4.1.2: +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +lru-cache@^4.1.2: version "4.1.5" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== @@ -4680,7 +4743,7 @@ micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": +"mime-db@>= 1.43.0 < 2", mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== @@ -4755,16 +4818,16 @@ mrmime@^1.0.0: resolved "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz" integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw== +ms@^2.1.1, ms@2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -ms@2.1.2, ms@^2.1.1: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - ms@2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" @@ -4825,11 +4888,10 @@ nocloud-ui@^1.0.7: resolved "https://registry.npmjs.org/nocloud-ui/-/nocloud-ui-1.0.7.tgz" integrity sha512-MMuuuBO7BO3HFq1LQqGQoJxGpbrdGgTJEzH0HtwUl0KeHPWaCXXhEytKZgP2HdJJL7CwzzC/Mt8/O4BLQ8lTmg== - -nocloudjsrest@^1.5.11: - version "1.5.11" - resolved "https://registry.yarnpkg.com/nocloudjsrest/-/nocloudjsrest-1.5.11.tgz#b07ec73e95f84d26d1bcda0fec875ca691d22067" - integrity sha512-xM6Na/Dj0obmL+uYkrouluWMpSznoR2qwjWK8eCiit9POgDkGKEtDEorFYIdAbpHHlzrsfLrqzrRn7EDbAqmIw== +nocloudjsrest@^1.5.14: + version "1.5.14" + resolved "https://registry.npmjs.org/nocloudjsrest/-/nocloudjsrest-1.5.14.tgz" + integrity sha512-OIfnJYYeYglZ/bjCciKoLnDbqklSexogfUk8GQsbp+p4vPhFp/9IA5qoZBCITPnx6O8z5ao+OmYjepARV3TW5A== dependencies: axios "^0.24.0" @@ -5137,7 +5199,12 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^2.0.0, path-key@^2.0.1: +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz" + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + +path-key@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz" integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== @@ -5440,15 +5507,7 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@^7.0.36: - version "7.0.39" - resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz" - integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== - dependencies: - picocolors "^0.2.1" - source-map "^0.6.1" - -postcss@^8.2.6, postcss@^8.3.5, postcss@^8.4.14, postcss@^8.4.21: +"postcss@^7.0.0 || ^8.0.1", postcss@^8.0.9, postcss@^8.1.0, postcss@^8.2.15, postcss@^8.2.2, postcss@^8.2.6, postcss@^8.3.5, postcss@^8.4.14, postcss@^8.4.21: version "8.4.23" resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.23.tgz" integrity sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA== @@ -5457,6 +5516,14 @@ postcss@^8.2.6, postcss@^8.3.5, postcss@^8.4.14, postcss@^8.4.21: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^7.0.36: + version "7.0.39" + resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz" + integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== + dependencies: + picocolors "^0.2.1" + source-map "^0.6.1" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" @@ -5821,15 +5888,20 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.1.0, safe-buffer@>=5.1.0, safe-buffer@~5.2.0, safe-buffer@5.2.1: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== "safer-buffer@>= 2.1.2 < 3": version "2.1.2" @@ -5844,7 +5916,7 @@ sass-loader@^13.0.2: klona "^2.0.6" neo-async "^2.6.2" -sass@~1.32.6: +sass@^1.3.0, sass@~1.32.6: version "1.32.13" resolved "https://registry.npmjs.org/sass/-/sass-1.32.13.tgz" integrity sha512-dEgI9nShraqP7cXQH+lEXVf73WOPCse0QlFzSD8k+1TcOxCMwVXfQlr0jtoluZysQOyJGnfr21dLvYKDJq8HkA== @@ -5860,7 +5932,25 @@ schema-utils@^2.6.5: ajv "^6.12.4" ajv-keywords "^3.5.2" -schema-utils@^3.0.0, schema-utils@^3.1.1, schema-utils@^3.2.0: +schema-utils@^3.0.0: + version "3.3.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +schema-utils@^3.1.1: + version "3.3.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +schema-utils@^3.2.0: version "3.3.0" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz" integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== @@ -5891,7 +5981,7 @@ selfsigned@^2.1.1: dependencies: node-forge "^1" -"semver@2 || 3 || 4 || 5", semver@^5.5.0: +semver@^5.5.0: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -5901,20 +5991,53 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.1.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8: +semver@^7.1.2: version "7.5.1" resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz" integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== dependencies: lru-cache "^6.0.0" -semver@^7.3.6, semver@^7.5.4: +semver@^7.3.4: + version "7.5.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== + dependencies: + lru-cache "^6.0.0" + +semver@^7.3.5: + version "7.5.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== + dependencies: + lru-cache "^6.0.0" + +semver@^7.3.6: version "7.5.4" resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^7.3.8: + version "7.5.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== + dependencies: + lru-cache "^6.0.0" + +semver@^7.5.4: + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +"semver@2 || 3 || 4 || 5": + version "5.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + send@0.18.0: version "0.18.0" resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz" @@ -5976,7 +6099,7 @@ setprototypeof@1.2.0: sha256-uint8array@^0.10.7: version "0.10.7" - resolved "https://registry.yarnpkg.com/sha256-uint8array/-/sha256-uint8array-0.10.7.tgz#c751fc914f4227b26d996980562065fa4eadcf99" + resolved "https://registry.npmjs.org/sha256-uint8array/-/sha256-uint8array-0.10.7.tgz" integrity sha512-1Q6JQU4tX9NqsDGodej6pkrUVQVNapLZnvkwIhddH/JqzBZF1fSaxSWNY6sziXBE8aEa2twtGkXUrwzGeZCMpQ== shallow-clone@^3.0.0: @@ -6150,15 +6273,29 @@ stackframe@^1.3.4: resolved "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz" integrity sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw== +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== + statuses@2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" string-width@^2.1.1: version "2.1.1" @@ -6177,20 +6314,6 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" @@ -6297,7 +6420,7 @@ svg.filter.js@^2.0.2: dependencies: svg.js "^2.2.5" -svg.js@>=2.3.x, svg.js@^2.0.1, svg.js@^2.2.5, svg.js@^2.4.0, svg.js@^2.6.5: +svg.js@^2.0.1, svg.js@^2.2.5, svg.js@^2.4.0, svg.js@^2.6.5, svg.js@>=2.3.x: version "2.7.1" resolved "https://registry.npmjs.org/svg.js/-/svg.js-2.7.1.tgz" integrity sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA== @@ -6505,7 +6628,7 @@ universalify@^2.0.0: resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unpipe@1.0.0, unpipe@~1.0.0: +unpipe@~1.0.0, unpipe@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== @@ -6622,7 +6745,7 @@ vue-style-loader@^4.1.0, vue-style-loader@^4.1.3: hash-sum "^1.0.2" loader-utils "^1.0.2" -vue-template-compiler@^2.7.14: +vue-template-compiler@^2.0.0, vue-template-compiler@^2.7.14, vue-template-compiler@>=2.5.0: version "2.7.14" resolved "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz" integrity sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ== @@ -6635,14 +6758,7 @@ vue-template-es2015-compiler@^1.9.0: resolved "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz" integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw== -vue2-editor@^2.10.3: - version "2.10.3" - resolved "https://registry.npmjs.org/vue2-editor/-/vue2-editor-2.10.3.tgz" - integrity sha512-99rWL93xfGeFRrq8NY5L7U+Cog/Uenx+UOOJragtxtbhBE9Rv5/C3P/YhJhjMECSbQyHFjUriqv1S3mghvU9Kg== - dependencies: - quill "^1.3.6" - -vue@^2.7.14: +vue@*, "vue@^2 || ^3.2.13", vue@^2.0.0, vue@^2.6.4, vue@^2.7.0, vue@^2.7.14, vue@^2.7.2, vue@>=2.5.0: version "2.7.14" resolved "https://registry.npmjs.org/vue/-/vue-2.7.14.tgz" integrity sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ== @@ -6650,6 +6766,13 @@ vue@^2.7.14: "@vue/compiler-sfc" "2.7.14" csstype "^3.1.0" +vue2-editor@^2.10.3: + version "2.10.3" + resolved "https://registry.npmjs.org/vue2-editor/-/vue2-editor-2.10.3.tgz" + integrity sha512-99rWL93xfGeFRrq8NY5L7U+Cog/Uenx+UOOJragtxtbhBE9Rv5/C3P/YhJhjMECSbQyHFjUriqv1S3mghvU9Kg== + dependencies: + quill "^1.3.6" + vuetify-loader@^1.9.2: version "1.9.2" resolved "https://registry.npmjs.org/vuetify-loader/-/vuetify-loader-1.9.2.tgz" @@ -6661,7 +6784,7 @@ vuetify-loader@^1.9.2: file-loader "^6.2.0" loader-utils "^2.0.0" -vuetify@^2.7.1: +"vuetify@^1.3.0 || ^2.0.0", vuetify@^2.7.1: version "2.7.1" resolved "https://registry.npmjs.org/vuetify/-/vuetify-2.7.1.tgz" integrity sha512-DVFmRsDtYrITw9yuGLwpFWngFYzEgk0KwloDCIV3+vhZw+NBFJOSzdbttbYmOwtqvQlhDxUyIRQolrRbSFAKlg== @@ -6722,7 +6845,7 @@ webpack-chain@^6.5.1: deepmerge "^1.5.2" javascript-stringify "^2.0.1" -webpack-cli@^5.1.4: +webpack-cli@^5.1.4, webpack-cli@5.x.x: version "5.1.4" resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz" integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== @@ -6796,7 +6919,7 @@ webpack-merge@^5.7.3: clone-deep "^4.0.1" wildcard "^2.0.0" -webpack-sources@^3.2.3: +webpack-sources@*, webpack-sources@^3.2.3: version "3.2.3" resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== @@ -6806,7 +6929,7 @@ webpack-virtual-modules@^0.4.2: resolved "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.4.6.tgz" integrity sha512-5tyDlKLqPfMqjT3Q9TAqf2YqjwmnUleZwzJi1A5qXnlBCdj2AtOJ6wAWdglTIDOPgOiOrXeBeFcsQ8+aGQ6QbA== -webpack@^5.54.0, webpack@^5.88.2: +"webpack@^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0", "webpack@^3.0.0 || ^4.1.0 || ^5.0.0-0", "webpack@^4.0.0 || ^5.0.0", "webpack@^4.1.0 || ^5.0.0-0", "webpack@^4.27.0 || ^5.0.0", "webpack@^4.37.0 || ^5.0.0", webpack@^5.0.0, webpack@^5.1.0, webpack@^5.20.0, webpack@^5.54.0, webpack@^5.88.2, webpack@>=2, webpack@5.x.x: version "5.88.2" resolved "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz" integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ== @@ -6836,7 +6959,7 @@ webpack@^5.54.0, webpack@^5.88.2: watchpack "^2.4.0" webpack-sources "^3.2.3" -websocket-driver@>=0.5.1, websocket-driver@^0.7.4: +websocket-driver@^0.7.4, websocket-driver@>=0.5.1: version "0.7.4" resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz" integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== @@ -6939,7 +7062,12 @@ yallist@^4.0.0: resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0, yaml@^1.10.2: +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + +yaml@^1.10.2: version "1.10.2" resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== From cd6f95eb6582d7443f15fcac234616ad79823088 Mon Sep 17 00:00:00 2001 From: 639852 Date: Tue, 19 Sep 2023 16:57:17 +0400 Subject: [PATCH 57/88] - Fixed bug with token --- admin-ui/src/App.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/admin-ui/src/App.vue b/admin-ui/src/App.vue index eae0e2804..4db34041f 100644 --- a/admin-ui/src/App.vue +++ b/admin-ui/src/App.vue @@ -420,13 +420,14 @@ export default { }, }, created() { - window.addEventListener("message", ({ data, origin }) => { - const url = `https://app.${location.host.split(".").slice(1).join(".")}`; - - if (origin !== url) return; - this.$store.commit("auth/setToken", data); - location.assign("/admin"); - }); + // window.addEventListener("message", ({ data, origin }) => { + // const url = `https://app.${location.host.split(".").slice(1).join(".")}`; + + // if (origin !== url) return; + // if (data === 'ready') return; + // this.$store.commit("auth/setToken", data); + // location.assign("/admin"); + // }); this.$store.dispatch("auth/load"); From 15846d6d648ca54f86f10ffa16447c9d43e6f5b7 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Tue, 19 Sep 2023 18:04:24 +0400 Subject: [PATCH 58/88] add copy product --- .../src/components/plans_products_table.vue | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/admin-ui/src/components/plans_products_table.vue b/admin-ui/src/components/plans_products_table.vue index 0b1ccad34..b3c26a731 100644 --- a/admin-ui/src/components/plans_products_table.vue +++ b/admin-ui/src/components/plans_products_table.vue @@ -32,6 +32,15 @@ + + Copy + + Create @@ -157,7 +166,7 @@ + + \ No newline at end of file From fb2f08c3e228ce38f0fbae117fed175daa099d43 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Wed, 20 Sep 2023 17:40:54 +0400 Subject: [PATCH 81/88] refactor modules billing label --- .../components/modules/ione/billingLabel.vue | 117 +++-------------- .../components/modules/ovh/billingLabel.vue | 124 ++++-------------- 2 files changed, 40 insertions(+), 201 deletions(-) diff --git a/admin-ui/src/components/modules/ione/billingLabel.vue b/admin-ui/src/components/modules/ione/billingLabel.vue index 998d3d8bf..c4a42ba27 100644 --- a/admin-ui/src/components/modules/ione/billingLabel.vue +++ b/admin-ui/src/components/modules/ione/billingLabel.vue @@ -1,44 +1,18 @@ diff --git a/admin-ui/src/components/modules/ovh/billingLabel.vue b/admin-ui/src/components/modules/ovh/billingLabel.vue index 6bed501de..c702d8a9b 100644 --- a/admin-ui/src/components/modules/ovh/billingLabel.vue +++ b/admin-ui/src/components/modules/ovh/billingLabel.vue @@ -1,49 +1,34 @@ From 94450ff8b83bc8eaafb518ad684f091841f09a28 Mon Sep 17 00:00:00 2001 From: SazukinPavel Date: Wed, 20 Sep 2023 19:10:25 +0400 Subject: [PATCH 82/88] add invoice meta type --- admin-ui/src/views/TransactionsCreate.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/admin-ui/src/views/TransactionsCreate.vue b/admin-ui/src/views/TransactionsCreate.vue index 9b6960d3e..3750eec2f 100644 --- a/admin-ui/src/views/TransactionsCreate.vue +++ b/admin-ui/src/views/TransactionsCreate.vue @@ -260,6 +260,11 @@ export default { } else { total = Math.abs(total); total = this.amountType ? total : -total; + if (this.isInvoice) { + this.transaction.meta.invoiceType = this.amountType + ? "top-up" + : "payment"; + } } await api.transactions.create({ From bdf69764f36c79a5d2509d7f883267e1d1424337 Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Thu, 21 Sep 2023 11:46:06 +0300 Subject: [PATCH 83/88] Fix --- pkg/graph/records.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/graph/records.go b/pkg/graph/records.go index 2b0cf5b65..13f245fc0 100644 --- a/pkg/graph/records.go +++ b/pkg/graph/records.go @@ -190,12 +190,12 @@ func (ctrl *RecordsController) GetRecordsReports(ctx context.Context, req *pb.Ge } if req.Account != nil { - query += ` FILTER t.account == @acc` + query += ` FILTER record.account == @acc` params["acc"] = req.GetAccount() } if req.Service != nil { - query += ` FILTER t.service == @srv` + query += ` FILTER record.service == @srv` params["srv"] = req.GetService() } @@ -283,12 +283,12 @@ func (ctrl *RecordsController) GetRecordsReportsCount(ctx context.Context, req * } if req.Account != nil { - query += ` FILTER t.account == @acc` + query += ` FILTER record.account == @acc` params["acc"] = req.GetAccount() } if req.Service != nil { - query += ` FILTER t.service == @srv` + query += ` FILTER record.service == @srv` params["srv"] = req.GetService() } From 9be36ea0dcb156166fb9dd37d2299d4976d06fd9 Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Thu, 21 Sep 2023 12:36:03 +0300 Subject: [PATCH 84/88] Fix --- pkg/oauth2/handlers/bitrix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go index 23f0b4ded..294214c1e 100644 --- a/pkg/oauth2/handlers/bitrix.go +++ b/pkg/oauth2/handlers/bitrix.go @@ -25,7 +25,7 @@ type BitrixOauthHandler struct { } type UserInfo struct { - Result []map[string]interface{} `json:"result"` + Result map[string]interface{} `json:"result"` } func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg config.OAuth2Config, regClient registry.AccountsServiceClient) { @@ -106,7 +106,7 @@ func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg conf return } - user := userInfo.Result[0] + user := userInfo.Result value := user[field].(string) name := user["NAME"].(string) From 5454037cb455ea0da2de7488189606c5c038ba0e Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Thu, 21 Sep 2023 12:43:19 +0300 Subject: [PATCH 85/88] Fix --- pkg/oauth2/handlers/bitrix.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go index 294214c1e..11f0a6e2a 100644 --- a/pkg/oauth2/handlers/bitrix.go +++ b/pkg/oauth2/handlers/bitrix.go @@ -102,10 +102,6 @@ func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg conf return } - if len(userInfo.Result) != 1 { - return - } - user := userInfo.Result value := user[field].(string) From 5b7390bc7f9b59b72cd3da5e571d3c9ecc341da6 Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Thu, 21 Sep 2023 12:58:42 +0300 Subject: [PATCH 86/88] Fix --- pkg/credentials/credentials.go | 2 +- pkg/credentials/oauth2.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/credentials/credentials.go b/pkg/credentials/credentials.go index 4b55eebb4..4a26bc407 100644 --- a/pkg/credentials/credentials.go +++ b/pkg/credentials/credentials.go @@ -114,7 +114,7 @@ func MakeCredentials(credentials *accountspb.Credentials, log *zap.Logger) (Cred case credentials.Type == "whmcs": cred, err = NewWHMCSCredentials(credentials.Data) case strings.HasPrefix(credentials.Type, "oauth2"): - cred, err = NewOAuth2Credentials(credentials.Data) + cred, err = NewOAuth2Credentials(credentials.Data, credentials.GetType()) default: return nil, errors.New("auth type is wrong") } diff --git a/pkg/credentials/oauth2.go b/pkg/credentials/oauth2.go index b93cdb060..c9105e959 100644 --- a/pkg/credentials/oauth2.go +++ b/pkg/credentials/oauth2.go @@ -18,12 +18,12 @@ type OAuth2Credentials struct { driver.DocumentMeta } -func NewOAuth2Credentials(data []string) (Credentials, error) { +func NewOAuth2Credentials(data []string, credType string) (Credentials, error) { if len(data) < 2 { return nil, fmt.Errorf("some credentials data is missing, expected data length to be 2, got: %d", len(data)) } field, value := data[0], data[1] - return &OAuth2Credentials{AuthField: field, AuthValue: value}, nil + return &OAuth2Credentials{AuthField: field, AuthValue: value, AuthType: credType}, nil } func (cred *OAuth2Credentials) Type() string { @@ -41,10 +41,11 @@ func (cred *OAuth2Credentials) SetLogger(log *zap.Logger) { } func (cred *OAuth2Credentials) Find(ctx context.Context, db driver.Database) bool { - query := `FOR cred IN @@credentials FILTER cred[@field] == @value RETURN cred` + query := `FOR cred IN @@credentials FILTER cred.auth_field == @field AND cred.auth_value == @value && cred.auth_type == @type RETURN cred` c, err := db.Query(ctx, query, map[string]interface{}{ "field": cred.AuthField, "value": cred.AuthValue, + "type": cred.AuthType, "@credentials": schema.CREDENTIALS_COL, }) if err != nil { From ffec2cd8b1b48f7b1ba2a97ceee9a7c3c1717301 Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Thu, 21 Sep 2023 13:12:13 +0300 Subject: [PATCH 87/88] Fix --- pkg/oauth2/handlers/bitrix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go index 11f0a6e2a..7c5a0cd00 100644 --- a/pkg/oauth2/handlers/bitrix.go +++ b/pkg/oauth2/handlers/bitrix.go @@ -158,7 +158,7 @@ func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg conf } } - http.Redirect(w, r, fmt.Sprintf("%s?token=?%s", redirect, resp.GetToken()), http.StatusSeeOther) + http.Redirect(w, r, fmt.Sprintf("%s?token=%s", redirect, resp.GetToken()), http.StatusSeeOther) })) } From 1dfcd81b5078ccc2a4e9f09a51edf8bdd571dd9d Mon Sep 17 00:00:00 2001 From: Nikita Zhamoidzik Date: Thu, 21 Sep 2023 13:40:03 +0300 Subject: [PATCH 88/88] Fix --- pkg/oauth2/handlers/bitrix.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/oauth2/handlers/bitrix.go b/pkg/oauth2/handlers/bitrix.go index 7c5a0cd00..726f4f14d 100644 --- a/pkg/oauth2/handlers/bitrix.go +++ b/pkg/oauth2/handlers/bitrix.go @@ -53,7 +53,13 @@ func (g *BitrixOauthHandler) Setup(log *zap.Logger, router *mux.Router, cfg conf g.m.Unlock() url := oauth2Config.AuthCodeURL(state) - http.Redirect(w, r, url, http.StatusTemporaryRedirect) + + result := map[string]string{ + "url": url, + } + + marshal, _ := json.Marshal(result) + w.Write(marshal) })) router.Handle("/oauth/bitrix/checkout", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { state, code := r.FormValue("state"), r.FormValue("code")