forked from EGCETSII/decide_django_2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request EGCETSII#32 from Full-Tortuga/feature/16-interfaz_…
…crear_backup Feature/16 interfaz crear backup
- Loading branch information
Showing
7 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from django.urls import path, include | ||
from . import backups | ||
from . import views | ||
|
||
urlpatterns = [ | ||
#It isn already implemented in the views.py | ||
path('', views.index), | ||
path('create', backups.CreateBackup.as_view(), name='create_backup'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ | |
'postproc', | ||
'store', | ||
'visualizer', | ||
'backups', | ||
] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Card } from "@nextui-org/react"; | ||
import { useRef } from "react"; | ||
import { Messages } from "primereact/messages"; | ||
import Api from "../services/backend"; | ||
import "../css/ConnectionTest.css"; | ||
|
||
const Backups = () => { | ||
const messages = useRef(null); | ||
|
||
function connect() { | ||
Api.create_backup() | ||
.then((status) => { | ||
if (status === 201) { | ||
messages.current.show({ | ||
severity: "success", | ||
summary: "Se ha creado correctamente el backup", | ||
}); | ||
} | ||
}) | ||
.catch((err) => { | ||
messages.current.show({ | ||
severity: "warn", | ||
summary: "Error generando el backup", | ||
}); | ||
}); | ||
} | ||
|
||
return ( | ||
<div> | ||
<Messages ref={messages}></Messages> | ||
<Card | ||
id="card-connection-test" | ||
color="gradient" | ||
textColor="white" | ||
width="50%" | ||
hoverable="true" | ||
onClick={connect} | ||
clickable="true" | ||
> | ||
Generar nuevo backup(Copia de seguridad) | ||
</Card> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Backups; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters