Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/core/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def _unpack_chord_result(
'default_timeout': 60 * 60 * 12
}
}
celery.conf.resultrepr_maxsize = 4096



celery.conf.update(settings)

celery.conf.update(
Expand Down
34 changes: 20 additions & 14 deletions src/core/app/routes/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from app import auth
from app import database

from app.database import Hosts
from app.database import Pools
from app.database import Connectors

class items_create_connector(BaseModel):
Expand Down Expand Up @@ -59,10 +59,10 @@ def filter_connector_by_id(connector_id):
with Session(engine) as session:
statement = select(Connectors).where(Connectors.id == ensure_uuid(connector_id))
results = session.exec(statement)
storage = results.one()
if not storage:
connector = results.one()
if not connector:
raise ValueError(f'Connector with id {connector_id} not found')
return storage
return connector
except Exception as e:
raise ValueError(e)

Expand Down Expand Up @@ -137,20 +137,26 @@ def api_delete_connector(connector_id):
raise ValueError(e)
records = []
with Session(engine) as session:
statement = select(Hosts).where(Hosts.connector_id == ensure_uuid(connector_id))
statement = select(Pools).where(
Pools.connector_id == ensure_uuid(connector_id))
results = session.exec(statement)
for host in results:
records.append(host)
for pool in results:
records.append(pool)
if len(records) > 0:
raise ValueError('One or more hosts are linked to this connector')
try:
connector = filter_connector_by_id(connector_id)
with Session(engine) as session:
raise ValueError('One or more pools are linked to this connector')
try:
statement2 = select(Connectors).where(
Connectors.id == ensure_uuid(connector_id))
results = session.exec(statement2)
connector = results.one()
if not connector:
raise ValueError(
f'Backup policy with id {connector_id} not found')
session.delete(connector)
session.commit()
return {'state': 'SUCCESS'}
except Exception as e:
raise ValueError(e)
return {'state': 'SUCCESS'}
except Exception as e:
raise ValueError(e)

@app.post('/api/v1/connectors', status_code=201)
def create_connector(item: items_create_connector, identity: Json = Depends(auth.valid_token)):
Expand Down
8 changes: 4 additions & 4 deletions src/core/app/routes/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ def retrieve_task_status(task_id, identity: Json = Depends(auth.valid_token)):
'total': 1,
'status': str(task.info)
}
if "not found" in str(task.info):
raise HTTPException(status_code=404, detail=response)
else:
raise HTTPException(status_code=500, detail=response)
# if "not found" in str(task.info):
# raise HTTPException(status_code=404, detail=response)
# else:
# raise HTTPException(status_code=500, detail=response)
return response


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
:options="dayOptions"
v-model="selectedDays"
multiple
:rules="[(value) => value?.length > 0 || 'Field is required']"
>
<template #prependInner>
<va-icon name="event" size="small" color="primary" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,22 @@ export default defineComponent({
: this.filtered.length
},
nextRun () {
if (this.policy.schedule) {
const options = {
currentDate: new Date(),
tz: 'Europe/Paris'
try{
if (this.policy.schedule) {
const options = {
currentDate: new Date(),
tz: 'Europe/Paris'
}
const interval = parser.parseExpression(this.policy.schedule, options)
const result = `${new Date(interval.next()).toLocaleDateString()} - ${new Date(interval.next()).toLocaleTimeString()}`
return result
} else {
return 'N/A'
}
const interval = parser.parseExpression(this.policy.schedule, options)
const result = `${new Date(interval.next()).toLocaleDateString()} - ${new Date(interval.next()).toLocaleTimeString()}`
return result
} else {
}catch(error){
return 'N/A'
}

}
},
mounted () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export default defineComponent({
return this.useCustomFilteringFn ? this.filterExact : undefined
}
},
mounted () {
this.$store.dispatch("requestVirtualMachine", { token: this.$keycloak.token })
},
methods: {
filterExact(source) {
if (this.filter === '') {
Expand Down
3 changes: 3 additions & 0 deletions src/ui/src/pages/admin/tasks/backup/Backup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export default defineComponent({
loadingBackupType: "SelfBuildingSquareSpinner"
}
},
mounted () {
this.$store.dispatch("requestBackupTask", { token: this.$keycloak.token })
},
computed: {
filteredTaskList() {
if (this.selectedDate) {
Expand Down
3 changes: 3 additions & 0 deletions src/ui/src/pages/admin/tasks/restore/Restore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export default defineComponent({
})
}
},
mounted () {
this.$store.dispatch("requestRestoreTask", { token: this.$keycloak.token })
},
methods: {
dateSelector(dateToCheck) {
const convertedDateCheck = new Date(dateToCheck * 1000)
Expand Down