Skip to content

Commit

Permalink
Merge pull request #1761 from slntopp/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SazukinPavel committed Jun 5, 2024
2 parents 2621962 + 7f47469 commit 5c35774
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 3 deletions.
5 changes: 5 additions & 0 deletions admin-ui/src/components/instances_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
{{ formatSecondsToDate(getValue("date", item)) || "Unknown" }}
</template>
<template v-slot:[`item.deleted`]="{ item }">
{{ formatSecondsToDate(item.deleted) || "-" }}
</template>
<template v-slot:[`item.dueDate`]="{ item }">
{{
typeof getExpirationDate(item) === "number"
Expand Down Expand Up @@ -610,6 +614,7 @@ export default {
{ text: "Period", value: "period" },
{ text: "Email", value: "email" },
{ text: "Created date", value: "date", editable: { type: "date" } },
{ text: "Deleted date", value: "deleted" },
{ text: "UUID", value: "uuid" },
{ text: "Price model", value: "billingPlan.title" },
{ text: "IP", value: "state.meta.networking" },
Expand Down
8 changes: 8 additions & 0 deletions admin-ui/src/components/modules/cpanel/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
/>
</v-col>
<v-col>
<v-text-field
label="Deleted date"
readonly
:value="formatSecondsToDate(template.deleted, true, '-')"
/>
</v-col>
<v-col
v-if="
template.billingPlan.title.toLowerCase() !== 'payg' ||
Expand Down
8 changes: 8 additions & 0 deletions admin-ui/src/components/modules/empty/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
/>
</v-col>

<v-col>
<v-text-field
label="Deleted date"
readonly
:value="formatSecondsToDate(template.deleted, true, '-')"
/>
</v-col>

<v-col>
<v-text-field
readonly
Expand Down
8 changes: 8 additions & 0 deletions admin-ui/src/components/modules/ione/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
/>
</v-col>
<v-col>
<v-text-field
label="Deleted date"
readonly
:value="formatSecondsToDate(template.deleted, true, '-')"
/>
</v-col>
<v-col v-if="!isMonitoringEmpty">
<v-text-field
readonly
Expand Down
8 changes: 8 additions & 0 deletions admin-ui/src/components/modules/keyweb/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
/>
</v-col>

<v-col>
<v-text-field
label="Deleted date"
readonly
:value="formatSecondsToDate(template.deleted, true, '-')"
/>
</v-col>

<v-col v-if="template.billingPlan.title.toLowerCase() !== 'payg'">
<v-text-field
readonly
Expand Down
8 changes: 8 additions & 0 deletions admin-ui/src/components/modules/openai/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
"
/>
</v-col>

<v-col>
<v-text-field
label="Deleted date"
readonly
:value="formatSecondsToDate(template.deleted, true, '-')"
/>
</v-col>
</v-row>
<instances-panels title="Prices">
<nocloud-table
Expand Down
8 changes: 8 additions & 0 deletions admin-ui/src/components/modules/opensrs/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
/>
</v-col>

<v-col>
<v-text-field
label="Deleted date"
readonly
:value="formatSecondsToDate(template.deleted, true, '-')"
/>
</v-col>

<v-col>
<v-text-field
readonly
Expand Down
9 changes: 9 additions & 0 deletions admin-ui/src/components/modules/ovh/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
"
/>
</v-col>

<v-col>
<v-text-field
label="Deleted date"
readonly
:value="formatSecondsToDate(template.deleted, true, '-')"
/>
</v-col>

<v-col>
<v-text-field
readonly
Expand Down
6 changes: 3 additions & 3 deletions pkg/graph/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (ctrl *InstancesController) Create(ctx context.Context, group driver.Docume
c := pb.Context{
Instance: i.GetUuid(),
Sp: sp,
Event: "create",
Event: spb.NoCloudStatus_INIT.String(),
}
body, err := proto.Marshal(&c)
if err == nil {
Expand Down Expand Up @@ -301,7 +301,7 @@ func (ctrl *InstancesController) Update(ctx context.Context, sp string, inst, ol
c := pb.Context{
Instance: inst.GetUuid(),
Sp: sp,
Event: "update",
Event: "UPDATE",
}
body, err := proto.Marshal(&c)
if err == nil {
Expand Down Expand Up @@ -358,7 +358,7 @@ func (ctrl *InstancesController) Delete(ctx context.Context, group string, i *pb
c := pb.Context{
Instance: i.GetUuid(),
Sp: sp,
Event: "create",
Event: spb.NoCloudStatus_DEL.String(),
}
body, err := proto.Marshal(&c)
if err == nil {
Expand Down
7 changes: 7 additions & 0 deletions pkg/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,13 @@ func (s *ServicesServer) Up(ctx context.Context, request *pb.UpRequest) (*pb.UpR
continue
}

for _, inst := range group.GetInstances() {
if inst.GetStatus() == statuspb.NoCloudStatus_DEL {
continue
}
s.ctrl.IGController().Instances().SetStatus(ctx, inst, statuspb.NoCloudStatus_UP)
}

log.Debug("Updated Group", zap.Any("group", group))
}

Expand Down

0 comments on commit 5c35774

Please sign in to comment.