mirror of
https://github.com/OpenListTeam/OpenList-Frontend.git
synced 2026-03-15 03:20:25 +00:00
chore: update project meta (#10)
* chore: change the name to OpenList
* chore: change powered_by to OpenList
* chore: change meta content to OpenList
* chore: update homepage to url
* chore: update meta
* fix: update author footer
* chore: update index.html
* chore: update setting string
* chore: update issue template
* chore: update manifest.json
* feat: build.sh
* chore: update pre-commit hook lint-staged
* feat: add ci build for PR
* fix: update release CI build
* [skip ci] fix: update format CI
* [skip ci] fix: pre-release build CI
* chore: update @crowdin/cli to v4.7.1
* revert: "chore: update @crowdin/cli to v4.7.1"
This reverts commit a2243e014d.
* chore: update logo to use docs url
* fix: the build.sh handle the naming
* fix(ci): multiple versions of pnpm specified
* refactor(build.sh): make it satisfy both CI and local build
* [skip ci] chore: add todo comment for gpg sign ci commit
* refactor: remove netlify.toml (useless)
* fix: handle pre release for tag `v*.*.*-*`
* [skip ci] style: format code with prettier
* fix: should clear the former dash
* fix: pre release tag following triggering one
* fix: should use tag name as pre release name
* refactor: use gh cli
fix: should update rolling tag
* fix: release build failed
* fix: temporarily removing pre-release tags before `npx changelogithub`
---------
Co-authored-by: 未觉寻星 <2937150394@qq.com>
Co-authored-by: 一纸忘忧 <i@ikxin.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: Do not submit any issue here
|
||||
about: Please go to the `alist` repo if you hava issue to submit.
|
||||
about: Please go to the `OpenList` repo if you hava issue to submit.
|
||||
title: Do not submit any issue here
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
76
.github/workflows/build.yml
vendored
76
.github/workflows/build.yml
vendored
@@ -1,76 +0,0 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ubuntu-latest]
|
||||
name: Build
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "18"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
id: pnpm-install
|
||||
with:
|
||||
version: 9
|
||||
run_install: false
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
path: alist-web
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout dist repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: alist-org/web-dist
|
||||
ref: dev
|
||||
path: web-dist
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd alist-web
|
||||
pnpm install
|
||||
pnpm i18n:build
|
||||
pnpm build
|
||||
cd ..
|
||||
env:
|
||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||
|
||||
- name: Commit dist
|
||||
run: |
|
||||
cd web-dist
|
||||
rm -rf dist
|
||||
cp -r ../alist-web/dist .
|
||||
git add .
|
||||
git config --local user.email "i@nn.ci"
|
||||
git config --local user.name "Noah Hsu"
|
||||
git commit --amend -m "upload dev dist"
|
||||
cd ..
|
||||
|
||||
- name: Upload dist files
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.MY_TOKEN }}
|
||||
branch: dev
|
||||
directory: web-dist
|
||||
repository: alist-org/web-dist
|
||||
force: true
|
||||
10
.github/workflows/format.yml
vendored
10
.github/workflows/format.yml
vendored
@@ -26,10 +26,8 @@ jobs:
|
||||
- name: Format
|
||||
run: pnpm run format
|
||||
|
||||
- name: Add, Commit and Push
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
- name: Commit and Push
|
||||
uses: stefanzweifel/git-auto-commit-action@v6
|
||||
with:
|
||||
commit_message: "style: format code with prettier"
|
||||
commit_user_name: Isla
|
||||
commit_user_email: bot@nn.ci
|
||||
commit_author: "Isla <bot@nn.ci>"
|
||||
# TODO: GPG sign: https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#signing-commits
|
||||
commit_message: "[skip ci] style: format code with prettier"
|
||||
|
||||
52
.github/workflows/pr.yml
vendored
Normal file
52
.github/workflows/pr.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: PR Build Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build-check:
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ubuntu-latest]
|
||||
name: Build Check
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "18"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
id: pnpm-install
|
||||
with:
|
||||
version: 9
|
||||
run_install: false
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Build Development Version
|
||||
run: |
|
||||
chmod +x build.sh
|
||||
./build.sh --dev --no-compress
|
||||
env:
|
||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||
# OPENLIST_FRONTEND_BUILD_MODE: dev
|
||||
# OPENLIST_FRONTEND_BUILD_COMPRESS: false
|
||||
|
||||
- name: Upload Build Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openlist-frontend-dist-dev-${{ github.sha }}
|
||||
path: dist/
|
||||
retention-days: 7
|
||||
78
.github/workflows/pre-release.yml
vendored
Normal file
78
.github/workflows/pre-release.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: Pre Release Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*.*.*-*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
draft:
|
||||
description: "Create draft release"
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
pre-release:
|
||||
name: Pre Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "18"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
id: pnpm-install
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Build Pre-release
|
||||
run: |
|
||||
chmod +x build.sh
|
||||
./build.sh --dev --compress
|
||||
env:
|
||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||
|
||||
- name: Read version and determine tag name
|
||||
id: version
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||
echo "tag_name=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
version=$(cat dist/VERSION)
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
echo "tag_name=rolling" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Remove the existing pre-release
|
||||
run: gh release delete ${{ steps.version.outputs.tag_name }} --cleanup-tag --yes || true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish pre-release on GitHub
|
||||
run: |
|
||||
gh release create \
|
||||
--title "Pre-release ${{ steps.version.outputs.version }}" \
|
||||
--notes "Pre-release build for ${{ steps.version.outputs.version }}<br>This is a development build and not intended for production use." \
|
||||
--prerelease \
|
||||
--draft=${{ github.event_name == 'workflow_dispatch' && inputs.draft || false }} \
|
||||
${{ steps.version.outputs.tag_name }} \
|
||||
dist/openlist-frontend-dist-v*-*.tar.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
119
.github/workflows/release.yml
vendored
119
.github/workflows/release.yml
vendored
@@ -1,33 +1,33 @@
|
||||
name: release
|
||||
name: Release Build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
- "v*.*.*"
|
||||
- "!v*.*.*-*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
draft:
|
||||
description: "Create draft release"
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
version:
|
||||
description: "Version tag (for manual trigger, e.g., v1.0.0)"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
changelog:
|
||||
name: Create release changelog
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Generate changelog
|
||||
run: npx changelogithub # or changelogithub@0.12 if ensure the stable result
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.MY_TOKEN}}
|
||||
|
||||
release:
|
||||
needs: changelog
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ubuntu-latest]
|
||||
name: Release
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
@@ -38,53 +38,64 @@ jobs:
|
||||
name: Install pnpm
|
||||
id: pnpm-install
|
||||
with:
|
||||
version: 9
|
||||
run_install: false
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
path: alist-web
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout dist repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: alist-org/web-dist
|
||||
ref: main
|
||||
path: web-dist
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build
|
||||
- name: Setup version for manual trigger
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.version
|
||||
run: |
|
||||
mv alist-web/release.sh .
|
||||
bash release.sh
|
||||
git tag ${{ inputs.version }}
|
||||
echo "Created temporary tag: ${{ inputs.version }}"
|
||||
|
||||
- name: Generate changelog
|
||||
run: |
|
||||
# Remove existing tag `rolling`, since `rolling` should always point to the latest commit
|
||||
# This is necessary to avoid conflicts with the changelog generation
|
||||
git tag -d rolling || true
|
||||
|
||||
# Temporarily remove all pre-release tags (tags containing '-')
|
||||
# This prevents them from interfering with changelog generation
|
||||
PRE_RELEASE_TAGS=$(git tag -l | grep '-|+' || true)
|
||||
if [ -n "$PRE_RELEASE_TAGS" ]; then
|
||||
echo "Temporarily removing pre-release tags: $PRE_RELEASE_TAGS"
|
||||
echo "$PRE_RELEASE_TAGS" | xargs -r git tag -d
|
||||
fi
|
||||
|
||||
npx changelogithub --output ${{ github.workspace }}-CHANGELOG.txt
|
||||
|
||||
- name: Build Release
|
||||
run: |
|
||||
chmod +x build.sh
|
||||
./build.sh --release --compress
|
||||
env:
|
||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||
|
||||
- name: Publish npm
|
||||
if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.draft) }}
|
||||
run: |
|
||||
cd alist-web
|
||||
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
|
||||
pnpm publish --no-git-checks
|
||||
cd ..
|
||||
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
|
||||
echo "NPM_TOKEN not set, skipping npm publish"
|
||||
else
|
||||
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
|
||||
pnpm publish --no-git-checks
|
||||
fi
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Upload dist files
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.MY_TOKEN }}
|
||||
branch: main
|
||||
directory: web-dist
|
||||
repository: alist-org/web-dist
|
||||
- name: Read version from dist/VERSION
|
||||
id: version
|
||||
run: echo "tag_name=$(cat dist/VERSION)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: compress/*
|
||||
- name: Upload Release Assets
|
||||
run: |
|
||||
gh release edit \
|
||||
--title "Release ${{ steps.version.outputs.tag_name }}" \
|
||||
--notes-file "${{ github.workspace }}-CHANGELOG.txt" \
|
||||
--draft=${{ github.event_name == 'workflow_dispatch' && inputs.draft || false }} \
|
||||
${{ steps.version.outputs.tag_name }} \
|
||||
dist/openlist-frontend-dist-v*.tar.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
145
build.sh
Executable file
145
build.sh
Executable file
@@ -0,0 +1,145 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
PURPLE='\033[0;35m'
|
||||
CYAN='\033[0;36m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
log_info() { echo -e "${CYAN}$1${NC}"; }
|
||||
log_success() { echo -e "${GREEN}✓ $1${NC}"; }
|
||||
log_error() { echo -e "${RED}✗ Error: $1${NC}"; }
|
||||
log_warning() { echo -e "${YELLOW}$1${NC}"; }
|
||||
log_step() { echo -e "${PURPLE}$1${NC}"; }
|
||||
log_build() { echo -e "${BLUE}$1${NC}"; }
|
||||
|
||||
# CI Build Script
|
||||
# Usage: ./build.sh [--dev|--release] [--compress|--no-compress]
|
||||
# Environment variables:
|
||||
# OPENLIST_FRONTEND_BUILD_MODE=dev|release (default: dev)
|
||||
# OPENLIST_FRONTEND_BUILD_COMPRESS=true|false (default: false)
|
||||
# OPENLIST_FRONTEND_BUILD_ENFORCE_TAG=true|false (default: false)
|
||||
|
||||
# Set defaults from environment variables
|
||||
BUILD_TYPE=${OPENLIST_FRONTEND_BUILD_MODE:-dev}
|
||||
COMPRESS_FLAG=${OPENLIST_FRONTEND_BUILD_COMPRESS:-false}
|
||||
ENFORCE_TAG=${OPENLIST_FRONTEND_BUILD_ENFORCE_TAG:-false}
|
||||
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--dev)
|
||||
BUILD_TYPE="dev"
|
||||
shift
|
||||
;;
|
||||
--release)
|
||||
BUILD_TYPE="release"
|
||||
shift
|
||||
;;
|
||||
--compress)
|
||||
COMPRESS_FLAG="true"
|
||||
shift
|
||||
;;
|
||||
--no-compress)
|
||||
COMPRESS_FLAG="false"
|
||||
shift
|
||||
;;
|
||||
--enforce-tag)
|
||||
ENFORCE_TAG="true"
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
echo "Usage: $0 [--dev|--release] [--compress|--no-compress] [--enforce-tag]"
|
||||
echo ""
|
||||
echo "Options (will overwrite environment setting):"
|
||||
echo " --dev Build development version"
|
||||
echo " --release Build release version (will check if git tag match package.json version)"
|
||||
echo " --compress Create compressed archive"
|
||||
echo " --no-compress Skip compression"
|
||||
echo " --enforce-tag Force git tag requirement for both dev and release builds"
|
||||
echo ""
|
||||
echo "Environment variables:"
|
||||
echo " OPENLIST_FRONTEND_BUILD_MODE=dev|release (default: dev)"
|
||||
echo " OPENLIST_FRONTEND_BUILD_COMPRESS=true|false (default: false)"
|
||||
echo " OPENLIST_FRONTEND_BUILD_ENFORCE_TAG=true|false (default: false)"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
echo "Use --help for usage information"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Get git version and commit
|
||||
if [ "$BUILD_TYPE" == "release" ] || [ "$ENFORCE_TAG" == "true" ]; then
|
||||
# For release build or when enforce-tag is set, git tag is required
|
||||
if ! git_version=$(git describe --abbrev=0 --tags 2>/dev/null); then
|
||||
log_error "No git tags found. Release build requires a git tag."
|
||||
log_warning "Please create a tag first, or use --dev for development builds."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
package_version=$(grep '"version":' package.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
||||
git_version_clean=${git_version#v}
|
||||
if [ "$git_version_clean" != "$package_version" ]; then
|
||||
log_error "Package.json version (${package_version}) does not match git tag (${git_version_clean})."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# For dev build, use tag if available, otherwise fallback to v0.0.0
|
||||
git_version=$(git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0")
|
||||
git_version_clean=${git_version#v}
|
||||
git_version_clean=${git_version_clean%%-*}
|
||||
fi
|
||||
|
||||
commit=$(git rev-parse --short HEAD)
|
||||
|
||||
if [ "$BUILD_TYPE" == "dev" ]; then
|
||||
# ! For dev build, update package.json version to match git tag
|
||||
sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"${git_version_clean}\"/" package.json
|
||||
log_success "Package.json version updated to ${git_version_clean}"
|
||||
|
||||
version_tag="v${git_version_clean}-${commit}"
|
||||
log_build "Building DEV version ${version_tag}..."
|
||||
elif [ "$BUILD_TYPE" == "release" ]; then
|
||||
# ! For release build, we update package.json version,
|
||||
# ! and then `git tag` to trigger CI release.
|
||||
version_tag="v${git_version_clean}"
|
||||
log_build "Building RELEASE version ${version_tag}..."
|
||||
else
|
||||
log_error "Invalid build type: $BUILD_TYPE. Use --dev or --release."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
archive_name="openlist-frontend-dist-${version_tag}"
|
||||
log_info "Archive name will be: ${archive_name}.tar.gz"
|
||||
|
||||
# build
|
||||
log_step "==== Installing dependencies ===="
|
||||
pnpm install
|
||||
log_step "==== Building i18n ===="
|
||||
pnpm i18n:release
|
||||
log_step "==== Building project ===="
|
||||
pnpm build
|
||||
|
||||
# Write version to dist/VERSION file
|
||||
log_step "Writing version $version_tag to dist/VERSION..."
|
||||
echo -n "$version_tag" | cat > dist/VERSION
|
||||
log_success "Version file created: dist/VERSION"
|
||||
|
||||
# handle compression if requested
|
||||
if [ "$COMPRESS_FLAG" == "true" ]; then
|
||||
log_step "Creating compressed archive..."
|
||||
|
||||
tar -czvf "${archive_name}.tar.gz" -C dist .
|
||||
mv "${archive_name}.tar.gz" dist/
|
||||
log_success "Compressed archive created: dist/${archive_name}.tar.gz"
|
||||
fi
|
||||
|
||||
log_success "Build completed."
|
||||
14
index.html
14
index.html
@@ -1,19 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en" translate="no">
|
||||
<head>
|
||||
<!-- customize head -->
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="referrer" content="same-origin" />
|
||||
<meta name="generator" content="AList V3" />
|
||||
<meta name="generator" content="OpenList" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="google" content="notranslate" />
|
||||
<link href="/static/manifest.json" rel="manifest" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="AList" />
|
||||
<meta name="apple-mobile-web-app-title" content="OpenList" />
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
href="https://jsd.nn.ci/gh/alist-org/logo@main/logo.png"
|
||||
href="https://docs.oplist.org/logo.png"
|
||||
/>
|
||||
<script
|
||||
src="https://g.alicdn.com/IMM/office-js/1.1.5/aliyun-web-office-sdk.min.js"
|
||||
@@ -22,18 +22,18 @@
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
type="image/ico"
|
||||
href="https://jsd.nn.ci/gh/alist-org/logo@main/logo.svg"
|
||||
href="https://docs.oplist.org/logo.svg"
|
||||
/>
|
||||
<title>Loading...</title>
|
||||
<script>
|
||||
window.ALIST = {
|
||||
window.OPENLIST_CONFIG = {
|
||||
cdn: undefined,
|
||||
monaco_cdn: undefined,
|
||||
base_path: undefined,
|
||||
api: undefined,
|
||||
main_color: undefined,
|
||||
}
|
||||
window.__dynamic_base__ = window.ALIST.cdn || ""
|
||||
window.__dynamic_base__ = window.OPENLIST_CONFIG.cdn || ""
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[build.environment]
|
||||
NPM_FLAGS = "--version"
|
||||
17
package.json
17
package.json
@@ -1,24 +1,23 @@
|
||||
{
|
||||
"name": "alist-web",
|
||||
"name": "openlist-frontend",
|
||||
"version": "0.0.0",
|
||||
"author": {
|
||||
"name": "Xhofe",
|
||||
"email": "i@nn.ci",
|
||||
"url": "https://www.nn.ci"
|
||||
"name": "The OpenList Projects Contributors",
|
||||
"url": "https://github.com/OpenListTeam"
|
||||
},
|
||||
"description": "The front end of Alist V3",
|
||||
"description": "A new AList Fork to Anti Trust Crisis",
|
||||
"packageManager": "pnpm@9.9.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/alist-org/alist-web.git"
|
||||
"url": "git+https://github.com/xyamzw/OpenList-Frontend.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/alist-org/alist/issues"
|
||||
"url": "https://github.com/OpenListTeam/OpenList/issues"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"homepage": "https://alist.nn.ci",
|
||||
"homepage": "https://openlist.team/",
|
||||
"scripts": {
|
||||
"crowdin:upload": "crowdin upload sources --auto-update",
|
||||
"crowdin:download": "crowdin download --verbose",
|
||||
@@ -100,6 +99,6 @@
|
||||
"typescript-natural-sort": "^0.7.2"
|
||||
},
|
||||
"lint-staged": {
|
||||
"**/*": "prettier --write"
|
||||
"**/*.{js,ts,css,tsx,jsx,md,html,yml,yaml}": "prettier --write"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
"display": "standalone",
|
||||
"scope": "/",
|
||||
"start_url": "/",
|
||||
"name": "AList",
|
||||
"name": "OpenList",
|
||||
"icons": [
|
||||
{
|
||||
"src": "https://jsd.nn.ci/gh/alist-org/logo@main/logo.png",
|
||||
"src": "https://docs.oplist.org/logo.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
|
||||
27
release.sh
27
release.sh
@@ -1,27 +0,0 @@
|
||||
# replace version
|
||||
cd alist-web
|
||||
version=$(git describe --abbrev=0 --tags)
|
||||
sed -i -e "s/\"version\": \"0.0.0\"/\"version\": \"$version\"/g" package.json
|
||||
cat package.json
|
||||
|
||||
# build
|
||||
pnpm install
|
||||
pnpm i18n:release
|
||||
pnpm build
|
||||
cp -r dist ../
|
||||
cd ..
|
||||
|
||||
# commit to web-dist
|
||||
cd web-dist
|
||||
rm -rf dist
|
||||
cp -r ../dist .
|
||||
git add .
|
||||
git config --local user.email "i@nn.ci"
|
||||
git config --local user.name "Noah Hsu"
|
||||
git commit --allow-empty -m "upload $version dist files" -a
|
||||
git tag -a $version -m "release $version"
|
||||
cd ..
|
||||
|
||||
mkdir compress
|
||||
tar -czvf compress/dist.tar.gz dist/*
|
||||
zip -r compress/dist.zip dist/*
|
||||
@@ -1313,7 +1313,7 @@
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* https://github.com/alist-org/alist/issues/6929 */
|
||||
/* Fix the issue where fraction lines of $\frac{}{}$ are not displayed when using $\LaTeX$ syntax in md files */
|
||||
.katex-display .frac-line {
|
||||
border-bottom-width: 0.04em;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ function isNullOrUndefined(value: string | object): boolean {
|
||||
}
|
||||
|
||||
async function getSaveDir(rpc_url: string, rpc_secret: string) {
|
||||
let save_dir: string = "/downloads/alist"
|
||||
let save_dir: string = "/downloads/openlist"
|
||||
|
||||
const resp = await axios.post(rpc_url, {
|
||||
id: Math.random().toString(),
|
||||
@@ -97,7 +97,7 @@ export const useDownload = () => {
|
||||
return
|
||||
}
|
||||
try {
|
||||
let save_dir = "/downloads/alist"
|
||||
let save_dir = "/downloads/openlist"
|
||||
// TODO: select dir, but it seems there is no way to get the full path
|
||||
// if (window.showDirectoryPicker) {
|
||||
// const dirHandle = await window.showDirectoryPicker()
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
"root_folder_path": "Root folder path",
|
||||
"url": "Url"
|
||||
},
|
||||
"AList V3": {
|
||||
"OpenList": {
|
||||
"forward_archive_requests": "Forward archive requests",
|
||||
"meta_password": "Meta password",
|
||||
"pass_ua_to_upsteam": "Pass ua to upsteam",
|
||||
@@ -1133,7 +1133,7 @@
|
||||
},
|
||||
"189CloudPC": {},
|
||||
"AList V2": {},
|
||||
"AList V3": {},
|
||||
"OpenList": {},
|
||||
"Alias": {},
|
||||
"Aliyundrive": {
|
||||
"alert": "There may be an infinite loop bug in this driver.\nDeprecated, no longer maintained and will be removed in a future version.\nWe recommend using the official driver AliyundriveOpen."
|
||||
@@ -1217,7 +1217,7 @@
|
||||
"189Cloud": "189Cloud",
|
||||
"189CloudPC": "189CloudPC",
|
||||
"AList V2": "AList V2",
|
||||
"AList V3": "AList V3",
|
||||
"OpenList": "OpenList",
|
||||
"Alias": "Alias",
|
||||
"Aliyundrive": "Aliyundrive",
|
||||
"AliyundriveOpen": "AliyundriveOpen",
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
"success": "Download completed"
|
||||
},
|
||||
"footer": {
|
||||
"powered_by": "Powered by AList",
|
||||
"powered_by": "Powered by The OpenList Projects Contributors",
|
||||
"manage": "Manage"
|
||||
},
|
||||
"search": {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"otp-tips": "Input your OTP Code",
|
||||
"remember": "Remember me",
|
||||
"forget": "Forget password?",
|
||||
"forget_url": "https://alist.nn.ci/faq/howto.html#how-to-get-password-if-i-forget-it",
|
||||
"forget_url": "https://docs.openlist.team/faq/howto.html#how-to-get-password-if-i-forget-it",
|
||||
"clear": "Clear",
|
||||
"login": "Login",
|
||||
"use_guest": "Browse as a guest",
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"ftp": "FTP",
|
||||
"traffic": "Traffic"
|
||||
},
|
||||
"title": "AList Manage",
|
||||
"title": "OpenList Manage",
|
||||
"not_admin": "You are not admin user, please login with admin account.",
|
||||
"logout_success": "Logout successfully",
|
||||
"send": "Send",
|
||||
|
||||
@@ -40,7 +40,7 @@ const Preview = () => {
|
||||
cover =
|
||||
obj.thumb ||
|
||||
getSetting("audio_cover") ||
|
||||
"https://jsd.nn.ci/gh/alist-org/logo@main/logo.svg"
|
||||
"https://docs.oplist.org/logo.svg"
|
||||
}
|
||||
const audio = {
|
||||
name: obj.name,
|
||||
|
||||
@@ -4,7 +4,9 @@ import { useT, useManageTitle } from "~/hooks"
|
||||
|
||||
const fetchReadme = async () =>
|
||||
await (
|
||||
await fetch("https://jsd.nn.ci/gh/alist-org/alist@main/README.md")
|
||||
await fetch(
|
||||
"https://cdn.statically.io/gh/OpenListTeam/OpenList/main/README.md",
|
||||
)
|
||||
).text()
|
||||
|
||||
const About = () => {
|
||||
|
||||
@@ -167,7 +167,10 @@ const BackupRestore = () => {
|
||||
},
|
||||
)
|
||||
}
|
||||
download("alist_backup_" + new Date().toLocaleString() + ".json", allData)
|
||||
download(
|
||||
"openlist_backup_" + new Date().toLocaleString() + ".json",
|
||||
allData,
|
||||
)
|
||||
appendLog(t("br.finish_backup"), "info")
|
||||
}
|
||||
const [addSettingsLoading, addSettings] = useFetch(
|
||||
|
||||
@@ -195,7 +195,7 @@ export const side_menu_items: SideMenuItem[] = [
|
||||
{
|
||||
title: "manage.sidemenu.docs",
|
||||
icon: FaSolidBook,
|
||||
to: "https://alist.nn.ci",
|
||||
to: "https://docs.openlist.team",
|
||||
role: UserRole.GUEST,
|
||||
external: true,
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ export const setSettings = (items: Record<string, string>) => {
|
||||
})
|
||||
const version = settings["version"] || "Unknown"
|
||||
console.log(
|
||||
`%c AList %c ${version} %c https://github.com/alist-org/alist`,
|
||||
`%c OpenList %c ${version} %c https://github.com/OpenListTeam/OpenList`,
|
||||
"color: #fff; background: #5f5f5f",
|
||||
"color: #fff; background: #70c6be",
|
||||
"",
|
||||
@@ -28,8 +28,8 @@ export const getSettingNumber = (key: string, defaultV?: number) => {
|
||||
return defaultV ?? 0
|
||||
}
|
||||
export const getMainColor = (): string => {
|
||||
if (window.ALIST.main_color) {
|
||||
return window.ALIST.main_color
|
||||
if (window.OPENLIST_CONFIG.main_color) {
|
||||
return window.OPENLIST_CONFIG.main_color
|
||||
}
|
||||
return getSetting("main_color") || "#1890ff"
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ export const fetchText = async (
|
||||
responseType: "blob",
|
||||
params: ts
|
||||
? {
|
||||
alist_ts: new Date().getTime(),
|
||||
openlist_ts: new Date().getTime(),
|
||||
}
|
||||
: undefined,
|
||||
})
|
||||
|
||||
@@ -10,13 +10,13 @@ export const setBasePath = (path: string) => {
|
||||
base_path = base_path.slice(0, -1)
|
||||
}
|
||||
}
|
||||
if (window.ALIST.base_path) {
|
||||
setBasePath(window.ALIST.base_path)
|
||||
if (window.OPENLIST_CONFIG.base_path) {
|
||||
setBasePath(window.OPENLIST_CONFIG.base_path)
|
||||
}
|
||||
|
||||
export let api = import.meta.env.VITE_API_URL as string
|
||||
if (window.ALIST.api) {
|
||||
api = window.ALIST.api
|
||||
if (window.OPENLIST_CONFIG.api) {
|
||||
api = window.OPENLIST_CONFIG.api
|
||||
}
|
||||
if (api === "/") {
|
||||
api = location.origin + base_path
|
||||
@@ -26,5 +26,5 @@ if (api.endsWith("/")) {
|
||||
}
|
||||
|
||||
export const monaco_cdn =
|
||||
window.ALIST.monaco_cdn ||
|
||||
window.OPENLIST_CONFIG.monaco_cdn ||
|
||||
"https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.33.0-dev.20220228/min/vs"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sha256 from "sha256"
|
||||
|
||||
// TODO: use argon2
|
||||
const hash_salt = "https://github.com/alist-org/alist"
|
||||
|
||||
export function hashPwd(pwd: string) {
|
||||
|
||||
@@ -62,7 +62,7 @@ export const convertURL = (scheme: string, args: ConvertURLArgs) => {
|
||||
if (args.ts) {
|
||||
const d = new URL(args.d_url)
|
||||
const ts = Date.now()
|
||||
d.searchParams.set("alist_ts", ts.toString())
|
||||
d.searchParams.set("openlist_ts", ts.toString())
|
||||
args.d_url = d.toString()
|
||||
}
|
||||
ans = ans.replace(/\$[eb_]*url/, (old) => {
|
||||
|
||||
@@ -33,7 +33,7 @@ export default defineConfig({
|
||||
// experimental: {
|
||||
// renderBuiltUrl: (filename, { type, hostId, hostType }) => {
|
||||
// if (type === "asset") {
|
||||
// return { runtime: `window.ALIST.cdn/${filename}` };
|
||||
// return { runtime: `window.OPENLIST_CONFIG.cdn/${filename}` };
|
||||
// }
|
||||
// return { relative: true };
|
||||
// },
|
||||
|
||||
Reference in New Issue
Block a user