Git Product home page Git Product logo

Comments (4)

HFO4 avatar HFO4 commented on July 4, 2024 1

感谢整理。目前的模式是历史遗留问题,在V3版本中会将前后端彻底分离。

from frontend.

sky5454 avatar sky5454 commented on July 4, 2024

此项目npm run-script build后,逻辑代码会生成在 <div id="root"></div> 标签之中或之后。
启动项目npm run-script start,然后访问 http://localhost:3000

如果您需要更多逻辑代码,建议参考 Cloudreve 项目application/index/view 目录下的 thinkphp 模板文件(后缀名为 .html)

详见 div 标签附近的注释

此仓库相关开发知识见 ReactMaterialUI 库

前端转发路径见:

  • 开发环境 config/webpack.config.dev.js )
    plugins: [
    // Generates an `index.html` file with the <script> injected.
    new HtmlWebpackPlugin({
    inject: true,
    filename:"index.html",
    chunks:['index'],
    template: paths.appHtml,
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['video'],
    filename:"video.html",
    template: './public/video.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['markdown'],
    filename:"markdown.html",
    template: './public/markdown.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['folderShare'],
    filename:"folderShare.html",
    template: './public/folderShare.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['fileShare'],
    filename:"fileShare.html",
    template: './public/fileShare.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['lock'],
    filename:"lock.html",
    template: './public/lock.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['setting'],
    filename:"setting.html",
    template: './public/setting.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['profile'],
    filename:"profile.html",
    template: './public/profile.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['myShare'],
    filename:"myShare.html",
    template: './public/myShare.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['search'],
    filename:"search.html",
    template: './public/explore/result.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['download'],
    filename:"download.html",
    template: './public/home/download.html',
    }),
    new HtmlWebpackPlugin({
    inject: true,
    chunks:['login'],
    filename:"login.html",
    template: './public/member/login.html',
    }),
  • 生产环境 config/webpack.config.prod.js
    plugins: [
    // Generates an `index.html` file with the <script> injected.
    new HtmlWebpackPlugin({
    inject: true,
    filename:"explore/result.html",
    chunks:['search'],
    template: "public/explore/result.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"member/login.html",
    chunks:['login'],
    template: "public/member/login.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"member/setting.html",
    chunks:['setting'],
    template: "public/member/setting.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"profile/profile.html",
    chunks:['profile'],
    template: "public/profile/profile.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"share/share_home.html",
    chunks:['myShare'],
    template: "public/share/share_home.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"share/share_single.html",
    chunks:['fileShare'],
    template: "public/share/share_single.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"share/share_lock.html",
    chunks:['lock'],
    template: "public/share/share_lock.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"share/share_dir.html",
    chunks:['folderShare'],
    template: "public/share/share_dir.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"viewer/video.html",
    chunks:['video'],
    template: "public/viewer/video.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"viewer/markdown.html",
    chunks:['markdown'],
    template: "public/viewer/markdown.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"home/home.html",
    chunks:['index'],
    template: paths.appHtml,
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),
    new HtmlWebpackPlugin({
    inject: true,
    filename:"home/download.html",
    chunks:['download'],
    template: "public/home/download.html",
    minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
    },
    }),

另外,后端开发见 cloudreve/Cloudreve#233

from frontend.

sky5454 avatar sky5454 commented on July 4, 2024

去Cloudreve后端仓库里找数据(一般在Model层),然后对 {$php对象变量名} 进行替换,可以得到可用的页面

image

后端数据在Cloudreve仓库找,而非本前端仓库

首先,确定我们前端需要的数据,如 <meta name="theme-color" content="{$options.themeColor}" />
image

然后去后端仓库里找
image

发现有DB字样(getValues函数里的),所以可以确定数据来自于数据库,那我们到数据库里找即可。

image

从php中可知 defaultTheme的值 #3f51b5 就是 {$ThemeColor},直接替换就OK。其他值同理

from frontend.

sky5454 avatar sky5454 commented on July 4, 2024

感谢整理。目前的模式是历史遗留问题,在V3版本中会将前后端彻底分离。

你好,问一下V3的前端仓库什么时候出来。另外,其实建议完善一下开发文档,这样可以让更多的人参与进来。个人觉得你的这个项目是国内网盘里最好的了。
image


另外可以参考 qiniuClient 推出客户端版本

from frontend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.