added some todos and css to video reindex
This commit is contained in:
parent
3b1d85824f
commit
9ce867c6c8
@ -15,13 +15,13 @@ class GeneralSettings extends React.Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const updateRequest = new FormData();
|
const updateRequest = new FormData();
|
||||||
updateRequest.append('action', 'loadVideo');
|
updateRequest.append('action', 'loadGeneralSettings');
|
||||||
updateRequest.append('movieid', this.props.movie_id);
|
|
||||||
|
|
||||||
fetch('/api/videoload.php', {method: 'POST', body: updateRequest})
|
fetch('/api/settings.php', {method: 'POST', body: updateRequest})
|
||||||
.then((response) => response.json()
|
.then((response) => response.json()
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
// todo 2020-07-3: set state here
|
// todo 2020-07-3: set state here
|
||||||
|
// todo 2020-07-4: php and test code
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,10 @@ class GeneralSettings extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='GeneralForm'>
|
<div className='GeneralForm'>
|
||||||
<Form>
|
<Form onSubmit={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
this.saveSettings();
|
||||||
|
}}>
|
||||||
<Form.Row>
|
<Form.Row>
|
||||||
<Form.Group as={Col} controlId="formGridEmail">
|
<Form.Group as={Col} controlId="formGridEmail">
|
||||||
<Form.Label>Video Path</Form.Label>
|
<Form.Label>Video Path</Form.Label>
|
||||||
@ -67,6 +70,17 @@ class GeneralSettings extends React.Component {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveSettings() {
|
||||||
|
const updateRequest = new FormData();
|
||||||
|
updateRequest.append('action', 'saveGeneralSettings');
|
||||||
|
|
||||||
|
fetch('/api/settings.php', {method: 'POST', body: updateRequest})
|
||||||
|
.then((response) => response.json()
|
||||||
|
.then((result) => {
|
||||||
|
// todo 2020-07-4: settings result here
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default GeneralSettings;
|
export default GeneralSettings;
|
13
src/pages/SettingsPage/MovieSettings.css
Normal file
13
src/pages/SettingsPage/MovieSettings.css
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
.indextextarea {
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: auto;
|
||||||
|
|
||||||
|
min-height: 100px;
|
||||||
|
max-height: 300px;
|
||||||
|
width: 50%;
|
||||||
|
background-color: #c2c2c2;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import "./MovieSettings.css"
|
||||||
|
|
||||||
class MovieSettings extends React.Component {
|
class MovieSettings extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -35,12 +36,15 @@ class MovieSettings extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startReindex() {
|
startReindex() {
|
||||||
|
document.getElementsByClassName("indextextarea")[0].innerHTML = "";
|
||||||
console.log("starting");
|
console.log("starting");
|
||||||
const updateRequest = new FormData();
|
const updateRequest = new FormData();
|
||||||
// fetch all videos available
|
// fetch all videos available
|
||||||
fetch('/api/extractvideopreviews.php', {method: 'POST', body: updateRequest})
|
fetch('/api/extractvideopreviews.php', {method: 'POST', body: updateRequest})
|
||||||
.then((response) => response.json()
|
.then((response) => response.json()
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
|
// todo 2020-07-4: some kind of start event
|
||||||
|
// maybe disable start btn
|
||||||
console.log("returned");
|
console.log("returned");
|
||||||
}))
|
}))
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -60,11 +64,15 @@ class MovieSettings extends React.Component {
|
|||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.contentAvailable === true) {
|
if (result.contentAvailable === true) {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
// todo 2020-07-4: scroll to bottom of div here
|
||||||
this.setState({
|
this.setState({
|
||||||
|
// insert a string for each line
|
||||||
text: [...result.message.split("\n"),
|
text: [...result.message.split("\n"),
|
||||||
...this.state.text]
|
...this.state.text]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// clear refresh interval if no content available
|
||||||
|
// todo 2020-07-4: maybe enable start btn again
|
||||||
clearInterval(this.myinterval);
|
clearInterval(this.myinterval);
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
Loading…
Reference in New Issue
Block a user