-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keep track of OEKG modifications #1448
- Loading branch information
1 parent
da778d0
commit 076f20e
Showing
16 changed files
with
410 additions
and
703 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { PureComponent, Fragment, useState, useEffect } from "react"; | ||
import conf from "../conf.json"; | ||
import axios from "axios"; | ||
import LinearProgress from '@mui/material/LinearProgress'; | ||
import Box from '@mui/material/Box'; | ||
import ReactDiffViewer from 'react-diff-viewer-continued'; | ||
import Divider from '@mui/material/Divider'; | ||
import Typography from '@mui/material/Typography'; | ||
import Stack from '@mui/material/Stack'; | ||
|
||
export default function Diff() { | ||
const [modifications, setModifications] = useState({}); | ||
const [loading, setLoading] = useState(true); | ||
|
||
const getModifications= async () => { | ||
const { data } = await axios.get(conf.toep + `sirop/get_oekg_modifications/`); | ||
return data; | ||
}; | ||
|
||
useEffect(() => { | ||
getModifications().then((data) => { | ||
setModifications(JSON.parse(data)); | ||
setLoading(false); | ||
}); | ||
}, []); | ||
|
||
if (loading === false) { | ||
return ( | ||
<Box sx={{ width: '100%' }}> | ||
{ | ||
modifications.map((row, index) => | ||
<Box> | ||
<div style={{ backgroundColor: "#001c30e6", color: "white" }}> | ||
<Stack direction="row" alignItems="center" justifyContent={'space-between'}> | ||
<Typography variant="h6" gutterBottom style={{ margin: "10px" }}> | ||
{index + 1 } | ||
</Typography> | ||
<Typography variant="h6" gutterBottom style={{ margin: "10px" }}> | ||
{row.fields.timestamp} | ||
</Typography> | ||
<Typography variant="h6" gutterBottom style={{ margin: "10px" }}> | ||
{row.fields.user} | ||
</Typography> | ||
</Stack> | ||
</div> | ||
<ReactDiffViewer oldValue={row.fields.old_state} newValue={row.fields.new_state} splitView={true} /> | ||
<Divider style={{ marginTop: "10px" }}/> | ||
</Box> | ||
) | ||
} | ||
|
||
</Box> | ||
); | ||
} else { | ||
return <LinearProgress /> | ||
} | ||
|
||
} |
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,6 +1,6 @@ | ||
{ | ||
"localhost": "http://localhost:8000/", | ||
"toep1": "http://toep.iks.cs.ovgu.de/", | ||
"toep3": "http://localhost:8000/", | ||
"toep": "https://openenergy-platform.org/" | ||
"toep": "http://localhost:8000/", | ||
"toep2": "https://openenergy-platform.org/" | ||
} |
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,27 @@ | ||
# Generated by Django 3.2.7 on 2023-11-01 15:13 | ||
|
||
from django.db import migrations, models | ||
import django.utils.timezone | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('factsheet', '0003_alter_historyofoekg_timestamp'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='OEKG_Modifications', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('old_state', models.JSONField()), | ||
('new_state', models.JSONField()), | ||
('user', models.CharField(max_length=200)), | ||
('timestamp', models.DateTimeField(default=django.utils.timezone.now)), | ||
], | ||
), | ||
migrations.DeleteModel( | ||
name='HistoryOfOEKG', | ||
), | ||
] |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.