mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge remote-tracking branch 'origin/develop' into bootstrap
This commit is contained in:
commit
74645e12fc
143
.github/workflows/main-docker-alpine.yml
vendored
143
.github/workflows/main-docker-alpine.yml
vendored
@ -1,143 +0,0 @@
|
|||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
|
||||||
GHCR_REGISTRY: ghcr.io
|
|
||||||
DOCKERHUB_REGISTRY: docker.io
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
|
||||||
TEST_TAG: triliumnext/notes:test
|
|
||||||
PLATFORMS: linux/amd64
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test_docker:
|
|
||||||
name: Check Docker build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout the repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Set up node & dependencies
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: "npm"
|
|
||||||
|
|
||||||
- run: npm ci
|
|
||||||
|
|
||||||
- name: Run the TypeScript build
|
|
||||||
run: npx tsc
|
|
||||||
|
|
||||||
- name: Create server-package.json
|
|
||||||
run: cat package.json | grep -v electron > server-package.json
|
|
||||||
|
|
||||||
- name: Build and export to Docker
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
load: true
|
|
||||||
tags: ${{ env.TEST_TAG }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Run the container in the background
|
|
||||||
run: docker run -d --rm --name trilium_local ${{ env.TEST_TAG }}
|
|
||||||
|
|
||||||
- name: Wait for the healthchecks to pass
|
|
||||||
uses: stringbean/docker-healthcheck-action@v1
|
|
||||||
with:
|
|
||||||
container: trilium_local
|
|
||||||
wait-time: 50
|
|
||||||
require-status: running
|
|
||||||
require-healthy: true
|
|
||||||
|
|
||||||
build_docker:
|
|
||||||
name: Build Docker images
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- test_docker
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Extract metadata (tags, labels) for GHCR image
|
|
||||||
id: ghcr-meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=tag
|
|
||||||
type=sha
|
|
||||||
- name: Extract metadata (tags, labels) for DockerHub image
|
|
||||||
id: dh-meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=tag
|
|
||||||
type=sha
|
|
||||||
- name: Set up node & dependencies
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: "npm"
|
|
||||||
- run: npm ci
|
|
||||||
- name: Run the TypeScript build
|
|
||||||
run: npx tsc
|
|
||||||
- name: Create server-package.json
|
|
||||||
run: cat package.json | grep -v electron > server-package.json
|
|
||||||
- name: Log in to the GHCR container registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ${{ env.GHCR_REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build and push container image to GHCR
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
id: ghcr-push
|
|
||||||
with:
|
|
||||||
file: ./Dockerfile.alpine
|
|
||||||
context: .
|
|
||||||
platforms: ${{ env.PLATFORMS }}
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.ghcr-meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.ghcr-meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
- name: Generate and push artifact attestation to GHCR
|
|
||||||
uses: actions/attest-build-provenance@v1
|
|
||||||
with:
|
|
||||||
subject-name: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME}}
|
|
||||||
subject-digest: ${{ steps.ghcr-push.outputs.digest }}
|
|
||||||
push-to-registry: true
|
|
||||||
- name: Log in to the DockerHub container registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ${{ env.DOCKERHUB_REGISTRY }}
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
- name: Build and push image to DockerHub
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
id: dh-push
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: ${{ env.PLATFORMS }}
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.dh-meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.dh-meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
- name: Generate and push artifact attestation to DockerHub
|
|
||||||
uses: actions/attest-build-provenance@v1
|
|
||||||
with:
|
|
||||||
subject-name: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME}}
|
|
||||||
subject-digest: ${{ steps.dh-push.outputs.digest }}
|
|
||||||
push-to-registry: true
|
|
179
.github/workflows/main-docker.yml
vendored
179
.github/workflows/main-docker.yml
vendored
@ -14,14 +14,19 @@ on:
|
|||||||
env:
|
env:
|
||||||
GHCR_REGISTRY: ghcr.io
|
GHCR_REGISTRY: ghcr.io
|
||||||
DOCKERHUB_REGISTRY: docker.io
|
DOCKERHUB_REGISTRY: docker.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository_owner }}/notes
|
||||||
TEST_TAG: triliumnext/notes:test
|
TEST_TAG: ${{ github.repository_owner }}/notes:test
|
||||||
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
test_docker:
|
test_docker:
|
||||||
name: Check Docker build
|
name: Check Docker build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- dockerfile: Dockerfile.alpine
|
||||||
|
- dockerfile: Dockerfile
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -47,6 +52,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
file: ${{ matrix.dockerfile }}
|
||||||
load: true
|
load: true
|
||||||
tags: ${{ env.TEST_TAG }}
|
tags: ${{ env.TEST_TAG }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
@ -63,7 +69,7 @@ jobs:
|
|||||||
require-status: running
|
require-status: running
|
||||||
require-healthy: true
|
require-healthy: true
|
||||||
|
|
||||||
build_docker:
|
build:
|
||||||
name: Build Docker images
|
name: Build Docker images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
@ -73,26 +79,43 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
attestations: write
|
attestations: write
|
||||||
id-token: write
|
id-token: write
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- dockerfile: Dockerfile.alpine
|
||||||
|
platform: linux/amd64
|
||||||
|
- dockerfile: Dockerfile
|
||||||
|
platform: linux/arm64
|
||||||
|
- dockerfile: Dockerfile
|
||||||
|
platform: linux/arm/v7
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Prepare
|
||||||
- name: Extract metadata (tags, labels) for GHCR image
|
run: |
|
||||||
id: ghcr-meta
|
platform=${{ matrix.platform }}
|
||||||
|
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: |
|
||||||
tags: |
|
${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
type=ref,event=branch
|
${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
type=ref,event=tag
|
|
||||||
type=sha
|
|
||||||
- name: Extract metadata (tags, labels) for DockerHub image
|
|
||||||
id: dh-meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=sha
|
type=sha
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
|
||||||
- name: Set up node & dependencies
|
- name: Set up node & dependencies
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@ -103,50 +126,106 @@ jobs:
|
|||||||
run: npx tsc
|
run: npx tsc
|
||||||
- name: Create server-package.json
|
- name: Create server-package.json
|
||||||
run: cat package.json | grep -v electron > server-package.json
|
run: cat package.json | grep -v electron > server-package.json
|
||||||
- name: Log in to the GHCR container registry
|
|
||||||
|
- name: Login to GHCR
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.GHCR_REGISTRY }}
|
registry: ${{ env.GHCR_REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build and push container image to GHCR
|
- name: Login to DockerHub
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
id: ghcr-push
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: ${{ env.PLATFORMS }}
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.ghcr-meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.ghcr-meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
- name: Generate and push artifact attestation to GHCR
|
|
||||||
uses: actions/attest-build-provenance@v1
|
|
||||||
with:
|
|
||||||
subject-name: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME}}
|
|
||||||
subject-digest: ${{ steps.ghcr-push.outputs.digest }}
|
|
||||||
push-to-registry: true
|
|
||||||
- name: Log in to the DockerHub container registry
|
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.DOCKERHUB_REGISTRY }}
|
registry: ${{ env.DOCKERHUB_REGISTRY }}
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push image to DockerHub
|
|
||||||
|
- name: Build and push by digest
|
||||||
|
id: build
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
id: dh-push
|
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: ${{ env.PLATFORMS }}
|
file: ${{ matrix.dockerfile }}
|
||||||
push: true
|
platforms: ${{ matrix.platform }}
|
||||||
tags: ${{ steps.dh-meta.outputs.tags }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
labels: ${{ steps.dh-meta.outputs.labels }}
|
outputs: type=image,name=${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
- name: Export digest
|
||||||
- name: Generate and push artifact attestation to DockerHub
|
run: |
|
||||||
uses: actions/attest-build-provenance@v1
|
mkdir -p /tmp/digests
|
||||||
|
digest="${{ steps.build.outputs.digest }}"
|
||||||
|
touch "/tmp/digests/${digest#sha256:}"
|
||||||
|
|
||||||
|
- name: Upload digest
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME}}
|
name: digests-${{ env.PLATFORM_PAIR }}
|
||||||
subject-digest: ${{ steps.dh-push.outputs.digest }}
|
path: /tmp/digests/*
|
||||||
push-to-registry: true
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
merge:
|
||||||
|
name: Merge manifest lists
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
steps:
|
||||||
|
- name: Download digests
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: /tmp/digests
|
||||||
|
pattern: digests-*
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.GHCR_REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.DOCKERHUB_REGISTRY }}
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create manifest list and push
|
||||||
|
working-directory: /tmp/digests
|
||||||
|
run: |
|
||||||
|
# Extract the branch or tag name from the ref
|
||||||
|
REF_NAME=$(echo "${GITHUB_REF}" | sed 's/refs\/heads\///' | sed 's/refs\/tags\///')
|
||||||
|
|
||||||
|
# Get the first 7 characters of the commit SHA
|
||||||
|
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
||||||
|
|
||||||
|
# Create and push the manifest list with both the branch/tag name and the commit SHA
|
||||||
|
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||||
|
-t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${REF_NAME} \
|
||||||
|
-t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:sha256-${{ github.sha }} \
|
||||||
|
-t ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${SHORT_SHA} \
|
||||||
|
$(printf '${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
|
||||||
|
|
||||||
|
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||||
|
-t ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${REF_NAME} \
|
||||||
|
-t ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:sha256-${{ github.sha }} \
|
||||||
|
-t ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${SHORT_SHA} \
|
||||||
|
$(printf '${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
|
||||||
|
|
||||||
|
- name: Inspect image
|
||||||
|
run: |
|
||||||
|
docker buildx imagetools inspect ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
|
||||||
|
docker buildx imagetools inspect ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
|
@ -42,9 +42,9 @@ const NOTE_TYPE_ICONS = {
|
|||||||
"code": "bx bx-code",
|
"code": "bx bx-code",
|
||||||
"render": "bx bx-extension",
|
"render": "bx bx-extension",
|
||||||
"search": "bx bx-file-find",
|
"search": "bx bx-file-find",
|
||||||
"relationMap": "bx bx-map-alt",
|
"relationMap": "bx bxs-network-chart",
|
||||||
"book": "bx bx-book",
|
"book": "bx bx-book",
|
||||||
"noteMap": "bx bx-map-alt",
|
"noteMap": "bx bxs-network-chart",
|
||||||
"mermaid": "bx bx-selection",
|
"mermaid": "bx bx-selection",
|
||||||
"canvas": "bx bx-pen",
|
"canvas": "bx bx-pen",
|
||||||
"webView": "bx bx-globe-alt",
|
"webView": "bx bx-globe-alt",
|
||||||
@ -570,7 +570,7 @@ class FNote {
|
|||||||
return workspaceIconClass;
|
return workspaceIconClass;
|
||||||
}
|
}
|
||||||
else if (this.noteId === 'root') {
|
else if (this.noteId === 'root') {
|
||||||
return "bx bx-chevrons-right";
|
return "bx bx-home-alt-2";
|
||||||
}
|
}
|
||||||
if (this.noteId === '_share') {
|
if (this.noteId === '_share') {
|
||||||
return "bx bx-share-alt";
|
return "bx bx-share-alt";
|
||||||
|
2
libraries/ckeditor/ckeditor.js
vendored
2
libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,9 +14,9 @@ const NOTE_TYPE_ICONS = {
|
|||||||
"code": "bx bx-code",
|
"code": "bx bx-code",
|
||||||
"render": "bx bx-extension",
|
"render": "bx bx-extension",
|
||||||
"search": "bx bx-file-find",
|
"search": "bx bx-file-find",
|
||||||
"relationMap": "bx bx-map-alt",
|
"relationMap": "bx bxs-network-chart",
|
||||||
"book": "bx bx-book",
|
"book": "bx bx-book",
|
||||||
"noteMap": "bx bx-map-alt",
|
"noteMap": "bx bxs-network-chart",
|
||||||
"mermaid": "bx bx-selection",
|
"mermaid": "bx bx-selection",
|
||||||
"canvas": "bx bx-pen",
|
"canvas": "bx bx-pen",
|
||||||
"webView": "bx bx-globe-alt",
|
"webView": "bx bx-globe-alt",
|
||||||
@ -543,7 +543,7 @@ class FNote {
|
|||||||
return workspaceIconClass;
|
return workspaceIconClass;
|
||||||
}
|
}
|
||||||
else if (this.noteId === 'root') {
|
else if (this.noteId === 'root') {
|
||||||
return "bx bx-chevrons-right";
|
return "bx bx-home-alt-2";
|
||||||
}
|
}
|
||||||
if (this.noteId === '_share') {
|
if (this.noteId === '_share') {
|
||||||
return "bx bx-share-alt";
|
return "bx bx-share-alt";
|
||||||
|
@ -13,7 +13,8 @@ export async function initLocale() {
|
|||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
backend: {
|
backend: {
|
||||||
loadPath: `${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json`
|
loadPath: `${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json`
|
||||||
}
|
},
|
||||||
|
returnEmptyString: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ async function getNoteTypeItems(command) {
|
|||||||
{ title: t("note_types.text"), command: command, type: "text", uiIcon: "bx bx-note" },
|
{ title: t("note_types.text"), command: command, type: "text", uiIcon: "bx bx-note" },
|
||||||
{ title: t("note_types.code"), command: command, type: "code", uiIcon: "bx bx-code" },
|
{ title: t("note_types.code"), command: command, type: "code", uiIcon: "bx bx-code" },
|
||||||
{ title: t("note_types.saved-search"), command: command, type: "search", uiIcon: "bx bx-file-find" },
|
{ title: t("note_types.saved-search"), command: command, type: "search", uiIcon: "bx bx-file-find" },
|
||||||
{ title: t("note_types.relation-map"), command: command, type: "relationMap", uiIcon: "bx bx-map-alt" },
|
{ title: t("note_types.relation-map"), command: command, type: "relationMap", uiIcon: "bx bxs-network-chart" },
|
||||||
{ title: t("note_types.note-map"), command: command, type: "noteMap", uiIcon: "bx bx-map-alt" },
|
{ title: t("note_types.note-map"), command: command, type: "noteMap", uiIcon: "bx bxs-network-chart" },
|
||||||
{ title: t("note_types.render-note"), command: command, type: "render", uiIcon: "bx bx-extension" },
|
{ title: t("note_types.render-note"), command: command, type: "render", uiIcon: "bx bx-extension" },
|
||||||
{ title: t("note_types.book"), command: command, type: "book", uiIcon: "bx bx-book" },
|
{ title: t("note_types.book"), command: command, type: "book", uiIcon: "bx bx-book" },
|
||||||
{ title: t("note_types.mermaid-diagram"), command: command, type: "mermaid", uiIcon: "bx bx-selection" },
|
{ title: t("note_types.mermaid-diagram"), command: command, type: "mermaid", uiIcon: "bx bx-selection" },
|
||||||
|
@ -166,6 +166,23 @@ function getHost() {
|
|||||||
return `${url.protocol}//${url.hostname}:${url.port}`;
|
return `${url.protocol}//${url.hostname}:${url.port}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function openDirectory(directory) {
|
||||||
|
try {
|
||||||
|
if (utils.isElectron()) {
|
||||||
|
const electron = utils.dynamicRequire('electron');
|
||||||
|
const res = await electron.shell.openPath(directory);
|
||||||
|
if (res) {
|
||||||
|
console.error('Failed to open directory:', res);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.error('Not running in an Electron environment.');
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// Handle file system errors (e.g. path does not exist or is inaccessible)
|
||||||
|
console.error('Error:', err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
download,
|
download,
|
||||||
downloadFileNote,
|
downloadFileNote,
|
||||||
@ -176,4 +193,5 @@ export default {
|
|||||||
openAttachmentExternally,
|
openAttachmentExternally,
|
||||||
openNoteCustom,
|
openNoteCustom,
|
||||||
openAttachmentCustom,
|
openAttachmentCustom,
|
||||||
|
openDirectory
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,8 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
|
|||||||
else {
|
else {
|
||||||
toastService.showError(t("calendar.cannot_find_day_note"));
|
toastService.showError(t("calendar.cannot_find_day_note"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ev.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prevent dismissing the calendar popup by clicking on an empty space inside it.
|
// Prevent dismissing the calendar popup by clicking on an empty space inside it.
|
||||||
|
@ -125,7 +125,7 @@ const TPL = `
|
|||||||
|
|
||||||
<ul class="dropdown-menu dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-right">
|
||||||
<li class="dropdown-item" data-trigger-command="showOptions">
|
<li class="dropdown-item" data-trigger-command="showOptions">
|
||||||
<span class="bx bx-slider"></span>
|
<span class="bx bx-cog"></span>
|
||||||
${t('global_menu.options')}
|
${t('global_menu.options')}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ const TPL = `
|
|||||||
|
|
||||||
<li class="dropdown-item dropdown-submenu">
|
<li class="dropdown-item dropdown-submenu">
|
||||||
<span class="dropdown-toggle">
|
<span class="dropdown-toggle">
|
||||||
<span class="bx bx-empty"></span>
|
<span class="bx bx-chip"></span>
|
||||||
${t('global_menu.advanced')}
|
${t('global_menu.advanced')}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@ -194,43 +194,43 @@ const TPL = `
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="dropdown-item" data-trigger-command="showSQLConsoleHistory">
|
<li class="dropdown-item" data-trigger-command="showSQLConsoleHistory">
|
||||||
<span class="bx bx-empty"></span>
|
<span class="bx bx-data"></span>
|
||||||
${t('global_menu.open_sql_console_history')}
|
${t('global_menu.open_sql_console_history')}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="dropdown-item" data-trigger-command="showSearchHistory">
|
<li class="dropdown-item" data-trigger-command="showSearchHistory">
|
||||||
<span class="bx bx-empty"></span>
|
<span class="bx bx-search-alt"></span>
|
||||||
${t('global_menu.open_search_history')}
|
${t('global_menu.open_search_history')}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="dropdown-item" data-trigger-command="showBackendLog">
|
<li class="dropdown-item" data-trigger-command="showBackendLog">
|
||||||
<span class="bx bx-empty"></span>
|
<span class="bx bx-detail"></span>
|
||||||
${t('global_menu.show_backend_log')}
|
${t('global_menu.show_backend_log')}
|
||||||
<kbd data-command="showBackendLog"></kbd>
|
<kbd data-command="showBackendLog"></kbd>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="dropdown-item" data-trigger-command="reloadFrontendApp"
|
<li class="dropdown-item" data-trigger-command="reloadFrontendApp"
|
||||||
title="${t('global_menu.reload_hint')}">
|
title="${t('global_menu.reload_hint')}">
|
||||||
<span class="bx bx-empty"></span>
|
<span class="bx bx-refresh"></span>
|
||||||
${t('global_menu.reload_frontend')}
|
${t('global_menu.reload_frontend')}
|
||||||
<kbd data-command="reloadFrontendApp"></kbd>
|
<kbd data-command="reloadFrontendApp"></kbd>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="dropdown-item" data-trigger-command="showHiddenSubtree">
|
<li class="dropdown-item" data-trigger-command="showHiddenSubtree">
|
||||||
<span class="bx bx-empty"></span>
|
<span class="bx bx-hide"></span>
|
||||||
${t('global_menu.show_hidden_subtree')}
|
${t('global_menu.show_hidden_subtree')}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="dropdown-item show-help-button" data-trigger-command="showHelp">
|
<li class="dropdown-item show-help-button" data-trigger-command="showHelp">
|
||||||
<span class="bx bx-info-circle"></span>
|
<span class="bx bx-help-circle"></span>
|
||||||
${t('global_menu.show_help')}
|
${t('global_menu.show_help')}
|
||||||
<kbd data-command="showHelp"></kbd>
|
<kbd data-command="showHelp"></kbd>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="dropdown-item show-about-dialog-button">
|
<li class="dropdown-item show-about-dialog-button">
|
||||||
<span class="bx bx-empty"></span>
|
<span class="bx bx-info-circle"></span>
|
||||||
${t('global_menu.about')}
|
${t('global_menu.about')}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@ import server from "../../services/server.js";
|
|||||||
import utils from "../../services/utils.js";
|
import utils from "../../services/utils.js";
|
||||||
import { t } from "../../services/i18n.js";
|
import { t } from "../../services/i18n.js";
|
||||||
import BasicWidget from "../basic_widget.js";
|
import BasicWidget from "../basic_widget.js";
|
||||||
|
import openService from "../../services/open.js";
|
||||||
|
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="about-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
<div class="about-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
||||||
@ -69,8 +71,19 @@ export default class AboutDialog extends BasicWidget {
|
|||||||
this.$buildDate.text(appInfo.buildDate);
|
this.$buildDate.text(appInfo.buildDate);
|
||||||
this.$buildRevision.text(appInfo.buildRevision);
|
this.$buildRevision.text(appInfo.buildRevision);
|
||||||
this.$buildRevision.attr('href', `https://github.com/TriliumNext/Notes/commit/${appInfo.buildRevision}`);
|
this.$buildRevision.attr('href', `https://github.com/TriliumNext/Notes/commit/${appInfo.buildRevision}`);
|
||||||
|
if (utils.isElectron()) {
|
||||||
|
this.$dataDirectory.html($('<a></a>', {
|
||||||
|
href: '#',
|
||||||
|
text: appInfo.dataDirectory,
|
||||||
|
}));
|
||||||
|
this.$dataDirectory.find("a").on('click', (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
openService.openDirectory(appInfo.dataDirectory);
|
||||||
|
})
|
||||||
|
} else {
|
||||||
this.$dataDirectory.text(appInfo.dataDirectory);
|
this.$dataDirectory.text(appInfo.dataDirectory);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async openAboutDialogEvent() {
|
async openAboutDialogEvent() {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
|
@ -48,7 +48,7 @@ export default class HighlightsListWidget extends RightPanelWidget {
|
|||||||
get widgetButtons() {
|
get widgetButtons() {
|
||||||
return [
|
return [
|
||||||
new OnClickButtonWidget()
|
new OnClickButtonWidget()
|
||||||
.icon("bx-slider")
|
.icon("bx-cog")
|
||||||
.title("Options")
|
.title("Options")
|
||||||
.titlePlacement("left")
|
.titlePlacement("left")
|
||||||
.onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', {activate: true}))
|
.onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', {activate: true}))
|
||||||
|
@ -106,7 +106,7 @@ const TPL = `
|
|||||||
title="Scroll to active note"
|
title="Scroll to active note"
|
||||||
data-trigger-command="scrollToActiveNote"></button>
|
data-trigger-command="scrollToActiveNote"></button>
|
||||||
|
|
||||||
<button class="tree-floating-button bx bx-cog tree-settings-button"
|
<button class="tree-floating-button bx bxs-tree tree-settings-button"
|
||||||
title="Tree settings"></button>
|
title="Tree settings"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ export default class NoteMapRibbonWidget extends NoteContextAwareWidget {
|
|||||||
return {
|
return {
|
||||||
show: this.isEnabled(),
|
show: this.isEnabled(),
|
||||||
title: t("note_map.title"),
|
title: t("note_map.title"),
|
||||||
icon: 'bx bx-map-alt'
|
icon: 'bx bxs-network-chart'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ export default class TocWidget extends RightPanelWidget {
|
|||||||
get widgetButtons() {
|
get widgetButtons() {
|
||||||
return [
|
return [
|
||||||
new OnClickButtonWidget()
|
new OnClickButtonWidget()
|
||||||
.icon("bx-slider")
|
.icon("bx-cog")
|
||||||
.title("Options")
|
.title("Options")
|
||||||
.titlePlacement("left")
|
.titlePlacement("left")
|
||||||
.onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', {activate: true}))
|
.onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', {activate: true}))
|
||||||
|
@ -48,7 +48,7 @@ const HIDDEN_SUBTREE_DEFINITION: Item = {
|
|||||||
id: '_hidden',
|
id: '_hidden',
|
||||||
title: 'Hidden Notes',
|
title: 'Hidden Notes',
|
||||||
type: 'doc',
|
type: 'doc',
|
||||||
icon: 'bx bx-chip',
|
icon: 'bx bx-hide',
|
||||||
// we want to keep the hidden subtree always last, otherwise there will be problems with e.g., keyboard navigation
|
// we want to keep the hidden subtree always last, otherwise there will be problems with e.g., keyboard navigation
|
||||||
// over tree when it's in the middle
|
// over tree when it's in the middle
|
||||||
notePosition: 999_999_999,
|
notePosition: 999_999_999,
|
||||||
@ -222,7 +222,7 @@ const HIDDEN_SUBTREE_DEFINITION: Item = {
|
|||||||
{ id: '_lbJumpTo', title: 'Jump to Note', type: 'launcher', command: 'jumpToNote', icon: 'bx bx-send', attributes: [
|
{ id: '_lbJumpTo', title: 'Jump to Note', type: 'launcher', command: 'jumpToNote', icon: 'bx bx-send', attributes: [
|
||||||
{ type: 'label', name: 'desktopOnly' }
|
{ type: 'label', name: 'desktopOnly' }
|
||||||
] },
|
] },
|
||||||
{ id: '_lbNoteMap', title: 'Note Map', type: 'launcher', targetNoteId: '_globalNoteMap', icon: 'bx bx-map-alt' },
|
{ id: '_lbNoteMap', title: 'Note Map', type: 'launcher', targetNoteId: '_globalNoteMap', icon: 'bx bxs-network-chart' },
|
||||||
{ id: '_lbCalendar', title: 'Calendar', type: 'launcher', builtinWidget: 'calendar', icon: 'bx bx-calendar' },
|
{ id: '_lbCalendar', title: 'Calendar', type: 'launcher', builtinWidget: 'calendar', icon: 'bx bx-calendar' },
|
||||||
{ id: '_lbRecentChanges', title: 'Recent Changes', type: 'launcher', command: 'showRecentChanges', icon: 'bx bx-history', attributes: [
|
{ id: '_lbRecentChanges', title: 'Recent Changes', type: 'launcher', command: 'showRecentChanges', icon: 'bx bx-history', attributes: [
|
||||||
{ type: 'label', name: 'desktopOnly' }
|
{ type: 'label', name: 'desktopOnly' }
|
||||||
@ -241,6 +241,7 @@ const HIDDEN_SUBTREE_DEFINITION: Item = {
|
|||||||
id: '_options',
|
id: '_options',
|
||||||
title: 'Options',
|
title: 'Options',
|
||||||
type: 'book',
|
type: 'book',
|
||||||
|
icon: 'bx-cog',
|
||||||
children: [
|
children: [
|
||||||
{ id: '_optionsAppearance', title: 'Appearance', type: 'contentWidget', icon: 'bx-layout' },
|
{ id: '_optionsAppearance', title: 'Appearance', type: 'contentWidget', icon: 'bx-layout' },
|
||||||
{ id: '_optionsShortcuts', title: 'Shortcuts', type: 'contentWidget', icon: 'bxs-keyboard' },
|
{ id: '_optionsShortcuts', title: 'Shortcuts', type: 'contentWidget', icon: 'bxs-keyboard' },
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
[[ ! -z "${USER_UID}" ]] && usermod -u ${USER_UID} node || echo "No USER_UID specified, leaving 1000"
|
[ ! -z "${USER_UID}" ] && usermod -u ${USER_UID} node || echo "No USER_UID specified, leaving 1000"
|
||||||
[[ ! -z "${USER_GID}" ]] && groupmod -og ${USER_GID} node || echo "No USER_GID specified, leaving 1000"
|
[ ! -z "${USER_GID}" ] && groupmod -og ${USER_GID} node || echo "No USER_GID specified, leaving 1000"
|
||||||
|
|
||||||
chown -R node:node /home/node
|
chown -R node:node /home/node
|
||||||
exec su -c "node ./src/www" node
|
exec su -c "node ./src/www" node
|
Loading…
x
Reference in New Issue
Block a user