yeungalan 4 jaren geleden
bovenliggende
commit
1712154ae1
5 gewijzigde bestanden met toevoegingen van 19 en 9 verwijderingen
  1. BIN
      photo/.DS_Store
  2. 1 1
      photo/public/listFolder
  3. 7 3
      photo/src/FolderList.js
  4. 9 3
      photo/src/ImageList.js
  5. 2 2
      photo/src/SearchAppMenu.js

BIN
photo/.DS_Store


+ 1 - 1
photo/public/listFolder

@@ -1 +1 @@
-[{"Foldername":"DKLM","VPath":"user:/Photo/Photo/storage/DKLM/"}]
+[{"Foldername":"DKLM","VPath":"user:/Photo/Photo/storage/DKLM/"},{"Foldername":"1234","VPath":"user:/Photo/Photo/storage/1234/"}]

+ 7 - 3
photo/src/FolderList.js

@@ -52,7 +52,7 @@ export default function TitlebarGridList(props) {
     const [isLoaded, setIsLoaded] = React.useState(false);
     const [items, setItems] = React.useState([]);
 
-    const [folderName, setFolderName] = React.useState('');
+    const [folderName, setFolderName] = React.useState('user:/Photo/Photo/uploads/');
 
     const onChanageFolder = (folderN) => {
         setFolderName(folderN);
@@ -61,7 +61,11 @@ export default function TitlebarGridList(props) {
     }
 
     useEffect(() => {
-        fetch("http://localhost:3000/listFolder")
+        //fetch("http://localhost:3000/listFolder")
+        fetch("/system/ajgi/interface?script=/Photo/backend/listFolder.js", {
+            method: 'post',
+            body: JSON.stringify({ folder: folderName })
+        })
             .then(res => res.json())
             .then(
                 (result) => {
@@ -93,7 +97,7 @@ export default function TitlebarGridList(props) {
                             <GridListTileBar
                                 title={tile.Foldername}
                                 actionIcon={
-                                    <IconButton aria-label={`info about ${tile.Foldername}`} onClick={() => onChanageFolder(tile.Foldername)} className={classes.icon}>
+                                    <IconButton aria-label={`info about ${tile.Foldername}`} onClick={() => onChanageFolder(tile.VPath)} className={classes.icon}>
                                         <InfoIcon />
                                     </IconButton>
                                 }

+ 9 - 3
photo/src/ImageList.js

@@ -13,13 +13,19 @@ class imageList extends React.Component {
             error: null,
             isLoaded: false,
             items: [],
-            path: "",
         };
 
     }
 
     componentDidMount() {
-        fetch("http://localhost:3000/listFile?path=" + this.props.path)
+        fetch("/system/ajgi/interface?script=/Photo/backend/listFile.js", {
+                method: 'post',
+                headers: {
+                    'Accept': 'application/json',
+                    'Content-Type': 'application/json'
+                },
+                body: JSON.stringify({ folder: this.props.path })
+            })
             .then(res => res.json())
             .then(
                 (result) => {
@@ -41,7 +47,7 @@ class imageList extends React.Component {
     }
 
     setPath() {
-        this.setState({ path: "123" });
+        this.setState({ path: "user:/Photo/Photo/uploads/" });
     }
 
     render() {

+ 2 - 2
photo/src/SearchAppMenu.js

@@ -227,7 +227,7 @@ export default function ButtonAppBar() {
     const [Imagelistopen, setImagelistOpen] = React.useState(true);
     const [Folderlistopen, setFolderlistOpen] = React.useState(false);
 
-    const [folderName, setFolderName] = React.useState('');
+    const [folderName, setFolderName] = React.useState('user:/Photo/Photo/uploads/');
 
     
     const setFolderNameF = (folderN) => {
@@ -273,7 +273,7 @@ export default function ButtonAppBar() {
                         <MenuIcon />
                     </IconButton>
                     <Typography variant="h6" className={classes.title}>
-                        谷狗相薄
+                        ArOZ Photo
                     </Typography>
                     <Button variant="contained" startIcon={<CloudUploadIcon />} type="button" onClick={handleAlertClick}>上載</Button>
                     <IconButton style={{ color: '#ffffff' }} aria-label="delete" onClick={handleAlertClick}>