Skip to content

The Unified and Autonomous Development Platform

feat: Project wiki as in GitHub/GitLab

Robin Shen64e5e9a37a69
diff --git a/dev.sh b/dev.sh
index f6d71dc2c8..ce2ec151d5 100755
--- a/dev.sh
+++ b/dev.sh
@@ -11,6 +11,41 @@ export MAVEN_OPTS
HOTSWAP_AGENT_VERSION=2.0.3
ECJ_VERSION=3.38.0
MAVEN_REPOSITORY="${MAVEN_REPOSITORY:-$HOME/.m2/repository}"
+SERVER_PID_FILE="$ROOT/server-product/target/sandbox/dev-server.pid"
+
+running_server() {
+ [ -f "$SERVER_PID_FILE" ] || return 1
+ server_pid=$(cat "$SERVER_PID_FILE")
+ case "$server_pid" in
+ ''|*[!0-9]*|0) return 1 ;;
+ esac
+ # The development classpath can make the command line very long.
+ server_command=$(ps -ww -p "$server_pid" -o args=) || return 1
+ case "$server_command" in
+ *"-Donedev.dev.root=$ROOT "*"io.onedev.commons.bootstrap.Bootstrap"*) return 0 ;;
+ *) return 1 ;;
+ esac
+}
+
+stop_server() {
+ if ! running_server; then
+ rm -f "$SERVER_PID_FILE"
+ echo "Development server is not running."
+ return
+ fi
+
+ echo "Stopping development server (PID $server_pid)..."
+ kill "$server_pid"
+ for ((attempt = 0; attempt < 30; attempt++)); do
+ if ! running_server; then
+ echo "Development server stopped."
+ return
+ fi
+ sleep 1
+ done
+ echo "Development server did not stop within 30 seconds. Check the server console." >&2
+ return 1
+}
run_maven() {
if [ -f server-ee/pom.xml ]; then
@@ -292,6 +327,7 @@ usage() {
echo
echo "Commands:"
echo " run Build, start the dev server, and rebuild automatically when files change"
+ echo " stop Stop the running development server"
echo " build Build with Maven when needed, otherwise compile changed files with ECJ"
echo " rebuild Clean and build all modules while preserving the development sandbox"
echo " test Run tests with Maven"
@@ -304,7 +340,7 @@ usage() {
is_command() {
case "$1" in
- build|rebuild|clean|install|test|package|run) return 0 ;;
+ build|rebuild|clean|install|test|package|run|stop) return 0 ;;
*) return 1 ;;
esac
}
@@ -350,6 +386,10 @@ while [ "$#" -gt 0 ]; do
rebuild_project "${command_arguments[@]}"
fi
;;
+ stop)
+ flush_maven_commands
+ stop_server
+ ;;
run)
flush_maven_commands
run_requested=true
@@ -369,6 +409,10 @@ if [ "$run_requested" != true ]; then
fi
set -- "${run_arguments[@]}"
+if running_server; then
+ echo "Development server is already running (PID $server_pid). Use ./dev.sh stop first." >&2
+ exit 1
+fi
watch_reference=$(mktemp "${TMPDIR:-/tmp}/onedev-watch.XXXXXX")
touch "$watch_reference"
trap 'rm -f "$watch_reference"' EXIT
@@ -392,10 +436,22 @@ watch_and_build "$watch_reference" &
watcher_pid=$!
cleanup_run() {
kill "$watcher_pid" 2>/dev/null || true
+ if [ -n "${java_pid:-}" ]; then
+ kill "$java_pid" 2>/dev/null || true
+ wait "$java_pid" 2>/dev/null || true
+ if [ "$(cat "$SERVER_PID_FILE" 2>/dev/null)" = "$java_pid" ]; then
+ rm -f "$SERVER_PID_FILE"
+ fi
+ fi
wait "$watcher_pid" 2>/dev/null || true
rm -f "$watch_reference"
}
trap cleanup_run EXIT
-
-java $MAVEN_OPTS $hotswap_options -cp "$classpath" \
- io.onedev.commons.bootstrap.Bootstrap "$@"
+trap 'exit 130' INT
+trap 'exit 143' TERM
+
+java $MAVEN_OPTS $hotswap_options "-Donedev.dev.root=$ROOT" -cp "$classpath" \
+ io.onedev.commons.bootstrap.Bootstrap "$@" <&0 &
+java_pid=$!
+echo "$java_pid" > "$SERVER_PID_FILE"
+wait "$java_pid"
diff --git a/e2e-test/tests/api.js b/e2e-test/tests/api.js
new file mode 100644
index 0000000000..431ea3407f
--- /dev/null
+++ b/e2e-test/tests/api.js
@@ -0,0 +1,97 @@
+import { randomUUID } from 'node:crypto';
+import { expect } from '@playwright/test';
+
+export const admin = {
+ name: process.env.E2E_ADMIN_USER ?? 'admin',
+ password: process.env.E2E_ADMIN_PASSWORD ?? 'admin',
+};
+
+export function credentials(user) {
+ return { Authorization: `Basic ${Buffer.from(`${user.userName ?? user.name}:${user.password}`).toString('base64')}` };
+}
+
+/** REST fixture setup. Only resources created by this instance are cleaned up. */
+export class FixturesApi {
+ constructor(request) {
+ this.request = request;
+ this.projects = [];
+ this.users = [];
+ this.roles = new Map();
+ }
+
+ async json(method, url, options = {}) {
+ const response = await this.request[method](url, options);
+ expect(response.ok(), `${method} ${url}: ${await response.text()}`).toBeTruthy();
+ return response.json();
+ }
+
+ async createProject(name = `e2e-${randomUUID()}`) {
+ const id = await this.json('post', '~api/projects', { data: {
+ name, codeManagement: true, wikiManagement: true, codeAnalysisSetting: {}, gitPackConfig: {},
+ } });
+ this.projects.push(id);
+ return { id, name };
+ }
+
+ async createUser({ userName = `user-${randomUUID()}`, password = 'userpass1', type = 'Ordinary' } = {}) {
+ const data = { name: userName, type: type.toUpperCase() };
+ if (data.type === 'ORDINARY') {
+ data.password = password;
+ data.emailAddress = `${userName}@example.com`;
+ } else if (data.type === 'AI') {
+ data.aiSetting = { modelSetting: { baseUrl: 'http://127.0.0.1:1', name: 'dummy', timeoutSeconds: 30 } };
+ }
+ const id = await this.json('post', '~api/users', { data });
+ this.users.push(id);
+ return { id, userName, password };
+ }
+
+ async authorizeUser(project, user, roleName = 'Issue Reporter') {
+ if (!this.roles.has(roleName))
+ this.roles.set(roleName, await this.json('get', `~api/roles/ids/${encodeURIComponent(roleName)}`));
+ return this.json('post', '~api/user-authorizations', {
+ data: { projectId: project.id, userId: user.id, roleId: this.roles.get(roleName) },
+ });
+ }
+
+ async createIssue(project, { title = `Issue ${randomUUID()}`, description, confidential = false, fields = {}, creator } = {}) {
+ const id = await this.json('post', '~api/issues', {
+ data: { projectId: project.id, title, description, confidential, fields },
+ ...(creator ? { headers: credentials(creator) } : {}),
+ });
+ const issue = await this.json('get', `~api/issues/${id}`);
+ return { id, title, url: `${project.name}/~issues/${issue.number}` };
+ }
+
+ async authorizeIssueUser(issue, user, authorizer = admin) {
+ return this.json('post', '~api/issue-authorizations', {
+ data: { issueId: issue.id, userId: user.id },
+ headers: credentials(authorizer),
+ });
+ }
+
+ async putFile(project, file, content, commitMessage = `Set up ${file}`) {
+ return this.json('post', `~api/repositories/${project.id}/files/main/${file}`, { data: {
+ '@type': 'FileCreateOrUpdateRequest', commitMessage,
+ base64Content: Buffer.from(content).toString('base64'),
+ } });
+ }
+
+ async dispose() {
+ const errors = [];
+ // Projects own issues and authorizations, so remove them before users.
+ for (const url of [
+ ...this.projects.map((id) => `~api/projects/${id}`),
+ ...this.users.map((id) => `~api/users/${id}`),
+ ]) {
+ try {
+ const response = await this.request.delete(url);
+ expect(response.ok(), `Cleanup ${url}: ${await response.text()}`).toBeTruthy();
+ } catch (error) {
+ errors.push(error);
+ }
+ }
+ await this.request.dispose();
+ if (errors.length) throw new AggregateError(errors, 'Fixture cleanup failed');
+ }
+}
diff --git a/e2e-test/tests/authorize-user.spec.js b/e2e-test/tests/authorize-user.spec.js
deleted file mode 100644
index e121694935..0000000000
--- a/e2e-test/tests/authorize-user.spec.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import { expect, test } from './fixtures.js';
-import { authorizeUser, createProject, createUser, login } from './helpers.js';
-
-test('admin can authorize a user to a project with Issue Reporter role', async ({ page }) => {
- const suffix = Date.now();
-
- await login(page, 'admin', 'admin');
- const { userName } = await createUser(page, {
- userName: `reporter${suffix}`,
- password: 'reporter1',
- });
- const projectName = await createProject(page, `authorize-user-${suffix}`);
-
- await authorizeUser(page, projectName, userName, 'Issue Reporter');
-
- await page.goto(`${projectName}/~settings/user-authorizations`);
- const authRow = page
- .locator('.user-authorizations .bean-list tbody tr')
- .filter({ hasText: userName });
- await expect(authRow).toContainText('Issue Reporter');
-});
diff --git a/e2e-test/tests/confidential-issue.spec.js b/e2e-test/tests/confidential-issue.spec.js
index 43fd54669a..77c4020c7a 100644
--- a/e2e-test/tests/confidential-issue.spec.js
+++ b/e2e-test/tests/confidential-issue.spec.js
@@ -1,78 +1,42 @@
import { expect, test } from './fixtures.js';
-import {
- authorizeIssueUser,
- authorizeUser,
- createProject,
- createUser,
- login,
- logout,
- openIssue,
-} from './helpers.js';
+import { login } from './helpers.js';
test.describe('confidential issue access', () => {
- test.describe.configure({ mode: 'serial' });
-
- /** @type {string} */
- let projectName;
- /** @type {{ userName: string, password: string }} */
let creator;
- /** @type {{ userName: string, password: string }} */
let other;
- /** @type {{ userName: string, password: string }} */
- let granted;
- /** @type {string} */
- let issueUrl;
- /** @type {string} */
- let issueTitle;
+ let issue;
+
+ // Each case creates its own fixture and can run independently.
+ test.beforeEach(async ({ api }) => {
+ const project = await api.createProject();
+ creator = await api.createUser();
+ other = await api.createUser();
+ await api.authorizeUser(project, creator);
+ await api.authorizeUser(project, other);
+ issue = await api.createIssue(project, { confidential: true, creator });
+ });
test('normal user can access confidential issue created by himself', async ({ page }) => {
- const suffix = Date.now();
-
- await login(page, 'admin', 'admin');
- creator = await createUser(page, { userName: `creator${suffix}`, password: 'userpass1' });
- other = await createUser(page, { userName: `other${suffix}`, password: 'userpass1' });
- granted = await createUser(page, { userName: `granted${suffix}`, password: 'userpass1' });
- projectName = await createProject(page, `confidential-${suffix}`);
- await authorizeUser(page, projectName, creator.userName, 'Issue Reporter');
- await authorizeUser(page, projectName, other.userName, 'Issue Reporter');
- await authorizeUser(page, projectName, granted.userName, 'Issue Reporter');
-
- await logout(page);
await login(page, creator.userName, creator.password);
- ({ title: issueTitle, url: issueUrl } = await openIssue(page, projectName, {
- title: `Confidential ${suffix}`,
- confidential: true,
- }));
-
- await expect(
- page.locator('.issue-editable-title [data-tippy-content="Confidential"]'),
- ).toBeVisible();
- await expect(page.locator('.issue-editable-title')).toContainText(issueTitle);
+ await page.goto(issue.url);
+ await expect(page.locator('.issue-editable-title [data-tippy-content="Confidential"]')).toBeVisible();
+ await expect(page.locator('.issue-editable-title')).toContainText(issue.title);
});
test('normal user cannot access confidential issue created by others', async ({ page }) => {
await login(page, other.userName, other.password);
- const response = await page.goto(issueUrl);
-
+ const response = await page.goto(issue.url);
expect(response?.status()).toBe(403);
await expect(page.locator('.title h3')).toContainText('OOPS! There Is An Error');
await expect(page.locator('.sub-title')).toContainText('You are not allowed to perform this operation');
await expect(page.locator('.issue-editable-title')).toHaveCount(0);
});
- test('normal user authorized to a confidential issue created by others can access it', async ({
- page,
- }) => {
- await login(page, creator.userName, creator.password);
- await authorizeIssueUser(page, issueUrl, granted.userName);
-
- await logout(page);
- await login(page, granted.userName, granted.password);
- await page.goto(issueUrl);
-
- await expect(page.locator('.issue-editable-title')).toContainText(issueTitle);
- await expect(
- page.locator('.issue-editable-title [data-tippy-content="Confidential"]'),
- ).toBeVisible();
+ test('normal user authorized to a confidential issue created by others can access it', async ({ page, api }) => {
+ await api.authorizeIssueUser(issue, other, creator);
+ await login(page, other.userName, other.password);
+ await page.goto(issue.url);
+ await expect(page.locator('.issue-editable-title')).toContainText(issue.title);
+ await expect(page.locator('.issue-editable-title [data-tippy-content="Confidential"]')).toBeVisible();
});
});
diff --git a/e2e-test/tests/create-project.spec.js b/e2e-test/tests/create-project.spec.js
deleted file mode 100644
index 8c60126105..0000000000
--- a/e2e-test/tests/create-project.spec.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import { expect, test } from './fixtures.js';
-import { createProject, login } from './helpers.js';
-
-test('admin can create a project', async ({ page }) => {
- await login(page, 'admin', 'admin');
- const projectName = await createProject(page);
-
- await page.goto(projectName);
- await expect(page).toHaveURL(new RegExp(`/${projectName}(/|$)`));
- await expect(page.locator('.sidebar')).toContainText(projectName);
-});
diff --git a/e2e-test/tests/create-user.spec.js b/e2e-test/tests/create-user.spec.js
deleted file mode 100644
index 7ef2e22c5c..0000000000
--- a/e2e-test/tests/create-user.spec.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import { expect, test } from './fixtures.js';
-import { createUser, login, logout } from './helpers.js';
-
-test('admin can create a user', async ({ page }) => {
- await login(page, 'admin', 'admin');
- const { userName, password } = await createUser(page);
-
- await logout(page);
- await login(page, userName, password);
- await expect(page).not.toHaveURL(/~login/);
-});
diff --git a/e2e-test/tests/edit-issue-field-from-list.spec.js b/e2e-test/tests/edit-issue-field-from-list.spec.js
index 149201a89c..437aad4b98 100644
--- a/e2e-test/tests/edit-issue-field-from-list.spec.js
+++ b/e2e-test/tests/edit-issue-field-from-list.spec.js
@@ -1,7 +1,7 @@
-import { expect, test } from './fixtures.js';
-import { createProject, login, openIssue } from './helpers.js';
+import { expect, test, admin } from './fixtures.js';
+import { login } from './helpers.js';
-test('admin can edit an issue field from the issue list', async ({ page }) => {
+test('admin can edit an issue field from the issue list', async ({ page, api }) => {
const indicatorErrors = [];
page.on('console', (message) => {
if (message.type() === 'error' && message.text().includes('successIndicatorTimeout')) {
@@ -9,11 +9,11 @@ test('admin can edit an issue field from the issue list', async ({ page }) => {
}
});
- await login(page, 'admin', 'admin');
- const projectName = await createProject(page);
- await openIssue(page, projectName);
+ await login(page, admin.name, admin.password);
+ const project = await api.createProject();
+ await api.createIssue(project, { fields: { Type: 'Bug', Priority: 'Normal' } });
- await page.goto(`${projectName}/~issues`);
+ await page.goto(`${project.name}/~issues`);
const field = page.locator('tr.issue .field-values.editable').first();
await expect(field).toBeVisible();
await field.click();
diff --git a/e2e-test/tests/filter-users-by-type.spec.js b/e2e-test/tests/filter-users-by-type.spec.js
index df6b1ec636..898e56ee53 100644
--- a/e2e-test/tests/filter-users-by-type.spec.js
+++ b/e2e-test/tests/filter-users-by-type.spec.js
@@ -1,17 +1,17 @@
-import { expect, test } from './fixtures.js';
-import { createUser, login } from './helpers.js';
+import { expect, test, admin } from './fixtures.js';
+import { login } from './helpers.js';
-test('admin can filter users by type', async ({ page }) => {
+test('admin can filter users by type', async ({ page, api }) => {
const suffix = Date.now();
const prefix = `typefilter${suffix}`;
const ordinaryName = `${prefix}-ordinary`;
const serviceName = `${prefix}-service`;
const aiName = `${prefix}-ai`;
- await login(page, 'admin', 'admin');
- await createUser(page, { userName: ordinaryName });
- await createUser(page, { userName: serviceName, type: 'Service' });
- await createUser(page, { userName: aiName, type: 'AI' });
+ await login(page, admin.name, admin.password);
+ await api.createUser({ userName: ordinaryName });
+ await api.createUser({ userName: serviceName, type: 'Service' });
+ await api.createUser({ userName: aiName, type: 'AI' });
await page.goto('~administration/users');
await page.getByPlaceholder('Filter by name or email address').fill(prefix);
diff --git a/e2e-test/tests/fixtures.js b/e2e-test/tests/fixtures.js
index 23e033ba17..a61e4b0d2c 100644
--- a/e2e-test/tests/fixtures.js
+++ b/e2e-test/tests/fixtures.js
@@ -1,8 +1,20 @@
import { expect, test as base } from '@playwright/test';
+import { admin, credentials, FixturesApi } from './api.js';
-export { expect };
+export { expect, admin };
export const test = base.extend({
+ api: [async ({ playwright }, use, workerInfo) => {
+ const request = await playwright.request.newContext({
+ baseURL: workerInfo.project.use.baseURL, extraHTTPHeaders: credentials(admin),
+ });
+ const api = new FixturesApi(request);
+ try {
+ await use(api);
+ } finally {
+ await api.dispose();
+ }
+ }, { scope: 'worker' }],
disableAutoFocus: [async ({ context }, use) => {
await context.addInitScript(() => {
const add = () => document.documentElement.classList.add('no-autofocus');
diff --git a/e2e-test/tests/helpers.js b/e2e-test/tests/helpers.js
index 071e161f26..261a41bd71 100644
--- a/e2e-test/tests/helpers.js
+++ b/e2e-test/tests/helpers.js
@@ -1,5 +1,3 @@
-import { expect } from '@playwright/test';
-
/**
* @param {import('@playwright/test').Page} page
* @param {string} userName
@@ -20,200 +18,3 @@ export async function logout(page) {
await page.goto('~logout');
await page.waitForURL(/~login/);
}
-
-/**
- * Locate a BeanEditor form-group by its visible label text.
- * @param {import('@playwright/test').Page | import('@playwright/test').Locator} root
- * @param {string} label
- */
-export function formGroup(root, label) {
- return root.locator('.form-group').filter({
- has: root.locator('label.name > span').getByText(label, { exact: true }),
- });
-}
-
-/**
- * @param {import('@playwright/test').Page | import('@playwright/test').Locator} root
- * @param {string} label
- * @param {string} value
- */
-export async function fillLabeledInput(root, label, value) {
- await formGroup(root, label).locator('input.form-control, textarea.form-control').first().fill(value);
-}
-
-/**
- * Fill a confirmative password editor (password + confirm).
- * @param {import('@playwright/test').Page | import('@playwright/test').Locator} root
- * @param {string} password
- */
-export async function fillConfirmativePassword(root, password) {
- const group = formGroup(root, 'Password');
- await group.getByPlaceholder('Type password here').fill(password);
- await group.getByPlaceholder('Confirm password here').fill(password);
-}
-
-/**
- * Create a user. Ordinary and service accounts go through the admin UI.
- * AI accounts are created via REST so model settings do not need a live API.
- * Caller must be logged in as an administrator.
- * @param {import('@playwright/test').Page} page
- * @param {{ userName?: string, password?: string, email?: string, type?: 'Ordinary' | 'Service' | 'AI', apiUser?: string, apiPassword?: string }} [options]
- * @returns {Promise<{ userName: string, password: string, email: string }>}
- */
-export async function createUser(page, options = {}) {
- const suffix = Date.now();
- const userName = options.userName ?? `user${suffix}`;
- const password = options.password ?? 'userpass1';
- const email = options.email ?? `${userName}@example.com`;
- const type = options.type ?? 'Ordinary';
-
- if (type === 'AI') {
- const apiUser = options.apiUser ?? 'admin';
- const apiPassword = options.apiPassword ?? 'admin';
- const response = await page.request.post('~api/users', {
- headers: {
- Authorization: `Basic ${Buffer.from(`${apiUser}:${apiPassword}`).toString('base64')}`,
- 'Content-Type': 'application/json',
- },
- data: {
- type: 'AI',
- name: userName,
- aiSetting: {
- modelSetting: {
- baseUrl: 'http://127.0.0.1:1',
- name: 'dummy',
- timeoutSeconds: 30,
- },
- },
- },
- });
- expect(response.ok()).toBeTruthy();
- return { userName, password, email };
- }
-
- await page.goto('~administration/users/new');
- if (type !== 'Ordinary') {
- await select2Choose(page, formGroup(page, 'Type'), type);
- }
- await fillLabeledInput(page, 'Login Name', userName);
- if (type === 'Ordinary') {
- await fillConfirmativePassword(page, password);
- await fillLabeledInput(page, 'Email Address', email);
- }
- await page.getByRole('button', { name: 'Create' }).click();
- await expect(page).toHaveURL(/\/~users\/\d+\/basic-setting(?:\?|$)/);
- await expect(formGroup(page, 'Login Name').locator('input.form-control')).toHaveValue(userName);
-
- return { userName, password, email };
-}
-
-/**
- * Create a project via the UI. Caller must be logged in with permission to create projects.
- * @param {import('@playwright/test').Page} page
- * @param {string} [projectName]
- * @returns {Promise<string>}
- */
-export async function createProject(page, projectName) {
- const name = projectName ?? `project${Date.now()}`;
-
- await page.goto('~projects/new');
- await fillLabeledInput(page, 'Name', name);
- await page.getByRole('button', { name: 'Create' }).click();
- await expect(page).toHaveURL(new RegExp(`/${name}(/|$)`));
- await expect(page.locator('.sidebar')).toContainText(name);
-
- return name;
-}
-
-/**
- * Authorize a user on a project with the given role.
- * @param {import('@playwright/test').Page} page
- * @param {string} projectName
- * @param {string} userName
- * @param {string} roleName
- */
-export async function authorizeUser(page, projectName, userName, roleName) {
- await page.goto(`${projectName}/~settings/user-authorizations`);
- const authRows = page.locator('.user-authorizations .bean-list tbody tr');
- const countBefore = await authRows.count();
- await page.locator('.user-authorizations a.add-element').click();
- await expect(authRows).toHaveCount(countBefore + 1);
- const authRow = authRows.last();
- await select2Choose(page, authRow.locator('td').nth(1), userName);
- await select2Choose(page, authRow.locator('td').nth(2), roleName);
- await page.getByRole('button', { name: 'Save' }).click();
- await page.goto(`${projectName}/~settings/user-authorizations`);
- const savedAuthRow = page
- .locator('.user-authorizations .bean-list tbody tr')
- .filter({ hasText: userName });
- await expect(savedAuthRow).toContainText(roleName);
-}
-
-/**
- * Open (create) an issue in a project. Caller must be logged in with permission to create issues.
- * @param {import('@playwright/test').Page} page
- * @param {string} projectName
- * @param {{ title?: string, confidential?: boolean }} [options]
- * @returns {Promise<{ title: string, url: string }>}
- */
-export async function openIssue(page, projectName, options = {}) {
- const title = options.title ?? `Issue ${Date.now()}`;
- const confidential = options.confidential ?? false;
-
- await page.goto(`${projectName}/~issues/new`);
- await page.getByPlaceholder('Input title here').fill(title);
- if (confidential) {
- const confidentialSwitch = page.locator('.form-group.confidential .switch');
- await confidentialSwitch.scrollIntoViewIfNeeded();
- await confidentialSwitch.locator('label').click();
- }
- await page.getByRole('button', { name: 'Save' }).click();
-
- await expect(page).toHaveURL(new RegExp(`/${projectName}/~issues/\\d+`));
- await expect(page.locator('.issue-editable-title')).toContainText(title);
-
- return { title, url: page.url() };
-}
-
-/**
- * Authorize an additional user on a confidential issue. Caller must be able to modify the issue.
- * @param {import('@playwright/test').Page} page
- * @param {string} issueUrl Absolute or relative issue detail URL
- * @param {string} userName
- */
-export async function authorizeIssueUser(page, issueUrl, userName) {
- const authorizationsUrl = issueUrl.replace(/\/?$/, '') + '/authorizations';
- await page.goto(authorizationsUrl);
- await select2Choose(page, page.locator('.issue-authorization-list'), userName);
- await page.goto(authorizationsUrl);
- await expect(page.locator('.issue-authorization-list .authorizations')).toContainText(userName);
-}
-
-/**
- * Select an option in a Select2 single or multi choice.
- * @param {import('@playwright/test').Page} page
- * @param {import('@playwright/test').Locator} container
- * @param {string} optionText
- */
-export async function select2Choose(page, container, optionText) {
- const select2 = container.locator('.select2-container').first();
- const isMulti = await select2.evaluate((el) => el.classList.contains('select2-container-multi'));
- if (isMulti) {
- const multiInput = select2.locator('input.select2-input');
- await multiInput.click();
- await multiInput.fill(optionText);
- } else {
- await select2.locator('.select2-choice').click();
- await page.locator('#select2-drop input.select2-input').fill(optionText);
- }
- await page
- .locator('#select2-drop .select2-result-selectable')
- .filter({ hasText: optionText })
- .first()
- .click();
- await page.locator('#select2-drop').waitFor({ state: 'hidden' }).catch(() => {});
- if (isMulti && (await page.locator('#select2-drop').isVisible().catch(() => false))) {
- await page.keyboard.press('Escape');
- await page.locator('#select2-drop').waitFor({ state: 'hidden' }).catch(() => {});
- }
-}
diff --git a/e2e-test/tests/open-issue.spec.js b/e2e-test/tests/open-issue.spec.js
deleted file mode 100644
index 4ab43040a2..0000000000
--- a/e2e-test/tests/open-issue.spec.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import { expect, test } from './fixtures.js';
-import { createProject, login, openIssue } from './helpers.js';
-
-test('admin can open an issue', async ({ page }) => {
- await login(page, 'admin', 'admin');
- const projectName = await createProject(page);
-
- const { title } = await openIssue(page, projectName);
- await expect(page.locator('.issue-editable-title')).toContainText(title);
-});
diff --git a/e2e-test/tests/render-mermaid.spec.js b/e2e-test/tests/render-mermaid.spec.js
index 6e002e9ced..690013441c 100644
--- a/e2e-test/tests/render-mermaid.spec.js
+++ b/e2e-test/tests/render-mermaid.spec.js
@@ -1,21 +1,18 @@
-import { expect, test } from './fixtures.js';
-import { createProject, login } from './helpers.js';
+import { expect, test, admin } from './fixtures.js';
+import { login } from './helpers.js';
-test('renders Mermaid classes with numeric hex colors', async ({ page }) => {
- await login(page, 'admin', 'admin');
- const projectName = await createProject(page);
-
- await page.goto(`${projectName}/~issues/new`);
- await page.getByPlaceholder('Input title here').fill(`Mermaid diagram ${Date.now()}`);
- await page.locator('.new-issue > .description textarea').fill([
+test('renders Mermaid classes with numeric hex colors', async ({ page, api }) => {
+ const project = await api.createProject();
+ const issue = await api.createIssue(project, { description: [
'```mermaid',
'flowchart TD',
' classDef oldError fill:#f8d7da,stroke:#999,color:#333',
' A@{ shape: hex, label: "Error Node" }',
' class A oldError',
'```',
- ].join('\n'));
- await page.getByRole('button', { name: 'Save' }).click();
+ ].join('\n') });
+ await login(page, admin.name, admin.password);
+ await page.goto(issue.url);
const styledNode = page.locator('.mermaid svg .node.oldError');
await expect(styledNode).toBeVisible();
diff --git a/e2e-test/tests/server.spec.js b/e2e-test/tests/server.spec.js
deleted file mode 100644
index 6760f99fe1..0000000000
--- a/e2e-test/tests/server.spec.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import { expect, test } from './fixtures.js';
-
-test('serves the OneDev web interface', async ({ page }) => {
- const response = await page.goto('/');
-
- expect(response).not.toBeNull();
- expect(response.ok()).toBe(true);
- await expect(page).toHaveTitle(/OneDev/i);
- await expect(page.locator('body')).toBeVisible();
-});
diff --git a/e2e-test/tests/text-diff-expander.spec.js b/e2e-test/tests/text-diff-expander.spec.js
index 18a717c075..ecf4c6734b 100644
--- a/e2e-test/tests/text-diff-expander.spec.js
+++ b/e2e-test/tests/text-diff-expander.spec.js
@@ -1,51 +1,16 @@
-import { execFileSync } from 'node:child_process';
-import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import path from 'node:path';
-
-import { expect, test } from './fixtures.js';
-import { fillLabeledInput, login } from './helpers.js';
-
-test('expands text-diff gaps with directional arrows', async ({ page }) => {
- // 1. Open a commit containing two distant changes
- await login(page, 'admin', 'admin');
- const projectName = `text-diff-expander-${Date.now()}`;
- await page.goto('~projects/new');
- await fillLabeledInput(page, 'Name', projectName);
- await page.getByRole('button', { name: 'Create' }).click();
- await expect(page).toHaveURL(new RegExp(`/${projectName}(/|$)`));
- const repositoryDir = mkdtempSync(path.join(tmpdir(), 'onedev-text-diff-'));
- let commitHash;
- try {
- const git = (...args) => execFileSync('git', args, { cwd: repositoryDir, stdio: 'pipe' });
- git('init', '--initial-branch=main');
- git('config', 'user.name', 'OneDev E2E');
- git('config', 'user.email', '[email protected]');
-
- const lines = Array.from({ length: 100 }, (_, index) => `unchanged-line-${index + 1}`);
- writeFileSync(path.join(repositoryDir, 'fixture.txt'), `${lines.join('\n')}\n`);
- git('add', 'fixture.txt');
- git('commit', '-m', 'Add text diff fixture');
-
- lines[9] = 'changed-line-10';
- lines[89] = 'changed-line-90';
- writeFileSync(path.join(repositoryDir, 'fixture.txt'), `${lines.join('\n')}\n`);
- git('commit', '-am', 'Change distant fixture lines');
- commitHash = git('rev-parse', 'HEAD').toString().trim();
-
- const remoteUrl = new URL(page.url());
- remoteUrl.username = 'admin';
- remoteUrl.password = 'admin';
- remoteUrl.pathname = `/${projectName}`;
- remoteUrl.search = '';
- remoteUrl.hash = '';
- git('remote', 'add', 'origin', remoteUrl.toString());
- git('push', 'origin', 'main');
- } finally {
- rmSync(repositoryDir, { recursive: true, force: true });
- }
-
- const commitUrl = `${projectName}/~commits/${commitHash}`;
+import { expect, test, admin } from './fixtures.js';
+import { login } from './helpers.js';
+
+test('expands text-diff gaps with directional arrows', async ({ page, api }) => {
+ const project = await api.createProject();
+ const lines = Array.from({ length: 100 }, (_, index) => `unchanged-line-${index + 1}`);
+ await api.putFile(project, 'fixture.txt', `${lines.join('\n')}\n`, 'Add text diff fixture');
+ lines[9] = 'changed-line-10';
+ lines[89] = 'changed-line-90';
+ const { commitHash } = await api.putFile(project, 'fixture.txt', `${lines.join('\n')}\n`, 'Change distant fixture lines');
+ await login(page, admin.name, admin.password);
+
+ const commitUrl = `${project.name}/~commits/${commitHash}`;
await page.goto(commitUrl);
const expanders = page.locator('tr.expander');
await expect(expanders).toHaveCount(3);
diff --git a/e2e-test/tests/wiki.spec.js b/e2e-test/tests/wiki.spec.js
new file mode 100644
index 0000000000..584867b64b
--- /dev/null
+++ b/e2e-test/tests/wiki.spec.js
@@ -0,0 +1,336 @@
+import { expect, test as base, admin } from './fixtures.js';
+import { login, logout } from './helpers.js';
+
+// Shared project; each case resets Home so it can also run alone or on retry.
+const test = base.extend({
+ wikiProject: [async ({ api }, use) => {
+ const project = await api.createProject();
+ const user = await api.createUser();
+ await api.authorizeUser(project, user);
+ const putFile = (file, content) => api.putFile(project, file, content);
+ await putFile('private.txt', 'password = E2E_PRIVATE_CODE_CONTENT');
+ await putFile('wiki/Home.md', '# Home\n\nWelcome to the e2e wiki.');
+ await putFile('wiki/Another-page.md', '# Another page\n\nOrdinary link destination.');
+ await use({ ...project, reader: { name: user.userName, password: user.password }, putFile });
+ }, { scope: 'worker' }],
+});
+
+test.describe.configure({ mode: 'default' });
+
+const body = (page) => page.locator('.wiki-content .markdown-rendered');
+const editor = (page) => page.locator('.wiki .markdown-editor textarea');
+
+async function editHome(page, wikiProject, markdown) {
+ await page.goto(`${wikiProject.name}/~wiki/main/Home?edit=true`);
+ await editor(page).fill(markdown);
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ await expect(body(page)).toBeVisible();
+}
+
+test.beforeEach(async ({ page, wikiProject }) => {
+ await wikiProject.putFile('wiki/Home.md', '# Home\n\nWelcome to the e2e wiki.');
+ await login(page, admin.name, admin.password);
+});
+
+test('uploads an image and displays it in the wiki', async ({ page, wikiProject }) => {
+ await page.goto(`${wikiProject.name}/~wiki/main/Home?edit=true`);
+ await page.locator('.wiki .markdown-editor .do-image:visible').click();
+ await page.getByRole('link', { name: 'Upload', exact: true }).click();
+ const uploadForm = page.locator('form.upload-blob');
+ // A real 1x1 PNG, sent through the editor's upload UI.
+ await page.locator('input[type=file]').setInputFiles({
+ name: 'wiki-image.png', mimeType: 'image/png',
+ buffer: Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aD1sAAAAASUVORK5CYII=', 'base64'),
+ });
+ const preview = uploadForm.locator('.dz-preview').filter({ hasText: 'wiki-image.png' });
+ // Dropzone marks completion after processing the response and updating the form.
+ // Failed uploads also complete, so verify the result before committing.
+ await expect(preview).toHaveClass(/\bdz-complete\b/);
+ await expect(preview).not.toHaveClass(/\bdz-error\b/);
+ await uploadForm.getByRole('button', { name: 'Commit & Insert', exact: true }).click();
+ await expect(editor(page)).toHaveValue(/!\[.*\]\(wiki-image\.png\)/);
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ const image = body(page).locator('img');
+ await expect(image).toBeVisible();
+ await expect.poll(() => image.evaluate((img) => img.complete && img.naturalWidth > 0)).toBe(true);
+ await page.reload();
+ await expect.poll(() => image.evaluate((img) => img.complete && img.naturalWidth > 0)).toBe(true);
+});
+
+for (const wiki of [true, false]) {
+ for (const destination of [null, 'assets', '']) {
+ test(`uploads from ${wiki ? 'wiki' : 'Markdown'} to ${destination === null ? 'default folder' : destination || 'repository root'}`, async ({ page, wikiProject }) => {
+ const directory = wiki ? 'wiki/Guides' : 'docs/Guides';
+ await wikiProject.putFile(`${directory}/Upload.md`, '# Upload');
+ await page.goto(wiki
+ ? `${wikiProject.name}/~wiki/main/Guides/Upload?edit=true`
+ : `${wikiProject.name}/~files/main/${directory}/Upload.md?mode=edit`);
+ const input = page.locator('.markdown-editor textarea');
+ await input.fill('');
+ await page.locator('.markdown-editor .do-image:visible').click();
+ await page.getByRole('link', { name: 'Upload', exact: true }).click();
+ const form = page.locator('form.upload-blob');
+ const folder = form.locator('.directory input');
+ await expect(folder).toHaveValue(directory);
+ if (destination !== null)
+ await folder.fill(destination);
+ const filename = `upload-${wiki}-${destination === null ? 'default' : destination || 'root'}.png`;
+ await page.locator('input[type=file]').setInputFiles({
+ name: filename, mimeType: 'image/png',
+ buffer: Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aD1sAAAAASUVORK5CYII=', 'base64'),
+ });
+ const preview = form.locator('.dz-preview');
+ await expect(preview).toHaveClass(/\bdz-complete\b/);
+ await expect(preview).not.toHaveClass(/\bdz-error\b/);
+ await form.getByRole('button', { name: 'Commit & Insert', exact: true }).click();
+ const relative = destination === null ? filename : `../../${destination ? destination + '/' : ''}${filename}`;
+ await expect(input).toHaveValue(`![${filename}](${relative})`);
+ if (wiki)
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ else {
+ await page.getByText('Save', { exact: true }).click();
+ await page.getByRole('button', { name: 'Commit', exact: true }).click();
+ }
+ const image = page.locator('.markdown-rendered img');
+ await expect.poll(() => image.evaluate(img => img.complete && img.naturalWidth > 0)).toBe(true);
+ });
+ }
+}
+
+test('inserts relative repository file and image links from a nested wiki page', async ({ page, wikiProject }) => {
+ await wikiProject.putFile('wiki/Guides/Setup.md', '# Setup');
+ await wikiProject.putFile('sample image.png', Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aD1sAAAAASUVORK5CYII=', 'base64'));
+ await page.goto(`${wikiProject.name}/~wiki/main/Guides/Setup?edit=true`);
+ await editor(page).fill('');
+ await page.locator('.wiki .markdown-editor .do-link:visible').click();
+ await page.getByRole('link', { name: 'Pick Existing', exact: true }).click();
+ await page.locator('.blob-selector').getByRole('link', { name: 'private.txt', exact: true }).click();
+ await expect(editor(page)).toHaveValue('[private.txt](../../private.txt)');
+ await page.goto(`${wikiProject.name}/~wiki/main/Guides/Setup?edit=true`);
+ await editor(page).fill('');
+ await page.locator('.wiki .markdown-editor .do-image:visible').click();
+ await page.getByRole('link', { name: 'Pick Existing', exact: true }).click();
+ await page.waitForFunction(() => onedev.server.ajaxRequests.count === 0);
+ await page.locator('.blob-selector').getByRole('link', { name: 'sample image.png', exact: true }).click();
+ await expect(editor(page)).toHaveValue('![sample image.png](../../sample%20image.png)');
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ const image = body(page).locator('img');
+ await expect.poll(() => image.evaluate(img => img.complete && img.naturalWidth > 0)).toBe(true);
+});
+
+for (const nested of [false, true]) {
+ test(`inserts a wiki page link from ${nested ? 'the same subdirectory' : 'the wiki root into a subdirectory'}`, async ({ page, wikiProject }) => {
+ const source = nested ? 'Guides/Link-source' : 'Home';
+ await wikiProject.putFile(`wiki/${source}.md`, '# Link source');
+ await wikiProject.putFile('wiki/Guides/Page-Name.md', '# Page Name\n\nNested wiki link destination.');
+ await wikiProject.putFile('wiki/Guides/Other.md', '# Other');
+ await page.goto(`${wikiProject.name}/~wiki/main/${source}?edit=true`);
+ await editor(page).fill('');
+ await page.locator('.wiki .markdown-editor .do-link:visible').click();
+ await page.getByRole('link', { name: 'Pick Existing', exact: true }).click();
+ const picker = page.locator('.blob-selector');
+ // The picker expands the current page's parent folders automatically.
+ if (!nested)
+ await picker.getByRole('link', { name: 'Guides', exact: true }).click();
+ await picker.getByRole('link', { name: 'Page-Name.md', exact: true }).click();
+ await expect(editor(page)).toHaveValue(nested ? '[[Page Name]]' : '[[Guides/Page Name|Page Name]]');
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ const link = body(page).getByRole('link', { name: 'Page Name', exact: true });
+ await expect(link).toHaveAttribute('href', /\/~wiki\/main\/Guides\/Page-Name$/);
+ await expect(body(page).locator('.missing, .add-missing')).toHaveCount(0);
+ await link.click();
+ await expect(page).toHaveURL(/\/~wiki\/main\/Guides\/Page-Name$/);
+ await expect(body(page)).toContainText('Nested wiki link destination.');
+ });
+}
+
+test('creates a missing wiki page using the plus icon', async ({ page, wikiProject }) => {
+ await editHome(page, wikiProject, '# Home\n\n[[Some Page]]');
+ const link = body(page).getByRole('link', { name: 'Some Page', exact: true });
+ await expect(link).toHaveAttribute('href', /\/~wiki\/main\/Some-Page$/);
+ await expect(body(page).locator('a + .missing')).toHaveText('!!missing!!');
+ await body(page).getByTitle('Add this page', { exact: true }).click();
+ await expect(page.locator('.wiki .bean-editor .property-name input')).toBeVisible();
+ await expect(page.locator('.wiki .bean-editor .property-name input')).toBeEditable();
+ await expect(page.locator('.wiki .bean-editor .property-name input')).toHaveValue('Some-Page');
+ await editor(page).fill('# Some Page\n\nCreated from a missing link.');
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ await expect(body(page)).toContainText('Created from a missing link.');
+ await page.goto(`${wikiProject.name}/~wiki/main/Home`);
+ await expect(body(page).locator('.missing, .add-missing')).toHaveCount(0);
+ await link.click();
+ await expect(body(page)).toContainText('Created from a missing link.');
+});
+
+test('resolves an ordinary Markdown link to another wiki page', async ({ page, wikiProject }) => {
+ await editHome(page, wikiProject, '# Home\n\n[Another page](Another-page.md)');
+ const link = body(page).getByRole('link', { name: 'Another page', exact: true });
+ await expect(link).toHaveAttribute('href', /\/~wiki\/main\/Another-page$/);
+ await expect(body(page).locator('.missing')).toHaveCount(0);
+ await link.click();
+ await expect(body(page)).toContainText('Ordinary link destination.');
+});
+
+test('jumps to sidebar headings after changing pages and within the current page', async ({ page, wikiProject }) => {
+ await wikiProject.putFile('wiki/Heading-page.md',
+ '# Heading page\n\n' + 'Paragraph before the target.\n\n'.repeat(60)
+ + '## Target heading\n\n' + 'Paragraph after the target.\n\n'.repeat(40));
+ await page.goto(`${wikiProject.name}/~wiki/main/Home`);
+ await page.locator('.wiki-pages summary').click();
+ const entry = page.locator('.wiki-pages li').filter({
+ has: page.locator('a[data-wiki-page="Heading-page"]'),
+ });
+ await entry.locator('.page-expand').click();
+ const headingLink = entry.getByRole('link', { name: 'Target heading', exact: true });
+ const content = page.locator('.wiki-content');
+ const heading = content.getByRole('heading', { name: 'Target heading', exact: true });
+ for (let attempt = 0; attempt < 3; attempt++) {
+ await headingLink.click();
+ await expect(heading).toBeInViewport();
+ await expect.poll(() => content.evaluate(el => el.scrollTop)).toBeGreaterThan(500);
+ const viewer = await body(page).elementHandle();
+ await entry.locator('a[data-wiki-page]').click();
+ await expect.poll(() => content.evaluate(el => el.scrollTop)).toBe(0);
+ await headingLink.click();
+ await expect(heading).toBeInViewport();
+ expect(await viewer.evaluate(el => el.isConnected)).toBe(true);
+ await page.locator('.wiki-pages a[data-wiki-page="Home"]').click();
+ await expect(body(page)).toContainText('Welcome to the e2e wiki.');
+ }
+});
+
+test('keeps a cross-page heading in view after an image above it loads', async ({ page, wikiProject }) => {
+ await wikiProject.putFile('wiki/Image-page.md',
+ '# Images\n\n![Slow image](/wiki-heading-image.svg)\n\n## Procedures\n\nInstructions.');
+ let releaseImage;
+ const imageGate = new Promise(resolve => { releaseImage = resolve; });
+ await page.route('**/wiki-heading-image.svg', async route => {
+ await imageGate;
+ await route.fulfill({ contentType: 'image/svg+xml', body:
+ '<svg xmlns="http://www.w3.org/2000/svg" width="900" height="1600"><rect width="900" height="1600" fill="green"/></svg>' });
+ });
+ try {
+ await page.goto(`${wikiProject.name}/~wiki/main/Home`);
+ await page.locator('.wiki-pages summary').click();
+ const entry = page.locator('.wiki-pages li').filter({
+ has: page.locator('a[data-wiki-page="Image-page"]'),
+ });
+ await entry.locator('.page-expand').click();
+ await entry.getByRole('link', { name: 'Procedures', exact: true }).click();
+ const image = body(page).getByRole('img', { name: 'Slow image' });
+ await expect(image).toHaveAttribute('src', /wiki-heading-image.svg/);
+ releaseImage();
+ await expect.poll(() => image.evaluate(el => el.complete && el.naturalHeight > 0)).toBe(true);
+ await expect(body(page).getByRole('heading', { name: 'Procedures', exact: true })).toBeInViewport();
+ } finally {
+ releaseImage();
+ }
+});
+
+test('renders wiki references in the ordinary Markdown file viewer', async ({ page, wikiProject }) => {
+ await editHome(page, wikiProject, '# Home\n\n[[Another page]]');
+ await page.goto(`${wikiProject.name}/~files/main/wiki/Home.md`);
+ const markdown = page.locator('.markdown-blob-view .markdown-rendered');
+ const link = markdown.getByRole('link', { name: 'Another page', exact: true });
+ await expect(link).toHaveAttribute('href', /\/~wiki\/main\/Another-page$/);
+ await expect(markdown.locator('.missing, .add-missing')).toHaveCount(0);
+ await link.click();
+ await expect(body(page)).toContainText('Ordinary link destination.');
+});
+
+test('allows project members to view wiki but denies repository API and outside files without code access', async ({ page, wikiProject }) => {
+ await editHome(page, wikiProject, '# Home\n\n[Private file](../private.txt)');
+ const outsideUrl = await body(page).getByRole('link', { name: 'Private file', exact: true }).getAttribute('href');
+ // Positive control: the target exists and is readable by a code reader.
+ await page.goto(outsideUrl);
+ await expect(page.locator('.source-view')).toContainText('E2E_PRIVATE_CODE_CONTENT');
+ await logout(page);
+ await login(page, wikiProject.reader.name, wikiProject.reader.password);
+ await page.goto(`${wikiProject.name}/~wiki/main/Home`);
+ await expect(body(page)).toContainText('Home');
+ const wikiFile = await page.request.get(`~api/repositories/${wikiProject.id}/files/main/wiki/Home.md`);
+ // Repository API access requires code-read permission even for wiki files.
+ expect(wikiFile.status()).toBe(403);
+ await body(page).getByRole('link', { name: 'Private file', exact: true }).click();
+ await expect(page.getByText('You are not allowed to perform this operation', { exact: true })).toBeVisible();
+ await expect(page.locator('body')).not.toContainText('E2E_PRIVATE_CODE_CONTENT');
+ for (const url of [
+ `${wikiProject.name}/~files/main/wiki/Home.md?query=password`,
+ `${wikiProject.name}/~raw/main/private.txt`,
+ `~api/repositories/${wikiProject.id}/files/main/private.txt`,
+ ]) {
+ const response = await page.request.get(url);
+ expect(response.status(), url).toBe(403);
+ expect(await response.text()).not.toContain('E2E_PRIVATE_CODE_CONTENT');
+ }
+});
+
+for (const deletedPage of ['Delete-me', 'Home']) {
+ test(`deletes ${deletedPage} and returns home without reloading`, async ({ page, wikiProject }) => {
+ await wikiProject.putFile(`wiki/${deletedPage}.md`, '# Page to delete');
+ await page.goto(`${wikiProject.name}/~wiki/main/${deletedPage}`);
+ await page.evaluate(() => { window.wikiDeleteMarker = true; });
+ await page.locator('.wiki .head a[data-tippy-content="Delete page"]').click();
+ await page.getByRole('button', { name: 'Delete page', exact: true }).click();
+ await expect(page).toHaveURL(/\/~wiki\/main\/Home$/);
+ if (deletedPage === 'Home') {
+ await expect(page.getByText('Home page not found', { exact: true })).toBeVisible();
+ } else {
+ await expect(body(page)).toContainText('Welcome to the e2e wiki.');
+ await expect(page.locator(`a[data-wiki-page="${deletedPage}"]`)).toHaveCount(0);
+ await page.locator('.wiki-pages summary').click();
+ await page.locator('a[data-wiki-page="Another-page"]').click();
+ await expect(body(page)).toContainText('Ordinary link destination.');
+ }
+ expect(await page.evaluate(() => window.wikiDeleteMarker)).toBe(true);
+ });
+}
+
+test('renames an existing wiki page while saving content', async ({ page, wikiProject }) => {
+ await wikiProject.putFile('wiki/Rename-source.md', '# Original content');
+ await page.goto(`${wikiProject.name}/~wiki/main/Rename-source?edit=true`);
+ const name = page.locator('.wiki .bean-editor .property-name input');
+ await expect(name).toHaveValue('Rename-source');
+ await name.fill('Guides/Renamed page');
+ await editor(page).fill('# Renamed content');
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ await expect(page).toHaveURL(/\/~wiki\/main\/Guides\/Renamed-page$/);
+ await expect(body(page)).toContainText('Renamed content');
+ await expect(page.locator('a[data-wiki-page="Rename-source"]')).toHaveCount(0);
+ await expect(page.locator('a[data-wiki-page="Guides/Renamed-page"]')).toHaveCount(1);
+ await page.reload();
+ await expect(body(page)).toContainText('Renamed content');
+ await expect(page.locator('a[data-wiki-page="Rename-source"]')).toHaveCount(0);
+});
+
+test('rejects renaming a wiki page to an existing name', async ({ page, wikiProject }) => {
+ await page.goto(`${wikiProject.name}/~wiki/main/Another-page?edit=true`);
+ await page.locator('.wiki .bean-editor .property-name input').fill('Home');
+ await editor(page).fill('# Must not overwrite Home');
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ await expect(page.getByText('A page with this name already exists.', { exact: true })).toBeVisible();
+ await expect(editor(page)).toHaveValue('# Must not overwrite Home');
+ await page.goto(`${wikiProject.name}/~wiki/main/Home`);
+ await expect(body(page)).toContainText('Welcome to the e2e wiki.');
+ await page.goto(`${wikiProject.name}/~wiki/main/Another-page`);
+ await expect(body(page)).toContainText('Ordinary link destination.');
+});
+
+for (const entry of ['empty repository', 'missing home']) {
+ test(`shows an editable page name when adding Home from ${entry}`, async ({ page, api }) => {
+ const project = await api.createProject();
+ if (entry !== 'empty repository')
+ await api.putFile(project, 'wiki/Guide.md', '# Guide');
+ await page.goto(`${project.name}/~wiki/${entry === 'empty repository' ? '' : 'main/Home'}`);
+ await page.getByRole('link', { name: 'Add home page', exact: true }).click();
+ const name = page.locator('.wiki .bean-editor .property-name input');
+ await expect(name).toBeVisible();
+ await expect(name).toBeEditable();
+ await expect(name).toHaveValue('Home');
+ await name.fill('Custom home');
+ await editor(page).fill('# Custom home');
+ await page.getByRole('button', { name: 'Save page', exact: true }).click();
+ await expect(page).toHaveURL(/\/~wiki\/main\/Custom-home$/);
+ await expect(body(page)).toContainText('Custom home');
+ });
+}
diff --git a/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.java b/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.java
index 41b04a5545..6f92a4501a 100644
--- a/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.java
+++ b/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.java
@@ -9392,4 +9392,17 @@ public class DataMigrator {
}
}
+ private void migrate243(File dataDir, Stack<Integer> versions) {
+ for (File file : dataDir.listFiles()) {
+ if (file.getName().startsWith("Projects.xml")) {
+ var dom = VersionedXmlDoc.fromFile(file);
+ for (Element element : dom.getRootElement().elements()) {
+ element.addElement("wikiSetting");
+ element.addElement("wikiManagement").setText("false");
+ }
+ dom.writeToFile(file, false);
+ }
+ }
+ }
+
}
diff --git a/server-core/src/main/java/io/onedev/server/markdown/LinkUtils.java b/server-core/src/main/java/io/onedev/server/markdown/LinkUtils.java
new file mode 100644
index 0000000000..a519225408
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/markdown/LinkUtils.java
@@ -0,0 +1,76 @@
+package io.onedev.server.markdown;
+
+import java.net.URISyntaxException;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import io.onedev.commons.utils.ExceptionUtils;
+
+import io.onedev.commons.utils.PathUtils;
+import io.onedev.server.git.GitUtils;
+import io.onedev.server.util.UrlUtils;
+
+/** Shared repository link traversal; callers supply navigation and creation policies. */
+public class LinkUtils {
+
+ private static final Logger logger = LoggerFactory.getLogger(LinkUtils.class);
+
+ public static void resolveRelativeLinks(Document document, String directory,
+ BiFunction<String, String, String> linkUrlOf, BiFunction<String, String, String> imageUrlOf,
+ Predicate<String> missing, Function<String, String> addUrlOf, String addIconHref) {
+ for (Element element : document.select("a[href], img[src]")) {
+ try {
+ String attribute = element.tagName().equals("img") ? "src" : "href";
+ String url = element.attr(attribute).trim();
+ if (!url.isEmpty() && UrlUtils.isRelative(url) && !url.startsWith("#")) {
+ String relativePath = UrlUtils.decodePath(UrlUtils.trimHashAndQuery(url));
+ String referencedPath = GitUtils.normalizePath(PathUtils.resolve(directory, relativePath));
+ if (referencedPath != null) {
+ String resolvedUrl = element.tagName().equals("img")
+ ? imageUrlOf.apply(referencedPath, url) : linkUrlOf.apply(referencedPath, url);
+ if (resolvedUrl != null) {
+ element.attr(attribute, resolvedUrl);
+ if (missing.test(referencedPath)) {
+ markMissing(element, element.tagName().equals("img") ? null : addUrlOf.apply(referencedPath),
+ addIconHref, "Add this file");
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ if (ExceptionUtils.find(e, URISyntaxException.class) != null)
+ logger.error("Error parsing url", e);
+ else
+ throw ExceptionUtils.unchecked(e);
+ }
+ }
+ }
+
+ public static String appendSuffix(String resolvedUrl, String originalUrl) {
+ if (resolvedUrl == null)
+ return null;
+ int query = originalUrl.indexOf('?');
+ int hash = originalUrl.indexOf('#');
+ int suffixIndex = query < 0 ? hash : hash < 0 ? query : Math.min(query, hash);
+ String suffix = suffixIndex >= 0 ? originalUrl.substring(suffixIndex) : "";
+ if (suffix.startsWith("?") && resolvedUrl.contains("?"))
+ suffix = "&" + suffix.substring(1);
+ return resolvedUrl + suffix;
+ }
+
+ public static void markMissing(Element element, String addUrl, String addIconHref, String title) {
+ Element marker = new Element("span").addClass("missing").text("!!missing!!");
+ element.after(marker);
+ if (addUrl != null && addIconHref != null) {
+ Element addLink = new Element("a").attr("href", addUrl).attr("title", title).addClass("add-missing");
+ addLink.appendElement("svg").addClass("icon").appendElement("use").attr("xlink:href", addIconHref);
+ marker.after(addLink);
+ }
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/markdown/UrlProcessor.java b/server-core/src/main/java/io/onedev/server/markdown/UrlProcessor.java
index 1de560cc80..6909864958 100644
--- a/server-core/src/main/java/io/onedev/server/markdown/UrlProcessor.java
+++ b/server-core/src/main/java/io/onedev/server/markdown/UrlProcessor.java
@@ -1,30 +1,18 @@
package io.onedev.server.markdown;
-import java.net.URISyntaxException;
-
import org.jspecify.annotations.Nullable;
-import org.apache.commons.lang.StringUtils;
import org.apache.wicket.request.cycle.RequestCycle;
import org.eclipse.jgit.lib.ObjectId;
import org.jsoup.nodes.Document;
-import org.jsoup.nodes.Element;
-import org.jsoup.nodes.Node;
-import org.jsoup.select.NodeTraversor;
-import org.jsoup.select.NodeVisitor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import io.onedev.commons.utils.ExceptionUtils;
import io.onedev.commons.utils.ExplicitException;
import io.onedev.commons.utils.PathUtils;
import io.onedev.server.OneDev;
import io.onedev.server.git.BlobIdent;
-import io.onedev.server.git.GitUtils;
import io.onedev.server.git.service.GitService;
import io.onedev.server.model.Project;
import io.onedev.server.security.SecurityUtils;
-import io.onedev.server.util.UrlUtils;
import io.onedev.server.web.asset.icon.IconScope;
import io.onedev.server.web.component.markdown.SuggestionSupport;
import io.onedev.server.web.component.svg.SpriteImage;
@@ -33,8 +21,6 @@ import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
import io.onedev.server.web.page.project.blob.render.BlobRenderContext.Mode;
public class UrlProcessor implements HtmlProcessor {
-
- private static final Logger logger = LoggerFactory.getLogger(UrlProcessor.class);
@Override
public void process(Document document, Project project,
@@ -52,76 +38,28 @@ public class UrlProcessor implements HtmlProcessor {
revId = null;
}
- NodeTraversor.traverse(new NodeVisitor() {
-
- @Override
- public void head(Node node, int depth) {
+ LinkUtils.resolveRelativeLinks(document, blobRenderContext.getDirectory(),
+ (path, url) -> resolveUrl(blobRenderContext.getDirectoryUrl(), url),
+ (path, url) -> blobRenderContext.appendRaw(resolveUrl(blobRenderContext.getDirectoryUrl(), url)),
+ path -> revId == null || gitService.getMode(project, revId, path) == 0, path -> {
+ BlobIdent blobIdent = blobRenderContext.getBlobIdent();
+ Mode mode = blobRenderContext.getMode();
+ if (mode != Mode.ADD && mode != Mode.EDIT
+ && SecurityUtils.canModifyFile(project, blobIdent.revision, path)) {
+ ProjectBlobPage.State state = new ProjectBlobPage.State();
+ state.blobIdent = blobIdent;
+ state.mode = Mode.ADD;
+ state.initialNewPath = PathUtils.relativize(blobRenderContext.getDirectory(), path);
+ return RequestCycle.get().urlFor(ProjectBlobPage.class,
+ ProjectBlobPage.paramsOf(project, state)).toString();
}
-
- @Override
- public void tail(Node node, int depth) {
- try {
- if (node.nodeName().equals("a")) {
- String url = node.attr("href");
- if (StringUtils.isNotBlank(url)) {
- url = url.trim();
- if (UrlUtils.isRelative(url) && !url.startsWith("#")) {
- Element element = (Element) node;
- element.attr("href", resolveUrl(blobRenderContext.getDirectoryUrl(), url));
- String path = UrlUtils.decodePath(UrlUtils.trimHashAndQuery(url));
- String directory = blobRenderContext.getDirectory();
- String referencedPath = PathUtils.resolve(directory, path);
- referencedPath = GitUtils.normalizePath(referencedPath);
- if (referencedPath != null && (revId == null || gitService.getMode(project, revId, referencedPath) == 0)) {
- element.after("<span class='missing'>!!missing!!</span>");
- Element missingElement = element.nextElementSibling();
- BlobIdent blobIdent = blobRenderContext.getBlobIdent();
- Mode mode = blobRenderContext.getMode();
- if (mode != Mode.ADD && mode != Mode.EDIT
- && SecurityUtils.canModifyFile(project, blobIdent.revision, referencedPath)) {
- ProjectBlobPage.State state = new ProjectBlobPage.State();
- state.blobIdent = blobRenderContext.getBlobIdent();
- state.mode = Mode.ADD;
- state.initialNewPath = path;
- CharSequence urlToAddFile = RequestCycle.get().urlFor(ProjectBlobPage.class,
- ProjectBlobPage.paramsOf(project, state));
- String htmlToAddFile = String.format(
- "<a href='%s' title='Add this file' class='add-missing'><svg class='icon'><use xlink:href='%s'/></svg></a>",
- urlToAddFile.toString(), SpriteImage.getVersionedHref(IconScope.class, "plus"));
- missingElement.after(htmlToAddFile);
- }
- }
- }
- }
- } else if (node.nodeName().equals("img")) {
- String url = node.attr("src");
- if (StringUtils.isNotBlank(url)) {
- url = url.trim();
- if (UrlUtils.isRelative(url) && !url.startsWith("#")) {
- Element element = (Element) node;
- element.attr("src", blobRenderContext.appendRaw(resolveUrl(blobRenderContext.getDirectoryUrl(), url)));
- String basePath = blobRenderContext.getDirectory();
- String referencedPath = PathUtils.resolve(basePath, UrlUtils.decodePath(UrlUtils.trimHashAndQuery(url)));
- referencedPath = GitUtils.normalizePath(referencedPath);
- if (referencedPath != null && (revId == null || gitService.getMode(project, revId, referencedPath) == 0)) {
- element.after("<span class='missing'>!!missing!!</span>");
- }
- }
- }
- }
- } catch (Exception e) {
- if (ExceptionUtils.find(e, URISyntaxException.class) != null)
- logger.error("Error parsing url", e);
- else
- throw ExceptionUtils.unchecked(e);
- }
- }
- }, document);
+ return null;
+ }, SpriteImage.getVersionedHref(IconScope.class, "plus"));
}
}
private String resolveUrl(String baseUrl, String urlToResolve) {
- return PathUtils.normalizeDots(PathUtils.resolve(baseUrl, urlToResolve));
- }
+ return PathUtils.normalizeDots(PathUtils.resolve(baseUrl, urlToResolve));
+ }
}
diff --git a/server-core/src/main/java/io/onedev/server/model/Project.java b/server-core/src/main/java/io/onedev/server/model/Project.java
index 69c703beba..e724d599fa 100644
--- a/server-core/src/main/java/io/onedev/server/model/Project.java
+++ b/server-core/src/main/java/io/onedev/server/model/Project.java
@@ -1,5 +1,7 @@
package io.onedev.server.model;
+import io.onedev.server.model.support.WikiSetting;
+
import static io.onedev.commons.utils.match.WildcardUtils.matchPath;
import static io.onedev.server.model.Project.PROP_NAME;
import static io.onedev.server.model.Project.PROP_PATH;
@@ -210,6 +212,8 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel
public static final String PROP_CODE_MANAGEMENT = "codeManagement";
+ public static final String PROP_WIKI_MANAGEMENT = "wikiManagement";
+
public static final String PROP_PACK_MANAGEMENT = "packManagement";
public static final String PROP_ISSUE_MANAGEMENT = "issueManagement";
@@ -397,6 +401,8 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel
private ArrayList<WorkspaceSpec> workspaceSpecs = new ArrayList<>();
private boolean codeManagement = true;
+
+ private boolean wikiManagement = true;
private boolean packManagement = true;
@@ -411,6 +417,10 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel
@Lob
@Column(length=65535)
private CodeAnalysisSetting codeAnalysisSetting = new CodeAnalysisSetting();
+
+ @Lob
+ @Column(length=65535)
+ private WikiSetting wikiSetting = new WikiSetting();
@Lob
@Column(length=65535)
@@ -1052,6 +1062,16 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel
this.codeManagement = codeManagement;
}
+ @Editable(order=275, description="Whether or not to enable wiki management for the project")
+ @DependsOn(property="codeManagement")
+ public boolean isWikiManagement() {
+ return wikiManagement;
+ }
+
+ public void setWikiManagement(boolean wikiManagement) {
+ this.wikiManagement = wikiManagement;
+ }
+
@Editable(order=300, description="Whether or not to enable issue management for the project")
public boolean isIssueManagement() {
return issueManagement;
@@ -1139,6 +1159,24 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel
this.gitPackConfig = gitPackConfig;
}
+ public WikiSetting getWikiSetting() {
+ if (wikiSetting == null)
+ wikiSetting = new WikiSetting();
+ return wikiSetting;
+ }
+
+ public void setWikiSetting(WikiSetting wikiSetting) {
+ this.wikiSetting = wikiSetting;
+ }
+
+ public String getWikiFolder() {
+ for (Project current = this; current != null; current = current.getParent()) {
+ if (current.getWikiSetting().getFolder() != null)
+ return current.getWikiSetting().getFolder();
+ }
+ return "wiki";
+ }
+
public CodeAnalysisSetting getCodeAnalysisSetting() {
return codeAnalysisSetting;
}
diff --git a/server-core/src/main/java/io/onedev/server/model/support/WikiSetting.java b/server-core/src/main/java/io/onedev/server/model/support/WikiSetting.java
new file mode 100644
index 0000000000..7a27c1f737
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/model/support/WikiSetting.java
@@ -0,0 +1,26 @@
+package io.onedev.server.model.support;
+
+import io.onedev.server.annotation.Editable;
+import io.onedev.server.annotation.Path;
+import org.jspecify.annotations.Nullable;
+
+import java.io.Serializable;
+
+@Editable
+public class WikiSetting implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private String folder;
+
+ @Editable(name="Wiki Folder", placeholder="Inherit from parent", rootPlaceholder="wiki",
+ description="Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). "
+ + "Use Home.md for the home page and _Sidebar.md for the sidebar")
+ @Path(Path.Type.RELATIVE)
+ @Nullable
+ public String getFolder() {
+ return folder;
+ }
+
+ public void setFolder(@Nullable String folder) {
+ this.folder = folder;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/rest/resource/IssueAuthorizationResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/IssueAuthorizationResource.java
new file mode 100644
index 0000000000..8c8e9f6a01
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/rest/resource/IssueAuthorizationResource.java
@@ -0,0 +1,75 @@
+package io.onedev.server.rest.resource;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.shiro.authz.UnauthorizedException;
+
+import io.onedev.server.data.migration.VersionedXmlDoc;
+import io.onedev.server.model.IssueAuthorization;
+import io.onedev.server.rest.annotation.Api;
+import io.onedev.server.security.SecurityUtils;
+import io.onedev.server.service.AuditService;
+import io.onedev.server.service.IssueAuthorizationService;
+
+@Path("/issue-authorizations")
+@Consumes(MediaType.APPLICATION_JSON)
+@Produces(MediaType.APPLICATION_JSON)
+@Singleton
+public class IssueAuthorizationResource {
+
+ private final IssueAuthorizationService authorizationService;
+
+ private final AuditService auditService;
+
+ @Inject
+ public IssueAuthorizationResource(IssueAuthorizationService authorizationService, AuditService auditService) {
+ this.authorizationService = authorizationService;
+ this.auditService = auditService;
+ }
+
+ @Api(order=100, description = "Get issue authorization of specified id")
+ @Path("/{authorizationId}")
+ @GET
+ public IssueAuthorization getAuthorization(@PathParam("authorizationId") Long authorizationId) {
+ IssueAuthorization authorization = authorizationService.load(authorizationId);
+ if (!SecurityUtils.canModifyIssue(authorization.getIssue()))
+ throw new UnauthorizedException();
+ return authorization;
+ }
+
+ @Api(order=200, description="Create issue authorization")
+ @POST
+ public Long createAuthorization(@NotNull IssueAuthorization authorization) {
+ if (!SecurityUtils.canModifyIssue(authorization.getIssue()))
+ throw new UnauthorizedException();
+ authorizationService.createOrUpdate(authorization);
+ var newAuditContent = VersionedXmlDoc.fromBean(authorization).toXML();
+ auditService.audit(authorization.getIssue().getProject(), "created issue authorization via RESTful API", null, newAuditContent);
+ return authorization.getId();
+ }
+
+ @Api(order=300, description = "Delete issue authorization of specified id")
+ @Path("/{authorizationId}")
+ @DELETE
+ public Response deleteAuthorization(@PathParam("authorizationId") Long authorizationId) {
+ IssueAuthorization authorization = authorizationService.load(authorizationId);
+ if (!SecurityUtils.canModifyIssue(authorization.getIssue()))
+ throw new UnauthorizedException();
+ authorizationService.delete(authorization);
+ var oldAuditContent = VersionedXmlDoc.fromBean(authorization).toXML();
+ auditService.audit(authorization.getIssue().getProject(), "deleted issue authorization via RESTful API", oldAuditContent, null);
+ return Response.ok().build();
+ }
+
+}
diff --git a/server-core/src/main/java/io/onedev/server/rest/resource/IssueResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/IssueResource.java
index ff698a7281..0e9abaff3e 100644
--- a/server-core/src/main/java/io/onedev/server/rest/resource/IssueResource.java
+++ b/server-core/src/main/java/io/onedev/server/rest/resource/IssueResource.java
@@ -40,6 +40,7 @@ import io.onedev.server.SubscriptionService;
import io.onedev.server.attachment.AttachmentService;
import io.onedev.server.data.migration.VersionedXmlDoc;
import io.onedev.server.model.Issue;
+import io.onedev.server.model.IssueAuthorization;
import io.onedev.server.model.IssueChange;
import io.onedev.server.model.IssueComment;
import io.onedev.server.model.IssueLink;
@@ -226,6 +227,16 @@ public class IssueResource {
return issue.getWatches();
}
+ @Api(order=625)
+ @Path("/{issueId}/authorizations")
+ @GET
+ public Collection<IssueAuthorization> getAuthorizations(@PathParam("issueId") Long issueId) {
+ Issue issue = issueService.load(issueId);
+ if (!SecurityUtils.canModifyIssue(issue))
+ throw new UnauthorizedException();
+ return issue.getAuthorizations();
+ }
+
@Api(order=650)
@Path("/{issueId}/links")
@GET
diff --git a/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java
index 93d253c59a..5babb87b08 100644
--- a/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java
+++ b/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java
@@ -1,5 +1,7 @@
package io.onedev.server.rest.resource;
+import io.onedev.server.model.support.WikiSetting;
+
import static io.onedev.server.util.DateUtils.parseISO8601Date;
import static io.onedev.server.util.DateUtils.toLocalDate;
import static java.time.ZoneId.systemDefault;
@@ -472,6 +474,9 @@ public class ProjectResource {
@Api(order = 600)
private boolean codeManagement = true;
+
+ @Api(order = 625)
+ private boolean wikiManagement;
@Api(order = 650)
private boolean packManagement = true;
@@ -556,6 +561,14 @@ public class ProjectResource {
this.createDate = createDate;
}
+ public boolean isWikiManagement() {
+ return wikiManagement;
+ }
+
+ public void setWikiManagement(boolean wikiManagement) {
+ this.wikiManagement = wikiManagement;
+ }
+
public boolean isCodeManagement() {
return codeManagement;
}
@@ -627,6 +640,7 @@ public class ProjectResource {
project.setKey(getKey());
project.setDescription(getDescription());
project.setCodeManagement(isCodeManagement());
+ project.setWikiManagement(isWikiManagement());
project.setPackManagement(isPackManagement());
project.setIssueManagement(isIssueManagement());
project.setTimeTracking(isTimeTracking());
@@ -646,6 +660,7 @@ public class ProjectResource {
data.setDescription(project.getDescription());
data.setCreateDate(project.getCreateDate());
data.setCodeManagement(project.isCodeManagement());
+ data.setWikiManagement(project.isWikiManagement());
data.setPackManagement(project.isPackManagement());
data.setIssueManagement(project.isIssueManagement());
data.setTimeTracking(project.isTimeTracking());
@@ -667,6 +682,8 @@ public class ProjectResource {
private ArrayList<TagProtection> tagProtections = new ArrayList<>();
private ProjectIssueSetting issueSetting = new ProjectIssueSetting();
+
+ private WikiSetting wikiSetting = new WikiSetting();
private ProjectBuildSetting buildSetting = new ProjectBuildSetting();
@@ -702,6 +719,16 @@ public class ProjectResource {
this.tagProtections = tagProtections;
}
+ @Valid
+ @NotNull
+ public WikiSetting getWikiSetting() {
+ return wikiSetting;
+ }
+
+ public void setWikiSetting(WikiSetting wikiSetting) {
+ this.wikiSetting = wikiSetting;
+ }
+
@Valid
public ProjectIssueSetting getIssueSetting() {
return issueSetting;
@@ -789,6 +816,7 @@ public class ProjectResource {
project.setBuildSetting(getBuildSetting());
project.setPackSetting(getPackSetting());
project.setIssueSetting(getIssueSetting());
+ project.setWikiSetting(getWikiSetting());
project.setNamedCodeCommentQueries(getNamedCodeCommentQueries());
project.setNamedCommitQueries(getNamedCommitQueries());
project.setPullRequestSetting(getPullRequestSetting());
@@ -807,6 +835,7 @@ public class ProjectResource {
setting.setBuildSetting(project.getBuildSetting());
setting.setPackSetting(project.getPackSetting());
setting.setIssueSetting(project.getIssueSetting());
+ setting.setWikiSetting(project.getWikiSetting());
setting.setNamedCodeCommentQueries(project.getNamedCodeCommentQueries());
setting.setNamedCommitQueries(project.getNamedCommitQueries());
setting.setPullRequestSetting(project.getPullRequestSetting());
diff --git a/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java b/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java
index 18ce87d2f9..83376577e9 100644
--- a/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java
+++ b/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java
@@ -26,6 +26,7 @@ import com.google.common.collect.Sets;
import io.onedev.commons.loader.AppLoader;
import io.onedev.k8shelper.KubernetesHelper;
import io.onedev.server.OneDev;
+import io.onedev.server.git.GitUtils;
import io.onedev.server.model.AccessToken;
import io.onedev.server.model.Build;
import io.onedev.server.model.CodeComment;
@@ -287,6 +288,38 @@ public class SecurityUtils extends org.apache.shiro.SecurityUtils {
return canCreateBranch(getSubject(), project, branchName);
}
+ /** The caller must normalize the file path before checking permission and reading it. */
+ public static boolean canReadFile(Project project, String file) {
+ return canReadFile(getSubject(), project, file);
+ }
+
+ /** The caller must normalize the file path before checking permission and reading it. */
+ public static boolean canReadFile(Subject subject, Project project, String file) {
+ return canReadCode(subject, project) || project.isWikiManagement()
+ && file != null && file.startsWith(project.getWikiFolder() + "/")
+ && canAccessProject(subject, project);
+ }
+
+ public static boolean canEditWikiPage(Project project, @Nullable String revision, String path) {
+ if (!project.isCodeManagement() || !project.isWikiManagement() || !canAccessProject(project))
+ return false;
+ String branchName;
+ if (revision == null) {
+ if (project.getDefaultBranch() != null || !canCreateBranch(project, "main"))
+ return false;
+ branchName = "main";
+ } else {
+ var branch = project.getRef(revision);
+ if (branch == null || !branch.getName().startsWith("refs/heads/"))
+ return false;
+ branchName = GitUtils.ref2branch(branch.getName());
+ }
+ var user = getAuthUser();
+ return user != null && canModifyFile(project, branchName, path)
+ && project.getBranchProtection(branchName, user).getDisallowedFileTypes()
+ .stream().noneMatch(it -> it.equalsIgnoreCase("md"));
+ }
+
public static boolean canModifyFile(Project project, String branch, String file) {
var subject = getSubject();
var user = getUser(subject);
@@ -894,4 +927,4 @@ public class SecurityUtils extends org.apache.shiro.SecurityUtils {
return accessibleReportNames;
}
-}
\ No newline at end of file
+}
diff --git a/server-core/src/main/java/io/onedev/server/validation/validator/PathValidator.java b/server-core/src/main/java/io/onedev/server/validation/validator/PathValidator.java
index 3aeb4f0cdb..77dd1eaae6 100644
--- a/server-core/src/main/java/io/onedev/server/validation/validator/PathValidator.java
+++ b/server-core/src/main/java/io/onedev/server/validation/validator/PathValidator.java
@@ -52,9 +52,11 @@ public class PathValidator implements ConstraintValidator<Path, Object> {
}
public static String checkPath(Path.Type type, String value) {
- if (value.contains(".."))
- return "'..' is not allowed";
- else if (FilenameUtils.getPrefixLength(value) == 0 && type == Path.Type.ABSOLUTE)
+ for (String segment : value.replace('\\', '/').split("/")) {
+ if (segment.equals(".."))
+ return "'..' is not allowed";
+ }
+ if (FilenameUtils.getPrefixLength(value) == 0 && type == Path.Type.ABSOLUTE)
return "Absolute path is required";
else if (FilenameUtils.getPrefixLength(value) != 0 && type == Path.Type.RELATIVE)
return "Relative path is required";
diff --git a/server-core/src/main/java/io/onedev/server/web/asset/icon/wiki.svg b/server-core/src/main/java/io/onedev/server/web/asset/icon/wiki.svg
new file mode 100644
index 0000000000..c4843c080f
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/asset/icon/wiki.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1788765352255" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19919" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M192 320h256v64H192V320z m0 192h256V448H192v64z m0 128h256V576H192v64z m704-320h-256v64h256V320z m0 128h-256v64h256V448z m0 128h-256v64h256V576z m128-384v576c0 35.2-28.8 64-64 64H608l-64 64-64-64H128c-35.2 0-64-28.8-64-64V192c0-35.2 28.8-64 64-64h352l64 64 64-64H960c35.2 0 64 28.8 64 64z m-512 32L480 192H128v576h384V224z m448-32H608l-32 32V768h384V192z" p-id="19920"></path></svg>
\ No newline at end of file
diff --git a/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/DropzoneField.java b/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/DropzoneField.java
index a2de982b88..5842f342b8 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/DropzoneField.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/DropzoneField.java
@@ -1,5 +1,7 @@
package io.onedev.server.web.component.dropzonefield;
+import static io.onedev.server.web.translation.Translation._T;
+
import io.onedev.server.OneDev;
import io.onedev.server.web.behavior.AbstractPostAjaxBehavior;
import io.onedev.server.web.upload.FileUpload;
@@ -20,6 +22,7 @@ import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.util.lang.Bytes;
import org.jspecify.annotations.Nullable;
+import org.unbescape.javascript.JavaScriptEscape;
import java.util.ArrayList;
import java.util.UUID;
@@ -137,13 +140,14 @@ public class DropzoneField extends FormComponentPanel<String> {
response.render(JavaScriptHeaderItem.forReference(new DropzoneFieldResourceReference()));
String script = String.format(
- "onedev.server.dropzone.onDomReady('%s', '%s', %s, %s, %s, %d);",
+ "onedev.server.dropzone.onDomReady('%s', '%s', %s, %s, %s, %d, '%s');",
getMarkupId(),
uploadBehavior.getCallbackUrl(),
deleteBehavior.getCallbackFunction(CallbackParameter.explicit("name")),
acceptedFiles!=null?"'" + acceptedFiles + "'":"null",
maxFiles!=0?maxFiles:"null",
- maxFilesize);
+ maxFilesize,
+ JavaScriptEscape.escapeJavaScript(_T("Drop files here or click to upload")));
response.render(OnDomReadyHeaderItem.forScript(script));
}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/dropzone-field.js b/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/dropzone-field.js
index 5a4a6ec7dc..7881f286d7 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/dropzone-field.js
+++ b/server-core/src/main/java/io/onedev/server/web/component/dropzonefield/dropzone-field.js
@@ -1,5 +1,5 @@
onedev.server.dropzone = {
- onDomReady: function(containerId, uploadUrl, deleteCallback, acceptedFiles, maxFiles, maxFilesize) {
+ onDomReady: function(containerId, uploadUrl, deleteCallback, acceptedFiles, maxFiles, maxFilesize, defaultMessage) {
var input = document.querySelector("#" + containerId + ">.dropzone");
var dropzone = new Dropzone(input, {
@@ -8,7 +8,7 @@ onedev.server.dropzone = {
acceptedFiles: acceptedFiles,
maxFiles: maxFiles,
maxFilesize: maxFilesize,
- dictDefaultMessage: "Drop files here or click to upload",
+ dictDefaultMessage: defaultMessage,
success: function() {
onedev.server.form.markDirty($(input).closest("form"));
},
@@ -22,4 +22,4 @@ onedev.server.dropzone = {
}
});
}
-}
\ No newline at end of file
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownEditor.html b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownEditor.html
new file mode 100644
index 0000000000..49e8bf84fe
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownEditor.html
@@ -0,0 +1,3 @@
+<wicket:panel>
+ <div wicket:id="input"></div>
+</wicket:panel>
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownEditor.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownEditor.java
new file mode 100644
index 0000000000..e1192f9943
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownEditor.java
@@ -0,0 +1,308 @@
+package io.onedev.server.web.component.markdown;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import io.onedev.server.util.FilenameUtils;
+import org.apache.commons.lang3.Strings;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
+import org.apache.wicket.markup.html.form.FormComponentPanel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.eclipse.jgit.lib.FileMode;
+import org.jetbrains.annotations.Nullable;
+
+import com.google.common.collect.Sets;
+
+import io.onedev.commons.utils.PathUtils;
+import io.onedev.server.OneDev;
+import io.onedev.server.git.BlobIdent;
+import io.onedev.server.markdown.MarkdownService;
+import io.onedev.server.model.Build;
+import io.onedev.server.model.Issue;
+import io.onedev.server.model.Project;
+import io.onedev.server.model.PullRequest;
+import io.onedev.server.model.User;
+import io.onedev.server.model.Workspace;
+import io.onedev.server.search.entity.issue.IssueQuery;
+import io.onedev.server.search.entity.pullrequest.PullRequestQuery;
+import io.onedev.server.security.SecurityUtils;
+import io.onedev.server.service.BuildService;
+import io.onedev.server.service.IssueService;
+import io.onedev.server.service.PullRequestService;
+import io.onedev.server.service.UserService;
+import io.onedev.server.util.ContentDetector;
+import io.onedev.server.util.ProjectScope;
+import io.onedev.server.util.Similarities;
+import io.onedev.server.util.UrlUtils;
+import io.onedev.server.util.facade.UserCache;
+import io.onedev.server.web.page.project.blob.ProjectBlobPage;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext.Mode;
+import io.onedev.server.web.upload.FileUpload;
+import io.onedev.server.web.util.WikiLinkResolver;
+import io.onedev.server.workspace.WorkspaceService;
+
+/** Markdown file editor shared by repository and wiki pages. */
+public class BlobMarkdownEditor extends FormComponentPanel<byte[]> {
+
+ @Inject
+ private MarkdownService markdownService;
+
+ private final BlobRenderContext context;
+
+ private MarkdownEditor input;
+
+ public BlobMarkdownEditor(String id, BlobRenderContext context, byte[] initialContent) {
+ this(id, Model.of(initialContent), context);
+ }
+
+ public BlobMarkdownEditor(String id, IModel<byte[]> model, @Nullable BlobRenderContext context) {
+ super(id, model);
+ this.context = context;
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+
+ Charset detectedCharset = ContentDetector.detectCharset(getModelObject());
+ Charset charset = detectedCharset!=null?detectedCharset:Charset.defaultCharset();
+ add(input = new MarkdownEditor("input", Model.of(new String(getModelObject(), charset)), false, context) {
+ @Override
+ protected String renderMarkdown(String markdown) {
+ return BlobMarkdownEditor.this.renderMarkdown(markdown);
+ }
+
+ @Override
+ protected String getAutosaveKey() {
+ return BlobMarkdownEditor.this.getAutosaveKey();
+ }
+
+ @Override
+ protected boolean shouldTrimInput() {
+ return false;
+ }
+
+ @Override
+ protected UserMentionSupport getUserMentionSupport() {
+ return BlobMarkdownEditor.this.getUserMentionSupport();
+ }
+
+ @Override
+ protected AtWhoReferenceSupport getReferenceSupport() {
+ return BlobMarkdownEditor.this.getReferenceSupport();
+ }
+
+ @Override
+ public BlobSelectionSupport getBlobSelectionSupport() {
+ return BlobMarkdownEditor.this.getRepositoryFileSelectionSupport();
+ }
+
+ @Override
+ public BlobUploadSupport getBlobUploadSupport() {
+ return BlobMarkdownEditor.this.getRepositoryUploadSupport();
+ }
+ });
+
+ if (context != null) {
+ input.add(AttributeAppender.append("class", "no-autosize d-flex flex-grow-1 flex-column autofit"));
+ if (!isAutofocus())
+ input.add(AttributeAppender.append("class", "no-autofocus"));
+ }
+ input.setOutputMarkupId(true);
+ }
+
+ @Override
+ public void convertInput() {
+ String content = input.getConvertedInput();
+ if (content != null) {
+ /*
+ * Textarea always uses CRLF as line ending, and below we change back to original EOL
+ */
+ String initialContent = input.getModelObject();
+ if (initialContent == null || !initialContent.contains("\r\n"))
+ content = Strings.CS.replace(content, "\r\n", "\n");
+ setConvertedInput(content.getBytes(StandardCharsets.UTF_8));
+ } else {
+ setConvertedInput(new byte[0]);
+ }
+ }
+
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ if (isAutofocus()) {
+ String script = String.format("$('#%s textarea').focus();", input.getMarkupId());
+ response.render(OnDomReadyHeaderItem.forScript(script));
+ }
+ }
+
+ protected Project getProject() {
+ return context.getProject();
+ }
+
+ protected String renderMarkdown(String markdown) {
+ var rendered = markdownService.process(markdownService.render(markdown), getProject(), context, null, false);
+ return WikiLinkResolver.resolveWikiLinks(rendered, getRenderContext());
+ }
+
+ @Nullable
+ protected BlobRenderContext getRenderContext() {
+ return context;
+ }
+
+ @Nullable
+ protected String getAutosaveKey() {
+ return context != null ? context.getEditorAutosaveKey() : null;
+ }
+
+ protected UserMentionSupport getUserMentionSupport() {
+ return new UserMentionSupport() {
+
+ @Override
+ public List<User> findUsers(String query, int count) {
+ UserCache cache = OneDev.getInstance(UserService.class).cloneCache();
+ List<User> users = new ArrayList<>(cache.getUsers());
+ users.sort(cache.comparingDisplayName(Sets.newHashSet()));
+
+ users = new Similarities<User>(users) {
+
+ @Override
+ public double getSimilarScore(User object) {
+ return cache.getSimilarScore(object, query);
+ }
+
+ };
+
+ if (users.size() > count)
+ return users.subList(0, count);
+ else
+ return users;
+ }
+
+ };
+ }
+
+ protected AtWhoReferenceSupport getReferenceSupport() {
+ return new AtWhoReferenceSupport() {
+
+ @Override
+ public Project getCurrentProject() {
+ return getProject();
+ }
+
+ @Override
+ public List<PullRequest> queryPullRequests(Project project, String query, int count) {
+ var subject = SecurityUtils.getSubject();
+ if (SecurityUtils.canReadCode(subject, project)) {
+ var requestQuery = new PullRequestQuery(new io.onedev.server.search.entity.pullrequest.FuzzyCriteria(query));
+ return OneDev.getInstance(PullRequestService.class).query(subject, project, requestQuery, false, 0, count);
+ } else {
+ return new ArrayList<>();
+ }
+ }
+
+ @Override
+ public List<Issue> queryIssues(Project project, String query, int count) {
+ var subject = SecurityUtils.getSubject();
+ if (SecurityUtils.canAccessProject(subject, project)) {
+ var projectScope = new ProjectScope(project, false, false);
+ var issueQuery = new IssueQuery(new io.onedev.server.search.entity.issue.FuzzyCriteria(query));
+ return OneDev.getInstance(IssueService.class).query(subject, projectScope, issueQuery, false, 0, count);
+ } else {
+ return new ArrayList<>();
+ }
+ }
+
+ @Override
+ public List<Build> queryBuilds(Project project, String query, int count) {
+ var subject = SecurityUtils.getSubject();
+ return OneDev.getInstance(BuildService.class).query(subject, project, query, count);
+ }
+
+ @Override
+ public List<Workspace> queryWorkspaces(Project project, String query, int count) {
+ return OneDev.getInstance(WorkspaceService.class).query(SecurityUtils.getSubject(), project, query, count);
+ }
+
+ };
+ }
+
+ protected boolean isAutofocus() {
+ return context != null && context.getMode() == Mode.EDIT;
+ }
+
+ @Nullable
+ public BlobSelectionSupport getRepositoryFileSelectionSupport() {
+ if (context == null)
+ return null;
+ return new BlobSelectionSupport() {
+ @Override
+ public Project getProject() {
+ return context.getProject();
+ }
+
+ @Override
+ public BlobIdent getBlobIdent() {
+ return context.getBlobIdent();
+ }
+
+ @Override
+ public void onSelect(AjaxRequestTarget target, String path, boolean image, String text) {
+ var blob = new BlobIdent(context.getBlobIdent().revision, path, FileMode.REGULAR_FILE.getBits());
+ String referenceUrl = urlFor(ProjectBlobPage.class,
+ ProjectBlobPage.paramsOf(getProject(), blob)).toString();
+ String relativeUrl = PathUtils.relativize(context.getDirectoryUrl(), referenceUrl);
+ insertUrl(target, image, relativeUrl, text != null ? text : blob.getName(), null);
+ }
+ };
+ }
+
+ @Nullable
+ public BlobUploadSupport getRepositoryUploadSupport() {
+ if (context == null)
+ return null;
+ return new BlobUploadSupport() {
+ @Override
+ public Project getProject() {
+ return context.getProject();
+ }
+
+ @Override
+ public BlobIdent getBlobIdent() {
+ return context.getBlobIdent();
+ }
+
+ @Override
+ public String getDefaultDirectory() {
+ return context.getDirectory();
+ }
+
+ @Override
+ public String upload(FileUpload upload, String directory, String commitMessage) {
+ context.onCommitted(null, context.uploadFiles(upload, directory, commitMessage));
+ String fileName = FilenameUtils.sanitizeFileName(FileUpload.getFileName(upload.getItems().iterator().next()));
+ String uploadedPath = directory != null ? directory + "/" + fileName : fileName;
+ String relativePath = PathUtils.relativize(context.getDirectory(), uploadedPath);
+ return java.util.Arrays.stream(relativePath.split("/"))
+ .map(UrlUtils::encodePath).collect(java.util.stream.Collectors.joining("/"));
+ }
+ };
+ }
+
+ public void insertText(AjaxRequestTarget target, String text) {
+ input.insertText(target, text);
+ }
+
+ public void insertUrl(AjaxRequestTarget target, boolean image, String url, String text, @Nullable String replaceMessage) {
+ input.insertUrl(target, image, url, text, replaceMessage);
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownViewer.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownViewer.java
new file mode 100644
index 0000000000..61696dcf36
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobMarkdownViewer.java
@@ -0,0 +1,20 @@
+package io.onedev.server.web.component.markdown;
+
+import org.apache.wicket.model.IModel;
+import org.jspecify.annotations.Nullable;
+
+import io.onedev.server.web.util.WikiLinkResolver;
+
+public class BlobMarkdownViewer extends MarkdownViewer {
+
+ public BlobMarkdownViewer(String id, IModel<String> model,
+ @Nullable ContentVersionSupport contentVersionSupport) {
+ super(id, model, contentVersionSupport);
+ }
+
+ @Override
+ protected String renderMarkdown(String markdown) {
+ return WikiLinkResolver.resolveWikiLinks(super.renderMarkdown(markdown), getRenderContext());
+ }
+
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobSelectionSupport.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobSelectionSupport.java
new file mode 100644
index 0000000000..3b80c16ce9
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobSelectionSupport.java
@@ -0,0 +1,16 @@
+package io.onedev.server.web.component.markdown;
+
+import java.io.Serializable;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import io.onedev.server.git.BlobIdent;
+import io.onedev.server.model.Project;
+
+/** Customizes repository selection without requiring a full file editor context. */
+public interface BlobSelectionSupport extends Serializable {
+ Project getProject();
+ BlobIdent getBlobIdent();
+ default boolean accepts(BlobIdent blob, boolean image) {
+ return true;
+ }
+ void onSelect(AjaxRequestTarget target, String path, boolean image, String text);
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobUploadSupport.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobUploadSupport.java
new file mode 100644
index 0000000000..d7d5aacccb
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/BlobUploadSupport.java
@@ -0,0 +1,22 @@
+package io.onedev.server.web.component.markdown;
+
+import java.io.Serializable;
+
+import io.onedev.server.git.BlobIdent;
+import io.onedev.server.model.Project;
+import io.onedev.server.web.upload.FileUpload;
+
+/** Repository uploads shared by Markdown editors. Upload directories are relative to the repository root. */
+public interface BlobUploadSupport extends Serializable {
+ Project getProject();
+ BlobIdent getBlobIdent();
+ String getDefaultDirectory();
+
+ /** Commit the upload, update the editor revision, and return the URL to insert. */
+ String upload(FileUpload upload, String directory, String commitMessage);
+
+ /** Return a wiki page reference when the uploaded URL points to a wiki page. */
+ default @org.jspecify.annotations.Nullable String getPageReference(String url, String text) {
+ return null;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.html b/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.html
index 3a1dc1b66a..6b6320daec 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.html
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.html
@@ -72,7 +72,7 @@
<a wicket:id="select" t:data-tippy-content="Select" class="btn btn-outline-secondary btn-icon"><wicket:svg href="folder-open" class="icon"></wicket:svg></a>
</span>
</div>
- <p class="form-text text-muted"><wicket:t>Optionally specify relative directory to put uploaded files</wicket:t></p>
+ <p class="form-text text-muted"><wicket:t>Specify a folder relative to the repository root. Leave empty to upload to the root folder.</wicket:t></p>
</div>
<div class="form-group">
<label><wicket:t>Commit Message</wicket:t></label>
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.java
index da78778b7e..c71e449513 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.java
@@ -52,7 +52,6 @@ import org.unbescape.javascript.JavaScriptEscape;
import com.google.common.base.Preconditions;
import io.onedev.commons.utils.ExplicitException;
-import io.onedev.commons.utils.PathUtils;
import io.onedev.commons.utils.StringUtils;
import io.onedev.server.OneDev;
import io.onedev.server.attachment.AttachmentSupport;
@@ -74,8 +73,6 @@ import io.onedev.server.web.component.link.DropdownLink;
import io.onedev.server.web.component.tabbable.AjaxActionTab;
import io.onedev.server.web.component.tabbable.Tab;
import io.onedev.server.web.component.tabbable.Tabbable;
-import io.onedev.server.web.page.project.blob.ProjectBlobPage;
-import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
import io.onedev.server.web.upload.FileUpload;
import io.onedev.server.web.upload.UploadService;
@@ -85,7 +82,6 @@ abstract class InsertUrlPanel extends Panel {
private static final MetaDataKey<String> ACTIVE_TAB = new MetaDataKey<String>(){};
- private static final MetaDataKey<String> UPLOAD_DIRECTORY = new MetaDataKey<String>(){};
private static final MetaDataKey<HashSet<String>> FILE_PICKER_STATE = new MetaDataKey<HashSet<String>>(){};
@@ -169,16 +165,16 @@ abstract class InsertUrlPanel extends Panel {
}
@Nullable
- private ObjectId resolveCommitId(BlobRenderContext context) {
+ private ObjectId resolveCommitId(Project project, BlobIdent blob) {
/*
* We resolve revision to get latest commit id so that we can select to insert newly
* added/uploaded files while editing a markdown file
*/
- String revision = context.getBlobIdent().revision;
+ String revision = blob.revision;
if (revision == null)
revision = "main";
GitService gitService = OneDev.getInstance(GitService.class);
- return gitService.resolve(context.getProject(), revision, false);
+ return gitService.resolve(project, revision, false);
}
private Set<BlobIdent> getPickerState(@Nullable ObjectId commitId, BlobIdent currentBlobIdent,
@@ -211,12 +207,16 @@ abstract class InsertUrlPanel extends Panel {
private Component newPickExistingPanel() {
Fragment fragment;
- BlobRenderContext context = markdownEditor.getBlobRenderContext();
- if (context != null) {
+ var selectionSupport = markdownEditor.getBlobSelectionSupport();
+ if (selectionSupport != null) {
+ Project project = selectionSupport.getProject();
+ BlobIdent currentBlob = selectionSupport.getBlobIdent();
fragment = new Fragment(CONTENT_ID, "pickBlobFrag", this);
BlobIdentFilter blobIdentFilter = new BlobIdentFilter() {
@Override
public boolean filter(BlobIdent blobIdent) {
+ if (!selectionSupport.accepts(blobIdent, isImage))
+ return false;
if (isImage) {
if (blobIdent.isTree()) {
return true;
@@ -230,16 +230,16 @@ abstract class InsertUrlPanel extends Panel {
}
};
- ObjectId commitId = resolveCommitId(context);
+ ObjectId commitId = resolveCommitId(project, currentBlob);
- Set<BlobIdent> filePickerState = getPickerState(commitId, context.getBlobIdent(),
+ Set<BlobIdent> filePickerState = getPickerState(commitId, currentBlob,
WebSession.get().getMetaData(FILE_PICKER_STATE));
IModel<Project> projectModel = new AbstractReadOnlyModel<Project>() {
@Override
public Project getObject() {
- return markdownEditor.getBlobRenderContext().getProject();
+ return selectionSupport.getProject();
}
};
@@ -247,13 +247,7 @@ abstract class InsertUrlPanel extends Panel {
@Override
protected void onSelect(AjaxRequestTarget target, String blobPath) {
- BlobIdent blobIdent = new BlobIdent(context.getBlobIdent().revision, blobPath,
- FileMode.REGULAR_FILE.getBits());
- String baseUrl = context.getDirectoryUrl();
- String referenceUrl = urlFor(ProjectBlobPage.class,
- ProjectBlobPage.paramsOf(context.getProject(), blobIdent)).toString();
- String relativized = PathUtils.relativize(baseUrl, referenceUrl);
- markdownEditor.insertUrl(target, isImage, relativized, linkText!=null?linkText:blobIdent.getName(), null);
+ selectionSupport.onSelect(target, blobPath, isImage, linkText);
onClose(target);
}
@@ -448,6 +442,7 @@ abstract class InsertUrlPanel extends Panel {
});
fragment.add(form);
} else {
+ BlobUploadSupport support = Preconditions.checkNotNull(markdownEditor.getBlobUploadSupport());
int maxUploadFileSize = OneDev.getInstance(SettingService.class).getPerformanceSetting().getMaxUploadFileSize();
fragment = new Fragment(CONTENT_ID, "uploadBlobFrag", this);
Form<?> form = new Form<Void>("form");
@@ -462,27 +457,10 @@ abstract class InsertUrlPanel extends Panel {
form.add(new DropzoneField("file", model, acceptedFiles, 1, maxUploadFileSize)
.setRequired(true).setLabel(Model.of(_T("Attachment"))));
- form.add(new TextField<String>("directory", new IModel<String>() {
+ form.add(new TextField<String>("directory", Model.of(support.getDefaultDirectory())));
- @Override
- public void detach() {
- }
-
- @Override
- public String getObject() {
- return WebSession.get().getMetaData(UPLOAD_DIRECTORY);
- }
-
- @Override
- public void setObject(String object) {
- WebSession.get().setMetaData(UPLOAD_DIRECTORY, object);
- }
-
- }));
-
- BlobRenderContext context = Preconditions.checkNotNull(markdownEditor.getBlobRenderContext());
- ObjectId commitId = resolveCommitId(context);
- Set<BlobIdent> folderPickerState = getPickerState(commitId, context.getBlobIdent(),
+ ObjectId commitId = resolveCommitId(support.getProject(), support.getBlobIdent());
+ Set<BlobIdent> folderPickerState = getPickerState(commitId, support.getBlobIdent(),
WebSession.get().getMetaData(FOLDER_PICKER_STATE));
form.add(new DropdownLink("select") {
@@ -495,15 +473,15 @@ abstract class InsertUrlPanel extends Panel {
protected void onSelect(AjaxRequestTarget target, BlobIdent blobIdent) {
dropdown.close();
- String relativePath = PathUtils.relativize(context.getDirectory(), blobIdent.path);
+ String directory = blobIdent.path != null ? blobIdent.path : "";
String script = String.format("$('form.upload-blob .directory input').val('%s');",
- JavaScriptEscape.escapeJavaScript(relativePath));
+ JavaScriptEscape.escapeJavaScript(directory));
target.appendJavaScript(script);
}
@Override
protected Project getProject() {
- return markdownEditor.getBlobRenderContext().getProject();
+ return support.getProject();
}
@Override
@@ -535,7 +513,7 @@ abstract class InsertUrlPanel extends Panel {
@Override
protected Project getProject() {
- return markdownEditor.getBlobRenderContext().getProject();
+ return support.getProject();
}
};
@@ -547,22 +525,20 @@ abstract class InsertUrlPanel extends Panel {
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
- BlobRenderContext context = Preconditions.checkNotNull(markdownEditor.getBlobRenderContext());
String commitMessage = InsertUrlPanel.this.commitMessage;
if (StringUtils.isBlank(commitMessage))
commitMessage = _T("Add files via upload");
var upload = getUploadService().getUpload(uploadId);
try {
- String directory = WebSession.get().getMetaData(UPLOAD_DIRECTORY);
- context.onCommitted(null, context.uploadFiles(upload, directory, commitMessage));
+ String directory = (String) form.get("directory").getDefaultModelObject();
+ String url = support.upload(upload, directory, commitMessage);
String fileName = FileUpload.getFileName(upload.getItems().iterator().next());
- String url;
- if (directory != null)
- url = StringUtils.stripEnd(directory, "/") + "/" + UrlUtils.encodePath(fileName);
- else
- url = UrlUtils.encodePath(fileName);
- markdownEditor.insertUrl(target, isImage, url, linkText!=null?linkText:fileName, null);
+ String pageReference = !isImage ? support.getPageReference(url, linkText) : null;
+ if (pageReference != null)
+ markdownEditor.insertText(target, pageReference);
+ else
+ markdownEditor.insertUrl(target, isImage, url, linkText!=null?linkText:fileName, null);
upload.clear();
onClose(target);
} catch (ExplicitException e) {
@@ -595,7 +571,8 @@ abstract class InsertUrlPanel extends Panel {
add(new Label("title", isImage? _T("Insert Image") : _T("Insert Link")));
- if (markdownEditor.getBlobRenderContext() == null && markdownEditor.getAttachmentSupport() == null) {
+ if (markdownEditor.getBlobUploadSupport() == null && markdownEditor.getAttachmentSupport() == null
+ && markdownEditor.getBlobSelectionSupport() == null) {
add(newInputUrlPanel());
} else {
String tabInputUrl = _T("Input URL");
@@ -641,7 +618,9 @@ abstract class InsertUrlPanel extends Panel {
}
};
- tabs.add(uploadTab);
+ boolean canUpload = markdownEditor.getBlobUploadSupport() != null || markdownEditor.getAttachmentSupport() != null;
+ if (canUpload)
+ tabs.add(uploadTab);
fragment.add(new Tabbable("tabs", tabs));
@@ -650,7 +629,7 @@ abstract class InsertUrlPanel extends Panel {
if (tabPickExisting.equals(activeTab)) {
pickExistingTab.setSelected(true);
fragment.add(newPickExistingPanel());
- } else if (tabUpload.equals(activeTab)) {
+ } else if (canUpload && tabUpload.equals(activeTab)) {
uploadTab.setSelected(true);
fragment.add(newUploadPanel());
} else {
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownBlobViewer.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownBlobViewer.java
deleted file mode 100644
index f28c3a3e45..0000000000
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownBlobViewer.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package io.onedev.server.web.component.markdown;
-
-import org.apache.wicket.model.IModel;
-import org.jspecify.annotations.Nullable;
-
-/**
- * A markdown viewer whose content comes from a repository blob.
- */
-public class MarkdownBlobViewer extends MarkdownViewer {
-
- public MarkdownBlobViewer(String id, IModel<String> model,
- @Nullable ContentVersionSupport contentVersionSupport) {
- super(id, model, contentVersionSupport);
- }
-
-}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
index 3cfd745879..a191d93def 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
@@ -703,6 +703,16 @@ public class MarkdownEditor extends FormComponentPanel<String> {
return new ArrayList<>();
}
+ @Nullable
+ public BlobSelectionSupport getBlobSelectionSupport() {
+ return null;
+ }
+
+ @Nullable
+ public BlobUploadSupport getBlobUploadSupport() {
+ return null;
+ }
+
@Nullable
public BlobRenderContext getBlobRenderContext() {
return blobRenderContext;
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlineDropdownLink.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlineDropdownLink.java
index 7364e17067..274406f62b 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlineDropdownLink.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlineDropdownLink.java
@@ -14,11 +14,11 @@ public abstract class MarkdownOutlineDropdownLink extends DropdownLink {
}
@Nullable
- protected abstract MarkdownBlobViewer getViewer();
+ protected abstract MarkdownViewer getViewer();
@Override
protected Component newContent(String id, FloatingPanel dropdown) {
- return new MarkdownOutlinePanel(id, getViewer(), false).setTrigger(this);
+ return new MarkdownOutlinePanel(id, getViewer(), false);
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.html b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.html
index 05324ec7fe..ad949121b3 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.html
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.html
@@ -1,4 +1,6 @@
<wicket:panel>
<div wicket:id="resizeHandle" class="ui-resizable-handle ui-resizable-w flex-shrink-0"></div>
- <div class="content flex-grow-1 overflow-auto"></div>
+ <div class="content flex-grow-1 overflow-auto">
+ <div class="no-headings text-muted p-2"><wicket:t>No headings</wicket:t></div>
+ </div>
</wicket:panel>
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.java
index 4389b4acf0..4af30ddbdd 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownOutlinePanel.java
@@ -7,7 +7,6 @@ import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Panel;
-import org.unbescape.javascript.JavaScriptEscape;
public class MarkdownOutlinePanel extends Panel {
@@ -15,19 +14,12 @@ public class MarkdownOutlinePanel extends Panel {
private final boolean sidebar;
- private Component trigger;
-
public MarkdownOutlinePanel(String id, Component viewer, boolean sidebar) {
super(id);
this.viewer = viewer;
this.sidebar = sidebar;
}
- public MarkdownOutlinePanel setTrigger(Component trigger) {
- this.trigger = trigger;
- return this;
- }
-
@Override
protected void onInitialize() {
super.onInitialize();
@@ -43,11 +35,8 @@ public class MarkdownOutlinePanel extends Panel {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
- String triggerId = trigger != null
- ? "'" + JavaScriptEscape.escapeJavaScript(trigger.getMarkupId(true)) + "'"
- : "undefined";
- String script = String.format("onedev.server.markdown.initOutline('%s', '%s', %s, %s);",
- getMarkupId(), viewer.getMarkupId(true), sidebar, triggerId);
+ String script = String.format("onedev.server.markdown.initOutline('%s', '%s', %s);",
+ getMarkupId(), viewer.getMarkupId(true), sidebar);
response.render(OnDomReadyHeaderItem.forScript(script));
}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.java
index ef892a08c6..96fdc01a77 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.java
@@ -110,8 +110,7 @@ public class MarkdownViewer extends GenericPanel<String> {
protected String load() {
String markdown = getModelObject();
if (markdown != null) {
- return markdownService.process(markdownService.render(markdown), getProject(),
- getRenderContext(), getSuggestionSupport(), false);
+ return renderMarkdown(markdown);
} else {
return null;
}
@@ -126,6 +125,11 @@ public class MarkdownViewer extends GenericPanel<String> {
lastContentVersion = contentVersionSupport.getVersion();
}
+ protected String renderMarkdown(String markdown) {
+ return markdownService.process(markdownService.render(markdown), getProject(),
+ getRenderContext(), getSuggestionSupport(), false);
+ }
+
protected BlobRenderContext getRenderContext() {
return null;
}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.css b/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.css
index fabdd52a70..4dcb71c194 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.css
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.css
@@ -550,6 +550,23 @@ body.markdown-editor-expanded {
color: #0073e9;
}
+.markdown-rendered a+.missing, .markdown-rendered img+.missing {
+ background: var(--light-danger);
+ margin-left: 4px;
+ padding: 0 2px;
+}
+.dark-mode .markdown-rendered a+.missing, .dark-mode .markdown-rendered img+.missing {
+ background: var(--dark-mode-light-danger);
+ color: var(--danger);
+}
+.markdown-rendered img+.missing {
+ vertical-align: middle;
+}
+.markdown-rendered .missing+.add-missing {
+ color: var(--success);
+ margin-left: 4px;
+}
+
.markdown-rendered .no-color * {
color: inherit !important;
background-color: inherit !important;
diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.js b/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.js
index 5414103308..1717c8e64d 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.js
+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.js
@@ -1385,7 +1385,7 @@ onedev.server.markdown = {
});
}
},
- initOutline: function(outlineId, viewerId, sidebar, triggerId) {
+ initOutline: function(outlineId, viewerId, sidebar) {
var $outline = $("#" + outlineId);
var $viewer = $("#" + viewerId);
var $content = $outline.children(".content");
@@ -1394,7 +1394,8 @@ onedev.server.markdown = {
return $(this).children("a.header-anchor").length != 0;
});
- $content.empty();
+ $content.children(".item").remove();
+ $content.children(".no-headings").toggle($headings.length == 0);
$headings.each(function() {
var $heading = $(this);
var href = $heading.children("a.header-anchor").first().attr("href");
@@ -1412,16 +1413,7 @@ onedev.server.markdown = {
$content.append($link);
});
- if (triggerId) {
- var $trigger = $("#" + triggerId);
- if ($trigger.is(":checkbox"))
- $trigger = $trigger.closest("label");
- $trigger.toggle($headings.length != 0);
- }
- if ($headings.length == 0)
- $outline.hide();
-
- if (sidebar && $headings.length != 0 && !$outline.hasClass("ui-resizable")) {
+ if (sidebar && !$outline.hasClass("ui-resizable")) {
var $viewerContainer = $viewer;
$outline.resizable({
autoHide: false,
diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.java b/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.java
index 9d0a73d4ba..1a53089bd4 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.java
@@ -148,7 +148,8 @@ public abstract class ForkOptionPanel extends Panel {
newProject.setKey(editProject.getKey());
newProject.setDescription(editProject.getDescription());
newProject.setPackManagement(editProject.isPackManagement());
- newProject.setIssueManagement(editProject.isIssueManagement());
+ newProject.setIssueManagement(editProject.isIssueManagement());
+ newProject.setWikiManagement(editProject.isWikiManagement());
newProject.setTimeTracking(editProject.isTimeTracking());
newProject.setCodeAnalysisSetting(getProject().getCodeAnalysisSetting());
newProject.setGitPackConfig(getProject().getGitPackConfig());
@@ -159,6 +160,7 @@ public abstract class ForkOptionPanel extends Panel {
newProject.getBuildSetting().setListParams(getProject().getBuildSetting().getListParams(false));
newProject.getBuildSetting().setNamedQueries(getProject().getBuildSetting().getNamedQueries());
newProject.setPackSetting(getProject().getPackSetting());
+ newProject.setWikiSetting(getProject().getWikiSetting());
newProject.setPullRequestSetting(getProject().getPullRequestSetting());
newProject.setWorkspaceSetting(getProject().getWorkspaceSetting());
newProject.setWorkspaceSpecs(getProject().getWorkspaceSpecs());
diff --git a/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentEditSupport.java b/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentEditSupport.java
new file mode 100644
index 0000000000..0ec9667e41
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentEditSupport.java
@@ -0,0 +1,47 @@
+package io.onedev.server.web.editable.wiki;
+
+import java.nio.charset.StandardCharsets;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+import io.onedev.server.web.component.markdown.MarkdownViewer;
+import io.onedev.server.web.editable.EditSupport;
+import io.onedev.server.web.editable.PropertyContext;
+import io.onedev.server.web.editable.PropertyDescriptor;
+import io.onedev.server.web.editable.PropertyEditor;
+import io.onedev.server.web.editable.PropertyViewer;
+import io.onedev.server.web.page.project.wiki.WikiPageBean;
+
+/** Retains repository-aware Markdown editing inside the standard bean editor. */
+public class WikiPageContentEditSupport implements EditSupport {
+
+ @Override
+ public PropertyContext<?> getEditContext(PropertyDescriptor descriptor) {
+ if (descriptor.getBeanClass() != WikiPageBean.class || !descriptor.getPropertyName().equals("content"))
+ return null;
+ return new PropertyContext<byte[]>(descriptor) {
+ @Override
+ public PropertyEditor<byte[]> renderForEdit(String id, IModel<byte[]> model) {
+ return new WikiPageContentPropertyEditor(id, descriptor, model);
+ }
+
+ @Override
+ public PropertyViewer renderForView(String id, IModel<byte[]> model) {
+ return new PropertyViewer(id, descriptor) {
+ @Override
+ protected Component newContent(String id, PropertyDescriptor descriptor) {
+ return new MarkdownViewer(id, Model.of(model.getObject() != null
+ ? new String(model.getObject(), StandardCharsets.UTF_8) : ""), null);
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public int getPriority() {
+ return DEFAULT_PRIORITY;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentPropertyEditor.html b/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentPropertyEditor.html
new file mode 100644
index 0000000000..57687bdfc8
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentPropertyEditor.html
@@ -0,0 +1,3 @@
+<wicket:panel>
+ <div wicket:id="input"></div>
+</wicket:panel>
diff --git a/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentPropertyEditor.java b/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentPropertyEditor.java
new file mode 100644
index 0000000000..1b38678315
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/editable/wiki/WikiPageContentPropertyEditor.java
@@ -0,0 +1,35 @@
+package io.onedev.server.web.editable.wiki;
+
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+import io.onedev.server.web.component.markdown.BlobMarkdownEditor;
+import io.onedev.server.web.editable.PropertyDescriptor;
+import io.onedev.server.web.editable.PropertyEditor;
+import io.onedev.server.web.page.project.wiki.ProjectWikiPage;
+
+public class WikiPageContentPropertyEditor extends PropertyEditor<byte[]> {
+
+ private BlobMarkdownEditor input;
+
+ public WikiPageContentPropertyEditor(String id, PropertyDescriptor descriptor, IModel<byte[]> model) {
+ super(id, descriptor, model);
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+ input = findParent(ProjectWikiPage.class).newContentEditor("input", Model.of(getModelObject()));
+ add(input);
+ }
+
+ @Override
+ protected byte[] convertInputToValue() {
+ return input.getConvertedInput();
+ }
+
+ @Override
+ public boolean needExplicitSubmit() {
+ return true;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.java b/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.java
index 7bed1f4c92..c1a68a57bf 100644
--- a/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.java
+++ b/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.java
@@ -101,6 +101,8 @@ import io.onedev.server.web.page.project.NewProjectPage;
import io.onedev.server.web.page.project.NoProjectStoragePage;
import io.onedev.server.web.page.project.ProjectListPage;
import io.onedev.server.web.page.project.blob.ProjectBlobPage;
+import io.onedev.server.web.page.project.wiki.ProjectWikiPage;
+import io.onedev.server.web.page.project.setting.wiki.WikiSettingPage;
import io.onedev.server.web.page.project.branches.ProjectBranchesPage;
import io.onedev.server.web.page.project.builds.ProjectBuildsPage;
import io.onedev.server.web.page.project.builds.detail.InvalidBuildPage;
@@ -427,6 +429,8 @@ public class BaseUrlMapper extends CompoundRequestMapper {
add(new ProjectPageMapper("${project}", ProjectOverviewPage.class));
+ add(new ProjectPageMapper("${project}/~wiki", ProjectWikiPage.class));
+ add(new ProjectPageMapper("${project}/~settings/wiki", WikiSettingPage.class));
add(new ProjectPageMapper("${project}/~files", ProjectBlobPage.class));
add(new ProjectPageMapper("${project}/~commits", ProjectCommitsPage.class));
add(new ProjectPageMapper("${project}/~commits/${commit}", CommitDetailPage.class));
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/NewProjectPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/NewProjectPage.java
index e94bc41739..200b7ec20d 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/NewProjectPage.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/NewProjectPage.java
@@ -1,6 +1,7 @@
package io.onedev.server.web.page.project;
import static io.onedev.server.model.Project.PROP_CODE_MANAGEMENT;
+import static io.onedev.server.model.Project.PROP_WIKI_MANAGEMENT;
import static io.onedev.server.model.Project.PROP_DESCRIPTION;
import static io.onedev.server.model.Project.PROP_ISSUE_MANAGEMENT;
import static io.onedev.server.model.Project.PROP_KEY;
@@ -57,7 +58,7 @@ public class NewProjectPage extends LayoutPage {
Project editProject = new Project();
Collection<String> properties = Sets.newHashSet(PROP_NAME, PROP_KEY, PROP_DESCRIPTION,
- PROP_CODE_MANAGEMENT, PROP_PACK_MANAGEMENT, PROP_ISSUE_MANAGEMENT,
+ PROP_CODE_MANAGEMENT, PROP_WIKI_MANAGEMENT, PROP_PACK_MANAGEMENT, PROP_ISSUE_MANAGEMENT,
PROP_TIME_TRACKING);
DefaultRolesBean defaultRolesBean = new DefaultRolesBean();
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.java
index 17e41894d4..1833c327ab 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.java
@@ -64,6 +64,8 @@ import io.onedev.server.web.page.layout.LayoutPage;
import io.onedev.server.web.page.layout.SidebarMenu;
import io.onedev.server.web.page.layout.SidebarMenuItem;
import io.onedev.server.web.page.project.blob.ProjectBlobPage;
+import io.onedev.server.web.page.project.wiki.ProjectWikiPage;
+import io.onedev.server.web.page.project.setting.wiki.WikiSettingPage;
import io.onedev.server.web.page.project.branches.ProjectBranchesPage;
import io.onedev.server.web.page.project.builds.ProjectBuildsPage;
import io.onedev.server.web.page.project.builds.detail.BuildDetailPage;
@@ -250,6 +252,12 @@ public abstract class ProjectPage extends LayoutPage implements ProjectAware, Ch
Lists.newArrayList(WorkspaceDetailPage.class)));
}
+ if (getProject().isCodeManagement() && getProject().isWikiManagement()
+ && SecurityUtils.canAccessProject(getProject())) {
+ menuItems.add(new SidebarMenuItem.Page("wiki", _T("Wiki"),
+ ProjectWikiPage.class, ProjectWikiPage.paramsOf(getProject())));
+ }
+
List<SidebarMenuItem> statsMenuItems = new ArrayList<>();
if (getProject().isCodeManagement() && SecurityUtils.canReadCode(getProject())) {
@@ -316,6 +324,9 @@ public abstract class ProjectPage extends LayoutPage implements ProjectAware, Ch
settingMenuItems.add(new SidebarMenuItem.Page(null, _T("Cache Management"),
CacheManagementPage.class, CacheManagementPage.paramsOf(getProject())));
+ settingMenuItems.add(new SidebarMenuItem.Page(null, _T("Wiki"),
+ WikiSettingPage.class, WikiSettingPage.paramsOf(getProject())));
+
if (getSettingService().getServiceDeskSetting() != null && getProject().isIssueManagement()) {
settingMenuItems.add(new SidebarMenuItem.Page(null, _T("Service Desk"),
ServiceDeskSettingPage.class, ServiceDeskSettingPage.paramsOf(getProject())));
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.html b/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.html
index 78c0e60be6..821117890c 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.html
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.html
@@ -1,7 +1,7 @@
<wicket:panel>
<form wicket:id="form" class="upload-blobs">
<div class="modal-header">
- <h5 class="modal-title">Upload Files</h5>
+ <h5 class="modal-title"><wicket:t>Upload Files</wicket:t></h5>
<button wicket:id="close" type="button" class="close"><wicket:svg href="times" class="icon"/></button>
</div>
<div class="modal-body">
@@ -10,18 +10,18 @@
<div wicket:id="files" class="files"></div>
</div>
<div class="form-group">
- <label>Directory</label>
+ <label><wicket:t>Directory</wicket:t></label>
<input wicket:id="directory" class="form-control"></input>
- <p class="form-text text-muted">Optionally specify relative directory to put uploaded files</p>
+ <p class="form-text text-muted"><wicket:t>Specify a folder relative to the repository root. Leave empty to upload to the root folder.</wicket:t></p>
</div>
<div class="form-group">
- <label>Commit Message</label>
+ <label><wicket:t>Commit Message</wicket:t></label>
<textarea wicket:id="commitMessage" class="form-control" t:placeholder="Add files via upload" rows="6"></textarea>
</div>
</div>
<div class="modal-footer">
- <button wicket:id="upload" class="btn btn-primary">Upload</button>
- <button wicket:id="cancel" class="btn btn-secondary">Cancel</button>
+ <button wicket:id="upload" class="btn btn-primary"><wicket:t>Upload</wicket:t></button>
+ <button wicket:id="cancel" class="btn btn-secondary"><wicket:t>Cancel</wicket:t></button>
</div>
</form>
</wicket:panel>
\ No newline at end of file
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.java
index a432e11457..f989edb58f 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/BlobUploadPanel.java
@@ -5,7 +5,7 @@ import io.onedev.server.service.SettingService;
import io.onedev.server.model.Project;
import io.onedev.server.web.behavior.ReferenceInputBehavior;
import io.onedev.server.web.component.dropzonefield.DropzoneField;
-import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
+import io.onedev.server.web.upload.FileUpload;
import io.onedev.server.web.upload.UploadService;
import static io.onedev.server.web.translation.Translation._T;
@@ -25,8 +25,6 @@ import org.apache.wicket.util.lang.Bytes;
import org.eclipse.jgit.lib.ObjectId;
public abstract class BlobUploadPanel extends Panel {
-
- private final BlobRenderContext context;
private String directory;
@@ -34,9 +32,9 @@ public abstract class BlobUploadPanel extends Panel {
private String uploadId;
- public BlobUploadPanel(String id, BlobRenderContext context) {
+ public BlobUploadPanel(String id, String defaultDirectory) {
super(id);
- this.context = context;
+ directory = defaultDirectory;
}
@Override
@@ -83,7 +81,7 @@ public abstract class BlobUploadPanel extends Panel {
var upload = getUploadService().getUpload(uploadId);
try {
- onCommitted(target, context.uploadFiles(upload, directory, commitMessage));
+ onCommitted(target, uploadFiles(upload, directory, commitMessage));
} finally {
upload.clear();
}
@@ -103,7 +101,7 @@ public abstract class BlobUploadPanel extends Panel {
@Override
protected Project getProject() {
- return context.getProject();
+ return BlobUploadPanel.this.getProject();
}
};
@@ -124,6 +122,10 @@ public abstract class BlobUploadPanel extends Panel {
return OneDev.getInstance(UploadService.class);
}
+ protected abstract Project getProject();
+
+ protected abstract ObjectId uploadFiles(FileUpload upload, String directory, String commitMessage);
+
public abstract void onCommitted(AjaxRequestTarget target, ObjectId commitId);
public abstract void onCancel(AjaxRequestTarget target);
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
index f50139ec8c..7690101cc4 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
@@ -487,7 +487,17 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,
@Override
protected Component newContent(String id, ModalPanel modal) {
- return new BlobUploadPanel(id, ProjectBlobPage.this) {
+ return new BlobUploadPanel(id, getDirectory()) {
+
+ @Override
+ protected Project getProject() {
+ return ProjectBlobPage.this.getProject();
+ }
+
+ @Override
+ protected ObjectId uploadFiles(FileUpload upload, String directory, String commitMessage) {
+ return ProjectBlobPage.this.uploadFiles(upload, directory, commitMessage);
+ }
@Override
public void onCancel(AjaxRequestTarget target) {
@@ -1605,15 +1615,8 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,
public ObjectId uploadFiles(FileUpload upload, String directory, String commitMessage) {
Map<String, BlobContent> newBlobs = new HashMap<>();
- String parentPath = getDirectory();
-
- if (directory != null) {
- if (parentPath != null)
- parentPath += "/" + directory;
- else
- parentPath = directory;
- }
-
+ String parentPath = directory;
+
User user = Preconditions.checkNotNull(SecurityUtils.getAuthUser());
BlobIdent blobIdent = getBlobIdent();
@@ -1622,6 +1625,9 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,
String blobPath = FilenameUtils.sanitizeFileName(FileUpload.getFileName(item));
if (parentPath != null)
blobPath = parentPath + "/" + blobPath;
+ blobPath = GitUtils.normalizePath(blobPath);
+ if (blobPath == null)
+ throw new BlobEditException("Invalid upload path");
var blobType = FileExtension.getExtension(blobPath);
var disallowedFileTypes = getProject().getBranchProtection(blobIdent.revision, user).getDisallowedFileTypes();
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/project-blob.css b/server-core/src/main/java/io/onedev/server/web/page/project/blob/project-blob.css
index 2cf1f1ce17..cda049daa1 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/project-blob.css
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/project-blob.css
@@ -72,21 +72,3 @@
.floating.get-code .card {
box-shadow: none;
}
-
-.markdown-rendered a+.missing, img+.missing {
- background: var(--light-danger);
- margin-left: 4px;
- padding: 0 2px;
-}
-.dark-mode .markdown-rendered a+.missing, .dark-mode img+.missing {
- background: var(--dark-mode-light-danger);
- color: var(--danger);
-}
-.markdown-rendered img+.missing {
- vertical-align: middle;
-}
-
-.markdown-rendered .missing+.add-missing {
- color: var(--success);
- margin-left: 4px;
-}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/BlobRenderContext.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/BlobRenderContext.java
index 3bf699782e..bfb28c12fd 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/BlobRenderContext.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/BlobRenderContext.java
@@ -102,6 +102,7 @@ public interface BlobRenderContext extends Serializable {
void onAddComment(AjaxRequestTarget target, PlanarRange range);
+ /** Upload to the specified repository-root-relative directory, or the root if null. */
ObjectId uploadFiles(FileUpload upload, @Nullable String directory, String commitMessage);
@Nullable
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/commitoption/CommitOptionPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/commitoption/CommitOptionPanel.java
index a1b5e78f4d..d176d4dd96 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/commitoption/CommitOptionPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/commitoption/CommitOptionPanel.java
@@ -3,6 +3,9 @@ package io.onedev.server.web.page.project.blob.render.commitoption;
import static io.onedev.server.web.translation.Translation._T;
import java.text.MessageFormat;
+
+import io.onedev.server.web.util.DefaultCommitMessage;
+import io.onedev.server.web.util.DefaultCommitMessage.Operation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -100,38 +103,22 @@ public class CommitOptionPanel extends Panel {
public String getDefaultCommitMessage() {
String oldPath = getOldPath();
- String oldName;
- if (oldPath != null && oldPath.contains("/"))
- oldName = StringUtils.substringAfterLast(oldPath, "/");
+ String newPath = newContentProvider != null ? context.getNewPath() : null;
+ Operation operation;
+ if (newContentProvider == null)
+ operation = Operation.DELETE;
+ else if (oldPath == null)
+ operation = Operation.ADD;
+ else if (oldPath.equals(newPath))
+ operation = Operation.EDIT;
else
- oldName = oldPath;
-
- String commitMessage;
- if (newContentProvider == null) {
- commitMessage = "Delete " + oldName;
- } else {
- String newPath = context.getNewPath();
-
- String newName;
- if (newPath != null && newPath.contains("/"))
- newName = StringUtils.substringAfterLast(newPath, "/");
- else
- newName = newPath;
-
- if (oldPath == null) {
- if (newName != null)
- commitMessage = MessageFormat.format(_T("Add {0}"), newName);
- else
- commitMessage = _T("Add new file");
- } else if (oldPath.equals(newPath)) {
- commitMessage = MessageFormat.format(_T("Edit {0}"), oldName);
- } else {
- commitMessage = MessageFormat.format(_T("Rename {0}"), oldName);
- }
- }
- if (context.getProject().getBranchProtection(context.getBlobIdent().revision, SecurityUtils.getUser()).getCommitMessageChecker() instanceof ConventionalCommitChecker)
- commitMessage = "chore: " + commitMessage;
- return commitMessage;
+ operation = Operation.RENAME;
+ String path = operation == Operation.ADD ? newPath : oldPath;
+ String name = path != null && path.contains("/") ? StringUtils.substringAfterLast(path, "/") : path;
+ boolean conventional = context.getProject()
+ .getBranchProtection(context.getBlobIdent().revision, SecurityUtils.getUser())
+ .getCommitMessageChecker() instanceof ConventionalCommitChecker;
+ return DefaultCommitMessage.generate(operation, name, _T("Add new file"), conventional);
}
private GitService getGitService() {
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/folder/FolderViewPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/folder/FolderViewPanel.java
index 15872e1ba0..032d664fb6 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/folder/FolderViewPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/folder/FolderViewPanel.java
@@ -45,8 +45,9 @@ import io.onedev.server.web.behavior.AbstractPostAjaxBehavior;
import io.onedev.server.web.behavior.CtrlAwareOnClickAjaxBehavior;
import io.onedev.server.web.component.blob.BlobIcon;
import io.onedev.server.web.component.link.ViewStateAwareAjaxLink;
-import io.onedev.server.web.component.markdown.MarkdownBlobViewer;
+import io.onedev.server.web.component.markdown.BlobMarkdownViewer;
import io.onedev.server.web.component.markdown.MarkdownOutlineDropdownLink;
+import io.onedev.server.web.component.markdown.MarkdownViewer;
import io.onedev.server.web.component.user.card.PersonCardPanel;
import io.onedev.server.web.page.project.blob.ProjectBlobPage;
import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
@@ -253,7 +254,7 @@ public class FolderViewPanel extends Panel {
}
});
- var markdown = new MarkdownBlobViewer("body", new LoadableDetachableModel<String>() {
+ var markdown = new BlobMarkdownViewer("body", new LoadableDetachableModel<String>() {
@Override
protected String load() {
@@ -277,7 +278,7 @@ public class FolderViewPanel extends Panel {
readmeContainer.add(new MarkdownOutlineDropdownLink("outline") {
@Override
- protected MarkdownBlobViewer getViewer() {
+ protected MarkdownViewer getViewer() {
return markdown;
}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/nocommits/NoCommitsPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/nocommits/NoCommitsPanel.java
index 4693e8c160..b0d0d2945c 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/nocommits/NoCommitsPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/nocommits/NoCommitsPanel.java
@@ -31,6 +31,7 @@ import io.onedev.server.web.component.modal.ModalLink;
import io.onedev.server.web.component.modal.ModalPanel;
import io.onedev.server.web.component.project.gitprotocol.GitProtocolPanel;
import io.onedev.server.web.page.project.blob.BlobUploadPanel;
+import io.onedev.server.web.upload.FileUpload;
import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
import io.onedev.server.web.page.project.blob.render.BlobRenderContext.Mode;
@@ -95,7 +96,17 @@ public class NoCommitsPanel extends Panel {
@Override
protected Component newContent(String id, ModalPanel modal) {
- return new BlobUploadPanel(id, context) {
+ return new BlobUploadPanel(id, null) {
+
+ @Override
+ protected Project getProject() {
+ return context.getProject();
+ }
+
+ @Override
+ protected ObjectId uploadFiles(FileUpload upload, String directory, String commitMessage) {
+ return context.uploadFiles(upload, directory, commitMessage);
+ }
@Override
public void onCancel(AjaxRequestTarget target) {
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditPanel.java
index e1963f51b6..806e043177 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditPanel.java
@@ -1,39 +1,40 @@
-package io.onedev.server.web.page.project.blob.render.renderers.markdown;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.markup.head.CssHeaderItem;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.html.form.FormComponentPanel;
-
-import io.onedev.server.web.component.diff.text.PlainTextDiffPanel;
-import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
-import io.onedev.server.web.page.project.blob.render.edit.BlobEditPanel;
-
-public class MarkdownBlobEditPanel extends BlobEditPanel {
-
- public MarkdownBlobEditPanel(String id, BlobRenderContext context) {
- super(id, context);
- }
-
- @Override
- public void renderHead(IHeaderResponse response) {
- super.renderHead(response);
- response.render(CssHeaderItem.forReference(new MarkdownBlobCssResourceReference()));
- }
-
- @Override
- protected FormComponentPanel<byte[]> newEditor(String componentId, byte[] initialContent) {
- return new MarkdownBlobEditor(componentId, context, initialContent);
- }
-
- @Override
- protected Component newChangesViewer(String componentId, byte[] initialContent, byte[] editingContent) {
- var oldLines = Arrays.asList(new String(initialContent, StandardCharsets.UTF_8).split("\n"));
- var newLines = Arrays.asList(new String(editingContent, StandardCharsets.UTF_8).split("\n"));
- return new PlainTextDiffPanel(componentId, oldLines, newLines, true, context.getBlobIdent().path);
- }
-
-}
+package io.onedev.server.web.page.project.blob.render.renderers.markdown;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.html.form.FormComponentPanel;
+
+import io.onedev.server.web.component.diff.text.PlainTextDiffPanel;
+import io.onedev.server.web.component.markdown.BlobMarkdownEditor;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
+import io.onedev.server.web.page.project.blob.render.edit.BlobEditPanel;
+
+public class MarkdownBlobEditPanel extends BlobEditPanel {
+
+ public MarkdownBlobEditPanel(String id, BlobRenderContext context) {
+ super(id, context);
+ }
+
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ response.render(CssHeaderItem.forReference(new MarkdownBlobCssResourceReference()));
+ }
+
+ @Override
+ protected FormComponentPanel<byte[]> newEditor(String componentId, byte[] initialContent) {
+ return new BlobMarkdownEditor(componentId, context, initialContent);
+ }
+
+ @Override
+ protected Component newChangesViewer(String componentId, byte[] initialContent, byte[] editingContent) {
+ var oldLines = Arrays.asList(new String(initialContent, StandardCharsets.UTF_8).split("\n"));
+ var newLines = Arrays.asList(new String(editingContent, StandardCharsets.UTF_8).split("\n"));
+ return new PlainTextDiffPanel(componentId, oldLines, newLines, true, context.getBlobIdent().path);
+ }
+
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.html b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.html
deleted file mode 100644
index 5f5ee6edd1..0000000000
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<wicket:panel>
- <div wicket:id="input" class="no-autosize d-flex flex-grow-1 flex-column autofit"></div>
-</wicket:panel>
\ No newline at end of file
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.java
deleted file mode 100644
index f5d09397ec..0000000000
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package io.onedev.server.web.page.project.blob.render.renderers.markdown;
-
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.Strings;
-import org.apache.wicket.behavior.AttributeAppender;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
-import org.apache.wicket.markup.html.form.FormComponentPanel;
-import org.apache.wicket.model.Model;
-import org.jetbrains.annotations.Nullable;
-
-import com.google.common.collect.Sets;
-
-import io.onedev.server.OneDev;
-import io.onedev.server.markdown.MarkdownService;
-import io.onedev.server.model.Build;
-import io.onedev.server.model.Issue;
-import io.onedev.server.model.Project;
-import io.onedev.server.model.PullRequest;
-import io.onedev.server.model.User;
-import io.onedev.server.model.Workspace;
-import io.onedev.server.search.entity.issue.IssueQuery;
-import io.onedev.server.search.entity.pullrequest.PullRequestQuery;
-import io.onedev.server.security.SecurityUtils;
-import io.onedev.server.service.BuildService;
-import io.onedev.server.service.IssueService;
-import io.onedev.server.service.PullRequestService;
-import io.onedev.server.service.UserService;
-import io.onedev.server.util.ContentDetector;
-import io.onedev.server.util.ProjectScope;
-import io.onedev.server.util.Similarities;
-import io.onedev.server.util.facade.UserCache;
-import io.onedev.server.web.component.markdown.AtWhoReferenceSupport;
-import io.onedev.server.web.component.markdown.MarkdownEditor;
-import io.onedev.server.web.component.markdown.UserMentionSupport;
-import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
-import io.onedev.server.web.page.project.blob.render.BlobRenderContext.Mode;
-import io.onedev.server.workspace.WorkspaceService;
-
-class MarkdownBlobEditor extends FormComponentPanel<byte[]> {
-
- private final BlobRenderContext context;
-
- private MarkdownEditor input;
-
- public MarkdownBlobEditor(String id, BlobRenderContext context, byte[] initialContent) {
- super(id, Model.of(initialContent));
-
- this.context = context;
- }
-
- @Override
- protected void onInitialize() {
- super.onInitialize();
-
- Charset detectedCharset = ContentDetector.detectCharset(getModelObject());
- Charset charset = detectedCharset!=null?detectedCharset:Charset.defaultCharset();
- add(input = new MarkdownEditor("input", Model.of(new String(getModelObject(), charset)),
- false, context) {
-
- @Override
- protected String renderMarkdown(String markdown) {
- MarkdownService manager = OneDev.getInstance(MarkdownService.class);
- return manager.process(manager.render(markdown), context.getProject(), context, null, false);
- }
-
- @Nullable
- @Override
- protected String getAutosaveKey() {
- return context.getEditorAutosaveKey();
- }
-
- @Override
- protected boolean shouldTrimInput() {
- return false;
- }
-
- @Override
- protected UserMentionSupport getUserMentionSupport() {
- return new UserMentionSupport() {
-
- @Override
- public List<User> findUsers(String query, int count) {
- UserCache cache = OneDev.getInstance(UserService.class).cloneCache();
- List<User> users = new ArrayList<>(cache.getUsers());
- users.sort(cache.comparingDisplayName(Sets.newHashSet()));
-
- users = new Similarities<User>(users) {
-
- @Override
- public double getSimilarScore(User object) {
- return cache.getSimilarScore(object, query);
- }
-
- };
-
- if (users.size() > count)
- return users.subList(0, count);
- else
- return users;
- }
-
- };
- }
-
- @Override
- protected AtWhoReferenceSupport getReferenceSupport() {
- return new AtWhoReferenceSupport() {
-
- @Override
- public Project getCurrentProject() {
- return context.getProject();
- }
-
- @Override
- public List<PullRequest> queryPullRequests(Project project, String query, int count) {
- var subject = SecurityUtils.getSubject();
- if (SecurityUtils.canReadCode(subject, project)) {
- var requestQuery = new PullRequestQuery(new io.onedev.server.search.entity.pullrequest.FuzzyCriteria(query));
- return OneDev.getInstance(PullRequestService.class).query(subject, project, requestQuery, false, 0, count);
- } else {
- return new ArrayList<>();
- }
- }
-
- @Override
- public List<Issue> queryIssues(Project project, String query, int count) {
- var subject = SecurityUtils.getSubject();
- if (SecurityUtils.canAccessProject(subject, project)) {
- var projectScope = new ProjectScope(project, false, false);
- var issueQuery = new IssueQuery(new io.onedev.server.search.entity.issue.FuzzyCriteria(query));
- return OneDev.getInstance(IssueService.class).query(subject, projectScope, issueQuery, false, 0, count);
- } else {
- return new ArrayList<>();
- }
- }
-
- @Override
- public List<Build> queryBuilds(Project project, String query, int count) {
- var subject = SecurityUtils.getSubject();
- return OneDev.getInstance(BuildService.class).query(subject, project, query, count);
- }
-
- @Override
- public List<Workspace> queryWorkspaces(Project project, String query, int count) {
- return OneDev.getInstance(WorkspaceService.class).query(SecurityUtils.getSubject(), project, query, count);
- }
-
- };
- }
-
- });
-
- if (context.getMode() != Mode.EDIT)
- input.add(AttributeAppender.append("class", "no-autofocus"));
- input.setOutputMarkupId(true);
- }
-
- @Override
- public void convertInput() {
- String content = input.getConvertedInput();
- if (content != null) {
- /*
- * Textarea always uses CRLF as line ending, and below we change back to original EOL
- */
- String initialContent = input.getModelObject();
- if (initialContent == null || !initialContent.contains("\r\n"))
- content = Strings.CS.replace(content, "\r\n", "\n");
- setConvertedInput(content.getBytes(StandardCharsets.UTF_8));
- } else {
- setConvertedInput(new byte[0]);
- }
- }
-
- @Override
- public void renderHead(IHeaderResponse response) {
- super.renderHead(response);
- if (context.getMode() == Mode.EDIT) {
- String script = String.format("$('#%s textarea').focus();", input.getMarkupId());
- response.render(OnDomReadyHeaderItem.forScript(script));
- }
- }
-
-}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.html b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.html
index 06bb58319d..79874791be 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.html
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.html
@@ -4,6 +4,6 @@
<div wicket:id="outline" class="need-width"></div>
</div>
<wicket:fragment wicket:id="outlineOptionsFrag">
- <label class="checkbox"><input type="checkbox" wicket:id="outline" class="outline-toggle"> <wicket:t>Outline</wicket:t></label>
+ <label class="checkbox markdown-outline-option"><input type="checkbox" wicket:id="outline" class="outline-toggle"> <wicket:t>Outline</wicket:t></label>
</wicket:fragment>
</wicket:extend>
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.java
index 3f9623fd86..60f6ac9b6e 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobViewPanel.java
@@ -11,7 +11,7 @@ import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.http.WebRequest;
import io.onedev.server.git.Blob;
-import io.onedev.server.web.component.markdown.MarkdownBlobViewer;
+import io.onedev.server.web.component.markdown.BlobMarkdownViewer;
import io.onedev.server.web.component.markdown.MarkdownOutlinePanel;
import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
import io.onedev.server.web.page.project.blob.render.view.BlobViewPanel;
@@ -34,7 +34,7 @@ public class MarkdownBlobViewPanel extends BlobViewPanel {
@Override
protected void onInitialize() {
Blob blob = context.getProject().getBlob(context.getBlobIdent(), true);
- var markdown = new MarkdownBlobViewer("markdown", Model.of(blob.getText().getContent()), null) {
+ var markdown = new BlobMarkdownViewer("markdown", Model.of(blob.getText().getContent()), null) {
@Override
protected BlobRenderContext getRenderContext() {
@@ -48,7 +48,6 @@ public class MarkdownBlobViewPanel extends BlobViewPanel {
add(markdown);
add(outline);
- outline.setTrigger(outlineToggle);
WebRequest request = (WebRequest) RequestCycle.get().getRequest();
var widthCookie = request.getCookie(COOKIE_OUTLINE_WIDTH);
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/markdown-blob.css b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/markdown-blob.css
index 0b3f24e9b2..131abf5585 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/markdown-blob.css
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/markdown-blob.css
@@ -17,3 +17,10 @@
.blob-edit .markdown-editor>.body>.preview>.markdown-rendered {
border-radius: 0 !important;
}
+
+@media (max-width: 991.98px) {
+ .markdown-outline-option,
+ .markdown-blob-view>.markdown-outline {
+ display: none !important;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/SourceViewPanel.html b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/SourceViewPanel.html
index bd51e80695..65304c3301 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/SourceViewPanel.html
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/SourceViewPanel.html
@@ -46,6 +46,6 @@
</form>
</wicket:fragment>
<wicket:fragment wicket:id="actionsFrag">
- <wicket:enclosure child="outline"><label class="checkbox"><input type="checkbox" wicket:id="outline" class="outline-toggle"><wicket:t>Outline</wicket:t></label></wicket:enclosure>
+ <wicket:enclosure child="outline"><label class="checkbox source-outline-option"><input type="checkbox" wicket:id="outline" class="outline-toggle"><wicket:t>Outline</wicket:t></label></wicket:enclosure>
</wicket:fragment>
</wicket:extend>
\ No newline at end of file
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/source-view.css b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/source-view.css
index 08cdb32d4b..573d39c0ba 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/source-view.css
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/source/source-view.css
@@ -122,3 +122,10 @@
.outline-search>.modal-body>.content {
height: 480px;
}
+
+@media (max-width: 991.98px) {
+ .source-outline-option,
+ .source-view>.outline {
+ display: none !important;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/overview/ProjectOverviewPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/overview/ProjectOverviewPage.java
index a21f342c2b..d33fcffc6d 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/overview/ProjectOverviewPage.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/overview/ProjectOverviewPage.java
@@ -79,8 +79,9 @@ import io.onedev.server.web.component.MultilineLabel;
import io.onedev.server.web.component.entity.labels.EntityLabelsPanel;
import io.onedev.server.web.component.issue.statestats.StateStatsBar;
import io.onedev.server.web.component.link.ViewStateAwarePageLink;
-import io.onedev.server.web.component.markdown.MarkdownBlobViewer;
+import io.onedev.server.web.component.markdown.BlobMarkdownViewer;
import io.onedev.server.web.component.markdown.MarkdownOutlineDropdownLink;
+import io.onedev.server.web.component.markdown.MarkdownViewer;
import io.onedev.server.web.component.modal.ModalLink;
import io.onedev.server.web.component.modal.ModalPanel;
import io.onedev.server.web.component.project.ProjectAvatar;
@@ -257,7 +258,7 @@ public class ProjectOverviewPage extends ProjectPage {
}
}));
- var markdown = new MarkdownBlobViewer("body", new LoadableDetachableModel<>() {
+ var markdown = new BlobMarkdownViewer("body", new LoadableDetachableModel<>() {
@Override
protected String load() {
@@ -450,7 +451,7 @@ public class ProjectOverviewPage extends ProjectPage {
readme.add(new MarkdownOutlineDropdownLink("outline") {
@Override
- protected MarkdownBlobViewer getViewer() {
+ protected MarkdownViewer getViewer() {
return markdown;
}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/general/GeneralProjectSettingPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/setting/general/GeneralProjectSettingPage.java
index 55df831425..0350cf024a 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/project/setting/general/GeneralProjectSettingPage.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/general/GeneralProjectSettingPage.java
@@ -1,6 +1,7 @@
package io.onedev.server.web.page.project.setting.general;
import static io.onedev.server.model.Project.PROP_CODE_MANAGEMENT;
+import static io.onedev.server.model.Project.PROP_WIKI_MANAGEMENT;
import static io.onedev.server.model.Project.PROP_DESCRIPTION;
import static io.onedev.server.model.Project.PROP_ISSUE_MANAGEMENT;
import static io.onedev.server.model.Project.PROP_KEY;
@@ -59,7 +60,7 @@ public class GeneralProjectSettingPage extends ProjectSettingPage {
super.onInitialize();
Collection<String> properties = Sets.newHashSet(PROP_NAME, PROP_KEY,
- PROP_DESCRIPTION, PROP_CODE_MANAGEMENT, PROP_PACK_MANAGEMENT,
+ PROP_DESCRIPTION, PROP_CODE_MANAGEMENT, PROP_WIKI_MANAGEMENT, PROP_PACK_MANAGEMENT,
PROP_ISSUE_MANAGEMENT, PROP_TIME_TRACKING);
DefaultRolesBean defaultRolesBean = new DefaultRolesBean();
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/wiki/WikiSettingPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/setting/wiki/WikiSettingPage.html
new file mode 100644
index 0000000000..4c0f0b50d8
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/wiki/WikiSettingPage.html
@@ -0,0 +1,10 @@
+<wicket:extend>
+ <div class="card">
+ <div class="card-body">
+ <form wicket:id="form" class="leave-confirm">
+ <div wicket:id="editor"></div>
+ <input class="btn btn-primary dirty-aware" t:value="Update" type="submit">
+ </form>
+ </div>
+ </div>
+</wicket:extend>
\ No newline at end of file
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/wiki/WikiSettingPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/setting/wiki/WikiSettingPage.java
new file mode 100644
index 0000000000..bb52fd6f4d
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/wiki/WikiSettingPage.java
@@ -0,0 +1,69 @@
+package io.onedev.server.web.page.project.setting.wiki;
+
+import static io.onedev.server.web.translation.Translation._T;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.Session;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import io.onedev.server.OneDev;
+import io.onedev.server.data.migration.VersionedXmlDoc;
+import io.onedev.server.service.ProjectService;
+import io.onedev.server.model.Project;
+import io.onedev.server.model.support.WikiSetting;
+import io.onedev.server.security.SecurityUtils;
+import io.onedev.server.web.component.link.ViewStateAwarePageLink;
+import io.onedev.server.web.editable.BeanContext;
+import io.onedev.server.web.page.project.ProjectPage;
+import io.onedev.server.web.page.project.overview.ProjectOverviewPage;
+import io.onedev.server.web.page.project.setting.ProjectSettingPage;
+
+public class WikiSettingPage extends ProjectSettingPage {
+
+ public WikiSettingPage(PageParameters params) {
+ super(params);
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+
+ WikiSetting bean = getProject().getWikiSetting();
+ var oldAuditContent = VersionedXmlDoc.fromBean(bean).toXML();
+ Form<?> form = new Form<Void>("form") {
+
+ @Override
+ protected void onSubmit() {
+ super.onSubmit();
+
+ var newAuditContent = VersionedXmlDoc.fromBean(bean).toXML();
+ getProject().setWikiSetting(bean);
+ OneDev.getInstance(ProjectService.class).update(getProject());
+ auditService.audit(getProject(), "changed wiki settings", oldAuditContent, newAuditContent);
+ setResponsePage(WikiSettingPage.class, WikiSettingPage.paramsOf(getProject()));
+ Session.get().success(_T("Wiki settings updated"));
+ }
+
+ };
+ form.add(BeanContext.edit("editor", bean));
+
+ add(form);
+ }
+
+ @Override
+ protected Component newProjectTitle(String componentId) {
+ return new Label(componentId, "<span class='text-truncate'>" + _T("Wiki Settings") + "</span>").setEscapeModelStrings(false);
+ }
+
+ @Override
+ protected BookmarkablePageLink<Void> navToProject(String componentId, Project project) {
+ if (SecurityUtils.canManageProject(project))
+ return new ViewStateAwarePageLink<Void>(componentId, WikiSettingPage.class, paramsOf(project.getId()));
+ else
+ return new ViewStateAwarePageLink<Void>(componentId, ProjectOverviewPage.class, ProjectPage.paramsOf(project.getId()));
+ }
+
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/wiki/ProjectWikiPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/ProjectWikiPage.html
new file mode 100644
index 0000000000..f406fe9ed5
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/ProjectWikiPage.html
@@ -0,0 +1,84 @@
+<wicket:extend>
+ <div wicket:id="empty" class="bg-white flex-grow-1 d-flex flex-column p-5">
+ <div class="alert alert-notice alert-light-warning">
+ <wicket:t>Home page not found</wicket:t>
+ <a wicket:id="addHome" class="ml-2" t:data-tippy-content="Add home page" t:aria-label="Add home page"><wicket:svg href="plus" class="icon"></wicket:svg></a>
+ </div>
+ </div>
+ <div wicket:id="wiki" class="wiki bg-white flex-grow-1 d-flex flex-column">
+ <div class="head d-flex align-items-center justify-content-between flex-wrap px-3 flex-shrink-0 border-bottom">
+ <div class="d-flex flex-wrap align-items-center">
+ <a wicket:id="revision" class="revision-picker btn btn-light btn-sm mr-3 my-2"></a>
+ <div class="my-2 text-break d-flex align-items-baseline">
+ <h3 wicket:id="title" class="mb-0"></h3>
+ <div wicket:id="subtitle" class="text-muted ml-2"><wicket:t>in</wicket:t> <span wicket:id="folder"></span></div>
+ </div>
+ </div>
+ <div wicket:id="actions" class="py-2 d-flex align-items-center ml-3">
+ <div class="btn-group">
+ <a wicket:id="history" class="btn btn-light btn-hover-primary btn-sm btn-icon" t:data-tippy-content="Page history"><wicket:svg href="clock" class="icon"></wicket:svg></a>
+ <a wicket:id="edit" class="btn btn-light btn-hover-primary btn-sm btn-icon" t:data-tippy-content="Edit page"><wicket:svg href="edit" class="icon"></wicket:svg></a>
+ <a wicket:id="add" class="btn btn-light btn-hover-primary btn-sm btn-icon" t:data-tippy-content="Add page or upload files"><wicket:svg href="plus" class="icon"></wicket:svg></a>
+ <a wicket:id="delete" class="btn btn-light btn-hover-danger btn-sm btn-icon" t:data-tippy-content="Delete page"><wicket:svg href="trash" class="icon"></wicket:svg></a>
+ </div>
+ </div>
+ </div>
+ <div class="body autofit flex-grow-1 d-flex flex-column">
+ <div wicket:id="homeNotFound" class="p-5">
+ <div class="alert alert-notice alert-light-warning">
+ <wicket:t>Home page not found</wicket:t>
+ <a wicket:id="addHome" class="ml-2" t:data-tippy-content="Add home page" t:aria-label="Add home page"><wicket:svg href="plus" class="icon"></wicket:svg></a>
+ </div>
+ </div>
+ <div wicket:id="view" class="wiki-view flex-grow-1 d-flex overflow-hidden">
+ <main class="wiki-content flex-grow-1 overflow-auto p-4">
+ <div wicket:id="body"></div>
+ <a wicket:id="addHome" class="d-inline-block mt-3"><wicket:t>Add Home page</wicket:t></a>
+ </main>
+ <aside wicket:id="navigation" class="wiki-navigation markdown-outline side need-width">
+ <div class="ui-resizable-handle ui-resizable-w flex-shrink-0"></div>
+ <div class="navigation-content flex-grow-1 overflow-auto p-3">
+ <details class="wiki-pages border-bottom pb-3 mb-3">
+ <summary class="font-weight-bolder"><span class="ml-2"><wicket:t>Pages</wicket:t></span></summary>
+ <ul class="list-unstyled mt-2 mb-0">
+ <li wicket:id="pages" class="mb-2">
+ <div class="d-flex align-items-center">
+ <a wicket:id="expand" class="page-expand mr-1" t:aria-label="Toggle page outline"><span class="page-expand-indicator" aria-hidden="true"></span></a>
+ <a wicket:id="page" class="text-break"><span wicket:id="name"></span></a>
+ </div>
+ <div wicket:id="outline" class="wiki-page-outline"></div>
+ </li>
+ </ul>
+ </details>
+ <div wicket:id="sidebar" class="mb-4"></div>
+ <div wicket:id="currentOutline" class="wiki-page-outline mb-4"></div>
+ <div class="d-flex flex-wrap align-items-center">
+ <a wicket:id="sidebarEdit" class="btn btn-outline-secondary btn-sm mr-2 mb-2"><span wicket:id="label"></span></a>
+ <a wicket:id="useDefault" class="btn btn-outline-secondary btn-sm mb-2"><wicket:t>Use default</wicket:t></a>
+ </div>
+ </div>
+ </aside>
+ </div>
+ <form wicket:id="form" class="leave-confirm overflow-auto p-4">
+ <div wicket:id="feedback"></div>
+ <div wicket:id="editor"></div>
+ <input wicket:id="save" type="submit" class="btn btn-primary" t:value="Save page">
+ <a wicket:id="cancel" class="btn btn-light ml-2"><wicket:t>Cancel</wicket:t></a>
+ </form>
+ </div>
+ </div>
+ <wicket:fragment wicket:id="deleteConfirm">
+ <div class="modal-header"><h5 wicket:id="title" class="modal-title"></h5></div>
+ <form wicket:id="form">
+ <div class="modal-body">
+ <div wicket:id="feedback"></div>
+ <label><wicket:t>Commit message</wicket:t></label>
+ <textarea wicket:id="message" class="form-control" rows="3"></textarea>
+ </div>
+ <div class="modal-footer">
+ <button wicket:id="confirm" type="submit" class="btn btn-danger"><span wicket:id="label"></span></button>
+ <a wicket:id="cancel" class="btn btn-light"><wicket:t>Cancel</wicket:t></a>
+ </div>
+ </form>
+ </wicket:fragment>
+</wicket:extend>
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/wiki/ProjectWikiPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/ProjectWikiPage.java
new file mode 100644
index 0000000000..58274d7398
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/ProjectWikiPage.java
@@ -0,0 +1,913 @@
+package io.onedev.server.web.page.project.wiki;
+
+import static io.onedev.server.web.translation.Translation._T;
+
+import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.SerializationUtils;
+import javax.validation.ConstraintValidatorContext;
+
+import org.apache.shiro.authz.UnauthorizedException;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.CallbackParameter;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.feedback.FencedFeedbackPanel;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Element;
+import org.unbescape.javascript.JavaScriptEscape;
+
+import io.onedev.commons.utils.PathUtils;
+import io.onedev.server.OneDev;
+import io.onedev.server.validation.validator.PathValidator;
+import io.onedev.server.exception.NotFoundException;
+import io.onedev.server.git.BlobContent;
+import io.onedev.server.git.BlobEdits;
+import io.onedev.server.git.BlobIdent;
+import io.onedev.server.git.BlobIdentFilter;
+import io.onedev.server.git.GitUtils;
+import io.onedev.server.git.exception.BlobEditException;
+import io.onedev.server.git.exception.NotTreeException;
+import io.onedev.server.git.exception.ObjectAlreadyExistsException;
+import io.onedev.server.git.exception.ObsoleteCommitException;
+import io.onedev.server.git.service.GitService;
+import io.onedev.server.markdown.MarkdownService;
+import io.onedev.server.model.Project;
+import io.onedev.server.model.support.code.ConventionalCommitChecker;
+import io.onedev.server.search.commit.PathCriteria;
+import io.onedev.server.security.SecurityUtils;
+import io.onedev.server.util.CryptoUtils;
+import io.onedev.server.util.FileExtension;
+import io.onedev.server.util.FilenameUtils;
+import io.onedev.server.util.RevisionAndPath;
+import io.onedev.server.util.UrlUtils;
+import io.onedev.server.web.behavior.AbstractPostAjaxBehavior;
+import io.onedev.server.web.component.floating.FloatingPanel;
+import io.onedev.server.web.component.link.ViewStateAwarePageLink;
+import io.onedev.server.web.component.markdown.BlobMarkdownEditor;
+import io.onedev.server.web.component.markdown.BlobSelectionSupport;
+import io.onedev.server.web.component.markdown.BlobUploadSupport;
+import io.onedev.server.web.component.markdown.MarkdownViewer;
+import io.onedev.server.web.component.menu.MenuItem;
+import io.onedev.server.web.component.menu.MenuLink;
+import io.onedev.server.web.component.modal.ModalLink;
+import io.onedev.server.web.component.modal.ModalPanel;
+import io.onedev.server.web.component.revision.RevisionPicker;
+import io.onedev.server.web.page.project.ProjectPage;
+import io.onedev.server.web.page.project.blob.BlobUploadPanel;
+import io.onedev.server.web.page.project.commits.ProjectCommitsPage;
+import io.onedev.server.web.page.project.overview.ProjectOverviewPage;
+import io.onedev.server.web.upload.FileUpload;
+import io.onedev.server.web.util.DefaultCommitMessage;
+import io.onedev.server.web.util.DefaultCommitMessage.Operation;
+import io.onedev.server.web.util.WikiLinkResolver;
+import io.onedev.server.web.util.WikiUtils;
+import io.onedev.server.web.editable.BeanContext;
+import io.onedev.server.web.editable.BeanEditor;
+
+public class ProjectWikiPage extends ProjectPage {
+ private String revision;
+ private String page;
+ private final String folder;
+ private final boolean editing;
+ private final boolean creating;
+ private String returnPage;
+ private ObjectId commitId;
+ private WebMarkupContainer actions;
+
+ private WebMarkupContainer navigation;
+
+ private BeanEditor pageEditor;
+
+ private AbstractPostAjaxBehavior navigateBehavior;
+
+ public ProjectWikiPage(PageParameters params) {
+ super(params);
+ List<String> segments = new ArrayList<>();
+ for (int i = 0; i < params.getIndexedCount(); i++) {
+ String segment = params.get(i).toString();
+ if (!segment.isEmpty())
+ segments.add(segment);
+ }
+ RevisionAndPath revisionAndPath;
+ if (getProject().getDefaultBranch() == null) {
+ // Empty repositories have no revision to prefix page paths with yet.
+ revisionAndPath = new RevisionAndPath(null, segments.isEmpty() ? null : String.join("/", segments));
+ } else {
+ revisionAndPath = RevisionAndPath.parse(getProject(), segments);
+ }
+ revision = revisionAndPath.getRevision();
+ page = revisionAndPath.getPath() != null ? revisionAndPath.getPath() : "Home";
+ folder = getProject().getWikiFolder();
+ WikiUtils.pagePath(folder, page);
+ editing = params.get("edit").toBoolean(false);
+ creating = params.get("new").toBoolean(false);
+ returnPage = creating || editing && page.equals("_Sidebar")
+ ? params.get("return-page").toString("Home") : page;
+ WikiUtils.pagePath(folder, returnPage);
+ }
+
+ private GitService git() {
+ return OneDev.getInstance(GitService.class);
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+ add(navigateBehavior = new AbstractPostAjaxBehavior() {
+ @Override
+ protected void respond(AjaxRequestTarget target) {
+ var params = RequestCycle.get().getRequest().getRequestParameters();
+ String destination = params.getParameterValue("page").toString();
+ String hash = params.getParameterValue("hash").toString("");
+ if (!hash.isEmpty() && !hash.startsWith("#"))
+ throw new IllegalArgumentException("Invalid heading anchor");
+ selectPage(target, destination);
+ String url = urlFor(ProjectWikiPage.class, paramsOf(getProject(), revision, page)).toString() + hash;
+ pushState(target, JavaScriptEscape.escapeJavaScript(url), page);
+ target.appendJavaScript("onedev.server.wiki.scrollToHeading('"
+ + JavaScriptEscape.escapeJavaScript(hash) + "', true);");
+ }
+ });
+ if (revision != null)
+ commitId = getProject().getObjectId(revision, true).copy();
+ String path = WikiUtils.pagePath(folder, page);
+ String content = read(page);
+ if ((editing || creating) && !canEdit(path))
+ throw new UnauthorizedException();
+ if (commitId != null && content == null && !page.equals("Home") && !editing && !creating)
+ throw new NotFoundException("Wiki page not found: " + page);
+
+ boolean missingHome = content == null && !editing && !creating;
+ WebMarkupContainer empty = new WebMarkupContainer("empty");
+ empty.setVisible(getProject().getDefaultBranch() == null && !editing && !creating);
+ empty.add(link("addHome", "Home", true, false)
+ .setVisible(canEdit(WikiUtils.pagePath(folder, "Home"))));
+ add(empty);
+
+ WebMarkupContainer wiki = new WebMarkupContainer("wiki");
+ wiki.setVisible(!empty.isVisible());
+ wiki.setOutputMarkupId(true);
+ add(wiki);
+ wiki.add(new RevisionPicker("revision", new LoadableDetachableModel<Project>() {
+ @Override
+ protected Project load() {
+ return getProject();
+ }
+ }, revision, revision != null) {
+ @Override
+ protected void onSelect(AjaxRequestTarget target, String selected) {
+ setResponsePage(ProjectWikiPage.class, paramsOf(getProject(), selected, page));
+ }
+ }.setVisible(commitId != null));
+ wiki.add(new Label("title", creating ? _T("Add new page") : getWikiPageTitle()).setOutputMarkupId(true));
+ var subtitle = new WebMarkupContainer("subtitle") {
+ @Override
+ protected void onConfigure() {
+ super.onConfigure();
+ setVisible(!creating && folderOf(page) != null);
+ }
+ };
+ subtitle.setOutputMarkupPlaceholderTag(true);
+ subtitle.add(new Label("folder", new LoadableDetachableModel<String>() {
+ @Override
+ protected String load() {
+ return folderOf(page);
+ }
+ }));
+ wiki.add(subtitle);
+ wiki.add(newActions(path, content));
+ WebMarkupContainer homeNotFound = new WebMarkupContainer("homeNotFound");
+ homeNotFound.setVisible(missingHome);
+ homeNotFound.setOutputMarkupPlaceholderTag(true);
+ homeNotFound.add(link("addHome", "Home", true, false)
+ .setVisible(canEdit(WikiUtils.pagePath(folder, "Home"))));
+ wiki.add(homeNotFound);
+
+ WebMarkupContainer view = new WebMarkupContainer("view") {
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ if (!editing && !creating && commitId != null)
+ response.render(OnDomReadyHeaderItem.forScript(
+ "onedev.server.wiki.init('" + navigation.getMarkupId() + "', "
+ + navigateBehavior.getCallbackFunction(
+ CallbackParameter.explicit("page"),
+ CallbackParameter.explicit("hash")) + ", '"
+ + Base64.encodeBase64String(CryptoUtils.encrypt(
+ SerializationUtils.serialize(page))) + "');"));
+ }
+ };
+ view.setVisible(!editing && !creating && !missingHome);
+ view.setOutputMarkupPlaceholderTag(true);
+ view.add(viewer("body", content != null ? content : _T("This wiki page does not exist at this revision.")));
+ view.add(link("addHome", "Home", true, false).setVisible(read("Home") == null
+ && canEdit(WikiUtils.pagePath(folder, "Home"))));
+ navigation = new WebMarkupContainer("navigation");
+ navigation.setOutputMarkupId(true);
+ view.add(navigation);
+ String sidebar = read("_Sidebar");
+ navigation.add(viewer("sidebar", sidebar).setVisible(sidebar != null).setOutputMarkupPlaceholderTag(true));
+ navigation.add(new Label("currentOutline", new LoadableDetachableModel<String>() {
+ @Override
+ protected String load() {
+ return outline(read(page), "");
+ }
+ }).setEscapeModelStrings(false).setVisible(sidebar == null).setOutputMarkupPlaceholderTag(true));
+ navigation.add(newSidebarEdit());
+ navigation.add(newUseDefault(sidebar));
+ List<String> pages = new ArrayList<>();
+ if (commitId != null)
+ collectPages(folder, pages);
+ Collections.sort(pages);
+ navigation.add(new ListView<String>("pages", pages) {
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ String name = item.getModelObject();
+ var link = link("page", name, false, false);
+ link.add(AttributeModifier.replace("data-wiki-page", name));
+ link.add(new Label("name", name.replace('-', ' ')));
+ if (name.equals(page))
+ link.add(AttributeModifier.replace("aria-current", "page"));
+ item.add(link);
+ var outline = new Label("outline", new LoadableDetachableModel<String>() {
+ @Override
+ protected String load() {
+ String url = urlFor(ProjectWikiPage.class,
+ paramsOf(getProject(), revision, name)).toString();
+ return outline(read(name), url);
+ }
+ });
+ outline.setEscapeModelStrings(false).setVisible(false).setOutputMarkupPlaceholderTag(true);
+ item.add(outline);
+ item.add(new AjaxLink<Void>("expand") {
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ outline.setVisible(!outline.isVisible());
+ target.add(outline, this);
+ }
+
+ @Override
+ protected void onComponentTag(ComponentTag tag) {
+ super.onComponentTag(tag);
+ tag.put("aria-expanded", String.valueOf(outline.isVisible()));
+ }
+ });
+ }
+ });
+ wiki.add(view);
+
+ var bean = new WikiPageBean();
+ bean.setName(creating ? getPageParameters().get("initial-name").toString("") : page);
+ bean.setContent((creating || content == null ? "" : content).getBytes(StandardCharsets.UTF_8));
+ pageEditor = BeanContext.edit("editor", bean);
+ Form<Void> form = new Form<>("form");
+ form.add(pageEditor);
+ form.add(new Button("save") {
+ @Override
+ public void onSubmit() {
+ save(form, bean.getName(), new String(bean.getContent(), StandardCharsets.UTF_8),
+ bean.getCommitMessage(), false, content != null);
+ }
+ });
+ form.setVisible(editing || creating);
+ form.setOutputMarkupId(true);
+ form.add(new FencedFeedbackPanel("feedback", form));
+ form.add(link("cancel", returnPage, false, false));
+ wiki.add(form);
+ }
+
+ private String getEditedPageName() {
+ var bean = (WikiPageBean) pageEditor.getConvertedInput();
+ if (bean == null)
+ bean = (WikiPageBean) pageEditor.getModelObject();
+ return bean.getName();
+ }
+
+ public BlobMarkdownEditor newContentEditor(String id, IModel<byte[]> text) {
+ String path = WikiUtils.pagePath(folder, page);
+ return new BlobMarkdownEditor(id, text, null) {
+ private String getEditorPath() {
+ String pageName = getEditedPageName();
+ if (pageName != null && !pageName.isBlank()) {
+ String normalized = pageName.trim().replace(' ', '-');
+ if (PathValidator.checkPath(io.onedev.server.annotation.Path.Type.RELATIVE, normalized) == null)
+ return WikiUtils.pagePath(folder, normalized);
+ }
+ return path;
+ }
+
+ private String getRelativeUrl(String selectedPath) {
+ String relativePath = PathUtils.relativize(folderOf(getEditorPath()), selectedPath);
+ return java.util.Arrays.stream(relativePath.split("/"))
+ .map(UrlUtils::encodePath).collect(java.util.stream.Collectors.joining("/"));
+ }
+
+ @Override
+ protected Project getProject() {
+ return ProjectWikiPage.this.getProject();
+ }
+
+ @Override
+ protected String getAutosaveKey() {
+ String pageName = creating ? getEditedPageName() : page;
+ if (pageName == null || pageName.isBlank())
+ return null;
+ try {
+ return io.onedev.server.web.page.project.blob.render.BlobRenderContext.getAutosaveKey(
+ getProject(), WikiUtils.pagePath(folder, creating ? pageName.trim().replace(' ', '-') : pageName));
+ } catch (IllegalArgumentException | io.onedev.server.exception.NotAcceptableException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public BlobUploadSupport getRepositoryUploadSupport() {
+ return new BlobUploadSupport() {
+ @Override
+ public Project getProject() {
+ return ProjectWikiPage.this.getProject();
+ }
+
+ @Override
+ public BlobIdent getBlobIdent() {
+ return new BlobIdent(commitId != null ? commitId.name() : null, folder, FileMode.TREE.getBits());
+ }
+
+ @Override
+ public String getDefaultDirectory() {
+ return folderOf(getEditorPath());
+ }
+
+
+ @Override
+ public String upload(FileUpload upload, String directory, String message) {
+ String uploadedPath;
+ try {
+ uploadedPath = uploadPath(directory, FileUpload.getFileName(upload.getItems().iterator().next()));
+ } catch (IllegalArgumentException e) {
+ throw new BlobEditException(e.getMessage());
+ }
+ commitId = ProjectWikiPage.this.uploadFiles(upload, directory, message);
+ if (revision == null) {
+ revision = "main";
+ getProject().setDefaultBranch(revision);
+ }
+ getProject().cacheObjectId(revision, commitId);
+ return getRelativeUrl(uploadedPath);
+ }
+
+ @Override
+ public String getPageReference(String url, String text) {
+ String uploadedPath = GitUtils.normalizePath(PathUtils.resolve(folderOf(getEditorPath()), UrlUtils.decodePath(url)));
+ if (WikiUtils.isUnderFolder(folder, uploadedPath) && uploadedPath.endsWith(".md"))
+ return WikiUtils.pageReference(folder, getEditorPath(), uploadedPath, text);
+ return null;
+ }
+ };
+ }
+
+ @Override
+ public BlobSelectionSupport getRepositoryFileSelectionSupport() {
+ return new BlobSelectionSupport() {
+ @Override
+ public Project getProject() {
+ return ProjectWikiPage.this.getProject();
+ }
+
+ @Override
+ public BlobIdent getBlobIdent() {
+ return new BlobIdent(commitId != null ? commitId.name() : null, path, FileMode.REGULAR_FILE.getBits());
+ }
+
+ @Override
+ public void onSelect(AjaxRequestTarget target, String selectedPath, boolean image, String label) {
+ if (!image && selectedPath.startsWith(folder + "/") && selectedPath.endsWith(".md")) {
+ insertText(target, WikiUtils.pageReference(folder, getEditorPath(), selectedPath, label));
+ } else {
+ var ident = new BlobIdent(revision, selectedPath, FileMode.REGULAR_FILE.getBits());
+ String url = getRelativeUrl(selectedPath);
+ insertUrl(target, image, url, label != null ? label : ident.getName(), null);
+ }
+ }
+ };
+ }
+
+ @Override
+ protected String renderMarkdown(String markdown) {
+ return ProjectWikiPage.this.render(markdown, getEditorPath());
+ }
+ };
+ }
+
+ public String getDefaultPageCommitMessage(String name) {
+ return defaultCommitMessage(name, false, !creating && read(page) != null);
+ }
+
+ public boolean validatePage(WikiPageBean bean, ConstraintValidatorContext context) {
+ String name = bean.getName();
+ if (name == null || name.isBlank())
+ return true; // The name property's constraint supplies this error.
+ name = name.trim().replace(' ', '-');
+ if (PathValidator.checkPath(io.onedev.server.annotation.Path.Type.RELATIVE, name) != null)
+ return true;
+ boolean valid = true;
+ if ((creating || !name.equals(page)) && commitId != null
+ && getProject().getBlob(new BlobIdent(commitId.name(), WikiUtils.pagePath(folder, name)), false) != null) {
+ context.disableDefaultConstraintViolation();
+ context.buildConstraintViolationWithTemplate(_T("A page with this name already exists."))
+ .addPropertyNode("name").addConstraintViolation();
+ valid = false;
+ }
+ String message = bean.getCommitMessage();
+ if (message == null || message.isBlank())
+ message = getDefaultPageCommitMessage(name);
+ String error = getProject().getBranchProtection(revision != null ? revision : "main", SecurityUtils.getAuthUser())
+ .checkCommitMessage(message, false);
+ if (error != null) {
+ context.disableDefaultConstraintViolation();
+ context.buildConstraintViolationWithTemplate(error).addPropertyNode("commitMessage").addConstraintViolation();
+ valid = false;
+ }
+ return valid;
+ }
+
+ private WebMarkupContainer newActions(String path, String content) {
+ actions = new WebMarkupContainer("actions");
+ actions.setOutputMarkupPlaceholderTag(true);
+ actions.setVisible(!editing && !creating && content != null);
+
+ actions.add(new MenuLink("add") {
+ @Override
+ protected List<MenuItem> getMenuItems(FloatingPanel dropdown) {
+ return List.of(new MenuItem() {
+ @Override
+ public String getLabel() {
+ return _T("Add page");
+ }
+
+ @Override
+ public WebMarkupContainer newLink(String id) {
+ return link(id, "New-page", false, true);
+ }
+ }, new MenuItem() {
+ @Override
+ public String getLabel() {
+ return _T("Upload files");
+ }
+
+ @Override
+ public WebMarkupContainer newLink(String id) {
+ return new ModalLink(id) {
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ super.onClick(target);
+ dropdown.close();
+ }
+
+ @Override
+ protected Component newContent(String id, ModalPanel modal) {
+ return new BlobUploadPanel(id, folderOf(path)) {
+ @Override
+ protected Project getProject() {
+ return ProjectWikiPage.this.getProject();
+ }
+
+ @Override
+ protected ObjectId uploadFiles(FileUpload upload, String directory, String message) {
+ try {
+ return ProjectWikiPage.this.uploadFiles(upload, directory, message);
+ } catch (IllegalArgumentException | NotTreeException | ObjectAlreadyExistsException e) {
+ throw new BlobEditException(e.getMessage());
+ }
+ }
+
+ @Override
+ public void onCommitted(AjaxRequestTarget target, ObjectId commitId) {
+ modal.close();
+ setResponsePage(ProjectWikiPage.class, paramsOf(getProject(), revision != null ? revision : "main", returnPage));
+ }
+
+ @Override
+ public void onCancel(AjaxRequestTarget target) {
+ modal.close();
+ }
+ };
+ }
+ };
+ }
+ });
+ }
+ }.setVisible(canEdit(WikiUtils.pagePath(folder, "New-page"))));
+ actions.add(new ViewStateAwarePageLink<Void>("history", ProjectCommitsPage.class,
+ ProjectCommitsPage.paramsOf(getProject(), new PathCriteria(List.of(path)).toString(),
+ commitId != null ? commitId.name() : null))
+ .setVisible(SecurityUtils.canReadCode(getProject()) && content != null));
+ actions.add(link("edit", page, true, false).setVisible(canEdit(path)));
+ actions.add(new AjaxLink<Void>("delete") {
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ showDeleteConfirm(target, page, null);
+ }
+ }.setVisible(canEdit(path) && content != null));
+
+ return actions;
+ }
+
+ private Component newSidebarEdit() {
+ var sidebarEdit = link("sidebarEdit", "_Sidebar", true, false);
+ sidebarEdit.add(new Label("label", _T("Customize")));
+ return sidebarEdit.setVisible(canEdit(WikiUtils.pagePath(folder, "_Sidebar")))
+ .setOutputMarkupPlaceholderTag(true);
+ }
+
+ private Component newUseDefault(String sidebar) {
+ return new AjaxLink<Void>("useDefault") {
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ showDeleteConfirm(target, "_Sidebar", page);
+ }
+ }.setVisible(sidebar != null && canEdit(WikiUtils.pagePath(folder, "_Sidebar")))
+ .setOutputMarkupPlaceholderTag(true);
+ }
+
+ private void selectPage(AjaxRequestTarget target, String destination) {
+ if (editing || creating || !isPermitted())
+ throw new UnauthorizedException();
+ WikiUtils.pagePath(folder, destination);
+ String content = read(destination);
+ if (content == null && !destination.equals("Home"))
+ throw new NotFoundException("Wiki page not found: " + destination);
+ page = destination;
+ returnPage = destination;
+ var wiki = (WebMarkupContainer) get("wiki");
+ wiki.get("title").setDefaultModelObject(getWikiPageTitle());
+ wiki.addOrReplace(newActions(WikiUtils.pagePath(folder, page), content));
+ wiki.get("homeNotFound").setVisible(content == null);
+ var view = (WebMarkupContainer) wiki.get("view");
+ if (view.isVisible() != (content != null))
+ target.add(view, wiki.get("homeNotFound"));
+ view.setVisible(content != null);
+ view.addOrReplace(viewer("body", content));
+ view.get("addHome").setVisible(read("Home") == null && canEdit(WikiUtils.pagePath(folder, "Home")));
+ String sidebar = read("_Sidebar");
+ navigation.get("currentOutline").setVisible(sidebar == null);
+ navigation.addOrReplace(newSidebarEdit());
+ navigation.addOrReplace(newUseDefault(sidebar));
+ navigation.addOrReplace(viewer("sidebar", sidebar)
+ .setVisible(sidebar != null).setOutputMarkupPlaceholderTag(true));
+ target.add(wiki.get("title"), wiki.get("subtitle"), actions, view.get("body"),
+ navigation.get("sidebar"), navigation.get("currentOutline"), navigation.get("sidebarEdit"), navigation.get("useDefault"));
+ target.appendJavaScript("onedev.server.wiki.onPageChanged('"
+ + JavaScriptEscape.escapeJavaScript(page) + "');");
+ }
+
+ @Override
+ protected void onPopState(AjaxRequestTarget target, Serializable data) {
+ super.onPopState(target, data);
+ selectPage(target, (String) data);
+ }
+
+ private String outline(String markdown, String pageUrl) {
+ String html = markdown != null ? OneDev.getInstance(MarkdownService.class).render(markdown) : "";
+ var result = new Element("div");
+ if (!html.isEmpty()) {
+ for (var heading : Jsoup.parseBodyFragment(html).select("h1, h2, h3, h4, h5, h6")) {
+ var anchor = heading.selectFirst("a[href^=#]:has(span.header-anchor)");
+ if (anchor != null) {
+ String href = anchor.attr("href");
+ anchor.remove();
+ int level = Integer.parseInt(heading.tagName().substring(1));
+ result.appendElement("a").attr("href", pageUrl + href)
+ .attr("class", "d-block text-break py-1")
+ .attr("style", "padding-left:" + ((level - 1) * 12) + "px")
+ .text(heading.text());
+ }
+ }
+ }
+ if (result.children().isEmpty())
+ result.appendElement("span").addClass("text-muted").text(_T("No headings"));
+ return result.html();
+ }
+
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ response.render(JavaScriptHeaderItem.forReference(new WikiResourceReference()));
+ }
+
+ private String uploadPath(String directory, String filename) {
+ String path = FilenameUtils.sanitizeFileName(filename);
+ if (directory != null && !directory.isBlank()) {
+ WikiUtils.validatePath(directory);
+ path = directory + "/" + path;
+ }
+ return WikiUtils.normalizePath(path);
+ }
+
+ private ObjectId uploadFiles(FileUpload upload, String directory, String message) {
+ if (!canEdit(WikiUtils.pagePath(folder, "New-page")))
+ throw new UnauthorizedException();
+ String branchName = revision != null ? GitUtils.ref2branch(getProject().getRef(revision).getName()) : "main";
+ var user = SecurityUtils.getAuthUser();
+ var protection = getProject().getBranchProtection(branchName, user);
+ String error = protection.checkCommitMessage(message, false);
+ if (error != null)
+ throw new BlobEditException(error);
+ Map<String, BlobContent> blobs = new HashMap<>();
+ for (var item : upload.getItems()) {
+ String path = uploadPath(directory, FileUpload.getFileName(item));
+ if (!SecurityUtils.canModifyFile(getProject(), branchName, path))
+ throw new BlobEditException(_T("Not allowed to modify this file"));
+ String type = FileExtension.getExtension(path);
+ if (protection.getDisallowedFileTypes().stream().anyMatch(it -> it.equalsIgnoreCase(type)))
+ throw new BlobEditException(MessageFormat.format(_T("Not allowed file type: {0}"), type));
+ blobs.put(path, new BlobContent(item.get(), FileMode.REGULAR_FILE.getBits()));
+ }
+ ObjectId previousCommitId = commitId != null ? commitId : ObjectId.zeroId();
+ try {
+ return git().commit(getProject(), new BlobEdits(Set.of(), blobs), GitUtils.branch2ref(branchName),
+ previousCommitId, previousCommitId, user.asPerson(), message, protection.isCommitSignatureRequired());
+ } catch (ObsoleteCommitException e) {
+ throw new BlobEditException(_T("The branch changed. Reload before uploading files."));
+ }
+ }
+
+ private void showDeleteConfirm(AjaxRequestTarget target, String name, String destination) {
+ Model<String> message = Model.of("");
+ actions.setVisible(false);
+ target.add(actions);
+ new ModalPanel(target) {
+ @Override
+ protected Component newContent(String id) {
+ Fragment fragment = new Fragment(id, "deleteConfirm", ProjectWikiPage.this);
+ fragment.add(new Label("title", destination != null ? _T("Use default sidebar?") : _T("Delete this wiki page?")));
+ Form<Void> deleteForm = new Form<>("form");
+ deleteForm.setOutputMarkupId(true);
+ deleteForm.add(new FencedFeedbackPanel("feedback", deleteForm));
+ deleteForm.add(newCommitMessageInput(message, Model.of(name), true, true));
+ deleteForm.add(new AjaxButton("confirm") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> submittedForm) {
+ save(deleteForm::error, name, null, message.getObject(), true, true, destination);
+ if (deleteForm.hasError())
+ target.add(deleteForm);
+ else
+ close();
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> submittedForm) {
+ target.add(deleteForm);
+ }
+ }.add(new Label("label", destination != null ? _T("Use default") : _T("Delete page"))));
+ deleteForm.add(new AjaxLink<Void>("cancel") {
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ close();
+ }
+ });
+ fragment.add(deleteForm);
+ return fragment;
+ }
+
+ @Override
+ protected void onClosed() {
+ actions.setVisible(true);
+ AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);
+ if (target != null)
+ target.add(actions);
+ }
+ };
+ }
+
+ private TextArea<String> newCommitMessageInput(Model<String> message, Model<String> name, boolean delete, boolean existed) {
+ TextArea<String> input = new TextArea<>("message", message);
+ input.setOutputMarkupId(true);
+ input.add(AttributeModifier.replace("placeholder", new LoadableDetachableModel<String>() {
+ @Override
+ protected String load() {
+ return defaultCommitMessage(name.getObject(), delete, existed);
+ }
+ }));
+ return input;
+ }
+
+ private String defaultCommitMessage(String name, boolean delete, boolean existed) {
+ String branchName = revision != null ? revision : "main";
+ boolean conventional = getProject().getBranchProtection(branchName, SecurityUtils.getUser())
+ .getCommitMessageChecker() instanceof ConventionalCommitChecker;
+ if (creating && name != null)
+ name = name.trim().replace(' ', '-');
+ return defaultCommitMessage(name, delete, existed, conventional);
+ }
+
+ private static String defaultCommitMessage(String name, boolean delete, boolean existed, boolean conventional) {
+ String pageName = name != null && !name.isBlank() ? name : null;
+ Operation operation = delete ? Operation.DELETE : existed ? Operation.EDIT : Operation.ADD;
+ return DefaultCommitMessage.generate(operation, pageName, _T("Add new page"), conventional);
+ }
+
+ private BookmarkablePageLink<Void> link(String id, String destination, boolean edit, boolean create) {
+ var params = paramsOf(getProject(), revision, destination);
+ if (edit) {
+ params.add("edit", true);
+ if (destination.equals("_Sidebar"))
+ params.add("return-page", returnPage);
+ }
+ if (create) {
+ params.add("new", true);
+ params.add("return-page", returnPage);
+ }
+ return new BookmarkablePageLink<>(id, ProjectWikiPage.class, params);
+ }
+
+ private String read(String name) {
+ if (commitId == null)
+ return null;
+ var blob = getProject().getBlob(new BlobIdent(commitId.name(), WikiUtils.pagePath(folder, name), FileMode.REGULAR_FILE.getBits()), false);
+ if (blob == null || blob.getText() == null || blob.getLfsPointer() != null || !blob.getIdent().isFile())
+ return null;
+ return blob.getText().getContent();
+ }
+
+ private void collectPages(String directory, List<String> pages) {
+ var ident = git().getBlobIdent(getProject(), commitId, directory);
+ if (ident != null && ident.isTree()) {
+ for (var child : git().getChildren(getProject(), commitId, directory, BlobIdentFilter.ALL, false)) {
+ if (child.isTree()) {
+ collectPages(child.path, pages);
+ } else if (child.isFile() && child.path.endsWith(".md")) {
+ String name = child.path.substring(folder.length() + 1, child.path.length() - 3);
+ if (!name.equals("_Sidebar"))
+ pages.add(name);
+ }
+ }
+ }
+ }
+
+ private String getWikiPageTitle() {
+ return page.substring(page.lastIndexOf('/') + 1).replace('-', ' ');
+ }
+
+ private String render(String markdown) {
+ return render(markdown, WikiUtils.pagePath(folder, page));
+ }
+
+ private String render(String markdown, String currentPath) {
+ if (markdown == null)
+ return "";
+ var service = OneDev.getInstance(MarkdownService.class);
+ String html = service.process(service.render(markdown), getProject(), null, null, false);
+ return new WikiLinkResolver(getProject(), revision, folder, currentPath, returnPage).resolve(html);
+ }
+
+ private static String folderOf(String path) {
+ int slash = path.lastIndexOf('/');
+ return slash >= 0 ? path.substring(0, slash) : null;
+ }
+
+ private boolean canEdit(String path) {
+ return folder.equals(getProject().getWikiFolder()) && SecurityUtils.canEditWikiPage(getProject(), revision, path);
+ }
+
+ private void save(Form<?> form, String name, String text, String message, boolean delete, boolean existed) {
+ save(form::error, name, text, message, delete, existed, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ private void save(java.util.function.Consumer<String> reportError, String name, String text, String message,
+ boolean delete, boolean existed, String destination) {
+ try {
+ if (name == null)
+ throw new IllegalArgumentException("Specify a page name");
+ name = delete ? name : name.trim().replace(' ', '-');
+ String path = WikiUtils.pagePath(folder, name);
+ String oldPath = WikiUtils.pagePath(folder, delete ? name : page);
+ var branch = revision != null ? getProject().getRef(revision) : getProject().getBranchRef("main");
+ if (commitId == null ? branch != null || getProject().getDefaultBranch() != null
+ : branch == null || !branch.getObjectId().equals(commitId)) {
+ reportError.accept(_T("The branch changed. Copy your edits and reload before saving."));
+ return;
+ }
+ if (!canEdit(path) || !creating && !canEdit(oldPath))
+ throw new UnauthorizedException();
+ String branchName = branch != null ? GitUtils.ref2branch(branch.getName()) : "main";
+ var protection = getProject().getBranchProtection(branchName, SecurityUtils.getAuthUser());
+ if (message == null || message.isBlank())
+ message = defaultCommitMessage(name, delete, !creating && existed,
+ protection.getCommitMessageChecker() instanceof ConventionalCommitChecker);
+ String error = protection.checkCommitMessage(message, false);
+ if (error != null) {
+ reportError.accept(error);
+ return;
+ }
+ if (!delete && (creating || !name.equals(page)) && commitId != null
+ && getProject().getBlob(new BlobIdent(commitId.name(), path, FileMode.REGULAR_FILE.getBits()), false) != null) {
+ reportError.accept(_T("A page with this name already exists."));
+ return;
+ }
+ Set<String> oldPaths = !creating && existed ? Set.of(oldPath) : Set.of();
+ Map<String, BlobContent> blobs = delete ? Map.of() : Map.of(path,
+ new BlobContent(text != null ? text.getBytes(StandardCharsets.UTF_8) : new byte[0], FileMode.REGULAR_FILE.getBits()));
+ ObjectId previousCommitId = commitId != null ? commitId : ObjectId.zeroId();
+ ObjectId newCommitId = git().commit(getProject(), new BlobEdits(oldPaths, blobs), GitUtils.branch2ref(branchName), previousCommitId, previousCommitId,
+ SecurityUtils.getAuthUser().asPerson(), message, protection.isCommitSignatureRequired());
+ String selectedPage = destination != null ? destination : delete || name.equals("_Sidebar") ? "Home" : name;
+ if (delete) {
+ commitId = newCommitId;
+ revision = branchName;
+ AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);
+ selectPage(target, selectedPage);
+ List<String> pages = new ArrayList<>();
+ collectPages(folder, pages);
+ Collections.sort(pages);
+ ((ListView<String>) navigation.get("pages")).setList(pages);
+ target.add(get("wiki"));
+ String url = urlFor(ProjectWikiPage.class, paramsOf(getProject(), revision, page)).toString();
+ pushState(target, JavaScriptEscape.escapeJavaScript(url), page);
+ target.appendJavaScript("onedev.server.wiki.scrollToHeading('', true);");
+ } else {
+ setResponsePage(ProjectWikiPage.class, paramsOf(getProject(), branchName, selectedPage));
+ }
+ } catch (ObsoleteCommitException e) {
+ reportError.accept(_T("The branch changed. Copy your edits and reload before saving."));
+ } catch (IllegalArgumentException | BlobEditException e) {
+ reportError.accept(e.getMessage());
+ }
+ }
+
+ public static PageParameters paramsOf(Project project, String revision, String page) {
+ var params = ProjectPage.paramsOf(project);
+ if (revision == null)
+ revision = RevisionAndPath.parse(project, Collections.emptyList()).getRevision();
+ int index = 0;
+ if (revision != null) {
+ for (String segment : revision.split("/"))
+ params.set(index++, segment);
+ }
+ if (page != null) {
+ for (String segment : page.split("/"))
+ params.set(index++, segment);
+ }
+ return params;
+ }
+
+ private Component viewer(String id, String markdown) {
+ return new MarkdownViewer(id, Model.of(markdown), null) {
+ @Override
+ protected String renderMarkdown(String markdown) {
+ return ProjectWikiPage.this.render(markdown);
+ }
+ };
+ }
+
+ @Override
+ protected boolean isPermitted() {
+ return getProject().isCodeManagement() && getProject().isWikiManagement()
+ && SecurityUtils.canAccessProject(getProject());
+ }
+
+ @Override
+ protected Component newProjectTitle(String id) {
+ return new Label(id, _T("Wiki"));
+ }
+
+ @Override
+ protected BookmarkablePageLink<Void> navToProject(String id, Project project) {
+ if (SecurityUtils.canAccessProject(project) && project.isCodeManagement() && project.isWikiManagement())
+ return new BookmarkablePageLink<Void>(id, ProjectWikiPage.class, ProjectPage.paramsOf(project));
+ return new BookmarkablePageLink<Void>(id, ProjectOverviewPage.class, ProjectPage.paramsOf(project));
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/wiki/WikiPageBean.java b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/WikiPageBean.java
new file mode 100644
index 0000000000..55e95d2ff2
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/WikiPageBean.java
@@ -0,0 +1,69 @@
+package io.onedev.server.web.page.project.wiki;
+
+import java.io.Serializable;
+
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.NotEmpty;
+
+import io.onedev.server.annotation.ClassValidating;
+import io.onedev.server.annotation.Editable;
+import io.onedev.server.annotation.Multiline;
+import io.onedev.server.annotation.OmitName;
+import io.onedev.server.annotation.Path;
+import io.onedev.server.util.EditContext;
+import io.onedev.server.util.HierarchicalContext;
+import io.onedev.server.validation.Validatable;
+
+@Editable
+@ClassValidating
+public class WikiPageBean implements Serializable, Validatable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+ private byte[] content = new byte[0];
+ private String commitMessage;
+
+ @Editable(order=100, name="Page name")
+ @NotEmpty
+ @Path(Path.Type.RELATIVE)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Editable(order=200)
+ @OmitName
+ public byte[] getContent() {
+ return content;
+ }
+
+ public void setContent(byte[] content) {
+ this.content = content;
+ }
+
+ @Editable(order=300, name="Commit message", placeholderProvider="getDefaultCommitMessage")
+ @Multiline
+ public String getCommitMessage() {
+ return commitMessage;
+ }
+
+ public void setCommitMessage(String commitMessage) {
+ this.commitMessage = commitMessage;
+ }
+
+ @SuppressWarnings("unused")
+ private static String getDefaultCommitMessage() {
+ String name = (String) EditContext.get().getInputValue("name");
+ return HierarchicalContext.get().findData(ProjectWikiPage.class).getDefaultPageCommitMessage(name);
+ }
+
+ @Override
+ public boolean isValid(ConstraintValidatorContext context) {
+ return HierarchicalContext.get().findData(ProjectWikiPage.class).validatePage(this, context);
+ }
+
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/wiki/WikiResourceReference.java b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/WikiResourceReference.java
new file mode 100644
index 0000000000..dc1e371e4e
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/WikiResourceReference.java
@@ -0,0 +1,27 @@
+package io.onedev.server.web.page.project.wiki;
+
+import java.util.List;
+
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.HeaderItem;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+
+import io.onedev.server.web.component.markdown.MarkdownResourceReference;
+import io.onedev.server.web.page.base.BaseDependentCssResourceReference;
+import io.onedev.server.web.page.base.BaseDependentResourceReference;
+
+public class WikiResourceReference extends BaseDependentResourceReference {
+
+ public WikiResourceReference() {
+ super(WikiResourceReference.class, "wiki.js");
+ }
+
+ @Override
+ public List<HeaderItem> getDependencies() {
+ var dependencies = super.getDependencies();
+ dependencies.add(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
+ dependencies.add(CssHeaderItem.forReference(new BaseDependentCssResourceReference(
+ WikiResourceReference.class, "wiki.css")));
+ return dependencies;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/wiki/wiki.css b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/wiki.css
new file mode 100644
index 0000000000..e3886a3ff7
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/wiki.css
@@ -0,0 +1,58 @@
+.wiki>.head {
+ position: sticky;
+ top: 0;
+ z-index: 10;
+ background: inherit;
+}
+.wiki .wiki-view,
+.wiki .wiki-content,
+.wiki .navigation-content {
+ min-width: 0;
+ min-height: 0;
+}
+.wiki .wiki-content .markdown-viewer>.markdown-rendered {
+ max-width: 900px;
+ margin: 0 auto;
+}
+.wiki .wiki-navigation {
+ width: 300px;
+ max-width: calc(100% - 80px);
+ position: relative;
+ left: 0 !important;
+}
+.wiki .navigation-content {
+ overflow-wrap: anywhere;
+}
+.wiki .wiki-pages summary {
+ cursor: pointer;
+}
+.wiki .page-expand {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ width: 1.2rem;
+ height: 1.5rem;
+}
+.wiki .page-expand-indicator {
+ width: 0;
+ height: 0;
+ border-top: 4px solid transparent;
+ border-bottom: 4px solid transparent;
+ border-left: 5px solid currentColor;
+}
+.wiki .page-expand[aria-expanded=true] .page-expand-indicator {
+ transform: rotate(90deg);
+}
+.wiki .wiki-pages .wiki-page-outline {
+ padding-left: 1.8rem;
+}
+.wiki .wiki-pages [aria-current=page] {
+ font-weight: 600;
+}
+
+@media (max-width: 991.98px) {
+ .wiki .wiki-navigation {
+ display: none !important;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/wiki/wiki.js b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/wiki.js
new file mode 100644
index 0000000000..0fdb1829a5
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/page/project/wiki/wiki.js
@@ -0,0 +1,112 @@
+onedev.server.wiki = {
+ init: function(navigationId, navigate, initialState) {
+ var $navigation = $("#" + navigationId);
+ var $view = $navigation.parent();
+ var width = parseInt(Cookies.get("wiki.navigation.width"));
+ if (!Number.isFinite(width))
+ width = 300;
+ $navigation.width(Math.max(160, Math.min(width, $view.width() - 80)));
+ $navigation.resizable({
+ autoHide: false,
+ handles: {w: $navigation.children(".ui-resizable-handle")},
+ minWidth: 160,
+ start: function() {
+ $(this).resizable("option", "maxWidth", Math.max(160, $view.width() - 300));
+ },
+ stop: function(e, ui) {
+ Cookies.set("wiki.navigation.width", ui.size.width, {expires: Infinity});
+ }
+ });
+ var pages = new Map();
+ $navigation.find("a[data-wiki-page]").each(function() {
+ var url = new URL(this.href);
+ pages.set(url.origin + url.pathname + url.search, $(this).attr("data-wiki-page"));
+ });
+ // Delegate from the view so links in Ajax-replaced content also update the page and sidebar.
+ $view.off("click.wikiNavigation").on("click.wikiNavigation", "a", function(e) {
+ if (e.isDefaultPrevented() || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey
+ || e.which > 1 || this.target || this.hasAttribute("download"))
+ return;
+ var url = new URL(this.href);
+ var destination = pages.get(url.origin + url.pathname + url.search);
+ if (destination === undefined)
+ return;
+ e.preventDefault();
+ var currentPage = $navigation.find("a[data-wiki-page][aria-current='page']")
+ .attr("data-wiki-page");
+ if (destination === currentPage) {
+ history.replaceState(history.state, "", url.href);
+ onedev.server.wiki.scrollToHeading(url.hash);
+ return;
+ }
+ onedev.server.viewState.getFromViewAndSetToHistory();
+ navigate(destination, url.hash);
+ });
+ var $body = $(".wiki>.body");
+ $body.off("getViewState.wiki setViewState.wiki")
+ .on("getViewState.wiki", function() {
+ var $content = $(".wiki-content");
+ return {scroll: {left: $content.scrollLeft(), top: $content.scrollTop()}};
+ })
+ .on("setViewState.wiki", function(e, state) {
+ if (state.scroll)
+ $(".wiki-content").scrollLeft(state.scroll.left).scrollTop(state.scroll.top);
+ });
+ if (!history.state || !history.state.data)
+ onedev.server.history.replaceState(window.location.href, initialState, document.title);
+ $(window).resize();
+ },
+ onPageChanged: function(page) {
+ var $navigation = $(".wiki-navigation");
+ $navigation.find("a[data-wiki-page]").each(function() {
+ if ($(this).attr("data-wiki-page") === page)
+ $(this).attr("aria-current", "page");
+ else
+ $(this).removeAttr("aria-current");
+ });
+ $(window).resize();
+ },
+ scrollToHeading: function(hash, waitForImages) {
+ var request = this.headingRequest = (this.headingRequest || 0) + 1;
+ $(".wiki-content").scrollTop(0).scrollLeft(0);
+ if (hash) {
+ var name;
+ try {
+ name = decodeURIComponent(hash.substring(1));
+ } catch (e) {
+ return;
+ }
+ var $heading = $(".wiki-content [id], .wiki-content a[name]").filter(function() {
+ return this.id === name || this.getAttribute("name") === name;
+ }).first();
+ if ($heading.length) {
+ if (waitForImages) {
+ // Lazy images above the heading can change its position after the Ajax response.
+ var loader = lozad();
+ var images = $(".wiki-content img").filter(function() {
+ return this.compareDocumentPosition($heading[0]) & Node.DOCUMENT_POSITION_FOLLOWING;
+ }).get();
+ Promise.all(images.map(function(image) {
+ return new Promise(function(resolve) {
+ function done() {
+ image.removeEventListener("load", done);
+ image.removeEventListener("error", done);
+ resolve();
+ }
+ image.addEventListener("load", done);
+ image.addEventListener("error", done);
+ loader.triggerLoad(image);
+ if (image.complete)
+ done();
+ });
+ })).then(function() {
+ if (request === onedev.server.wiki.headingRequest && $heading[0].isConnected)
+ $heading[0].scrollIntoView();
+ });
+ } else {
+ $heading[0].scrollIntoView();
+ }
+ }
+ }
+ }
+};
diff --git a/server-core/src/main/java/io/onedev/server/web/resource/RawBlobResource.java b/server-core/src/main/java/io/onedev/server/web/resource/RawBlobResource.java
index cffd7d1068..b34ed28448 100644
--- a/server-core/src/main/java/io/onedev/server/web/resource/RawBlobResource.java
+++ b/server-core/src/main/java/io/onedev/server/web/resource/RawBlobResource.java
@@ -28,7 +28,6 @@ import org.slf4j.LoggerFactory;
import com.google.common.base.Splitter;
-import io.onedev.commons.utils.ExplicitException;
import io.onedev.k8shelper.KubernetesHelper;
import io.onedev.server.OneDev;
import io.onedev.server.cluster.ClusterService;
@@ -43,6 +42,7 @@ import io.onedev.server.security.SecurityUtils;
import io.onedev.server.service.ProjectService;
import io.onedev.server.util.IOUtils;
import io.onedev.server.util.LongRange;
+import io.onedev.server.util.RevisionAndPath;
import io.onedev.server.web.mapper.ProjectMapperUtils;
import io.onedev.server.web.util.MimeUtils;
import io.onedev.server.web.util.WicketUtils;
@@ -67,20 +67,18 @@ public class RawBlobResource extends AbstractResource {
List<String> revisionAndPathSegments = new ArrayList<>();
for (int i = 0; i < params.getIndexedCount(); i++) {
String segment = params.get(i).toString();
- if (segment.contains(".."))
- throw new ExplicitException("Invalid request path");
if (segment.length() != 0)
revisionAndPathSegments.add(segment);
}
- BlobIdent blobIdent = new BlobIdent(project, revisionAndPathSegments);
+ RevisionAndPath revisionAndPath = RevisionAndPath.parse(project, revisionAndPathSegments);
- String revision = blobIdent.revision;
- String path = blobIdent.path;
+ String revision = revisionAndPath.getRevision();
+ String path = GitUtils.normalizePath(revisionAndPath.getPath());
if (StringUtils.isBlank(revision) || StringUtils.isBlank(path))
throw new NotAcceptableException("Revision and path should be specified");
- if (!SecurityUtils.canReadCode(project))
+ if (!SecurityUtils.canReadFile(project, path))
throw new UnauthorizedException();
final Blob blob = project.getBlob(new BlobIdent(revision, path, 0), true);
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.java
index 0ac2305103..96e45cd3e9 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.java
@@ -127,6 +127,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "Ein untergeordnetes Projekt mit dem Namen \"{0}\" existiert bereits unter \"{1}\"");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"Eine Datei existiert dort, wo Sie versuchen, ein Unterverzeichnis zu erstellen. Wählen Sie einen neuen Pfad und versuchen Sie es erneut.");
+ m.put("A page with this name already exists.", "Eine Seite mit diesem Namen existiert bereits.");
m.put("A path with same name already exists.Please choose a different name and try again.",
"Ein Pfad mit demselben Namen existiert bereits. Bitte wählen Sie einen anderen Namen und versuchen Sie es erneut.");
m.put("A pull request is open for this change", "Ein Pull-Request ist für diese Änderung geöffnet");
@@ -200,6 +201,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "Fügen Sie hier GPG-Schlüssel hinzu, um Commits/Tags zu verifizieren, die von Ihnen signiert wurden");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"Fügen Sie hier GPG-öffentliche Schlüssel hinzu, die vertrauenswürdig sind. Commits, die mit vertrauenswürdigen Schlüsseln signiert sind, werden als verifiziert angezeigt.");
+ m.put("Add Home page", "Startseite hinzufügen");
m.put("Add Issue...", "Problem hinzufügen...");
m.put("Add Issues to Iteration", "Probleme zur Iteration hinzufügen");
m.put("Add New", "Neu hinzufügen");
@@ -246,6 +248,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Add new import", "Neuen Import hinzufügen");
m.put("Add new issue creation setting", "Neue Einstellung für Issue-Erstellung hinzufügen");
m.put("Add new job dependency", "Neue Job-Abhängigkeit hinzufügen");
+ m.put("Add new page", "Neue Seite hinzufügen");
m.put("Add new param", "Neuen Parameter hinzufügen");
m.put("Add new post-build action", "Neue Post-Build-Aktion hinzufügen");
m.put("Add new project dependency", "Neue Projekt-Abhängigkeit hinzufügen");
@@ -253,6 +256,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Add new step", "Neuen Schritt hinzufügen");
m.put("Add new trigger", "Neuen Trigger hinzufügen");
m.put("Add new user data", "Neue Benutzerdaten hinzufügen");
+ m.put("Add page", "Seite hinzufügen");
+ m.put("Add page or upload files", "Seite hinzufügen oder Dateien hochladen");
m.put("Add project", "Projekt hinzufügen");
m.put("Add reviewer...", "Reviewer hinzufügen...");
m.put("Add to batch to commit with other suggestions later", "Zur Batch hinzufügen, um später mit anderen Vorschlägen zu committen");
@@ -302,6 +307,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("All AI users", "Alle KI-Benutzer");
m.put("All Issues", "Alle Issues");
m.put("All RESTful Resources", "Alle RESTful-Ressourcen");
+ m.put("All Types", "Alle Typen");
m.put("All accessible", "Alle zugänglich");
m.put("All builds", "Alle Builds");
m.put("All changes", "Alle Änderungen");
@@ -439,6 +445,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Authorize user...", "Benutzer autorisieren...");
m.put("Authorized Projects", "Autorisierte Projekte");
m.put("Authorized Roles", "Autorisierte Rollen");
+ m.put("Auto", "Auto");
m.put("Auto Merge", "Automatisches Zusammenführen");
m.put("Auto Spec", "Automatische Spezifikation");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -526,6 +533,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Branch Protection", "Branch-Schutz");
m.put("Branch Revision", "Branch-Revision");
m.put("Branch is created", "Branch wurde erstellt");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "Branch wurde aktualisiert. Bitte aktualisieren Sie die Seite und senden Sie den Job erneut");
m.put("Branch update", "Branch-Aktualisierung");
m.put("Branches", "Branches");
m.put("Brand Setting Edit Bean", "Markeneinstellungs-Bearbeitungs-Bean");
@@ -826,6 +834,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "Schreibberechtigung für Code ist für diese Operation erforderlich");
m.put("Collapse all", "Alle einklappen");
m.put("Color", "Farbe");
+ m.put("Color mode", "Farbmodus");
m.put("Columns", "Spalten");
m.put("Command", "Befehl");
m.put("Command Palette", "Befehls-Palette");
@@ -1023,7 +1032,9 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Current platform", "Aktuelle Plattform");
m.put("Current project", "Aktuelles Projekt");
m.put("Custom Headers", "Benutzerdefinierte Header");
+ m.put("Customize", "Anpassen");
m.put("DISCARDED", "VERWORFEN");
+ m.put("Dark", "Dunkel");
m.put("Dashboard Share Bean", "Dashboard-Share-Bean");
m.put("Dashboard name", "Dashboard-Name");
m.put("Dashboards", "Dashboards");
@@ -1117,6 +1128,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Delete chat", "Chat löschen");
m.put("Delete dashboard", "Dashboard löschen");
m.put("Delete from branch {0}", "Von Branch {0} löschen");
+ m.put("Delete page", "Seite löschen");
m.put("Delete this", "Dies löschen");
m.put("Delete this GPG key", "Diesen GPG-Schlüssel löschen");
m.put("Delete this access token", "Diesen Zugriffstoken löschen");
@@ -1133,6 +1145,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Delete this state", "Diesen Zustand löschen");
m.put("Delete this tag", "Diesen Tag löschen");
m.put("Delete this value", "Diesen Wert löschen");
+ m.put("Delete this wiki page?", "Diese Wiki-Seite löschen?");
m.put("Delete this workspace", "Diesen Arbeitsbereich löschen");
m.put("Delete this workspace data", "Daten dieses Arbeitsbereichs löschen");
m.put("Deleted by us, modified by them", "Von uns gelöscht, von ihnen geändert");
@@ -1266,6 +1279,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Dockerfile", "Dockerfile");
m.put("Documentation", "Dokumentation");
m.put("Don't have an account yet?", "Haben Sie noch kein Konto?");
+ m.put("Down", "Runter");
m.put("Download", "Herunterladen");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"Laden Sie <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> oder <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a> herunter. Ein neuer Agent-Token wird im Paket enthalten sein.");
@@ -1274,6 +1288,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Download log", "Protokoll herunterladen");
m.put("Download patch", "Patch herunterladen");
m.put("Download tag archive", "Tag-Archiv herunterladen");
+ m.put("Drop files here or click to upload", "Dateien hierher ziehen oder klicken, um hochzuladen");
m.put("Dry Run", "Trockener Lauf");
m.put("Due Date", "Fälligkeitsdatum");
m.put("Due Date Issue Field", "Fälligkeitsdatum-Feld");
@@ -1301,6 +1316,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Edit job", "Job bearbeiten");
m.put("Edit on branch {0}", "Bearbeiten im Branch {0}");
m.put("Edit on source branch", "Bearbeiten im Quell-Branch");
+ m.put("Edit page", "Seite bearbeiten");
m.put("Edit plain", "Einfach bearbeiten");
m.put("Edit saved queries", "Gespeicherte Abfragen bearbeiten");
m.put("Edit this access token", "Diesen Zugriffstoken bearbeiten");
@@ -2105,6 +2121,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("License Setting", "Lizenzeinstellung");
m.put("Licensed To", "Lizenziert für");
m.put("Licensed To:", "Lizenziert für:");
+ m.put("Light", "Hell");
m.put("Line", "Zeile");
m.put("Line: ", "Zeile:");
m.put("Lines", "Zeilen");
@@ -2167,6 +2184,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Mail Service Test", "Mail-Dienst-Test");
m.put("Mail service not configured", "Mail-Dienst nicht konfiguriert");
m.put("Mail service settings saved", "Mail-Dienst-Einstellungen gespeichert");
+ m.put("Main Repository", "Haupt-Repository");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"Stellen Sie sicher, dass <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 oder höher</a> installiert ist");
m.put("Make sure current user has permission to run docker containers", "Stellen Sie sicher, dass der aktuelle Benutzer die Berechtigung hat, Docker-Container auszuführen");
@@ -2219,6 +2237,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "Maximale Upload-Dateigröße (MB)");
m.put("Max Value", "Maximalwert");
m.put("Maximum number of entries to return when search code in repository", "Maximale Anzahl von Einträgen, die bei der Codesuche im Repository zurückgegeben werden");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "Maximale Anzahl, wie oft dieser KI-Benutzer in einer einzelnen Aufgabe aktiviert werden kann. Wenn das Limit erreicht ist, wird der KI-Benutzer nicht ausgeführt und stattdessen ein Systemkommentar gepostet");
m.put("Maximum of retries before giving up", "Maximale Anzahl von Wiederholungen, bevor aufgegeben wird");
m.put("May not be empty", "Darf nicht leer sein");
m.put("Medium", "Mittel");
@@ -2406,6 +2426,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("No group by", "Keine Gruppierung");
m.put("No groups claim returned", "Keine Gruppenansprüche zurückgegeben");
m.put("No groups to remove from", "Keine Gruppen zum Entfernen");
+ m.put("No headings", "Keine Überschriften");
m.put("No ignore file", "Keine Ignorierdatei");
m.put("No image attachments", "Keine Bildanhänge");
m.put("No imports defined", "Keine Importe definiert");
@@ -2474,6 +2495,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "Keine verifizierte E-Mail des signierenden GPG-Schlüssels");
m.put("Not a verified email of signing ssh key owner", "Nicht eine verifizierte E-Mail des Besitzers des signierenden SSH-Schlüssels");
m.put("Not allowed file type: {0}", "Nicht erlaubter Dateityp: {0}");
+ m.put("Not allowed to modify this file", "Keine Berechtigung, diese Datei zu ändern");
m.put("Not assigned", "Nicht zugewiesen");
m.put("Not authorized to create project under \"{0}\"", "Nicht berechtigt, ein Projekt unter \"{0}\" zu erstellen");
m.put("Not authorized to create root project", "Nicht berechtigt, ein Root-Projekt zu erstellen");
@@ -2904,7 +2926,10 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Package {0} deleted", "Paket {0} gelöscht");
m.put("Packages", "Pakete");
m.put("Page Not Found", "Seite nicht gefunden");
+ m.put("Page history", "Seitenverlauf");
m.put("Page is in error, reload to recover", "Seite ist fehlerhaft, neu laden, um sich zu erholen");
+ m.put("Page name", "Seitenname");
+ m.put("Pages", "Seiten");
m.put("Param Instance", "Parameterinstanz");
m.put("Param Instances", "Parameterinstanzen");
m.put("Param Map", "Parameterkarte");
@@ -2999,6 +3024,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Plain text expected", "Reiner Text erwartet");
m.put("Platform", "Plattform");
m.put("Platforms", "Plattformen");
+ m.put("Playwright Test Report", "Playwright-Testbericht");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"Bitte <a wicket:id=\"download\" class=\"font-weight-bolder\">laden</a> Sie die Wiederherstellungscodes unten herunter und bewahren Sie sie geheim. Diese Codes können verwendet werden, um einmaligen Zugriff auf Ihr Konto zu gewähren, falls Sie keinen Zugriff auf die Authentifizierungsanwendung haben. Sie werden <b>NICHT</b> erneut angezeigt");
m.put("Please Confirm", "Bitte bestätigen");
@@ -3352,6 +3378,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Remove this file", "Diese Datei entfernen");
m.put("Remove this image", "Entfernen Sie dieses Bild");
m.put("Remove this reviewer", "Entfernen Sie diesen Prüfer");
+ m.put("Rename", "Umbenennen");
m.put("Rename {0}", "Umbenennen {0}");
m.put("Renew Subscription", "Abonnement erneuern");
m.put("Renovate CLI Options", "Renovate CLI-Optionen");
@@ -3368,6 +3395,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"Berichtsformat geändert. Sie können diesen Build erneut ausführen, um den Bericht im neuen Format zu erstellen");
m.put("Repository Sync", "Repository-Synchronisation");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "Repository-Ordner mit Markdown-Wiki-Seiten. Leer lassen, um vom übergeordneten Element zu erben (Standard ist wiki). Verwenden Sie Home.md für die Startseite und _Sidebar.md für die Seitenleiste");
m.put("Reprovision workspace", "Arbeitsbereich neu bereitstellen");
m.put("Request Body", "Anfrageinhalt");
m.put("Request For Changes", "Änderungen anfordern");
@@ -3505,6 +3534,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "Einstellungen speichern & Projekte neu verteilen");
m.put("Save Template", "Vorlage speichern");
m.put("Save as Mine", "Als meine speichern");
+ m.put("Save page", "Seite speichern");
m.put("Saved Queries", "Gespeicherte Abfragen");
m.put("Scan Path", "Scan-Pfad");
m.put("Scan Paths", "Scan-Pfade");
@@ -3673,7 +3703,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "Probleme anzeigen, die nicht in die aktuelle Iteration eingeplant sind");
m.put("Show matching agents", "Passende Agenten anzeigen");
m.put("Show more", "Mehr anzeigen");
- m.put("Show more lines", "Mehr Zeilen anzeigen");
+ m.put("Show more lines above", "Mehr Zeilen oben anzeigen");
+ m.put("Show more lines below", "Mehr Zeilen unten anzeigen");
m.put("Show next match", "Nächste Übereinstimmung anzeigen");
m.put("Show previous match", "Vorherige Übereinstimmung anzeigen");
m.put("Show test cases of this test suite", "Testfälle dieser Test-Suite anzeigen");
@@ -3834,6 +3865,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "Gibt ein Docker-Image an, gegen das getestet werden soll");
m.put("Specify a custom field of Enum type", "Gibt ein benutzerdefiniertes Feld vom Typ Enum an");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "Gibt eine Standardabfrage an, um behobene Issues der angegebenen Jobs zu filtern/zu sortieren");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "Geben Sie einen Ordner relativ zum Repository-Stamm an. Lassen Sie das Feld leer, um in den Stammordner hochzuladen.");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"Geben Sie einen Schlüssel an, um die Benutzerdaten zu identifizieren. Daten mit demselben Schlüssel werden über Arbeitsbereiche hinweg geteilt\nauch wenn das Projekt unterschiedlich ist");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3952,6 +3985,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "Geben Sie die Felder an, die auf der Board-Karte angezeigt werden sollen.");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"Geben Sie Dateien relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, die veröffentlicht werden sollen. Verwenden Sie * oder ? für Musterabgleich.");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "Geben Sie Dateien an, die relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsverzeichnis</a> veröffentlicht werden sollen.\nVeröffentlichte Dateien sollten den Playwright-JSON-Bericht und alle referenzierten Artefakte wie Screenshots und Traces enthalten.\nFühren Sie beispielsweise <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\naus dem Job-Arbeitsverzeichnis aus und verwenden Sie <code>test-results/**</code> als Dateimuster, um den Bericht und die Artefakte zusammen zu veröffentlichen.\nVerwenden Sie * oder ? für die Mustererkennung");
m.put("Specify files under above directory to be published", "Geben Sie Dateien im obigen Verzeichnis an, die veröffentlicht werden sollen");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"Dateien im obigen Verzeichnis angeben, die veröffentlicht werden sollen. Verwenden Sie * oder ? für Musterabgleich. <b>HINWEIS:</b> Wenn <code>index.html</code> enthalten ist, wird es als Startseite der Seite angezeigt; andernfalls wird eine Liste der veröffentlichten Dateien angezeigt");
@@ -4209,6 +4244,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Submitted By", "Eingereicht von");
m.put("Submitted manually", "Manuell eingereicht");
m.put("Submitter", "Einreicher");
+ m.put("Submodule", "Submodul");
m.put("Subscription Key", "Abonnement-Schlüssel");
m.put("Subscription Management", "Abonnement-Verwaltung");
m.put("Subscription data", "Abonnement-Daten");
@@ -4306,6 +4342,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "Test erfolgreich: Authentifizierung bestanden mit den unten abgerufenen Informationen:");
m.put("Text", "Text");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "Die URL des Serverendpunkts, der die Webhook-POST-Anfragen empfängt");
+ m.put("The branch changed. Copy your edits and reload before saving.", "Der Branch hat sich geändert. Kopieren Sie Ihre Änderungen und laden Sie neu, bevor Sie speichern.");
+ m.put("The branch changed. Reload before uploading files.", "Der Branch hat sich geändert. Laden Sie neu, bevor Sie Dateien hochladen.");
m.put("The change contains disallowed file type(s): {0}", "Die Änderung enthält nicht erlaubte Dateitypen: {0}");
m.put("The first board will be the default board", "Das erste Board wird das Standard-Board sein");
m.put("The first timesheet will be the default timesheet", "Die erste Zeiterfassung wird die Standard-Zeiterfassung sein");
@@ -4466,6 +4504,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "Dieser Benutzer authentifiziert sich über die interne Datenbank.");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"Dieser Benutzer authentifiziert sich derzeit über ein externes System. Das Festlegen eines Passworts wechselt zur Verwendung der internen Datenbank");
+ m.put("This wiki page does not exist at this revision.", "Diese Wiki-Seite existiert in dieser Revision nicht.");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"Dies wird das aktuelle Abonnement deaktivieren und alle Enterprise-Funktionen werden deaktiviert. Möchten Sie fortfahren?");
m.put("This will discard all project specific boards, do you want to continue?", "Dies wird alle projektspezifischen Boards verwerfen. Möchten Sie fortfahren?");
@@ -4514,6 +4553,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Toggle half screen", "Halbbildschirm umschalten");
m.put("Toggle matched contents", "Übereinstimmende Inhalte umschalten");
m.put("Toggle navigation", "Navigation umschalten");
+ m.put("Toggle page outline", "Seitenumriss umschalten");
m.put("Toggle work log", "Arbeitsprotokoll umschalten");
m.put("Tokens", "Tokens");
m.put("Too many commits to load", "Zu viele Commits zum Laden");
@@ -4673,6 +4713,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "Ungesehene Code-Kommentar-Aktivität");
m.put("Unvote", "Abstimmung zurückziehen");
m.put("Unwatched. Click to watch", "Nicht beobachtet. Klicken, um zu beobachten");
+ m.put("Up", "Hoch");
m.put("Update", "Aktualisieren");
m.put("Update Dependencies via Renovate", "Abhängigkeiten über Renovate aktualisieren");
m.put("Update Source Branch", "Quellzweig aktualisieren");
@@ -4688,6 +4729,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "Laden Sie eine 128x128 transparente PNG-Datei hoch, die als Logo für den Hellmodus verwendet werden soll");
m.put("Upload artifacts", "Artefakte hochladen");
m.put("Upload avatar", "Avatar hochladen");
+ m.put("Upload files", "Dateien hochladen");
m.put("Upload should be less than {0} Mb", "Upload sollte weniger als {0} MB betragen");
m.put("Upload to Project", "Zum Projekt hochladen");
m.put("Uploaded Caches", "Hochgeladene Caches");
@@ -4715,6 +4757,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Use Step Template", "Schrittvorlage verwenden");
m.put("Use curl in System Path", "curl im Systempfad verwenden");
m.put("Use default", "Standard verwenden");
+ m.put("Use default sidebar?", "Standard-Seitenleiste verwenden?");
m.put("Use default storage class", "Standard-Speicherklasse verwenden");
m.put("Use generated branch name", "Generierten Branch-Namen verwenden");
m.put("Use generated title and description", "Generierten Titel und Beschreibung verwenden");
@@ -4871,6 +4914,7 @@ public class Translation_de extends TranslationResourceBundle {
"Ob das interne Passwort-Login-Formular deaktiviert und nur SSO-Login verwendet werden soll.\n<b class=\"text-info\">TIPPS:</b> Falls Sie ausgesperrt sind, kann das interne Login über die Befehls\nzeile durch Ausführen von <code>bin/enable-internal-login</code> wieder aktiviert werden.");
m.put("Whether or not to enable code management for the project", "Ob die Codeverwaltung für das Projekt aktiviert werden soll oder nicht");
m.put("Whether or not to enable issue management for the project", "Ob die Problemverwaltung für das Projekt aktiviert werden soll oder nicht");
+ m.put("Whether or not to enable wiki management for the project", "Ob die Wiki-Verwaltung für das Projekt aktiviert werden soll oder nicht");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"Ob LFS-Objekte abgerufen werden sollen, wenn der Pull-Request von einem anderen Projekt geöffnet wird");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4892,6 +4936,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "Ob diese Abhängigkeit erfolgreich sein muss oder nicht");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"Ob Gruppen des Login-Benutzers abgerufen werden sollen oder nicht. Stellen Sie sicher, dass Sie Gruppenansprüche über die Token-Konfiguration der in Entra ID registrierten App hinzufügen, wenn diese Option aktiviert ist. Der Gruppenanspruch sollte in diesem Fall Gruppen-ID (die Standardoption) über verschiedene Token-Typen zurückgeben");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "Ob Submodule abgerufen werden sollen oder nicht. Siehe\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>dieses Tutorial</a> für\nInformationen zur Konfiguration der Submodul-Authentifizierung\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"Ob Untermodule abgerufen werden sollen oder nicht. Siehe <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>dieses Tutorial</a>, wie Sie oben Anmeldeinformationen für das Klonen einrichten, um Untermodule abzurufen");
m.put("Whether or not to run this step inside container", "Ob dieser Schritt innerhalb eines Containers ausgeführt werden soll oder nicht");
@@ -4913,6 +4959,12 @@ public class Translation_de extends TranslationResourceBundle {
m.put("Widget", "Widget");
m.put("Widget Tab", "Widget-Tab");
m.put("Widget Timesheet Setting", "Widget-Zeiterfassungseinstellungen");
+ m.put("Wiki", "Wiki");
+ m.put("Wiki Folder", "Wiki-Ordner");
+ m.put("Wiki Management", "Wiki-Verwaltung");
+ m.put("Wiki Setting", "Wiki-Einstellung");
+ m.put("Wiki Settings", "Wiki-Einstellungen");
+ m.put("Wiki settings updated", "Wiki-Einstellungen aktualisiert");
m.put("Will be prompted to set up two-factor authentication upon next login", "Wird beim nächsten Login aufgefordert, die Zwei-Faktor-Authentifizierung einzurichten");
m.put("Window", "Fenster");
m.put("Window Memory", "Fensterspeicher");
@@ -5191,6 +5243,7 @@ public class Translation_de extends TranslationResourceBundle {
m.put("week:Tue", "Di");
m.put("week:Wed", "Mi");
m.put("widget:Tabs", "Tabs");
+ m.put("wiki", "Wiki");
m.put("workspaces", "Arbeitsbereiche");
m.put("you may show this page later via incompatibilities link in help menu", "Sie können diese Seite später über den Link \"Inkompatibilitäten\" im Hilfemenü anzeigen.");
m.put("{0} Lines", "{0} Zeilen");
@@ -5229,20 +5282,8 @@ public class Translation_de extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "{javax.validation.constraints.NotEmpty.message}");
m.put("{javax.validation.constraints.NotNull.message}", "{javax.validation.constraints.NotNull.message}");
m.put("{javax.validation.constraints.Size.message}", "{javax.validation.constraints.Size.message}");
- m.put("All Types", "Alle Typen");
- m.put("Auto", "Auto");
- m.put("Color mode", "Farbmodus");
- m.put("Dark", "Dunkel");
- m.put("Light", "Hell");
- m.put("Main Repository", "Haupt-Repository");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "Maximale Anzahl, wie oft dieser KI-Benutzer in einer einzelnen Aufgabe aktiviert werden kann. Wenn das Limit erreicht ist, wird der KI-Benutzer nicht ausgeführt und stattdessen ein Systemkommentar gepostet");
- m.put("Playwright Test Report", "Playwright-Testbericht");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "Geben Sie Dateien an, die relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsverzeichnis</a> veröffentlicht werden sollen.\nVeröffentlichte Dateien sollten den Playwright-JSON-Bericht und alle referenzierten Artefakte wie Screenshots und Traces enthalten.\nFühren Sie beispielsweise <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\naus dem Job-Arbeitsverzeichnis aus und verwenden Sie <code>test-results/**</code> als Dateimuster, um den Bericht und die Artefakte zusammen zu veröffentlichen.\nVerwenden Sie * oder ? für die Mustererkennung");
- m.put("Submodule", "Submodul");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "Ob Submodule abgerufen werden sollen oder nicht. Siehe\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>dieses Tutorial</a> für\nInformationen zur Konfiguration der Submodul-Authentifizierung\n");
+ m.put("Add home page", "Startseite hinzufügen");
+ m.put("Home page not found", "Startseite nicht gefunden");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.java
index db6dba61ad..0e311d738e 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.java
@@ -127,6 +127,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "Ya existe un proyecto hijo con el nombre \"{0}\" bajo \"{1}\"");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"Un archivo existe donde estás intentando crear un subdirectorio. Elige una nueva ruta e inténtalo de nuevo.");
+ m.put("A page with this name already exists.", "Ya existe una página con este nombre.");
m.put("A path with same name already exists.Please choose a different name and try again.",
"Ya existe una ruta con el mismo nombre. Por favor, elige un nombre diferente e inténtalo de nuevo.");
m.put("A pull request is open for this change", "Hay una solicitud de extracción abierta para este cambio");
@@ -200,6 +201,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "Agregue claves GPG aquí para verificar commits/etiquetas firmados por usted");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"Agregue claves públicas GPG confiables aquí. Los commits firmados con claves confiables se mostrarán como verificados.");
+ m.put("Add Home page", "Agregar página de inicio");
m.put("Add Issue...", "Agregar Problema...");
m.put("Add Issues to Iteration", "Agregar Problemas a la Iteración");
m.put("Add New", "Agregar Nuevo");
@@ -246,6 +248,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Add new import", "Añadir nueva importación");
m.put("Add new issue creation setting", "Añadir nueva configuración de creación de problemas");
m.put("Add new job dependency", "Añadir nueva dependencia de trabajo");
+ m.put("Add new page", "Agregar nueva página");
m.put("Add new param", "Añadir nuevo parámetro");
m.put("Add new post-build action", "Añadir nueva acción posterior a la construcción");
m.put("Add new project dependency", "Añadir nueva dependencia de proyecto");
@@ -253,6 +256,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Add new step", "Añadir nuevo paso");
m.put("Add new trigger", "Añadir nuevo disparador");
m.put("Add new user data", "Agregar nuevos datos de usuario");
+ m.put("Add page", "Agregar página");
+ m.put("Add page or upload files", "Agregar página o subir archivos");
m.put("Add project", "Añadir proyecto");
m.put("Add reviewer...", "Añadir revisor...");
m.put("Add to batch to commit with other suggestions later", "Añadir al lote para confirmar con otras sugerencias más tarde");
@@ -302,6 +307,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("All AI users", "Todos los usuarios de IA");
m.put("All Issues", "Todos los problemas");
m.put("All RESTful Resources", "Todos los recursos RESTful");
+ m.put("All Types", "Todos los Tipos");
m.put("All accessible", "Todo accesible");
m.put("All builds", "Todos los builds");
m.put("All changes", "Todos los cambios");
@@ -439,6 +445,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Authorize user...", "Autorizar usuario...");
m.put("Authorized Projects", "Proyectos autorizados");
m.put("Authorized Roles", "Roles autorizados");
+ m.put("Auto", "Automático");
m.put("Auto Merge", "Fusión automática");
m.put("Auto Spec", "Especificación automática");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -526,6 +533,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Branch Protection", "Protección de rama");
m.put("Branch Revision", "Revisión de rama");
m.put("Branch is created", "La rama ha sido creada");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "La rama está actualizada. Por favor, actualiza la página y vuelve a enviar el trabajo");
m.put("Branch update", "Actualización de rama");
m.put("Branches", "Ramas");
m.put("Brand Setting Edit Bean", "Bean de edición de configuración de marca");
@@ -826,6 +834,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "Se requiere permiso de escritura de código para esta operación");
m.put("Collapse all", "Colapsar todo");
m.put("Color", "Color");
+ m.put("Color mode", "Modo de color");
m.put("Columns", "Columnas");
m.put("Command", "Comando");
m.put("Command Palette", "Paleta de Comandos");
@@ -1023,7 +1032,9 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Current platform", "Plataforma actual");
m.put("Current project", "Proyecto actual");
m.put("Custom Headers", "Encabezados Personalizados");
+ m.put("Customize", "Personalizar");
m.put("DISCARDED", "DESCARTADO");
+ m.put("Dark", "Oscuro");
m.put("Dashboard Share Bean", "Bean de compartir tablero");
m.put("Dashboard name", "Nombre del tablero");
m.put("Dashboards", "Tableros");
@@ -1117,6 +1128,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Delete chat", "Eliminar chat");
m.put("Delete dashboard", "Eliminar tablero");
m.put("Delete from branch {0}", "Eliminar desde la rama {0}");
+ m.put("Delete page", "Eliminar página");
m.put("Delete this", "Eliminar esto");
m.put("Delete this GPG key", "Eliminar esta clave GPG");
m.put("Delete this access token", "Eliminar este token de acceso");
@@ -1133,6 +1145,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Delete this state", "Eliminar este estado");
m.put("Delete this tag", "Eliminar esta etiqueta");
m.put("Delete this value", "Eliminar este valor");
+ m.put("Delete this wiki page?", "¿Eliminar esta página wiki?");
m.put("Delete this workspace", "Eliminar este espacio de trabajo");
m.put("Delete this workspace data", "Eliminar estos datos de espacio de trabajo");
m.put("Deleted by us, modified by them", "Eliminado por nosotros, modificado por ellos");
@@ -1266,6 +1279,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Dockerfile", "Dockerfile");
m.put("Documentation", "Documentación");
m.put("Don't have an account yet?", "¿Aún no tiene una cuenta?");
+ m.put("Down", "Abajo");
m.put("Download", "Descargar");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"Descargue <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> o <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. Se incluirá un nuevo token de agente en el paquete");
@@ -1274,6 +1288,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Download log", "Descargar registro");
m.put("Download patch", "Descargar parche");
m.put("Download tag archive", "Descargar archivo de etiqueta");
+ m.put("Drop files here or click to upload", "Suelta los archivos aquí o haz clic para subirlos");
m.put("Dry Run", "Prueba en seco");
m.put("Due Date", "Fecha de vencimiento");
m.put("Due Date Issue Field", "Campo de problema de fecha de vencimiento");
@@ -1301,6 +1316,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Edit job", "Editar trabajo");
m.put("Edit on branch {0}", "Editar en la rama {0}");
m.put("Edit on source branch", "Editar en la rama fuente");
+ m.put("Edit page", "Editar página");
m.put("Edit plain", "Editar texto plano");
m.put("Edit saved queries", "Editar consultas guardadas");
m.put("Edit this access token", "Editar este token de acceso");
@@ -2105,6 +2121,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("License Setting", "Configuración de Licencia");
m.put("Licensed To", "Licenciado a");
m.put("Licensed To:", "Licenciado a:");
+ m.put("Light", "Claro");
m.put("Line", "Línea");
m.put("Line: ", "Línea:");
m.put("Lines", "Líneas");
@@ -2167,6 +2184,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Mail Service Test", "Prueba del Servicio de Correo");
m.put("Mail service not configured", "Servicio de correo no configurado");
m.put("Mail service settings saved", "Configuraciones del servicio de correo guardadas");
+ m.put("Main Repository", "Repositorio Principal");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"Asegúrate de que <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 o superior</a> esté instalado");
m.put("Make sure current user has permission to run docker containers", "Asegúrese de que el usuario actual tenga permiso para ejecutar contenedores de Docker");
@@ -2219,6 +2237,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "Tamaño Máximo de Archivo de Carga (MB)");
m.put("Max Value", "Valor Máximo");
m.put("Maximum number of entries to return when search code in repository", "Número máximo de entradas a devolver al buscar código en el repositorio");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "Número máximo de veces que este usuario de IA puede ser activado en una sola tarea. Cuando se alcance el límite, el usuario de IA no se ejecutará y se publicará un comentario del sistema en su lugar");
m.put("Maximum of retries before giving up", "Máximo de reintentos antes de rendirse");
m.put("May not be empty", "No puede estar vacío");
m.put("Medium", "Medio");
@@ -2406,6 +2426,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("No group by", "No hay agrupación");
m.put("No groups claim returned", "No se devolvió reclamación de grupos");
m.put("No groups to remove from", "No hay grupos de los que eliminar");
+ m.put("No headings", "Sin encabezados");
m.put("No ignore file", "No hay archivo de ignorar");
m.put("No image attachments", "No hay imágenes adjuntas");
m.put("No imports defined", "No hay importaciones definidas");
@@ -2474,6 +2495,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "No es un correo electrónico verificado de la clave GPG de firma");
m.put("Not a verified email of signing ssh key owner", "No es un correo electrónico verificado del propietario de la clave ssh de firma");
m.put("Not allowed file type: {0}", "Tipo de archivo no permitido: {0}");
+ m.put("Not allowed to modify this file", "No está permitido modificar este archivo");
m.put("Not assigned", "No asignado");
m.put("Not authorized to create project under \"{0}\"", "No autorizado para crear un proyecto bajo \"{0}\"");
m.put("Not authorized to create root project", "No autorizado para crear un proyecto raíz");
@@ -2904,7 +2926,10 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Package {0} deleted", "Paquete {0} eliminado");
m.put("Packages", "Paquetes");
m.put("Page Not Found", "Página no encontrada");
+ m.put("Page history", "Historial de la página");
m.put("Page is in error, reload to recover", "La página tiene un error, recargue para recuperar");
+ m.put("Page name", "Nombre de la página");
+ m.put("Pages", "Páginas");
m.put("Param Instance", "Instancia de Parámetro");
m.put("Param Instances", "Instancias de Parámetro");
m.put("Param Map", "Mapa de Parámetros");
@@ -2999,6 +3024,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Plain text expected", "Se espera texto plano");
m.put("Platform", "Plataforma");
m.put("Platforms", "Plataformas");
+ m.put("Playwright Test Report", "Informe de Pruebas de Playwright");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"Por favor, <a wicket:id=\"download\" class=\"font-weight-bolder\">descargue</a> los códigos de recuperación a continuación y manténgalos en secreto. Estos códigos pueden ser utilizados para proporcionar acceso único a su cuenta en caso de que no pueda acceder a la aplicación de autenticación. No se mostrarán <b>NUNCA</b> nuevamente");
m.put("Please Confirm", "Por favor confirme");
@@ -3352,6 +3378,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Remove this file", "Eliminar este archivo");
m.put("Remove this image", "Eliminar esta imagen");
m.put("Remove this reviewer", "Eliminar este revisor");
+ m.put("Rename", "Renombrar");
m.put("Rename {0}", "Renombrar {0}");
m.put("Renew Subscription", "Renovar Suscripción");
m.put("Renovate CLI Options", "Opciones de Renovate CLI");
@@ -3368,6 +3395,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"Formato del informe cambiado. Puede volver a ejecutar esta compilación para generar el informe en el nuevo formato");
m.put("Repository Sync", "Sincronización del repositorio");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "Carpeta del repositorio que contiene páginas wiki en Markdown. Déjalo vacío para heredar del padre (por defecto es wiki). Usa Home.md para la página principal y _Sidebar.md para la barra lateral");
m.put("Reprovision workspace", "Reprovisionar espacio de trabajo");
m.put("Request Body", "Cuerpo de la solicitud");
m.put("Request For Changes", "Solicitud de cambios");
@@ -3505,6 +3534,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "Guardar configuración y redistribuir proyectos.");
m.put("Save Template", "Guardar plantilla.");
m.put("Save as Mine", "Guardar como mío.");
+ m.put("Save page", "Guardar página");
m.put("Saved Queries", "Consultas guardadas.");
m.put("Scan Path", "Ruta de escaneo.");
m.put("Scan Paths", "Rutas de escaneo.");
@@ -3673,7 +3703,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "Mostrar problemas no programados en la iteración actual");
m.put("Show matching agents", "Mostrar agentes coincidentes");
m.put("Show more", "Mostrar más");
- m.put("Show more lines", "Mostrar más líneas");
+ m.put("Show more lines above", "Mostrar más líneas arriba");
+ m.put("Show more lines below", "Mostrar más líneas abajo");
m.put("Show next match", "Mostrar siguiente coincidencia");
m.put("Show previous match", "Mostrar coincidencia anterior");
m.put("Show test cases of this test suite", "Mostrar casos de prueba de esta suite de pruebas");
@@ -3834,6 +3865,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "Especifica una imagen Docker para probar");
m.put("Specify a custom field of Enum type", "Especifica un campo personalizado de tipo Enum");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "Especifica una consulta predeterminada para filtrar/ordenar problemas solucionados de los trabajos especificados");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "Especifique una carpeta relativa a la raíz del repositorio. Déjelo vacío para cargar en la carpeta raíz.");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"Especifique una clave para identificar los datos del usuario. Los datos con la misma clave se compartirán entre espacios de trabajo\nincluso si el proyecto es diferente");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3952,6 +3985,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "Especifique los campos para mostrar en la tarjeta del tablero");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"Especifique los archivos relativos al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para publicar. Use * o ? para coincidencia de patrones");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "Especifique los archivos a publicar en relación con el <a href='https://docs.onedev.io/concepts#job-workdir'>directorio de trabajo del trabajo</a>.\nLos archivos publicados deben incluir el informe JSON de Playwright y todos los artefactos referenciados, como capturas de pantalla y trazas.\nPor ejemplo, ejecute <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndesde el directorio de trabajo del trabajo, y use <code>test-results/**</code> como el patrón de archivo para publicar el informe y los artefactos juntos.\nUse * o ? para la coincidencia de patrones");
m.put("Specify files under above directory to be published", "Especifica los archivos bajo el directorio mencionado para ser publicados");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"Especifique los archivos en el directorio anterior para ser publicados. Use * o ? para coincidencia de patrones. <b>NOTA:</b> Si <code>index.html</code> está incluido, se servirá como la página de inicio del sitio; de lo contrario, se mostrará una lista de archivos publicados");
@@ -4209,6 +4244,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Submitted By", "Enviado Por");
m.put("Submitted manually", "Enviado manualmente");
m.put("Submitter", "Remitente");
+ m.put("Submodule", "Submódulo");
m.put("Subscription Key", "Clave de Suscripción");
m.put("Subscription Management", "Gestión de Suscripción");
m.put("Subscription data", "Datos de Suscripción");
@@ -4306,6 +4342,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "Prueba exitosa: autenticación aprobada con la siguiente información recuperada:");
m.put("Text", "Texto");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "La URL del punto final del servidor que recibirá las solicitudes POST del webhook");
+ m.put("The branch changed. Copy your edits and reload before saving.", "La rama cambió. Copia tus ediciones y recarga antes de guardar.");
+ m.put("The branch changed. Reload before uploading files.", "La rama cambió. Recarga antes de subir archivos.");
m.put("The change contains disallowed file type(s): {0}", "El cambio contiene tipo(s) de archivo no permitido(s): {0}");
m.put("The first board will be the default board", "El primer tablero será el tablero predeterminado");
m.put("The first timesheet will be the default timesheet", "La primera hoja de tiempo será la hoja de tiempo predeterminada");
@@ -4466,6 +4504,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "Este usuario se está autenticando a través de la base de datos interna.");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"Este usuario se está autenticando actualmente a través de un sistema externo. Configurar una contraseña cambiará a usar la base de datos interna");
+ m.put("This wiki page does not exist at this revision.", "Esta página wiki no existe en esta revisión.");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"Esto desactivará la suscripción actual y todas las funciones empresariales serán deshabilitadas, ¿desea continuar?");
m.put("This will discard all project specific boards, do you want to continue?", "Esto descartará todos los tableros específicos del proyecto, ¿desea continuar?");
@@ -4514,6 +4553,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Toggle half screen", "Alternar media pantalla");
m.put("Toggle matched contents", "Alternar contenidos coincidentes");
m.put("Toggle navigation", "Alternar navegación");
+ m.put("Toggle page outline", "Alternar esquema de la página");
m.put("Toggle work log", "Alternar registro de trabajo");
m.put("Tokens", "Tokens");
m.put("Too many commits to load", "Demasiados commits para cargar");
@@ -4673,6 +4713,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "Actividad de comentarios de código no vista");
m.put("Unvote", "Quitar voto");
m.put("Unwatched. Click to watch", "No observado. Haz clic para observar");
+ m.put("Up", "Arriba");
m.put("Update", "Actualizar");
m.put("Update Dependencies via Renovate", "Actualizar dependencias mediante Renovate");
m.put("Update Source Branch", "Actualizar rama fuente");
@@ -4688,6 +4729,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "Subir un archivo PNG transparente de 128x128 para usar como logo en modo claro");
m.put("Upload artifacts", "Subir artefactos");
m.put("Upload avatar", "Subir avatar");
+ m.put("Upload files", "Subir archivos");
m.put("Upload should be less than {0} Mb", "La subida debe ser menor a {0} Mb");
m.put("Upload to Project", "Subir al proyecto");
m.put("Uploaded Caches", "Cachés subidos");
@@ -4715,6 +4757,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Use Step Template", "Usar plantilla de paso");
m.put("Use curl in System Path", "Usar curl en la ruta del sistema");
m.put("Use default", "Usar predeterminado");
+ m.put("Use default sidebar?", "¿Usar barra lateral predeterminada?");
m.put("Use default storage class", "Usar clase de almacenamiento predeterminada");
m.put("Use generated branch name", "Usar nombre de rama generado");
m.put("Use generated title and description", "Usar título y descripción generados");
@@ -4871,6 +4914,7 @@ public class Translation_es extends TranslationResourceBundle {
"Si deshabilitar o no el formulario de inicio de sesión con contraseña interna y usar solo inicio de sesión SSO.\n<b class=\"text-info\">CONSEJOS:</b> Si está bloqueado, el inicio de sesión interno se puede volver a habilitar desde la línea\nde comandos ejecutando <code>bin/enable-internal-login</code>");
m.put("Whether or not to enable code management for the project", "Si se habilita o no la gestión de código para el proyecto");
m.put("Whether or not to enable issue management for the project", "Si se habilita o no la gestión de problemas para el proyecto");
+ m.put("Whether or not to enable wiki management for the project", "Habilitar o no la gestión del wiki para el proyecto");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"Si se deben obtener objetos LFS si la solicitud de extracción se abre desde un proyecto diferente o no");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4892,6 +4936,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "Si se requiere que esta dependencia sea exitosa o no");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"Si se deben recuperar los grupos del usuario de inicio de sesión o no. Asegúrate de agregar la reclamación de grupos mediante la configuración de tokens de la aplicación registrada en Entra ID si esta opción está habilitada. La reclamación de grupos debe devolver el ID del grupo (la opción predeterminada) mediante varios tipos de tokens en este caso");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "Si se deben recuperar o no los submódulos. Consulte\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>este tutorial</a> sobre\ncómo configurar la autenticación de submódulos\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"Si se deben recuperar submódulos o no. Consulta <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>este tutorial</a> sobre cómo configurar la credencial de clonación anterior para recuperar submódulos");
m.put("Whether or not to run this step inside container", "Si este paso se ejecutará dentro de un contenedor o no");
@@ -4913,6 +4959,12 @@ public class Translation_es extends TranslationResourceBundle {
m.put("Widget", "Widget");
m.put("Widget Tab", "Pestaña de Widget");
m.put("Widget Timesheet Setting", "Configuración de Hoja de Tiempo del Widget");
+ m.put("Wiki", "Wiki");
+ m.put("Wiki Folder", "Carpeta del Wiki");
+ m.put("Wiki Management", "Gestión del Wiki");
+ m.put("Wiki Setting", "Configuración del Wiki");
+ m.put("Wiki Settings", "Configuraciones del Wiki");
+ m.put("Wiki settings updated", "Configuraciones del wiki actualizadas");
m.put("Will be prompted to set up two-factor authentication upon next login", "Se le pedirá configurar la autenticación de dos factores en el próximo inicio de sesión");
m.put("Window", "Ventana");
m.put("Window Memory", "Memoria de Ventana");
@@ -5191,6 +5243,7 @@ public class Translation_es extends TranslationResourceBundle {
m.put("week:Tue", "Mar");
m.put("week:Wed", "Mié");
m.put("widget:Tabs", "Pestañas");
+ m.put("wiki", "wiki");
m.put("workspaces", "espacios de trabajo");
m.put("you may show this page later via incompatibilities link in help menu", "puede mostrar esta página más tarde a través del enlace de incompatibilidades en el menú de ayuda");
m.put("{0} Lines", "{0} Líneas");
@@ -5229,20 +5282,8 @@ public class Translation_es extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "{javax.validation.constraints.NotEmpty.message}");
m.put("{javax.validation.constraints.NotNull.message}", "{javax.validation.constraints.NotNull.message}");
m.put("{javax.validation.constraints.Size.message}", "{javax.validation.constraints.Size.message}");
- m.put("All Types", "Todos los Tipos");
- m.put("Auto", "Automático");
- m.put("Color mode", "Modo de color");
- m.put("Dark", "Oscuro");
- m.put("Light", "Claro");
- m.put("Main Repository", "Repositorio Principal");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "Número máximo de veces que este usuario de IA puede ser activado en una sola tarea. Cuando se alcance el límite, el usuario de IA no se ejecutará y se publicará un comentario del sistema en su lugar");
- m.put("Playwright Test Report", "Informe de Pruebas de Playwright");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "Especifique los archivos a publicar en relación con el <a href='https://docs.onedev.io/concepts#job-workdir'>directorio de trabajo del trabajo</a>.\nLos archivos publicados deben incluir el informe JSON de Playwright y todos los artefactos referenciados, como capturas de pantalla y trazas.\nPor ejemplo, ejecute <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndesde el directorio de trabajo del trabajo, y use <code>test-results/**</code> como el patrón de archivo para publicar el informe y los artefactos juntos.\nUse * o ? para la coincidencia de patrones");
- m.put("Submodule", "Submódulo");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "Si se deben recuperar o no los submódulos. Consulte\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>este tutorial</a> sobre\ncómo configurar la autenticación de submódulos\n");
+ m.put("Add home page", "Agregar página de inicio");
+ m.put("Home page not found", "Página de inicio no encontrada");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.java
index 848fb024d0..6d8245430f 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.java
@@ -127,6 +127,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "Un projet enfant avec le nom \"{0}\" existe déjà sous \"{1}\"");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"Un fichier existe là où vous essayez de créer un sous-répertoire. Choisissez un nouveau chemin et réessayez.");
+ m.put("A page with this name already exists.", "Une page avec ce nom existe déjà.");
m.put("A path with same name already exists.Please choose a different name and try again.",
"Un chemin avec le même nom existe déjà. Veuillez choisir un nom différent et réessayez.");
m.put("A pull request is open for this change", "Une demande de tirage est ouverte pour ce changement");
@@ -200,6 +201,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "Ajoutez ici des clés GPG pour vérifier les commits/tags signés par vous");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"Ajoutez ici des clés publiques GPG à faire confiance. Les commits signés avec des clés de confiance seront affichés comme vérifiés.");
+ m.put("Add Home page", "Ajouter la page d'accueil");
m.put("Add Issue...", "Ajouter un problème...");
m.put("Add Issues to Iteration", "Ajouter des problèmes à l'itération");
m.put("Add New", "Ajouter nouveau");
@@ -246,6 +248,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Add new import", "Ajouter une nouvelle importation");
m.put("Add new issue creation setting", "Ajouter un nouveau paramètre de création de problème");
m.put("Add new job dependency", "Ajouter une nouvelle dépendance de tâche");
+ m.put("Add new page", "Ajouter une nouvelle page");
m.put("Add new param", "Ajouter un nouveau paramètre");
m.put("Add new post-build action", "Ajouter une nouvelle action post-construction");
m.put("Add new project dependency", "Ajouter une nouvelle dépendance de projet");
@@ -253,6 +256,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Add new step", "Ajouter une nouvelle étape");
m.put("Add new trigger", "Ajouter un nouveau déclencheur");
m.put("Add new user data", "Ajouter de nouvelles données utilisateur");
+ m.put("Add page", "Ajouter une page");
+ m.put("Add page or upload files", "Ajouter une page ou télécharger des fichiers");
m.put("Add project", "Ajouter un projet");
m.put("Add reviewer...", "Ajouter un réviseur...");
m.put("Add to batch to commit with other suggestions later", "Ajouter au lot pour valider avec d'autres suggestions plus tard");
@@ -302,6 +307,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("All AI users", "Tous les utilisateurs AI");
m.put("All Issues", "Tous les problèmes");
m.put("All RESTful Resources", "Toutes les ressources RESTful");
+ m.put("All Types", "Tous les types");
m.put("All accessible", "Tout accessible");
m.put("All builds", "Toutes les constructions");
m.put("All changes", "Tous les changements");
@@ -439,6 +445,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Authorize user...", "Autoriser l'utilisateur...");
m.put("Authorized Projects", "Projets autorisés");
m.put("Authorized Roles", "Rôles autorisés");
+ m.put("Auto", "Auto");
m.put("Auto Merge", "Fusion automatique");
m.put("Auto Spec", "Spécification automatique");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -526,6 +533,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Branch Protection", "Protection de la branche");
m.put("Branch Revision", "Révision de la branche");
m.put("Branch is created", "La branche est créée");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "La branche est mise à jour. Veuillez actualiser la page et soumettre à nouveau le travail");
m.put("Branch update", "Mise à jour de la branche");
m.put("Branches", "Branches");
m.put("Brand Setting Edit Bean", "Bean d'édition des paramètres de marque");
@@ -826,6 +834,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "Permission d'écriture de code requise pour cette opération");
m.put("Collapse all", "Réduire tout");
m.put("Color", "Couleur");
+ m.put("Color mode", "Mode couleur");
m.put("Columns", "Colonnes");
m.put("Command", "Commande");
m.put("Command Palette", "Palette de commandes");
@@ -1023,7 +1032,9 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Current platform", "Plateforme actuelle");
m.put("Current project", "Projet actuel");
m.put("Custom Headers", "En-têtes personnalisés");
+ m.put("Customize", "Personnaliser");
m.put("DISCARDED", "REJETÉ");
+ m.put("Dark", "Sombre");
m.put("Dashboard Share Bean", "Bean de partage de tableau de bord");
m.put("Dashboard name", "Nom du tableau de bord");
m.put("Dashboards", "Tableaux de bord");
@@ -1117,6 +1128,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Delete chat", "Supprimer le chat");
m.put("Delete dashboard", "Supprimer le tableau de bord");
m.put("Delete from branch {0}", "Supprimer de la branche {0}");
+ m.put("Delete page", "Supprimer la page");
m.put("Delete this", "Supprimer ceci");
m.put("Delete this GPG key", "Supprimer cette clé GPG");
m.put("Delete this access token", "Supprimer ce jeton d'accès");
@@ -1133,6 +1145,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Delete this state", "Supprimer cet état");
m.put("Delete this tag", "Supprimer ce tag");
m.put("Delete this value", "Supprimer cette valeur");
+ m.put("Delete this wiki page?", "Supprimer cette page wiki ?");
m.put("Delete this workspace", "Supprimer cet espace de travail");
m.put("Delete this workspace data", "Supprimer ces données d'espace de travail");
m.put("Deleted by us, modified by them", "Supprimé par nous, modifié par eux");
@@ -1266,6 +1279,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Dockerfile", "Dockerfile");
m.put("Documentation", "Documentation");
m.put("Don't have an account yet?", "Vous n'avez pas encore de compte ?");
+ m.put("Down", "Bas");
m.put("Download", "Télécharger");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"Téléchargez <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> ou <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. Un nouveau jeton d'agent sera inclus dans le package");
@@ -1274,6 +1288,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Download log", "Télécharger le journal");
m.put("Download patch", "Télécharger le correctif");
m.put("Download tag archive", "Télécharger l'archive du tag");
+ m.put("Drop files here or click to upload", "Déposez les fichiers ici ou cliquez pour les télécharger");
m.put("Dry Run", "Exécution à blanc");
m.put("Due Date", "Date d'échéance");
m.put("Due Date Issue Field", "Champ de problème de date d'échéance");
@@ -1301,6 +1316,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Edit job", "Modifier le travail");
m.put("Edit on branch {0}", "Modifier sur la branche {0}");
m.put("Edit on source branch", "Modifier sur la branche source");
+ m.put("Edit page", "Modifier la page");
m.put("Edit plain", "Modifier en texte brut");
m.put("Edit saved queries", "Modifier les requêtes enregistrées");
m.put("Edit this access token", "Modifier ce jeton d'accès");
@@ -2105,6 +2121,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("License Setting", "Paramètre de Licence");
m.put("Licensed To", "Licencié À");
m.put("Licensed To:", "Licencié À :");
+ m.put("Light", "Clair");
m.put("Line", "Ligne");
m.put("Line: ", "Ligne :");
m.put("Lines", "Lignes");
@@ -2167,6 +2184,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Mail Service Test", "Test du Service de Messagerie");
m.put("Mail service not configured", "Service de messagerie non configuré");
m.put("Mail service settings saved", "Paramètres du service de messagerie enregistrés");
+ m.put("Main Repository", "Référentiel principal");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"Assurez-vous que <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 ou supérieur</a> est installé");
m.put("Make sure current user has permission to run docker containers", "Assurez-vous que l'utilisateur actuel a l'autorisation d'exécuter des conteneurs docker");
@@ -2219,6 +2237,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "Taille Maximale de Fichier Téléchargé (MB)");
m.put("Max Value", "Valeur Maximale");
m.put("Maximum number of entries to return when search code in repository", "Nombre maximal d'entrées à retourner lors de la recherche de code dans le dépôt");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "Nombre maximum de fois que cet utilisateur IA peut être réveillé dans une seule tâche. Lorsque la limite est atteinte, l'utilisateur IA ne s'exécutera pas et un commentaire système sera publié à la place");
m.put("Maximum of retries before giving up", "Nombre maximal de tentatives avant d'abandonner");
m.put("May not be empty", "Ne peut pas être vide");
m.put("Medium", "Moyen");
@@ -2406,6 +2426,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("No group by", "Aucun regroupement");
m.put("No groups claim returned", "Aucune revendication de groupe retournée");
m.put("No groups to remove from", "Aucun groupe à retirer");
+ m.put("No headings", "Aucun titre");
m.put("No ignore file", "Aucun fichier d'ignorance");
m.put("No image attachments", "Aucune pièce jointe d'image");
m.put("No imports defined", "Aucune importation définie");
@@ -2474,6 +2495,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "Pas un email vérifié de la clé GPG de signature");
m.put("Not a verified email of signing ssh key owner", "Pas un email vérifié du propriétaire de la clé ssh de signature");
m.put("Not allowed file type: {0}", "Type de fichier non autorisé : {0}");
+ m.put("Not allowed to modify this file", "Non autorisé à modifier ce fichier");
m.put("Not assigned", "Non assigné");
m.put("Not authorized to create project under \"{0}\"", "Non autorisé à créer un projet sous \"{0}\"");
m.put("Not authorized to create root project", "Non autorisé à créer un projet racine");
@@ -2904,7 +2926,10 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Package {0} deleted", "Paquet {0} supprimé");
m.put("Packages", "Paquets");
m.put("Page Not Found", "Page non trouvée");
+ m.put("Page history", "Historique de la page");
m.put("Page is in error, reload to recover", "La page est en erreur, rechargez pour récupérer");
+ m.put("Page name", "Nom de la page");
+ m.put("Pages", "Pages");
m.put("Param Instance", "Instance de paramètre");
m.put("Param Instances", "Instances de paramètre");
m.put("Param Map", "Carte de paramètre");
@@ -2999,6 +3024,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Plain text expected", "Texte brut attendu");
m.put("Platform", "Plateforme");
m.put("Platforms", "Plateformes");
+ m.put("Playwright Test Report", "Rapport de test Playwright");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"Veuillez <a wicket:id=\"download\" class=\"font-weight-bolder\">télécharger</a> les codes de récupération ci-dessous et les garder secrets. Ces codes peuvent être utilisés pour fournir un accès unique à votre compte en cas d'impossibilité d'accéder à l'application d'authentification. Ils ne seront <b>PAS</b> affichés à nouveau");
m.put("Please Confirm", "Veuillez confirmer");
@@ -3352,6 +3378,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Remove this file", "Supprimer ce fichier");
m.put("Remove this image", "Supprimer cette image");
m.put("Remove this reviewer", "Supprimer cet examinateur");
+ m.put("Rename", "Renommer");
m.put("Rename {0}", "Renommer {0}");
m.put("Renew Subscription", "Renouveler l'abonnement");
m.put("Renovate CLI Options", "Options CLI de Renovate");
@@ -3368,6 +3395,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"Format du rapport modifié. Vous pouvez relancer cette construction pour générer le rapport dans le nouveau format");
m.put("Repository Sync", "Synchronisation du dépôt");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "Dossier du dépôt contenant les pages wiki Markdown. Laissez vide pour hériter du parent (par défaut wiki). Utilisez Home.md pour la page d'accueil et _Sidebar.md pour la barre latérale");
m.put("Reprovision workspace", "Reprovisionner l'espace de travail");
m.put("Request Body", "Corps de la requête");
m.put("Request For Changes", "Demande de modifications");
@@ -3505,6 +3534,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "Enregistrer les paramètres et redistribuer les projets");
m.put("Save Template", "Enregistrer le modèle");
m.put("Save as Mine", "Enregistrer comme mien");
+ m.put("Save page", "Enregistrer la page");
m.put("Saved Queries", "Requêtes enregistrées");
m.put("Scan Path", "Chemin de scan");
m.put("Scan Paths", "Chemins de scan");
@@ -3673,7 +3703,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "Afficher les problèmes non planifiés dans l'itération actuelle");
m.put("Show matching agents", "Afficher les agents correspondants");
m.put("Show more", "Afficher plus");
- m.put("Show more lines", "Afficher plus de lignes");
+ m.put("Show more lines above", "Afficher plus de lignes au-dessus");
+ m.put("Show more lines below", "Afficher plus de lignes en dessous");
m.put("Show next match", "Afficher la correspondance suivante");
m.put("Show previous match", "Afficher la correspondance précédente");
m.put("Show test cases of this test suite", "Afficher les cas de test de cette suite de tests");
@@ -3834,6 +3865,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "Spécifie une image Docker à tester");
m.put("Specify a custom field of Enum type", "Spécifie un champ personnalisé de type Enum");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "Spécifie une requête par défaut pour filtrer/ordonner les problèmes résolus des jobs spécifiés");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "Spécifiez un dossier relatif à la racine du dépôt. Laissez vide pour télécharger dans le dossier racine.");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"Spécifiez une clé pour identifier les données utilisateur. Les données avec la même clé seront partagées entre les espaces de travail\nmême si le projet est différent");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3952,6 +3985,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "Spécifiez les champs à afficher sur la carte du tableau");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"Spécifiez les fichiers relatifs à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a> à publier. Utilisez * ou ? pour correspondre au modèle");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "Spécifiez les fichiers à publier par rapport au <a href='https://docs.onedev.io/concepts#job-workdir'>répertoire de travail du job</a>.\nLes fichiers publiés doivent inclure le rapport JSON de Playwright et tous les artefacts référencés, tels que les captures d'écran et les traces.\nPar exemple, exécutez <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndepuis le répertoire de travail du job, et utilisez <code>test-results/**</code> comme modèle de fichier pour publier le rapport et les artefacts ensemble.\nUtilisez * ou ? pour le filtrage par motif");
m.put("Specify files under above directory to be published", "Spécifiez les fichiers sous le répertoire ci-dessus à publier");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"Spécifiez les fichiers dans le répertoire ci-dessus à publier. Utilisez * ou ? pour correspondre au modèle. <b>REMARQUE :</b> Si <code>index.html</code> est inclus, il sera utilisé comme page de démarrage du site ; sinon, une liste des fichiers publiés sera affichée");
@@ -4209,6 +4244,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Submitted By", "Soumis par");
m.put("Submitted manually", "Soumis manuellement");
m.put("Submitter", "Soumetteur");
+ m.put("Submodule", "Sous-module");
m.put("Subscription Key", "Clé d'abonnement");
m.put("Subscription Management", "Gestion des abonnements");
m.put("Subscription data", "Données d'abonnement");
@@ -4306,6 +4342,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "Test réussi : authentification validée avec les informations suivantes récupérées :");
m.put("Text", "Texte");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "L'URL du point de terminaison du serveur qui recevra les requêtes POST du webhook");
+ m.put("The branch changed. Copy your edits and reload before saving.", "La branche a changé. Copiez vos modifications et rechargez avant de sauvegarder.");
+ m.put("The branch changed. Reload before uploading files.", "La branche a changé. Rechargez avant de télécharger des fichiers.");
m.put("The change contains disallowed file type(s): {0}", "Le changement contient des types de fichiers non autorisés : {0}");
m.put("The first board will be the default board", "Le premier tableau sera le tableau par défaut");
m.put("The first timesheet will be the default timesheet", "La première feuille de temps sera la feuille de temps par défaut");
@@ -4466,6 +4504,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "Cet utilisateur s'authentifie via la base de données interne.");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"Cet utilisateur s'authentifie actuellement via un système externe. Définir un mot de passe basculera vers l'utilisation de la base de données interne");
+ m.put("This wiki page does not exist at this revision.", "Cette page wiki n'existe pas à cette révision.");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"Cela désactivera l'abonnement actuel et toutes les fonctionnalités d'entreprise seront désactivées, voulez-vous continuer ?");
m.put("This will discard all project specific boards, do you want to continue?", "Cela supprimera tous les tableaux spécifiques au projet, voulez-vous continuer ?");
@@ -4514,6 +4553,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Toggle half screen", "Basculer en demi-écran");
m.put("Toggle matched contents", "Basculer les contenus correspondants");
m.put("Toggle navigation", "Basculer la navigation");
+ m.put("Toggle page outline", "Basculer le plan de la page");
m.put("Toggle work log", "Basculer le journal de travail");
m.put("Tokens", "Tokens");
m.put("Too many commits to load", "Trop de commits à charger");
@@ -4673,6 +4713,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "Activité de commentaire de code non vue");
m.put("Unvote", "Retirer le vote");
m.put("Unwatched. Click to watch", "Non surveillé. Cliquez pour surveiller");
+ m.put("Up", "Haut");
m.put("Update", "Mettre à jour");
m.put("Update Dependencies via Renovate", "Mettre à jour les dépendances via Renovate");
m.put("Update Source Branch", "Mettre à jour la branche source");
@@ -4688,6 +4729,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "Téléverser un fichier PNG transparent 128x128 à utiliser comme logo pour le mode clair");
m.put("Upload artifacts", "Télécharger les artefacts");
m.put("Upload avatar", "Téléverser un avatar");
+ m.put("Upload files", "Télécharger des fichiers");
m.put("Upload should be less than {0} Mb", "Le téléversement doit être inférieur à {0} Mo");
m.put("Upload to Project", "Téléverser vers le projet");
m.put("Uploaded Caches", "Caches téléversés");
@@ -4715,6 +4757,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Use Step Template", "Utiliser le modèle d'étape");
m.put("Use curl in System Path", "Utiliser curl dans le chemin système");
m.put("Use default", "Utiliser par défaut");
+ m.put("Use default sidebar?", "Utiliser la barre latérale par défaut ?");
m.put("Use default storage class", "Utiliser la classe de stockage par défaut");
m.put("Use generated branch name", "Utiliser le nom de branche généré");
m.put("Use generated title and description", "Utiliser le titre et la description générés");
@@ -4871,6 +4914,7 @@ public class Translation_fr extends TranslationResourceBundle {
"Indique si le formulaire de connexion par mot de passe interne doit être désactivé et si seule la connexion SSO doit être utilisée.\n<b class=\"text-info\">CONSEILS :</b> Si vous êtes bloqué, la connexion interne peut être réactivée depuis la ligne de commande en exécutant <code>bin/enable-internal-login</code>");
m.put("Whether or not to enable code management for the project", "Si la gestion du code doit être activée pour le projet ou non");
m.put("Whether or not to enable issue management for the project", "Si la gestion des issues doit être activée pour le projet ou non");
+ m.put("Whether or not to enable wiki management for the project", "Activer ou non la gestion du wiki pour le projet");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"Si les objets LFS doivent être récupérés si la pull request est ouverte depuis un projet différent ou non");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4892,6 +4936,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "Si cette dépendance doit être réussie ou non");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"Si les groupes de l'utilisateur connecté doivent être récupérés ou non. Assurez-vous d'ajouter la revendication de groupes via la configuration du token de l'application enregistrée dans Entra ID si cette option est activée. La revendication de groupes devrait retourner l'identifiant de groupe (l'option par défaut) via divers types de tokens dans ce cas");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "Si oui ou non récupérer les sous-modules. Référez-vous à\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>ce tutoriel</a> sur\ncomment configurer l'authentification des sous-modules\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"Si les sous-modules doivent être récupérés ou non. Référez-vous à <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>ce tutoriel</a> pour savoir comment configurer les identifiants de clonage ci-dessus pour récupérer les sous-modules");
m.put("Whether or not to run this step inside container", "Si cette étape doit être exécutée à l'intérieur d'un conteneur ou non");
@@ -4913,6 +4959,12 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("Widget", "Widget");
m.put("Widget Tab", "Onglet Widget");
m.put("Widget Timesheet Setting", "Paramètre de feuille de temps du Widget");
+ m.put("Wiki", "Wiki");
+ m.put("Wiki Folder", "Dossier Wiki");
+ m.put("Wiki Management", "Gestion du Wiki");
+ m.put("Wiki Setting", "Paramètre du Wiki");
+ m.put("Wiki Settings", "Paramètres du Wiki");
+ m.put("Wiki settings updated", "Paramètres du wiki mis à jour");
m.put("Will be prompted to set up two-factor authentication upon next login", "Une demande de configuration de l'authentification à deux facteurs sera faite lors de la prochaine connexion");
m.put("Window", "Fenêtre");
m.put("Window Memory", "Mémoire de fenêtre");
@@ -5191,6 +5243,7 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("week:Tue", "Mar");
m.put("week:Wed", "Mer");
m.put("widget:Tabs", "Onglets");
+ m.put("wiki", "wiki");
m.put("workspaces", "espaces de travail");
m.put("you may show this page later via incompatibilities link in help menu", "vous pouvez afficher cette page plus tard via le lien des incompatibilités dans le menu d'aide");
m.put("{0} Lines", "{0} Lignes");
@@ -5229,20 +5282,8 @@ public class Translation_fr extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "{javax.validation.constraints.NotEmpty.message}");
m.put("{javax.validation.constraints.NotNull.message}", "{javax.validation.constraints.NotNull.message}");
m.put("{javax.validation.constraints.Size.message}", "{javax.validation.constraints.Size.message}");
- m.put("All Types", "Tous les types");
- m.put("Auto", "Auto");
- m.put("Color mode", "Mode couleur");
- m.put("Dark", "Sombre");
- m.put("Light", "Clair");
- m.put("Main Repository", "Référentiel principal");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "Nombre maximum de fois que cet utilisateur IA peut être réveillé dans une seule tâche. Lorsque la limite est atteinte, l'utilisateur IA ne s'exécutera pas et un commentaire système sera publié à la place");
- m.put("Playwright Test Report", "Rapport de test Playwright");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "Spécifiez les fichiers à publier par rapport au <a href='https://docs.onedev.io/concepts#job-workdir'>répertoire de travail du job</a>.\nLes fichiers publiés doivent inclure le rapport JSON de Playwright et tous les artefacts référencés, tels que les captures d'écran et les traces.\nPar exemple, exécutez <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndepuis le répertoire de travail du job, et utilisez <code>test-results/**</code> comme modèle de fichier pour publier le rapport et les artefacts ensemble.\nUtilisez * ou ? pour le filtrage par motif");
- m.put("Submodule", "Sous-module");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "Si oui ou non récupérer les sous-modules. Référez-vous à\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>ce tutoriel</a> sur\ncomment configurer l'authentification des sous-modules\n");
+ m.put("Add home page", "Ajouter la page d'accueil");
+ m.put("Home page not found", "Page d'accueil introuvable");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.java
index ecbb65111e..259fcf8f78 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.java
@@ -127,6 +127,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "Un progetto figlio con nome \"{0}\" esiste già sotto \"{1}\"");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"Esiste un file dove stai cercando di creare una sottodirectory. Scegli un nuovo percorso e riprova.");
+ m.put("A page with this name already exists.", "Una pagina con questo nome esiste già.");
m.put("A path with same name already exists.Please choose a different name and try again.",
"Esiste già un percorso con lo stesso nome. Scegli un nome diverso e riprova.");
m.put("A pull request is open for this change", "Una pull request è aperta per questa modifica");
@@ -200,6 +201,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "Aggiungi qui le chiavi GPG per verificare i commit/tag firmati da te");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"Aggiungi qui le chiavi pubbliche GPG da considerare affidabili. I commit firmati con chiavi affidabili saranno mostrati come verificati.");
+ m.put("Add Home page", "Aggiungi pagina principale");
m.put("Add Issue...", "Aggiungi Issue...");
m.put("Add Issues to Iteration", "Aggiungi Issue all'iterazione");
m.put("Add New", "Aggiungi nuovo");
@@ -246,6 +248,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Add new import", "Aggiungi nuova importazione");
m.put("Add new issue creation setting", "Aggiungi nuova impostazione di creazione problema");
m.put("Add new job dependency", "Aggiungi nuova dipendenza di lavoro");
+ m.put("Add new page", "Aggiungi nuova pagina");
m.put("Add new param", "Aggiungi nuovo parametro");
m.put("Add new post-build action", "Aggiungi nuova azione post-build");
m.put("Add new project dependency", "Aggiungi nuova dipendenza di progetto");
@@ -253,6 +256,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Add new step", "Aggiungi nuovo passaggio");
m.put("Add new trigger", "Aggiungi nuovo trigger");
m.put("Add new user data", "Aggiungi nuovi dati utente");
+ m.put("Add page", "Aggiungi pagina");
+ m.put("Add page or upload files", "Aggiungi pagina o carica file");
m.put("Add project", "Aggiungi progetto");
m.put("Add reviewer...", "Aggiungi revisore...");
m.put("Add to batch to commit with other suggestions later", "Aggiungi al batch per il commit con altre proposte più tardi");
@@ -302,6 +307,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("All AI users", "Tutti gli utenti AI");
m.put("All Issues", "Tutti i problemi");
m.put("All RESTful Resources", "Tutte le risorse RESTful");
+ m.put("All Types", "Tutti i tipi");
m.put("All accessible", "Tutti accessibili");
m.put("All builds", "Tutte le build");
m.put("All changes", "Tutte le modifiche");
@@ -439,6 +445,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Authorize user...", "Autorizza utente...");
m.put("Authorized Projects", "Progetti autorizzati");
m.put("Authorized Roles", "Ruoli autorizzati");
+ m.put("Auto", "Auto");
m.put("Auto Merge", "Unione automatica");
m.put("Auto Spec", "Specifica automatica");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -526,6 +533,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Branch Protection", "Protezione del branch");
m.put("Branch Revision", "Revisione del branch");
m.put("Branch is created", "Il branch è stato creato");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "Il branch è aggiornato. Si prega di aggiornare la pagina e reinviare il lavoro");
m.put("Branch update", "Aggiornamento del branch");
m.put("Branches", "Branch");
m.put("Brand Setting Edit Bean", "Bean di modifica delle impostazioni del brand");
@@ -826,6 +834,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "È richiesto il permesso di scrittura del codice per questa operazione");
m.put("Collapse all", "Comprimi tutto");
m.put("Color", "Colore");
+ m.put("Color mode", "Modalità colore");
m.put("Columns", "Colonne");
m.put("Command", "Comando");
m.put("Command Palette", "Palette dei Comandi");
@@ -1023,7 +1032,9 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Current platform", "Piattaforma Corrente");
m.put("Current project", "Progetto Corrente");
m.put("Custom Headers", "Intestazioni Personalizzate");
+ m.put("Customize", "Personalizza");
m.put("DISCARDED", "SCARTATO");
+ m.put("Dark", "Scuro");
m.put("Dashboard Share Bean", "Bean Condivisione Dashboard");
m.put("Dashboard name", "Nome Dashboard");
m.put("Dashboards", "Dashboard");
@@ -1117,6 +1128,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Delete chat", "Elimina chat");
m.put("Delete dashboard", "Elimina la dashboard");
m.put("Delete from branch {0}", "Elimina dal branch {0}");
+ m.put("Delete page", "Elimina pagina");
m.put("Delete this", "Elimina questo");
m.put("Delete this GPG key", "Elimina questa chiave GPG");
m.put("Delete this access token", "Elimina questo token di accesso");
@@ -1133,6 +1145,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Delete this state", "Elimina questo stato");
m.put("Delete this tag", "Elimina questo tag");
m.put("Delete this value", "Elimina questo valore");
+ m.put("Delete this wiki page?", "Eliminare questa pagina wiki?");
m.put("Delete this workspace", "Elimina questo workspace");
m.put("Delete this workspace data", "Elimina questi dati del workspace");
m.put("Deleted by us, modified by them", "Eliminato da noi, modificato da loro");
@@ -1266,6 +1279,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Dockerfile", "Dockerfile");
m.put("Documentation", "Documentazione");
m.put("Don't have an account yet?", "Non hai ancora un account?");
+ m.put("Down", "Giù");
m.put("Download", "Scarica");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"Scarica <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> o <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. Un nuovo token agente sarà incluso nel pacchetto");
@@ -1274,6 +1288,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Download log", "Scarica il log");
m.put("Download patch", "Scarica patch");
m.put("Download tag archive", "Scarica l'archivio del tag");
+ m.put("Drop files here or click to upload", "Rilascia i file qui o fai clic per caricare");
m.put("Dry Run", "Esecuzione simulata");
m.put("Due Date", "Data di scadenza");
m.put("Due Date Issue Field", "Campo del problema per la data di scadenza");
@@ -1301,6 +1316,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Edit job", "Modifica lavoro");
m.put("Edit on branch {0}", "Modifica sul branch {0}");
m.put("Edit on source branch", "Modifica sul branch sorgente");
+ m.put("Edit page", "Modifica pagina");
m.put("Edit plain", "Modifica semplice");
m.put("Edit saved queries", "Modifica query salvate");
m.put("Edit this access token", "Modifica questo token di accesso");
@@ -2105,6 +2121,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("License Setting", "Impostazione della Licenza");
m.put("Licensed To", "Licenziato a");
m.put("Licensed To:", "Licenziato a:");
+ m.put("Light", "Chiaro");
m.put("Line", "Linea");
m.put("Line: ", "Linea:");
m.put("Lines", "Linee");
@@ -2167,6 +2184,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Mail Service Test", "Test del Servizio di Posta");
m.put("Mail service not configured", "Servizio di posta non configurato");
m.put("Mail service settings saved", "Impostazioni del servizio di posta salvate");
+ m.put("Main Repository", "Repository principale");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"Assicurati che <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 o superiore</a> sia installato");
m.put("Make sure current user has permission to run docker containers", "Assicurati che l'utente corrente abbia il permesso di eseguire contenitori docker");
@@ -2219,6 +2237,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "Dimensione Massima del File di Upload (MB)");
m.put("Max Value", "Valore Massimo");
m.put("Maximum number of entries to return when search code in repository", "Numero massimo di voci da restituire durante la ricerca del codice nel repository");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "Numero massimo di volte in cui questo utente AI può essere attivato in un singolo task. Quando il limite viene raggiunto, l'utente AI non verrà eseguito e verrà pubblicato un commento di sistema");
m.put("Maximum of retries before giving up", "Massimo numero di tentativi prima di arrendersi");
m.put("May not be empty", "Non può essere vuoto");
m.put("Medium", "Medio");
@@ -2406,6 +2426,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("No group by", "Nessun raggruppamento");
m.put("No groups claim returned", "Nessuna rivendicazione di gruppi restituita");
m.put("No groups to remove from", "Nessun gruppo da cui rimuovere");
+ m.put("No headings", "Nessun titolo");
m.put("No ignore file", "Nessun file di ignoranza");
m.put("No image attachments", "Nessun allegato di immagine");
m.put("No imports defined", "Nessuna importazione definita");
@@ -2474,6 +2495,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "Email non verificata della chiave GPG di firma");
m.put("Not a verified email of signing ssh key owner", "Email non verificata del proprietario della chiave ssh di firma");
m.put("Not allowed file type: {0}", "Tipo di file non consentito: {0}");
+ m.put("Not allowed to modify this file", "Non è consentito modificare questo file");
m.put("Not assigned", "Non assegnato");
m.put("Not authorized to create project under \"{0}\"", "Non autorizzato a creare un progetto sotto \"{0}\"");
m.put("Not authorized to create root project", "Non autorizzato a creare un progetto root");
@@ -2904,7 +2926,10 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Package {0} deleted", "Pacchetto {0} eliminato");
m.put("Packages", "Pacchetti");
m.put("Page Not Found", "Pagina Non Trovata");
+ m.put("Page history", "Cronologia della pagina");
m.put("Page is in error, reload to recover", "La pagina è in errore, ricarica per recuperare");
+ m.put("Page name", "Nome della pagina");
+ m.put("Pages", "Pagine");
m.put("Param Instance", "Istanza Parametro");
m.put("Param Instances", "Istanze Parametro");
m.put("Param Map", "Mappa Parametro");
@@ -2999,6 +3024,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Plain text expected", "Testo semplice previsto");
m.put("Platform", "Piattaforma");
m.put("Platforms", "Piattaforme");
+ m.put("Playwright Test Report", "Report di test Playwright");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"Si prega di <a wicket:id=\"download\" class=\"font-weight-bolder\">scaricare</a> i codici di recupero qui sotto e di mantenerli segreti. Questi codici possono essere utilizzati per fornire accesso temporaneo al tuo account nel caso in cui non sia possibile accedere all'applicazione di autenticazione. Non saranno <b>MAI</b> visualizzati di nuovo");
m.put("Please Confirm", "Si prega di confermare");
@@ -3352,6 +3378,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Remove this file", "Rimuovi questo file");
m.put("Remove this image", "Rimuovi questa immagine");
m.put("Remove this reviewer", "Rimuovi questo revisore");
+ m.put("Rename", "Rinomina");
m.put("Rename {0}", "Rinomina {0}");
m.put("Renew Subscription", "Rinnova Abbonamento");
m.put("Renovate CLI Options", "Opzioni CLI di Renovate");
@@ -3368,6 +3395,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"Formato del report modificato. Puoi rieseguire questa build per generare il report nel nuovo formato");
m.put("Repository Sync", "Sincronizzazione del repository");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "Cartella del repository contenente le pagine wiki in Markdown. Lascia vuoto per ereditare dal genitore (predefinito: wiki). Usa Home.md per la pagina iniziale e _Sidebar.md per la barra laterale");
m.put("Reprovision workspace", "Riprovvisione spazio di lavoro");
m.put("Request Body", "Corpo della Richiesta");
m.put("Request For Changes", "Richiesta di modifiche");
@@ -3505,6 +3534,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "Salva impostazioni e ridistribuisci progetti.");
m.put("Save Template", "Salva modello.");
m.put("Save as Mine", "Salva come mio.");
+ m.put("Save page", "Salva pagina");
m.put("Saved Queries", "Query salvate.");
m.put("Scan Path", "Percorso di scansione.");
m.put("Scan Paths", "Percorsi di scansione.");
@@ -3673,7 +3703,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "Mostra problematiche non pianificate nell'iterazione corrente");
m.put("Show matching agents", "Mostra agenti corrispondenti");
m.put("Show more", "Mostra di più");
- m.put("Show more lines", "Mostra più righe");
+ m.put("Show more lines above", "Mostra più righe sopra");
+ m.put("Show more lines below", "Mostra più righe sotto");
m.put("Show next match", "Mostra corrispondenza successiva");
m.put("Show previous match", "Mostra corrispondenza precedente");
m.put("Show test cases of this test suite", "Mostra casi di test di questa suite di test");
@@ -3834,6 +3865,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "Specifica un'immagine Docker da testare");
m.put("Specify a custom field of Enum type", "Specifica un campo personalizzato di tipo Enum");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "Specifica una query predefinita per filtrare/ordinare i problemi risolti dei lavori specificati");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "Specifica una cartella relativa alla radice del repository. Lascia vuoto per caricare nella cartella radice.");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"Specifica una chiave per identificare i dati utente. I dati con la stessa chiave verranno condivisi tra gli ambienti di lavoro\nanche se il progetto è diverso");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3952,6 +3985,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "Specifica i campi da visualizzare nella scheda della board");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"Specifica i file relativi a <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> da pubblicare. Usa * o ? per la corrispondenza dei pattern");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "Specifica i file da pubblicare relativi alla <a href='https://docs.onedev.io/concepts#job-workdir'>directory di lavoro del job</a>.\nI file pubblicati dovrebbero includere il report JSON di Playwright e tutti gli artefatti referenziati, come screenshot e tracce.\nAd esempio, esegui <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndalla directory di lavoro del job e utilizza <code>test-results/**</code> come pattern per pubblicare il report e gli artefatti insieme.\nUsa * o ? per il pattern matching");
m.put("Specify files under above directory to be published", "Specifica i file sotto la directory sopra da pubblicare");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"Specifica i file nella directory sopra da pubblicare. Usa * o ? per il pattern match. <b>NOTA:</b> Se <code>index.html</code> è incluso, sarà servito come pagina iniziale del sito; altrimenti verrà mostrato un elenco dei file pubblicati");
@@ -4209,6 +4244,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Submitted By", "Inviato da");
m.put("Submitted manually", "Inviato manualmente");
m.put("Submitter", "Mittente");
+ m.put("Submodule", "Sottomodulo");
m.put("Subscription Key", "Chiave di Abbonamento");
m.put("Subscription Management", "Gestione Abbonamenti");
m.put("Subscription data", "Dati di Abbonamento");
@@ -4306,6 +4342,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "Test riuscito: autenticazione superata con le seguenti informazioni recuperate:");
m.put("Text", "Testo");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "L'URL del server endpoint che riceverà le richieste POST del webhook");
+ m.put("The branch changed. Copy your edits and reload before saving.", "Il branch è cambiato. Copia le tue modifiche e ricarica prima di salvare.");
+ m.put("The branch changed. Reload before uploading files.", "Il branch è cambiato. Ricarica prima di caricare i file.");
m.put("The change contains disallowed file type(s): {0}", "La modifica contiene tipo(i) di file non consentito(i): {0}");
m.put("The first board will be the default board", "La prima bacheca sarà la bacheca predefinita");
m.put("The first timesheet will be the default timesheet", "Il primo timesheet sarà il timesheet predefinito");
@@ -4466,6 +4504,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "Questo utente si sta autenticando tramite database interno.");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"Questo utente si sta attualmente autenticando tramite sistema esterno. Impostare una password cambierà per utilizzare il database interno");
+ m.put("This wiki page does not exist at this revision.", "Questa pagina wiki non esiste in questa revisione.");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"Questo disattiverà l'abbonamento corrente e tutte le funzionalità enterprise saranno disabilitate, vuoi continuare?");
m.put("This will discard all project specific boards, do you want to continue?", "Questo scarterà tutte le bacheche specifiche del progetto, vuoi continuare?");
@@ -4514,6 +4553,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Toggle half screen", "Attiva/disattiva mezza schermata");
m.put("Toggle matched contents", "Attiva/disattiva i contenuti corrispondenti");
m.put("Toggle navigation", "Attiva/disattiva la navigazione");
+ m.put("Toggle page outline", "Attiva/disattiva contorno pagina");
m.put("Toggle work log", "Attiva/disattiva il registro di lavoro");
m.put("Tokens", "Token");
m.put("Too many commits to load", "Troppi commit da caricare");
@@ -4673,6 +4713,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "Attività di commento al codice non visualizzata");
m.put("Unvote", "Rimuovi voto");
m.put("Unwatched. Click to watch", "Non osservato. Clicca per osservare");
+ m.put("Up", "Su");
m.put("Update", "Aggiorna");
m.put("Update Dependencies via Renovate", "Aggiorna dipendenze tramite Renovate");
m.put("Update Source Branch", "Aggiorna il branch sorgente");
@@ -4688,6 +4729,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "Carica un file PNG trasparente 128x128 da utilizzare come logo per la modalità chiara");
m.put("Upload artifacts", "Carica artefatti");
m.put("Upload avatar", "Carica avatar");
+ m.put("Upload files", "Carica file");
m.put("Upload should be less than {0} Mb", "Il caricamento deve essere inferiore a {0} Mb");
m.put("Upload to Project", "Carica nel progetto");
m.put("Uploaded Caches", "Cache caricate");
@@ -4715,6 +4757,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Use Step Template", "Usa il modello di passaggio");
m.put("Use curl in System Path", "Usa curl nel percorso di sistema");
m.put("Use default", "Usa predefinito");
+ m.put("Use default sidebar?", "Usare la barra laterale predefinita?");
m.put("Use default storage class", "Usa la classe di archiviazione predefinita");
m.put("Use generated branch name", "Usa il nome del branch generato");
m.put("Use generated title and description", "Usa il titolo e la descrizione generati");
@@ -4871,6 +4914,7 @@ public class Translation_it extends TranslationResourceBundle {
"Se disabilitare o meno il modulo di login con password interno e utilizzare solo il login SSO.\n<b class=\"text-info\">CONSIGLI:</b> Se sei bloccato, il login interno può essere riabilitato dalla riga\ndi comando eseguendo <code>bin/enable-internal-login</code>");
m.put("Whether or not to enable code management for the project", "Se abilitare la gestione del codice per il progetto o meno");
m.put("Whether or not to enable issue management for the project", "Se abilitare la gestione dei problemi per il progetto o meno");
+ m.put("Whether or not to enable wiki management for the project", "Abilitare o meno la gestione del wiki per il progetto");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"Se recuperare oggetti LFS se la richiesta di pull è aperta da un progetto diverso o meno");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4892,6 +4936,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "Se richiedere che questa dipendenza abbia successo o meno");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"Se recuperare i gruppi dell'utente di login o meno. Assicurati di aggiungere il claim dei gruppi tramite la configurazione del token dell'app registrata in Entra ID se questa opzione è abilitata. Il claim dei gruppi dovrebbe restituire l'id del gruppo (l'opzione predefinita) tramite vari tipi di token in questo caso");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "Se recuperare o meno i sottomoduli. Consulta\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>questo tutorial</a> su\ncome configurare l'autenticazione dei sottomoduli\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"Se recuperare i sottomoduli o meno. Consulta <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>questo tutorial</a> su come configurare le credenziali di clone sopra per recuperare i sottomoduli");
m.put("Whether or not to run this step inside container", "Se eseguire questo passaggio all'interno del container o meno");
@@ -4913,6 +4959,12 @@ public class Translation_it extends TranslationResourceBundle {
m.put("Widget", "Widget");
m.put("Widget Tab", "Scheda Widget");
m.put("Widget Timesheet Setting", "Impostazione del Foglio Orario Widget");
+ m.put("Wiki", "Wiki");
+ m.put("Wiki Folder", "Cartella Wiki");
+ m.put("Wiki Management", "Gestione Wiki");
+ m.put("Wiki Setting", "Impostazione Wiki");
+ m.put("Wiki Settings", "Impostazioni Wiki");
+ m.put("Wiki settings updated", "Impostazioni wiki aggiornate");
m.put("Will be prompted to set up two-factor authentication upon next login", "Sarà richiesto di configurare l'autenticazione a due fattori al prossimo accesso");
m.put("Window", "Finestra");
m.put("Window Memory", "Memoria Finestra");
@@ -5191,6 +5243,7 @@ public class Translation_it extends TranslationResourceBundle {
m.put("week:Tue", "Mar");
m.put("week:Wed", "Mer");
m.put("widget:Tabs", "Tab");
+ m.put("wiki", "wiki");
m.put("workspaces", "workspace");
m.put("you may show this page later via incompatibilities link in help menu", "puoi mostrare questa pagina più tardi tramite il link delle incompatibilità nel menu di aiuto");
m.put("{0} Lines", "{0} Linee");
@@ -5229,20 +5282,8 @@ public class Translation_it extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "{javax.validation.constraints.NotEmpty.message}");
m.put("{javax.validation.constraints.NotNull.message}", "{javax.validation.constraints.NotNull.message}");
m.put("{javax.validation.constraints.Size.message}", "{javax.validation.constraints.Size.message}");
- m.put("All Types", "Tutti i tipi");
- m.put("Auto", "Auto");
- m.put("Color mode", "Modalità colore");
- m.put("Dark", "Scuro");
- m.put("Light", "Chiaro");
- m.put("Main Repository", "Repository principale");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "Numero massimo di volte in cui questo utente AI può essere attivato in un singolo task. Quando il limite viene raggiunto, l'utente AI non verrà eseguito e verrà pubblicato un commento di sistema");
- m.put("Playwright Test Report", "Report di test Playwright");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "Specifica i file da pubblicare relativi alla <a href='https://docs.onedev.io/concepts#job-workdir'>directory di lavoro del job</a>.\nI file pubblicati dovrebbero includere il report JSON di Playwright e tutti gli artefatti referenziati, come screenshot e tracce.\nAd esempio, esegui <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndalla directory di lavoro del job e utilizza <code>test-results/**</code> come pattern per pubblicare il report e gli artefatti insieme.\nUsa * o ? per il pattern matching");
- m.put("Submodule", "Sottomodulo");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "Se recuperare o meno i sottomoduli. Consulta\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>questo tutorial</a> su\ncome configurare l'autenticazione dei sottomoduli\n");
+ m.put("Add home page", "Aggiungi pagina iniziale");
+ m.put("Home page not found", "Pagina iniziale non trovata");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.java
index 9997fceb39..872de973a4 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.java
@@ -127,6 +127,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "\"{1}\" の下に \"{0}\" という名前の子プロジェクトがすでに存在します");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"サブディレクトリを作成しようとしている場所にファイルが存在します。新しいパスを選択して再試行してください。");
+ m.put("A page with this name already exists.", "この名前のページは既に存在します。");
m.put("A path with same name already exists.Please choose a different name and try again.",
"同じ名前のパスが既に存在します。別の名前を選択して再試行してください。");
m.put("A pull request is open for this change", "この変更に対するプルリクエストが開かれています");
@@ -200,6 +201,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "あなたが署名したコミット/タグを確認するために、ここにGPGキーを追加してください");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"信頼されるGPG公開鍵をここに追加してください。信頼された鍵で署名されたコミットは確認済みとして表示されます。");
+ m.put("Add Home page", "ホームページを追加");
m.put("Add Issue...", "問題を追加...");
m.put("Add Issues to Iteration", "イテレーションに問題を追加");
m.put("Add New", "新規追加");
@@ -246,6 +248,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Add new import", "新しいインポートを追加");
m.put("Add new issue creation setting", "新しい課題作成設定を追加");
m.put("Add new job dependency", "新しいジョブ依存関係を追加");
+ m.put("Add new page", "新しいページを追加");
m.put("Add new param", "新しいパラメータを追加");
m.put("Add new post-build action", "新しいポストビルドアクションを追加");
m.put("Add new project dependency", "新しいプロジェクト依存関係を追加");
@@ -253,6 +256,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Add new step", "新しいステップを追加");
m.put("Add new trigger", "新しいトリガーを追加");
m.put("Add new user data", "新しいユーザーデータを追加");
+ m.put("Add page", "ページを追加");
+ m.put("Add page or upload files", "ページを追加またはファイルをアップロード");
m.put("Add project", "プロジェクトを追加");
m.put("Add reviewer...", "レビュアーを追加...");
m.put("Add to batch to commit with other suggestions later", "後で他の提案と一緒にコミットするためにバッチに追加");
@@ -302,6 +307,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("All AI users", "すべてのAIユーザー");
m.put("All Issues", "すべての課題");
m.put("All RESTful Resources", "すべてのRESTfulリソース");
+ m.put("All Types", "すべてのタイプ");
m.put("All accessible", "すべてアクセス可能");
m.put("All builds", "すべてのビルド");
m.put("All changes", "すべての変更");
@@ -439,6 +445,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Authorize user...", "ユーザーを認可...");
m.put("Authorized Projects", "認可されたプロジェクト");
m.put("Authorized Roles", "認可された役割");
+ m.put("Auto", "自動");
m.put("Auto Merge", "自動マージ");
m.put("Auto Spec", "自動仕様");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -526,6 +533,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Branch Protection", "ブランチ保護");
m.put("Branch Revision", "ブランチリビジョン");
m.put("Branch is created", "ブランチが作成されました");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "ブランチが更新されました。ページをリフレッシュしてジョブを再送信してください");
m.put("Branch update", "ブランチ更新");
m.put("Branches", "ブランチ一覧");
m.put("Brand Setting Edit Bean", "ブランド設定編集Bean");
@@ -826,6 +834,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "この操作にはコード書き込み権限が必要です");
m.put("Collapse all", "すべて折りたたむ");
m.put("Color", "色");
+ m.put("Color mode", "カラーモード");
m.put("Columns", "列");
m.put("Command", "コマンド");
m.put("Command Palette", "コマンドパレット");
@@ -1023,7 +1032,9 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Current platform", "現在のプラットフォーム");
m.put("Current project", "現在のプロジェクト");
m.put("Custom Headers", "カスタムヘッダー");
+ m.put("Customize", "カスタマイズ");
m.put("DISCARDED", "破棄済み");
+ m.put("Dark", "ダーク");
m.put("Dashboard Share Bean", "ダッシュボード共有Bean");
m.put("Dashboard name", "ダッシュボード名");
m.put("Dashboards", "ダッシュボード");
@@ -1117,6 +1128,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Delete chat", "チャットを削除");
m.put("Delete dashboard", "ダッシュボードを削除");
m.put("Delete from branch {0}", "ブランチ {0} から削除");
+ m.put("Delete page", "ページを削除");
m.put("Delete this", "これを削除");
m.put("Delete this GPG key", "このGPGキーを削除");
m.put("Delete this access token", "このアクセストークンを削除");
@@ -1133,6 +1145,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Delete this state", "この状態を削除");
m.put("Delete this tag", "このタグを削除");
m.put("Delete this value", "この値を削除");
+ m.put("Delete this wiki page?", "このウィキページを削除しますか?");
m.put("Delete this workspace", "このワークスペースを削除");
m.put("Delete this workspace data", "このワークスペースデータを削除");
m.put("Deleted by us, modified by them", "私たちによって削除され、彼らによって修正された");
@@ -1266,6 +1279,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Dockerfile", "Dockerfile");
m.put("Documentation", "ドキュメント");
m.put("Don't have an account yet?", "まだアカウントをお持ちでないですか?");
+ m.put("Down", "下へ");
m.put("Download", "ダウンロード");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"<a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> または <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a> をダウンロードしてください。新しいエージェントトークンがパッケージに含まれます。");
@@ -1274,6 +1288,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Download log", "ログをダウンロード");
m.put("Download patch", "パッチをダウンロード");
m.put("Download tag archive", "タグアーカイブをダウンロード");
+ m.put("Drop files here or click to upload", "ファイルをここにドロップするか、クリックしてアップロードしてください");
m.put("Dry Run", "ドライラン");
m.put("Due Date", "期限日");
m.put("Due Date Issue Field", "期限日課題フィールド");
@@ -1301,6 +1316,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Edit job", "ジョブを編集");
m.put("Edit on branch {0}", "ブランチ {0} で編集");
m.put("Edit on source branch", "ソースブランチで編集");
+ m.put("Edit page", "ページを編集");
m.put("Edit plain", "プレーンを編集");
m.put("Edit saved queries", "保存されたクエリを編集");
m.put("Edit this access token", "このアクセストークンを編集");
@@ -2105,6 +2121,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("License Setting", "ライセンス設定");
m.put("Licensed To", "ライセンス対象");
m.put("Licensed To:", "ライセンス対象:");
+ m.put("Light", "ライト");
m.put("Line", "行");
m.put("Line: ", "行:");
m.put("Lines", "行数");
@@ -2167,6 +2184,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Mail Service Test", "メールサービステスト");
m.put("Mail service not configured", "メールサービスが構成されていません");
m.put("Mail service settings saved", "メールサービス設定が保存されました");
+ m.put("Main Repository", "メインリポジトリ");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"<a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17以上</a>がインストールされていることを確認してください");
m.put("Make sure current user has permission to run docker containers", "現在のユーザーがDockerコンテナを実行する権限を持っていることを確認してください");
@@ -2219,6 +2237,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "最大アップロードファイルサイズ(MB)");
m.put("Max Value", "最大値");
m.put("Maximum number of entries to return when search code in repository", "リポジトリ内のコード検索時に返されるエントリの最大数");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "このAIユーザーが単一タスクで起動できる最大回数です。制限に達すると、AIユーザーは実行されず、代わりにシステムコメントが投稿されます");
m.put("Maximum of retries before giving up", "諦める前の最大リトライ回数");
m.put("May not be empty", "空であってはなりません");
m.put("Medium", "中程度");
@@ -2406,6 +2426,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("No group by", "グループ化なし");
m.put("No groups claim returned", "返されたグループクレームなし");
m.put("No groups to remove from", "削除するグループがありません");
+ m.put("No headings", "見出しがありません");
m.put("No ignore file", "無視ファイルなし");
m.put("No image attachments", "画像添付なし");
m.put("No imports defined", "定義されたインポートなし");
@@ -2474,6 +2495,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "署名GPGキーの確認済みメールではありません");
m.put("Not a verified email of signing ssh key owner", "署名sshキー所有者の確認済みメールではありません");
m.put("Not allowed file type: {0}", "許可されていないファイルタイプ: {0}");
+ m.put("Not allowed to modify this file", "このファイルを変更する権限がありません");
m.put("Not assigned", "未割り当て");
m.put("Not authorized to create project under \"{0}\"", "\"{0}\"の下にプロジェクトを作成する権限がありません");
m.put("Not authorized to create root project", "ルートプロジェクトを作成する権限がありません");
@@ -2904,7 +2926,10 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Package {0} deleted", "パッケージ {0} が削除されました");
m.put("Packages", "パッケージ");
m.put("Page Not Found", "ページが見つかりません");
+ m.put("Page history", "ページ履歴");
m.put("Page is in error, reload to recover", "ページにエラーがあります。リロードして回復してください");
+ m.put("Page name", "ページ名");
+ m.put("Pages", "ページ");
m.put("Param Instance", "パラメータインスタンス");
m.put("Param Instances", "パラメータインスタンス");
m.put("Param Map", "パラメータマップ");
@@ -2999,6 +3024,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Plain text expected", "プレーンテキストが期待されます");
m.put("Platform", "プラットフォーム");
m.put("Platforms", "プラットフォーム");
+ m.put("Playwright Test Report", "Playwrightテストレポート");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"以下のリカバリーコードを<a wicket:id=\"download\" class=\"font-weight-bolder\">ダウンロード</a>して秘密に保管してください。これらのコードは、認証アプリケーションにアクセスできない場合にアカウントへの一時的なアクセスを提供するために使用できます。これらは<b>再表示されません</b>");
m.put("Please Confirm", "確認してください");
@@ -3352,6 +3378,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Remove this file", "このファイルを削除");
m.put("Remove this image", "この画像を削除");
m.put("Remove this reviewer", "このレビュアーを削除");
+ m.put("Rename", "名前を変更");
m.put("Rename {0}", "{0}を名前変更");
m.put("Renew Subscription", "サブスクリプションを更新");
m.put("Renovate CLI Options", "Renovate CLI オプション");
@@ -3368,6 +3395,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"レポート形式が変更されました。このビルドを再実行して新しい形式でレポートを生成できます");
m.put("Repository Sync", "リポジトリ同期");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "Markdown ウィキページを含むリポジトリフォルダ。親から継承する場合は空のままにします(デフォルトは wiki)。ホームページには Home.md を、サイドバーには _Sidebar.md を使用します");
m.put("Reprovision workspace", "ワークスペースを再プロビジョン");
m.put("Request Body", "リクエストボディ");
m.put("Request For Changes", "変更のリクエスト");
@@ -3505,6 +3534,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "設定を保存してプロジェクトを再配布");
m.put("Save Template", "テンプレートを保存");
m.put("Save as Mine", "自分用として保存");
+ m.put("Save page", "ページを保存");
m.put("Saved Queries", "保存されたクエリ");
m.put("Scan Path", "スキャンパス");
m.put("Scan Paths", "スキャンパス");
@@ -3673,7 +3703,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "現在のイテレーションにスケジュールされていない課題を表示");
m.put("Show matching agents", "一致するエージェントを表示");
m.put("Show more", "さらに表示");
- m.put("Show more lines", "さらに多くの行を表示");
+ m.put("Show more lines above", "上の行をさらに表示");
+ m.put("Show more lines below", "下の行をさらに表示");
m.put("Show next match", "次の一致を表示");
m.put("Show previous match", "前の一致を表示");
m.put("Show test cases of this test suite", "このテストスイートのテストケースを表示");
@@ -3834,6 +3865,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "テスト対象の Docker イメージを指定します");
m.put("Specify a custom field of Enum type", "Enum 型のカスタムフィールドを指定します");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "指定されたジョブの修正済み課題をフィルタリング/並べ替えるためのデフォルトクエリを指定します");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "リポジトリのルートに対して相対的なフォルダーを指定してください。ルートフォルダーにアップロードする場合は空のままにしてください。");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"ユーザーデータを識別するためのキーを指定します。同じキーを持つデータは、プロジェクトが異なっていてもワークスペース間で共有されます\n");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3952,6 +3985,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "ボードカードに表示するフィールドを指定してください。");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する公開するファイルを指定してください。パターンマッチには*や?を使用してください。");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブ作業ディレクトリ</a>を基準に公開するファイルを指定します。\n公開するファイルには、Playwright JSONレポートとスクリーンショットやトレースなどのすべての参照アーティファクトを含める必要があります。\n例えば、ジョブ作業ディレクトリから<code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nを実行し、<code>test-results/**</code>をファイルパターンとして使用してレポートとアーティファクトを一緒に公開します。\nパターンマッチングには * または ? を使用してください");
m.put("Specify files under above directory to be published", "上記のディレクトリ内で公開するファイルを指定");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"上記ディレクトリ内で公開するファイルを指定してください。パターンマッチには * または ? を使用します。<b>注意:</b> <code>index.html</code> が含まれている場合、それがサイトの開始ページとして提供されます。それ以外の場合は公開されたファイルの一覧が表示されます");
@@ -4209,6 +4244,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Submitted By", "送信者");
m.put("Submitted manually", "手動で送信");
m.put("Submitter", "送信者");
+ m.put("Submodule", "サブモジュール");
m.put("Subscription Key", "サブスクリプションキー");
m.put("Subscription Management", "サブスクリプション管理");
m.put("Subscription data", "サブスクリプションデータ");
@@ -4306,6 +4342,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "テスト成功:以下の情報が取得され、認証が通過しました:");
m.put("Text", "テキスト");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "WebhookのPOSTリクエストを受信するサーバーエンドポイントのURL");
+ m.put("The branch changed. Copy your edits and reload before saving.", "ブランチが変更されました。編集内容をコピーして、保存する前に再読み込みしてください。");
+ m.put("The branch changed. Reload before uploading files.", "ブランチが変更されました。ファイルをアップロードする前に再読み込みしてください。");
m.put("The change contains disallowed file type(s): {0}", "変更には許可されていないファイルタイプが含まれています: {0}");
m.put("The first board will be the default board", "最初のボードがデフォルトボードになります");
m.put("The first timesheet will be the default timesheet", "最初のタイムシートがデフォルトタイムシートになります");
@@ -4466,6 +4504,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "このユーザーは内部データベースを介して認証しています");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"このユーザーは現在外部システムを介して認証しています。パスワードを設定すると内部データベースの使用に切り替わります");
+ m.put("This wiki page does not exist at this revision.", "このウィキページはこのリビジョンでは存在しません。");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"これにより現在のサブスクリプションが無効化され、すべてのエンタープライズ機能が無効になります。続行しますか?");
m.put("This will discard all project specific boards, do you want to continue?", "これによりプロジェクト固有のすべてのボードが破棄されます。続行しますか?");
@@ -4514,6 +4553,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Toggle half screen", "ハーフスクリーンを切り替え");
m.put("Toggle matched contents", "一致した内容を切り替える");
m.put("Toggle navigation", "ナビゲーションを切り替える");
+ m.put("Toggle page outline", "ページアウトラインを切り替え");
m.put("Toggle work log", "作業ログを切り替える");
m.put("Tokens", "トークン");
m.put("Too many commits to load", "読み込むコミットが多すぎます");
@@ -4673,6 +4713,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "未閲覧のコードコメントアクティビティ");
m.put("Unvote", "投票を取り消す");
m.put("Unwatched. Click to watch", "ウォッチ解除。クリックしてウォッチ");
+ m.put("Up", "上へ");
m.put("Update", "更新");
m.put("Update Dependencies via Renovate", "Renovateを使用して依存関係を更新");
m.put("Update Source Branch", "ソースブランチを更新");
@@ -4688,6 +4729,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "ライトモード用のロゴとして使用する128x128の透明なPNGファイルをアップロード");
m.put("Upload artifacts", "アーティファクトをアップロード");
m.put("Upload avatar", "アバターをアップロード");
+ m.put("Upload files", "ファイルをアップロード");
m.put("Upload should be less than {0} Mb", "アップロードは{0}MB未満である必要があります");
m.put("Upload to Project", "プロジェクトにアップロード");
m.put("Uploaded Caches", "アップロードされたキャッシュ");
@@ -4715,6 +4757,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Use Step Template", "ステップテンプレートを使用");
m.put("Use curl in System Path", "システムパス内のcurlを使用");
m.put("Use default", "デフォルトを使用");
+ m.put("Use default sidebar?", "デフォルトのサイドバーを使用しますか?");
m.put("Use default storage class", "デフォルトのストレージクラスを使用");
m.put("Use generated branch name", "生成されたブランチ名を使用");
m.put("Use generated title and description", "生成されたタイトルと説明を使用");
@@ -4871,6 +4914,7 @@ public class Translation_ja extends TranslationResourceBundle {
"内部パスワードログインフォームを無効化し、SSOログインのみを使用するかどうか。\n<b class=\"text-info\">TIPS:</b> ロックアウトされた場合、コマンドラインで<code>bin/enable-internal-login</code>を実行することで内部ログインを再有効化できます。");
m.put("Whether or not to enable code management for the project", "プロジェクトのコード管理を有効にするかどうか");
m.put("Whether or not to enable issue management for the project", "プロジェクトの課題管理を有効にするかどうか");
+ m.put("Whether or not to enable wiki management for the project", "プロジェクトのウィキ管理を有効にするかどうか");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"プルリクエストが異なるプロジェクトから開かれた場合にLFSオブジェクトを取得するかどうか");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4892,6 +4936,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "この依存関係が成功する必要があるかどうか");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"ログインユーザーのグループを取得するかどうか。このオプションを有効にする場合は、Entra IDに登録されたアプリのトークン構成を介してグループクレームを追加してください。この場合、グループクレームはさまざまなトークンタイプを介してデフォルトオプションでグループIDを返す必要があります");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "サブモジュールを取得するかどうか。\nサブモジュール認証の設定方法については、\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>このチュートリアル</a>を参照してください\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"サブモジュールを取得するかどうか。サブモジュールを取得するためのクローン資格情報を設定する方法については、<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>このチュートリアル</a>を参照してください");
m.put("Whether or not to run this step inside container", "このステップをコンテナ内で実行するかどうか");
@@ -4913,6 +4959,12 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("Widget", "ウィジェット");
m.put("Widget Tab", "ウィジェットタブ");
m.put("Widget Timesheet Setting", "ウィジェットタイムシート設定");
+ m.put("Wiki", "ウィキ");
+ m.put("Wiki Folder", "ウィキフォルダ");
+ m.put("Wiki Management", "ウィキ管理");
+ m.put("Wiki Setting", "ウィキ設定");
+ m.put("Wiki Settings", "ウィキ設定");
+ m.put("Wiki settings updated", "ウィキ設定が更新されました");
m.put("Will be prompted to set up two-factor authentication upon next login", "次回のログイン時に二要素認証の設定を求められます");
m.put("Window", "ウィンドウ");
m.put("Window Memory", "ウィンドウメモリ");
@@ -5191,6 +5243,7 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("week:Tue", "火");
m.put("week:Wed", "水");
m.put("widget:Tabs", "タブ");
+ m.put("wiki", "ウィキ");
m.put("workspaces", "ワークスペース");
m.put("you may show this page later via incompatibilities link in help menu", "ヘルプメニューの互換性リンクから後でこのページを表示できます");
m.put("{0} Lines", "{0} 行");
@@ -5229,20 +5282,8 @@ public class Translation_ja extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "{javax.validation.constraints.NotEmpty.message}");
m.put("{javax.validation.constraints.NotNull.message}", "{javax.validation.constraints.NotNull.message}");
m.put("{javax.validation.constraints.Size.message}", "{javax.validation.constraints.Size.message}");
- m.put("All Types", "すべてのタイプ");
- m.put("Auto", "自動");
- m.put("Color mode", "カラーモード");
- m.put("Dark", "ダーク");
- m.put("Light", "ライト");
- m.put("Main Repository", "メインリポジトリ");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "このAIユーザーが単一タスクで起動できる最大回数です。制限に達すると、AIユーザーは実行されず、代わりにシステムコメントが投稿されます");
- m.put("Playwright Test Report", "Playwrightテストレポート");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブ作業ディレクトリ</a>を基準に公開するファイルを指定します。\n公開するファイルには、Playwright JSONレポートとスクリーンショットやトレースなどのすべての参照アーティファクトを含める必要があります。\n例えば、ジョブ作業ディレクトリから<code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nを実行し、<code>test-results/**</code>をファイルパターンとして使用してレポートとアーティファクトを一緒に公開します。\nパターンマッチングには * または ? を使用してください");
- m.put("Submodule", "サブモジュール");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "サブモジュールを取得するかどうか。\nサブモジュール認証の設定方法については、\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>このチュートリアル</a>を参照してください\n");
+ m.put("Add home page", "ホームページを追加");
+ m.put("Home page not found", "ホームページが見つかりません");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.java
index ff35d60efc..d31bab7081 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.java
@@ -127,6 +127,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "\"{1}\" 아래에 이름이 \"{0}\"인 하위 프로젝트가 이미 존재합니다");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"하위 디렉토리를 생성하려는 위치에 파일이 존재합니다. 새로운 경로를 선택하고 다시 시도하세요.");
+ m.put("A page with this name already exists.", "이 이름의 페이지가 이미 존재합니다.");
m.put("A path with same name already exists.Please choose a different name and try again.",
"같은 이름의 경로가 이미 존재합니다. 다른 이름을 선택하고 다시 시도하세요.");
m.put("A pull request is open for this change", "이 변경에 대한 풀 리퀘스트가 열려 있습니다");
@@ -200,6 +201,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "본인이 서명한 커밋/태그를 확인하려면 여기에 GPG 키를 추가하세요");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"신뢰할 수 있는 GPG 공개 키를 여기에 추가하세요. 신뢰할 수 있는 키로 서명된 커밋은 확인된 것으로 표시됩니다.");
+ m.put("Add Home page", "홈 페이지 추가");
m.put("Add Issue...", "문제 추가...");
m.put("Add Issues to Iteration", "반복에 문제 추가");
m.put("Add New", "새로 추가");
@@ -246,6 +248,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Add new import", "새 가져오기 추가");
m.put("Add new issue creation setting", "새 이슈 생성 설정 추가");
m.put("Add new job dependency", "새 작업 종속성 추가");
+ m.put("Add new page", "새 페이지 추가");
m.put("Add new param", "새 매개변수 추가");
m.put("Add new post-build action", "새 후처리 작업 추가");
m.put("Add new project dependency", "새 프로젝트 종속성 추가");
@@ -253,6 +256,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Add new step", "새 단계 추가");
m.put("Add new trigger", "새 트리거 추가");
m.put("Add new user data", "새 사용자 데이터 추가");
+ m.put("Add page", "페이지 추가");
+ m.put("Add page or upload files", "페이지 추가 또는 파일 업로드");
m.put("Add project", "프로젝트 추가");
m.put("Add reviewer...", "검토자 추가...");
m.put("Add to batch to commit with other suggestions later", "나중에 다른 제안과 함께 커밋할 배치에 추가");
@@ -302,6 +307,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("All AI users", "모든 AI 사용자");
m.put("All Issues", "모든 이슈");
m.put("All RESTful Resources", "모든 RESTful 리소스");
+ m.put("All Types", "모든 유형");
m.put("All accessible", "모든 접근 가능");
m.put("All builds", "모든 빌드");
m.put("All changes", "모든 변경 사항");
@@ -439,6 +445,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Authorize user...", "사용자 승인...");
m.put("Authorized Projects", "승인된 프로젝트");
m.put("Authorized Roles", "승인된 역할");
+ m.put("Auto", "자동");
m.put("Auto Merge", "자동 병합");
m.put("Auto Spec", "자동 사양");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -526,6 +533,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Branch Protection", "브랜치 보호");
m.put("Branch Revision", "브랜치 수정");
m.put("Branch is created", "브랜치가 생성되었습니다.");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "브랜치가 업데이트되었습니다. 페이지를 새로고침하고 작업을 다시 제출하세요.");
m.put("Branch update", "브랜치 업데이트");
m.put("Branches", "브랜치들");
m.put("Brand Setting Edit Bean", "브랜드 설정 편집 빈");
@@ -826,6 +834,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "이 작업을 수행하려면 코드 쓰기 권한이 필요합니다.");
m.put("Collapse all", "모두 축소");
m.put("Color", "색상");
+ m.put("Color mode", "색상 모드");
m.put("Columns", "열");
m.put("Command", "명령");
m.put("Command Palette", "명령 팔레트");
@@ -1023,7 +1032,9 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Current platform", "현재 플랫폼");
m.put("Current project", "현재 프로젝트");
m.put("Custom Headers", "사용자 정의 헤더");
+ m.put("Customize", "사용자 정의");
m.put("DISCARDED", "폐기됨");
+ m.put("Dark", "다크");
m.put("Dashboard Share Bean", "대시보드 공유 빈");
m.put("Dashboard name", "대시보드 이름");
m.put("Dashboards", "대시보드");
@@ -1117,6 +1128,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Delete chat", "채팅 삭제");
m.put("Delete dashboard", "대시보드 삭제");
m.put("Delete from branch {0}", "브랜치 {0}에서 삭제");
+ m.put("Delete page", "페이지 삭제");
m.put("Delete this", "이 항목 삭제");
m.put("Delete this GPG key", "이 GPG 키 삭제");
m.put("Delete this access token", "이 액세스 토큰 삭제");
@@ -1133,6 +1145,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Delete this state", "이 상태 삭제");
m.put("Delete this tag", "이 태그 삭제");
m.put("Delete this value", "이 값 삭제");
+ m.put("Delete this wiki page?", "이 위키 페이지를 삭제하시겠습니까?");
m.put("Delete this workspace", "이 워크스페이스 삭제");
m.put("Delete this workspace data", "이 워크스페이스 데이터 삭제");
m.put("Deleted by us, modified by them", "우리가 삭제하고 그들이 수정함");
@@ -1266,6 +1279,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Dockerfile", "도커파일");
m.put("Documentation", "문서");
m.put("Don't have an account yet?", "아직 계정이 없으신가요?");
+ m.put("Down", "아래로");
m.put("Download", "다운로드");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"<a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> 또는 <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>를 다운로드하세요. 패키지에 새로운 에이전트 토큰이 포함됩니다.");
@@ -1274,6 +1288,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Download log", "로그를 다운로드하세요.");
m.put("Download patch", "패치 다운로드");
m.put("Download tag archive", "태그 아카이브를 다운로드하세요.");
+ m.put("Drop files here or click to upload", "파일을 이곳에 드롭하거나 클릭하여 업로드하세요");
m.put("Dry Run", "드라이 런");
m.put("Due Date", "마감일");
m.put("Due Date Issue Field", "마감일 이슈 필드");
@@ -1301,6 +1316,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Edit job", "작업 편집");
m.put("Edit on branch {0}", "브랜치 {0}에서 편집");
m.put("Edit on source branch", "소스 브랜치에서 편집");
+ m.put("Edit page", "페이지 편집");
m.put("Edit plain", "일반 편집");
m.put("Edit saved queries", "저장된 쿼리 편집");
m.put("Edit this access token", "이 액세스 토큰 편집");
@@ -2105,6 +2121,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("License Setting", "라이선스 설정");
m.put("Licensed To", "라이선스 사용자");
m.put("Licensed To:", "라이선스 사용자:");
+ m.put("Light", "라이트");
m.put("Line", "라인");
m.put("Line: ", "라인:");
m.put("Lines", "라인들");
@@ -2167,6 +2184,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Mail Service Test", "메일 서비스 테스트");
m.put("Mail service not configured", "메일 서비스가 구성되지 않음");
m.put("Mail service settings saved", "메일 서비스 설정이 저장됨");
+ m.put("Main Repository", "메인 저장소");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"<a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 이상</a>이 설치되어 있는지 확인하세요.");
m.put("Make sure current user has permission to run docker containers", "현재 사용자가 도커 컨테이너를 실행할 권한이 있는지 확인하세요");
@@ -2219,6 +2237,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "최대 업로드 파일 크기 (MB)");
m.put("Max Value", "최대 값");
m.put("Maximum number of entries to return when search code in repository", "저장소에서 코드 검색 시 반환할 최대 항목 수");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "이 AI 사용자가 단일 작업에서 깨울 수 있는 최대 횟수입니다. 제한에 도달하면 AI 사용자는 실행되지 않으며 대신 시스템 댓글이 게시됩니다");
m.put("Maximum of retries before giving up", "포기하기 전에 최대 재시도 횟수");
m.put("May not be empty", "비어 있을 수 없습니다");
m.put("Medium", "중간");
@@ -2406,6 +2426,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("No group by", "그룹화 없음");
m.put("No groups claim returned", "반환된 그룹 클레임 없음");
m.put("No groups to remove from", "제거할 그룹이 없습니다");
+ m.put("No headings", "헤딩 없음");
m.put("No ignore file", "무시 파일 없음");
m.put("No image attachments", "이미지 첨부 없음");
m.put("No imports defined", "정의된 가져오기 없음");
@@ -2474,6 +2495,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "GPG 키 서명의 확인된 이메일이 아닙니다");
m.put("Not a verified email of signing ssh key owner", "서명 ssh 키 소유자의 확인된 이메일이 아님");
m.put("Not allowed file type: {0}", "허용되지 않는 파일 유형: {0}");
+ m.put("Not allowed to modify this file", "이 파일을 수정할 수 없습니다.");
m.put("Not assigned", "할당되지 않음");
m.put("Not authorized to create project under \"{0}\"", "\"{0}\" 아래에 프로젝트를 생성할 권한이 없습니다.");
m.put("Not authorized to create root project", "루트 프로젝트를 생성할 권한이 없습니다.");
@@ -2904,7 +2926,10 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Package {0} deleted", "패키지 {0}이 삭제되었습니다.");
m.put("Packages", "패키지들");
m.put("Page Not Found", "페이지를 찾을 수 없습니다");
+ m.put("Page history", "페이지 기록");
m.put("Page is in error, reload to recover", "페이지에 오류가 있습니다. 복구하려면 다시 로드하십시오.");
+ m.put("Page name", "페이지 이름");
+ m.put("Pages", "페이지들");
m.put("Param Instance", "매개변수 인스턴스");
m.put("Param Instances", "매개변수 인스턴스들");
m.put("Param Map", "매개변수 맵");
@@ -2999,6 +3024,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Plain text expected", "일반 텍스트 예상됨");
m.put("Platform", "플랫폼");
m.put("Platforms", "플랫폼들");
+ m.put("Playwright Test Report", "Playwright 테스트 보고서");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"아래 복구 코드를 <a wicket:id=\"download\" class=\"font-weight-bolder\">다운로드</a>하고 비밀로 유지하세요. 이 코드는 인증 애플리케이션에 접근할 수 없는 경우 계정에 일회성 접근을 제공하는 데 사용됩니다. 이 코드는 <b>다시 표시되지 않습니다</b>");
m.put("Please Confirm", "확인해주세요");
@@ -3352,6 +3378,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Remove this file", "이 파일 제거");
m.put("Remove this image", "이 이미지를 제거하십시오");
m.put("Remove this reviewer", "이 리뷰어를 제거하십시오");
+ m.put("Rename", "이름 변경");
m.put("Rename {0}", "{0} 이름 변경");
m.put("Renew Subscription", "구독 갱신");
m.put("Renovate CLI Options", "Renovate CLI 옵션");
@@ -3368,6 +3395,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"보고서 형식이 변경되었습니다. 새 형식으로 보고서를 생성하려면 이 빌드를 다시 실행하십시오");
m.put("Repository Sync", "저장소 동기화");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "Markdown 위키 페이지를 포함하는 저장소 폴더입니다. 상위 폴더에서 상속하려면 비워 두세요 (기본값은 wiki). 홈 페이지는 Home.md를 사용하고 사이드바는 _Sidebar.md를 사용하세요.");
m.put("Reprovision workspace", "작업 공간 재프로비저닝");
m.put("Request Body", "요청 본문");
m.put("Request For Changes", "변경 요청");
@@ -3505,6 +3534,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "설정 저장 및 프로젝트 재배포");
m.put("Save Template", "템플릿 저장");
m.put("Save as Mine", "내 것으로 저장");
+ m.put("Save page", "페이지 저장");
m.put("Saved Queries", "저장된 쿼리");
m.put("Scan Path", "스캔 경로");
m.put("Scan Paths", "스캔 경로들");
@@ -3673,7 +3703,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "현재 반복에 일정되지 않은 이슈 보기");
m.put("Show matching agents", "일치하는 에이전트 보기");
m.put("Show more", "더 보기");
- m.put("Show more lines", "더 많은 줄 보기");
+ m.put("Show more lines above", "위쪽 줄 더 보기");
+ m.put("Show more lines below", "아래쪽 줄 더 보기");
m.put("Show next match", "다음 일치 항목 보기");
m.put("Show previous match", "이전 일치 항목 보기");
m.put("Show test cases of this test suite", "이 테스트 스위트의 테스트 케이스 보기");
@@ -3834,6 +3865,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "테스트할 Docker 이미지를 지정합니다");
m.put("Specify a custom field of Enum type", "Enum 유형의 사용자 정의 필드를 지정합니다");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "지정된 작업의 고정된 이슈를 필터링/정렬하기 위한 기본 쿼리를 지정합니다");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "저장소 루트에 상대적인 폴더를 지정하세요. 루트 폴더에 업로드하려면 비워 두세요.");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"사용자 데이터를 식별할 키를 지정하십시오. 동일한 키를 가진 데이터는 프로젝트가 다르더라도 워크스페이스 간에 공유됩니다\n");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3952,6 +3985,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "보드 카드에 표시할 필드를 지정하세요.");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 게시할 파일을 지정하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 작업 디렉토리</a>를 기준으로 게시할 파일을 지정하세요.\n게시된 파일에는 Playwright JSON 보고서와 스크린샷 및 추적과 같은 모든 참조 아티팩트가 포함되어야 합니다.\n예를 들어, 작업 작업 디렉토리에서 <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\n를 실행하고, 보고서와 아티팩트를 함께 게시하기 위해 <code>test-results/**</code>를 파일 패턴으로 사용하세요.\n패턴 매칭에는 * 또는 ?를 사용하세요");
m.put("Specify files under above directory to be published", "위 디렉토리 아래에 게시할 파일 지정");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"위 디렉토리 아래에서 게시할 파일을 지정하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요. <b>참고:</b> <code>index.html</code>이 포함된 경우, 사이트 시작 페이지로 제공됩니다. 그렇지 않으면 게시된 파일 목록이 표시됩니다.");
@@ -4209,6 +4244,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Submitted By", "제출자");
m.put("Submitted manually", "수동으로 제출됨");
m.put("Submitter", "제출자");
+ m.put("Submodule", "서브모듈");
m.put("Subscription Key", "구독 키");
m.put("Subscription Management", "구독 관리");
m.put("Subscription data", "구독 데이터");
@@ -4306,6 +4342,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "테스트 성공: 아래 정보가 검색된 상태로 인증 통과:");
m.put("Text", "텍스트");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "웹훅 POST 요청을 받을 서버 엔드포인트의 URL");
+ m.put("The branch changed. Copy your edits and reload before saving.", "브랜치가 변경되었습니다. 편집 내용을 복사하고 저장하기 전에 다시 로드하세요.");
+ m.put("The branch changed. Reload before uploading files.", "브랜치가 변경되었습니다. 파일을 업로드하기 전에 다시 로드하세요.");
m.put("The change contains disallowed file type(s): {0}", "변경 사항에 허용되지 않는 파일 유형이 포함되어 있습니다: {0}");
m.put("The first board will be the default board", "첫 번째 보드가 기본 보드가 됩니다");
m.put("The first timesheet will be the default timesheet", "첫 번째 타임시트가 기본 타임시트가 됩니다");
@@ -4466,6 +4504,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "이 사용자는 내부 데이터베이스를 통해 인증 중입니다.");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"이 사용자는 현재 외부 시스템을 통해 인증 중입니다. 비밀번호를 설정하면 내부 데이터베이스를 사용하도록 전환됩니다");
+ m.put("This wiki page does not exist at this revision.", "이 위키 페이지는 이 리비전에 존재하지 않습니다.");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"이 작업은 현재 구독을 비활성화하며 모든 엔터프라이즈 기능이 비활성화됩니다. 계속하시겠습니까?");
m.put("This will discard all project specific boards, do you want to continue?", "이 작업은 프로젝트별 보드를 모두 삭제합니다. 계속하시겠습니까?");
@@ -4514,6 +4553,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Toggle half screen", "반 화면 전환");
m.put("Toggle matched contents", "일치하는 내용 토글");
m.put("Toggle navigation", "탐색 토글");
+ m.put("Toggle page outline", "페이지 개요 전환");
m.put("Toggle work log", "작업 로그 토글");
m.put("Tokens", "토큰");
m.put("Too many commits to load", "로드할 커밋이 너무 많습니다");
@@ -4673,6 +4713,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "확인되지 않은 코드 댓글 활동");
m.put("Unvote", "투표 취소");
m.put("Unwatched. Click to watch", "관찰 취소됨. 클릭하여 관찰");
+ m.put("Up", "위로");
m.put("Update", "업데이트");
m.put("Update Dependencies via Renovate", "Renovate를 통해 종속성 업데이트");
m.put("Update Source Branch", "소스 브랜치 업데이트");
@@ -4688,6 +4729,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "라이트 모드 로고로 사용하기 위해 128x128 투명 png 파일 업로드");
m.put("Upload artifacts", "아티팩트 업로드");
m.put("Upload avatar", "아바타 업로드");
+ m.put("Upload files", "파일 업로드");
m.put("Upload should be less than {0} Mb", "업로드는 {0} Mb보다 작아야 합니다");
m.put("Upload to Project", "프로젝트로 업로드");
m.put("Uploaded Caches", "업로드된 캐시");
@@ -4715,6 +4757,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Use Step Template", "단계 템플릿 사용");
m.put("Use curl in System Path", "시스템 경로에서 curl 사용");
m.put("Use default", "기본값 사용");
+ m.put("Use default sidebar?", "기본 사이드바를 사용하시겠습니까?");
m.put("Use default storage class", "기본 스토리지 클래스 사용");
m.put("Use generated branch name", "생성된 브랜치 이름 사용");
m.put("Use generated title and description", "생성된 제목 및 설명 사용");
@@ -4871,6 +4914,7 @@ public class Translation_ko extends TranslationResourceBundle {
"내부 비밀번호 로그인 양식을 비활성화하고 SSO 로그인만 사용할지 여부.\n<b class=\"text-info\">팁:</b> 잠금 해제된 경우, 명령줄에서 <code>bin/enable-internal-login</code>을 실행하여 내부 로그인을 다시 활성화할 수 있습니다");
m.put("Whether or not to enable code management for the project", "프로젝트에 대한 코드 관리를 활성화할지 여부");
m.put("Whether or not to enable issue management for the project", "프로젝트에 대한 문제 관리를 활성화할지 여부");
+ m.put("Whether or not to enable wiki management for the project", "프로젝트에 대해 위키 관리를 활성화할지 여부");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"풀 리퀘스트가 다른 프로젝트에서 열렸을 경우 LFS 객체를 가져올지 여부");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4892,6 +4936,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "이 종속성이 성공해야 하는지 여부");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"로그인 사용자의 그룹을 검색할지 여부. 이 옵션이 활성화된 경우, Entra ID에 등록된 앱의 토큰 구성에서 그룹 클레임을 추가해야 합니다. 이 경우 그룹 클레임은 다양한 토큰 유형을 통해 기본 옵션으로 그룹 ID를 반환해야 합니다");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "서브모듈을 가져올지 여부입니다.\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>이 튜토리얼</a>을 참조하여\n서브모듈 인증을 구성하는 방법을 확인하세요\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"하위 모듈을 검색할지 여부. 위의 클론 자격 증명을 설정하는 방법에 대한 <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>이 튜토리얼</a>을 참조하세요");
m.put("Whether or not to run this step inside container", "이 단계를 컨테이너 내부에서 실행할지 여부");
@@ -4913,6 +4959,12 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("Widget", "위젯");
m.put("Widget Tab", "위젯 탭");
m.put("Widget Timesheet Setting", "위젯 타임시트 설정");
+ m.put("Wiki", "위키");
+ m.put("Wiki Folder", "위키 폴더");
+ m.put("Wiki Management", "위키 관리");
+ m.put("Wiki Setting", "위키 설정");
+ m.put("Wiki Settings", "위키 설정들");
+ m.put("Wiki settings updated", "위키 설정이 업데이트되었습니다.");
m.put("Will be prompted to set up two-factor authentication upon next login", "다음 로그인 시 이중 인증 설정을 요청받게 됩니다");
m.put("Window", "창");
m.put("Window Memory", "창 메모리");
@@ -5191,6 +5243,7 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("week:Tue", "화");
m.put("week:Wed", "수");
m.put("widget:Tabs", "탭");
+ m.put("wiki", "위키");
m.put("workspaces", "워크스페이스들");
m.put("you may show this page later via incompatibilities link in help menu", "도움말 메뉴의 호환성 링크를 통해 나중에 이 페이지를 표시할 수 있습니다");
m.put("{0} Lines", "{0} 줄");
@@ -5229,20 +5282,8 @@ public class Translation_ko extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "{javax.validation.constraints.NotEmpty.message}");
m.put("{javax.validation.constraints.NotNull.message}", "{javax.validation.constraints.NotNull.message}");
m.put("{javax.validation.constraints.Size.message}", "{javax.validation.constraints.Size.message}");
- m.put("All Types", "모든 유형");
- m.put("Auto", "자동");
- m.put("Color mode", "색상 모드");
- m.put("Dark", "다크");
- m.put("Light", "라이트");
- m.put("Main Repository", "메인 저장소");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "이 AI 사용자가 단일 작업에서 깨울 수 있는 최대 횟수입니다. 제한에 도달하면 AI 사용자는 실행되지 않으며 대신 시스템 댓글이 게시됩니다");
- m.put("Playwright Test Report", "Playwright 테스트 보고서");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 작업 디렉토리</a>를 기준으로 게시할 파일을 지정하세요.\n게시된 파일에는 Playwright JSON 보고서와 스크린샷 및 추적과 같은 모든 참조 아티팩트가 포함되어야 합니다.\n예를 들어, 작업 작업 디렉토리에서 <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\n를 실행하고, 보고서와 아티팩트를 함께 게시하기 위해 <code>test-results/**</code>를 파일 패턴으로 사용하세요.\n패턴 매칭에는 * 또는 ?를 사용하세요");
- m.put("Submodule", "서브모듈");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "서브모듈을 가져올지 여부입니다.\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>이 튜토리얼</a>을 참조하여\n서브모듈 인증을 구성하는 방법을 확인하세요\n");
+ m.put("Add home page", "홈 페이지 추가");
+ m.put("Home page not found", "홈 페이지를 찾을 수 없습니다");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.java
index 273abdf9c3..825fc7d538 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.java
@@ -127,6 +127,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "Um projeto filho com o nome \"{0}\" já existe sob \"{1}\"");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"Um arquivo existe onde você está tentando criar um subdiretório. Escolha um novo caminho e tente novamente.");
+ m.put("A page with this name already exists.", "Uma página com este nome já existe.");
m.put("A path with same name already exists.Please choose a different name and try again.",
"Um caminho com o mesmo nome já existe. Por favor, escolha um nome diferente e tente novamente.");
m.put("A pull request is open for this change", "Um pull request está aberto para esta alteração");
@@ -200,6 +201,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "Adicione chaves GPG aqui para verificar commits/tags assinados por você");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"Adicione chaves públicas GPG confiáveis aqui. Commits assinados com chaves confiáveis serão exibidos como verificados.");
+ m.put("Add Home page", "Adicionar página inicial");
m.put("Add Issue...", "Adicionar Problema...");
m.put("Add Issues to Iteration", "Adicionar Problemas à Iteração");
m.put("Add New", "Adicionar Novo");
@@ -246,6 +248,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Add new import", "Adicionar nova importação");
m.put("Add new issue creation setting", "Adicionar nova configuração de criação de problema");
m.put("Add new job dependency", "Adicionar nova dependência de trabalho");
+ m.put("Add new page", "Adicionar nova página");
m.put("Add new param", "Adicionar novo parâmetro");
m.put("Add new post-build action", "Adicionar nova ação pós-construção");
m.put("Add new project dependency", "Adicionar nova dependência de projeto");
@@ -253,6 +256,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Add new step", "Adicionar nova etapa");
m.put("Add new trigger", "Adicionar novo gatilho");
m.put("Add new user data", "Adicionar novos dados de usuário");
+ m.put("Add page", "Adicionar página");
+ m.put("Add page or upload files", "Adicionar página ou carregar arquivos");
m.put("Add project", "Adicionar projeto");
m.put("Add reviewer...", "Adicionar revisor...");
m.put("Add to batch to commit with other suggestions later", "Adicionar ao lote para confirmar com outras sugestões mais tarde");
@@ -302,6 +307,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("All AI users", "Todos os usuários de IA");
m.put("All Issues", "Todos os Problemas");
m.put("All RESTful Resources", "Todos os Recursos RESTful");
+ m.put("All Types", "Todos os Tipos");
m.put("All accessible", "Todos acessíveis");
m.put("All builds", "Todos os builds");
m.put("All changes", "Todas as alterações");
@@ -439,6 +445,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Authorize user...", "Autorizar usuário...");
m.put("Authorized Projects", "Projetos autorizados");
m.put("Authorized Roles", "Papéis autorizados");
+ m.put("Auto", "Automático");
m.put("Auto Merge", "Mesclagem automática");
m.put("Auto Spec", "Especificação automática");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -526,6 +533,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Branch Protection", "Proteção de Ramo");
m.put("Branch Revision", "Revisão do Ramo");
m.put("Branch is created", "A branch foi criada");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "O branch foi atualizado. Por favor, atualize a página e reenvie o trabalho");
m.put("Branch update", "Atualização de Ramo");
m.put("Branches", "Ramos");
m.put("Brand Setting Edit Bean", "Bean de Edição de Configuração de Marca");
@@ -826,6 +834,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "Permissão de escrita de código é necessária para esta operação");
m.put("Collapse all", "Colapsar tudo");
m.put("Color", "Cor");
+ m.put("Color mode", "Modo de cor");
m.put("Columns", "Colunas");
m.put("Command", "Comando");
m.put("Command Palette", "Paleta de Comandos");
@@ -1023,7 +1032,9 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Current platform", "Plataforma Atual");
m.put("Current project", "Projeto Atual");
m.put("Custom Headers", "Cabeçalhos Personalizados");
+ m.put("Customize", "Personalizar");
m.put("DISCARDED", "DESCARTADO");
+ m.put("Dark", "Escuro");
m.put("Dashboard Share Bean", "Bean de Compartilhamento de Painel");
m.put("Dashboard name", "Nome do Painel");
m.put("Dashboards", "Painéis");
@@ -1117,6 +1128,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Delete chat", "Excluir chat");
m.put("Delete dashboard", "Excluir painel");
m.put("Delete from branch {0}", "Excluir da branch {0}");
+ m.put("Delete page", "Excluir página");
m.put("Delete this", "Excluir isto");
m.put("Delete this GPG key", "Excluir esta chave GPG");
m.put("Delete this access token", "Excluir este token de acesso");
@@ -1133,6 +1145,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Delete this state", "Excluir este estado");
m.put("Delete this tag", "Excluir esta tag");
m.put("Delete this value", "Excluir este valor");
+ m.put("Delete this wiki page?", "Excluir esta página wiki?");
m.put("Delete this workspace", "Excluir este workspace");
m.put("Delete this workspace data", "Excluir estes dados de workspace");
m.put("Deleted by us, modified by them", "Excluído por nós, modificado por eles");
@@ -1266,6 +1279,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Dockerfile", "Dockerfile");
m.put("Documentation", "Documentação");
m.put("Don't have an account yet?", "Ainda não tem uma conta?");
+ m.put("Down", "Para baixo");
m.put("Download", "Baixar");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"Baixe <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> ou <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. Um novo token de agente será incluído no pacote");
@@ -1274,6 +1288,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Download log", "Baixar log");
m.put("Download patch", "Baixar patch");
m.put("Download tag archive", "Baixar arquivo de tag");
+ m.put("Drop files here or click to upload", "Solte os arquivos aqui ou clique para fazer upload");
m.put("Dry Run", "Execução Simulada");
m.put("Due Date", "Data de Vencimento");
m.put("Due Date Issue Field", "Campo de Problema com Data de Vencimento");
@@ -1301,6 +1316,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Edit job", "Editar trabalho");
m.put("Edit on branch {0}", "Editar na branch {0}");
m.put("Edit on source branch", "Editar na branch de origem");
+ m.put("Edit page", "Editar página");
m.put("Edit plain", "Editar simples");
m.put("Edit saved queries", "Editar consultas salvas");
m.put("Edit this access token", "Editar este token de acesso");
@@ -2105,6 +2121,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("License Setting", "Configuração de Licença");
m.put("Licensed To", "Licenciado Para");
m.put("Licensed To:", "Licenciado Para:");
+ m.put("Light", "Claro");
m.put("Line", "Linha");
m.put("Line: ", "Linha:");
m.put("Lines", "Linhas");
@@ -2167,6 +2184,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Mail Service Test", "Teste do Serviço de Email");
m.put("Mail service not configured", "Serviço de email não configurado");
m.put("Mail service settings saved", "Configurações do serviço de email salvas");
+ m.put("Main Repository", "Repositório Principal");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"Certifique-se de que <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 ou superior</a> está instalado");
m.put("Make sure current user has permission to run docker containers", "Certifique-se de que o usuário atual tem permissão para executar contêineres docker");
@@ -2219,6 +2237,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "Tamanho Máximo de Arquivo para Upload (MB)");
m.put("Max Value", "Valor Máximo");
m.put("Maximum number of entries to return when search code in repository", "Número máximo de entradas a retornar ao pesquisar código no repositório");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "Número máximo de vezes que este usuário de IA pode ser ativado em uma única tarefa. Quando o limite for atingido, o usuário de IA não será executado e um comentário do sistema será postado em vez disso");
m.put("Maximum of retries before giving up", "Máximo de tentativas antes de desistir");
m.put("May not be empty", "Não pode estar vazio");
m.put("Medium", "Médio");
@@ -2406,6 +2426,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("No group by", "Sem agrupamento");
m.put("No groups claim returned", "Sem reivindicação de grupos retornada");
m.put("No groups to remove from", "Sem grupos para remover");
+ m.put("No headings", "Sem cabeçalhos");
m.put("No ignore file", "Sem arquivo de ignorar");
m.put("No image attachments", "Sem anexos de imagem");
m.put("No imports defined", "Sem importações definidas");
@@ -2474,6 +2495,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "Email não verificado da chave GPG de assinatura");
m.put("Not a verified email of signing ssh key owner", "Não é um email verificado do proprietário da chave ssh de assinatura");
m.put("Not allowed file type: {0}", "Tipo de arquivo não permitido: {0}");
+ m.put("Not allowed to modify this file", "Não é permitido modificar este arquivo");
m.put("Not assigned", "Não atribuído");
m.put("Not authorized to create project under \"{0}\"", "Não autorizado a criar projeto em \"{0}\"");
m.put("Not authorized to create root project", "Não autorizado a criar projeto raiz");
@@ -2904,7 +2926,10 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Package {0} deleted", "Pacote {0} excluído");
m.put("Packages", "Pacotes");
m.put("Page Not Found", "Página Não Encontrada");
+ m.put("Page history", "Histórico da página");
m.put("Page is in error, reload to recover", "A página está com erro, recarregue para recuperar");
+ m.put("Page name", "Nome da página");
+ m.put("Pages", "Páginas");
m.put("Param Instance", "Instância de Parâmetro");
m.put("Param Instances", "Instâncias de Parâmetro");
m.put("Param Map", "Mapa de Parâmetro");
@@ -2999,6 +3024,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Plain text expected", "Texto simples esperado");
m.put("Platform", "Plataforma");
m.put("Platforms", "Plataformas");
+ m.put("Playwright Test Report", "Relatório de Teste Playwright");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"Por favor, <a wicket:id=\"download\" class=\"font-weight-bolder\">baixe</a> os códigos de recuperação abaixo e mantenha-os em segredo. Esses códigos podem ser usados para fornecer acesso único à sua conta caso você não consiga acessar o aplicativo de autenticação. Eles <b>NÃO</b> serão exibidos novamente");
m.put("Please Confirm", "Por favor, confirme");
@@ -3352,6 +3378,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Remove this file", "Remover este arquivo");
m.put("Remove this image", "Remover esta imagem");
m.put("Remove this reviewer", "Remover este revisor");
+ m.put("Rename", "Renomear");
m.put("Rename {0}", "Renomear {0}");
m.put("Renew Subscription", "Renovar Assinatura");
m.put("Renovate CLI Options", "Opções do CLI Renovate");
@@ -3368,6 +3395,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"Formato do relatório alterado. Você pode executar novamente esta build para gerar o relatório no novo formato");
m.put("Repository Sync", "Sincronização do repositório");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "Pasta do repositório contendo páginas wiki em Markdown. Deixe vazio para herdar do pai (padrão é wiki). Use Home.md para a página inicial e _Sidebar.md para a barra lateral");
m.put("Reprovision workspace", "Reprovisionar espaço de trabalho");
m.put("Request Body", "Corpo da Solicitação");
m.put("Request For Changes", "Solicitação de alterações");
@@ -3505,6 +3534,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "Salvar configurações e redistribuir projetos");
m.put("Save Template", "Salvar modelo");
m.put("Save as Mine", "Salvar como meu");
+ m.put("Save page", "Salvar página");
m.put("Saved Queries", "Consultas salvas");
m.put("Scan Path", "Caminho de varredura");
m.put("Scan Paths", "Caminhos de varredura");
@@ -3673,7 +3703,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "Mostrar questões não agendadas na iteração atual");
m.put("Show matching agents", "Mostrar agentes correspondentes");
m.put("Show more", "Mostrar mais");
- m.put("Show more lines", "Mostrar mais linhas");
+ m.put("Show more lines above", "Mostrar mais linhas acima");
+ m.put("Show more lines below", "Mostrar mais linhas abaixo");
m.put("Show next match", "Mostrar próxima correspondência");
m.put("Show previous match", "Mostrar correspondência anterior");
m.put("Show test cases of this test suite", "Mostrar casos de teste desta suíte de testes");
@@ -3834,6 +3865,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "Especifique uma Imagem Docker para Testar");
m.put("Specify a custom field of Enum type", "Especifique um campo personalizado do tipo Enum");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "Especifique uma consulta padrão para filtrar/ordenar issues resolvidas dos jobs especificados");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "Especifique uma pasta relativa à raiz do repositório. Deixe vazio para carregar na pasta raiz.");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"Especifique uma chave para identificar os dados do usuário. Dados com a mesma chave serão compartilhados entre espaços de trabalho\nmesmo que o projeto seja diferente");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3952,6 +3985,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "Especifique os campos a serem exibidos no cartão do quadro");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"Especifique os arquivos relativos ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> a serem publicados. Use * ou ? para correspondência de padrão");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "Especifique os arquivos a serem publicados relativos ao <a href='https://docs.onedev.io/concepts#job-workdir'>diretório de trabalho do job</a>.\nOs arquivos publicados devem incluir o relatório JSON do Playwright e todos os artefatos referenciados, como capturas de tela e rastreamentos.\nPor exemplo, execute <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndo diretório de trabalho do job e use <code>test-results/**</code> como o padrão de arquivo para publicar o relatório e os artefatos juntos.\nUse * ou ? para correspondência de padrões");
m.put("Specify files under above directory to be published", "Especifique arquivos no diretório acima para serem publicados");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"Especifique os arquivos no diretório acima para serem publicados. Use * ou ? para correspondência de padrões. <b>NOTA:</b> Se <code>index.html</code> estiver incluído, ele será exibido como a página inicial do site; caso contrário, será exibida uma lista de arquivos publicados");
@@ -4209,6 +4244,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Submitted By", "Enviado Por");
m.put("Submitted manually", "Enviado manualmente");
m.put("Submitter", "Remetente");
+ m.put("Submodule", "Submódulo");
m.put("Subscription Key", "Chave de Assinatura");
m.put("Subscription Management", "Gerenciamento de Assinatura");
m.put("Subscription data", "Dados de Assinatura");
@@ -4306,6 +4342,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "Teste bem-sucedido: autenticação aprovada com as informações abaixo recuperadas:");
m.put("Text", "Texto");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "A URL do endpoint do servidor que receberá as solicitações POST do webhook");
+ m.put("The branch changed. Copy your edits and reload before saving.", "O branch foi alterado. Copie suas edições e recarregue antes de salvar.");
+ m.put("The branch changed. Reload before uploading files.", "O branch foi alterado. Recarregue antes de carregar arquivos.");
m.put("The change contains disallowed file type(s): {0}", "A alteração contém tipo(s) de arquivo não permitido(s): {0}");
m.put("The first board will be the default board", "O primeiro quadro será o quadro padrão");
m.put("The first timesheet will be the default timesheet", "A primeira folha de horas será a folha padrão");
@@ -4466,6 +4504,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "Este usuário está se autenticando via banco de dados interno.");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"Este usuário está atualmente se autenticando via sistema externo. Definir uma senha mudará para usar o banco de dados interno");
+ m.put("This wiki page does not exist at this revision.", "Esta página wiki não existe nesta revisão.");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"Isso desativará a assinatura atual e todos os recursos empresariais serão desativados, deseja continuar?");
m.put("This will discard all project specific boards, do you want to continue?", "Isso descartará todos os quadros específicos do projeto, deseja continuar?");
@@ -4514,6 +4553,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Toggle half screen", "Alternar meia tela");
m.put("Toggle matched contents", "Alternar conteúdos correspondentes");
m.put("Toggle navigation", "Alternar navegação");
+ m.put("Toggle page outline", "Alternar contorno da página");
m.put("Toggle work log", "Alternar registro de trabalho");
m.put("Tokens", "Tokens");
m.put("Too many commits to load", "Commits demais para carregar");
@@ -4673,6 +4713,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "Atividade de comentário de código não visualizada");
m.put("Unvote", "Remover voto");
m.put("Unwatched. Click to watch", "Não assistido. Clique para assistir");
+ m.put("Up", "Para cima");
m.put("Update", "Atualizar");
m.put("Update Dependencies via Renovate", "Atualizar Dependências via Renovate");
m.put("Update Source Branch", "Atualizar Ramificação de Origem");
@@ -4688,6 +4729,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "Envie um arquivo PNG transparente 128x128 para ser usado como logotipo no modo claro");
m.put("Upload artifacts", "Carregar artefatos");
m.put("Upload avatar", "Enviar avatar");
+ m.put("Upload files", "Carregar arquivos");
m.put("Upload should be less than {0} Mb", "O envio deve ser menor que {0} Mb");
m.put("Upload to Project", "Enviar para o Projeto");
m.put("Uploaded Caches", "Caches Enviados");
@@ -4715,6 +4757,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Use Step Template", "Usar Modelo de Etapa");
m.put("Use curl in System Path", "Usar curl no Caminho do Sistema");
m.put("Use default", "Usar padrão");
+ m.put("Use default sidebar?", "Usar barra lateral padrão?");
m.put("Use default storage class", "Usar classe de armazenamento padrão");
m.put("Use generated branch name", "Usar nome de branch gerado");
m.put("Use generated title and description", "Usar título e descrição gerados");
@@ -4871,6 +4914,7 @@ public class Translation_pt extends TranslationResourceBundle {
"Se deve ou não desativar o formulário de login interno por senha e usar apenas login SSO.\n<b class=\"text-info\">DICAS:</b> Se você estiver bloqueado, o login interno pode ser reativado a partir da linha de comando executando <code>bin/enable-internal-login</code>");
m.put("Whether or not to enable code management for the project", "Se habilitar gerenciamento de código para o projeto ou não");
m.put("Whether or not to enable issue management for the project", "Se habilitar gerenciamento de issues para o projeto ou não");
+ m.put("Whether or not to enable wiki management for the project", "Habilitar ou não o gerenciamento de wiki para o projeto");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"Se buscar objetos LFS se o pull request for aberto de um projeto diferente ou não");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4892,6 +4936,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "Se exigir que esta dependência seja bem-sucedida ou não");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"Se recuperar grupos do usuário de login ou não. Certifique-se de adicionar a reivindicação de grupos via configuração de token do aplicativo registrado no Entra ID se esta opção estiver habilitada. A reivindicação de grupos deve retornar o id do grupo (a opção padrão) via vários tipos de token neste caso");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "Se deve ou não recuperar submódulos. Consulte\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>este tutorial</a> sobre\ncomo configurar a autenticação de submódulos\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"Se recuperar submódulos ou não. Consulte <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>este tutorial</a> sobre como configurar a credencial de clone acima para recuperar submódulos");
m.put("Whether or not to run this step inside container", "Se executar esta etapa dentro do container ou não");
@@ -4913,6 +4959,12 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("Widget", "Widget");
m.put("Widget Tab", "Aba do Widget");
m.put("Widget Timesheet Setting", "Configuração de Timesheet do Widget");
+ m.put("Wiki", "Wiki");
+ m.put("Wiki Folder", "Pasta Wiki");
+ m.put("Wiki Management", "Gerenciamento de Wiki");
+ m.put("Wiki Setting", "Configuração de Wiki");
+ m.put("Wiki Settings", "Configurações de Wiki");
+ m.put("Wiki settings updated", "Configurações de wiki atualizadas");
m.put("Will be prompted to set up two-factor authentication upon next login", "Será solicitado a configurar a autenticação de dois fatores no próximo login");
m.put("Window", "Janela");
m.put("Window Memory", "Memória da Janela");
@@ -5191,6 +5243,7 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("week:Tue", "Ter");
m.put("week:Wed", "Qua");
m.put("widget:Tabs", "Abas");
+ m.put("wiki", "wiki");
m.put("workspaces", "workspaces");
m.put("you may show this page later via incompatibilities link in help menu", "você pode mostrar esta página mais tarde via link de incompatibilidades no menu de ajuda");
m.put("{0} Lines", "{0} Linhas");
@@ -5229,20 +5282,8 @@ public class Translation_pt extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "{javax.validation.constraints.NotEmpty.message}");
m.put("{javax.validation.constraints.NotNull.message}", "{javax.validation.constraints.NotNull.message}");
m.put("{javax.validation.constraints.Size.message}", "{javax.validation.constraints.Size.message}");
- m.put("All Types", "Todos os Tipos");
- m.put("Auto", "Automático");
- m.put("Color mode", "Modo de cor");
- m.put("Dark", "Escuro");
- m.put("Light", "Claro");
- m.put("Main Repository", "Repositório Principal");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "Número máximo de vezes que este usuário de IA pode ser ativado em uma única tarefa. Quando o limite for atingido, o usuário de IA não será executado e um comentário do sistema será postado em vez disso");
- m.put("Playwright Test Report", "Relatório de Teste Playwright");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "Especifique os arquivos a serem publicados relativos ao <a href='https://docs.onedev.io/concepts#job-workdir'>diretório de trabalho do job</a>.\nOs arquivos publicados devem incluir o relatório JSON do Playwright e todos os artefatos referenciados, como capturas de tela e rastreamentos.\nPor exemplo, execute <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\ndo diretório de trabalho do job e use <code>test-results/**</code> como o padrão de arquivo para publicar o relatório e os artefatos juntos.\nUse * ou ? para correspondência de padrões");
- m.put("Submodule", "Submódulo");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "Se deve ou não recuperar submódulos. Consulte\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>este tutorial</a> sobre\ncomo configurar a autenticação de submódulos\n");
+ m.put("Add home page", "Adicionar página inicial");
+ m.put("Home page not found", "Página inicial não encontrada");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.java
index 7c0fbaf24b..74df5b7c13 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.java
@@ -153,6 +153,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("A child project with name \"{0}\" already exists under \"{1}\"", "在 \"{1}\" 下已存在名为 \"{0}\" 的子项目");
m.put("A file exists where you’re trying to create a subdirectory. Choose a new path and try again..",
"您尝试创建子目录的地方已存在一个文件。请选择一个新路径并重试。");
+ m.put("A page with this name already exists.", "一个具有此名称的页面已存在。");
m.put("A path with same name already exists.Please choose a different name and try again.",
"具有相同名称的路径已存在。请选择一个不同的名称并重试。");
m.put("A pull request is open for this change", "一个合并请求正在审查此更改");
@@ -226,6 +227,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Add GPG keys here to verify commits/tags signed by you", "在此添加 GPG 密钥以验证由您签名的提交/标签");
m.put("Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.",
"添加 GPG 公钥到受信任的公钥列表中。受信任的公钥签名的提交将显示为已验证。");
+ m.put("Add Home page", "添加主页");
m.put("Add Issue...", "添加工单...");
m.put("Add Issues to Iteration", "将工单添加到迭代");
m.put("Add New", "添加");
@@ -272,6 +274,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Add new import", "添加新导入");
m.put("Add new issue creation setting", "添加新工单创建设置");
m.put("Add new job dependency", "添加新任务依赖");
+ m.put("Add new page", "添加新页面");
m.put("Add new param", "添加新参数");
m.put("Add new post-build action", "添加新构建后操作");
m.put("Add new project dependency", "添加新项目依赖");
@@ -279,6 +282,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Add new step", "添加新步骤");
m.put("Add new trigger", "添加新触发器");
m.put("Add new user data", "添加新的用户数据");
+ m.put("Add page", "添加页面");
+ m.put("Add page or upload files", "添加页面或上传文件");
m.put("Add project", "添加项目");
m.put("Add reviewer...", "添加审查人员...");
m.put("Add to batch to commit with other suggestions later", "稍后与其他建议一起提交");
@@ -328,6 +333,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("All AI users", "所有 AI 用户");
m.put("All Issues", "所有工单");
m.put("All RESTful Resources", "所有RESTful资源");
+ m.put("All Types", "所有类型");
m.put("All accessible", "所有可访问的");
m.put("All builds", "所有构建");
m.put("All changes", "所有更改");
@@ -465,6 +471,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Authorize user...", "授权用户...");
m.put("Authorized Projects", "已授权项目");
m.put("Authorized Roles", "已授权角色");
+ m.put("Auto", "自动");
m.put("Auto Merge", "自动合并");
m.put("Auto Spec", "自动规范");
m.put("Auto update check is performed by requesting an image in your browser from onedev.io indicating new version availability, with color indicating severity of the update. It works the same way as how gravatar requests avatar images. If disabled, you are highly recommended to check update manually from time to time (can be done via help menu on left bottom of the screen) to see if there are any security/critical fixes",
@@ -552,6 +559,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Branch Protection", "分支保护");
m.put("Branch Revision", "分支修订");
m.put("Branch is created", "分支已创建");
+ m.put("Branch is updated. Please refresh the page and resubmit the job", "分支已更新。请刷新页面并重新提交任务");
m.put("Branch update", "分支更新");
m.put("Branches", "分支");
m.put("Brand Setting Edit Bean", "品牌设置编辑Bean");
@@ -852,6 +860,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Code write permission is required for this operation", "需要代码写入权限才能执行此操作");
m.put("Collapse all", "全部折叠");
m.put("Color", "颜色");
+ m.put("Color mode", "颜色模式");
m.put("Columns", "列");
m.put("Command", "命令");
m.put("Command Palette", "命令面板");
@@ -1049,7 +1058,9 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Current platform", "当前平台");
m.put("Current project", "当前项目");
m.put("Custom Headers", "自定义头");
+ m.put("Customize", "自定义");
m.put("DISCARDED", "已放弃");
+ m.put("Dark", "深色");
m.put("Dashboard Share Bean", "仪表盘共享 Bean");
m.put("Dashboard name", "仪表板名称");
m.put("Dashboards", "仪表盘");
@@ -1143,6 +1154,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Delete chat", "删除聊天");
m.put("Delete dashboard", "删除仪表板");
m.put("Delete from branch {0}", "从分支 {0} 删除");
+ m.put("Delete page", "删除页面");
m.put("Delete this", "删除");
m.put("Delete this GPG key", "删除此 GPG 密钥");
m.put("Delete this access token", "删除此访问令牌");
@@ -1159,6 +1171,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Delete this state", "删除该状态");
m.put("Delete this tag", "删除此标签");
m.put("Delete this value", "删除该值");
+ m.put("Delete this wiki page?", "删除此 wiki 页面?");
m.put("Delete this workspace", "删除此工作区");
m.put("Delete this workspace data", "删除此工作区数据");
m.put("Deleted by us, modified by them", "我们删除,他们修改");
@@ -1292,6 +1305,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Dockerfile", "Dockerfile");
m.put("Documentation", "文档");
m.put("Don't have an account yet?", "没有账户?");
+ m.put("Down", "下");
m.put("Download", "下载");
m.put("Download <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> or <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>. A new agent token will be included in the package",
"下载 <a wicket:id=\"agentZip\" class=\"link-primary\">agent.zip</a> 或 <a wicket:id=\"agentTgz\" class=\"link-primary\">agent.tar.gz</a>。新代理令牌将包含在包中");
@@ -1300,6 +1314,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Download log", "下载日志");
m.put("Download patch", "下载补丁");
m.put("Download tag archive", "下载标签归档");
+ m.put("Drop files here or click to upload", "将文件拖到此处或点击上传");
m.put("Dry Run", "试运行");
m.put("Due Date", "截止日期");
m.put("Due Date Issue Field", "截止日期工单字段");
@@ -1327,6 +1342,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Edit job", "编辑任务");
m.put("Edit on branch {0}", "在分支 {0} 编辑");
m.put("Edit on source branch", "在源分支上编辑");
+ m.put("Edit page", "编辑页面");
m.put("Edit plain", "编辑纯文本");
m.put("Edit saved queries", "编辑保存的查询");
m.put("Edit this access token", "编辑此访问令牌");
@@ -2131,6 +2147,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("License Setting", "许可证设置");
m.put("Licensed To", "授权给");
m.put("Licensed To:", "授权给:");
+ m.put("Light", "浅色");
m.put("Line", "行");
m.put("Line: ", "行:");
m.put("Lines", "行");
@@ -2193,6 +2210,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Mail Service Test", "邮件服务测试");
m.put("Mail service not configured", "邮件服务未配置");
m.put("Mail service settings saved", "邮件服务设置已保存");
+ m.put("Main Repository", "主仓库");
m.put("Make sure <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 or higher</a> is installed",
"确保已安装 <a href=\"https://openjdk.java.net\" target=\"_blank\">Java 17 或更高版本</a>");
m.put("Make sure current user has permission to run docker containers", "确保当前用户有权运行 Docker 容器");
@@ -2245,6 +2263,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Max Upload File Size (MB)", "最大上传文件大小 (MB)");
m.put("Max Value", "最大值");
m.put("Maximum number of entries to return when search code in repository", "搜索代码库时返回的最大条目数");
+ m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
+ "此 AI 用户在单个任务中可以被唤醒的最大次数。当达到限制时,AI 用户将不会运行,而是会发布一条系统评论");
m.put("Maximum of retries before giving up", "放弃前的最大重试次数");
m.put("May not be empty", "不能为空");
m.put("Medium", "中等");
@@ -2432,6 +2452,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("No group by", "无分组");
m.put("No groups claim returned", "没有返回组声明");
m.put("No groups to remove from", "没有可移除的组");
+ m.put("No headings", "没有标题");
m.put("No ignore file", "无忽略文件");
m.put("No image attachments", "没有图片附件");
m.put("No imports defined", "无导入");
@@ -2500,6 +2521,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Not a verified email of signing GPG key", "不是签署 GPG 密钥的已验证电子邮件");
m.put("Not a verified email of signing ssh key owner", "不是签署 ssh 密钥所有者的验证邮箱");
m.put("Not allowed file type: {0}", "不允许的文件类型:{0}");
+ m.put("Not allowed to modify this file", "不允许修改此文件");
m.put("Not assigned", "未分配");
m.put("Not authorized to create project under \"{0}\"", "无权限在 \"{0}\" 下创建项目");
m.put("Not authorized to create root project", "无权限创建根项目");
@@ -2930,7 +2952,10 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Package {0} deleted", "包 {0} 已删除");
m.put("Packages", "包");
m.put("Page Not Found", "页面未找到");
+ m.put("Page history", "页面历史");
m.put("Page is in error, reload to recover", "页面发生错误,请刷新页面");
+ m.put("Page name", "页面名称");
+ m.put("Pages", "页面");
m.put("Param Instance", "参数实例");
m.put("Param Instances", "参数实例");
m.put("Param Map", "参数映射");
@@ -3025,6 +3050,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Plain text expected", "需要纯文本");
m.put("Platform", "平台");
m.put("Platforms", "平台");
+ m.put("Playwright Test Report", "Playwright 测试报告");
m.put("Please <a wicket:id=\"download\" class=\"font-weight-bolder\">download</a> recovery codes below and keep them secret. These codes can be used to provide one-time access to your account in case you cannot access the authentication application. They will <b>NOT</b> be displayed again",
"请<a wicket:id=\"download\" class=\"font-weight-bolder\">下载</a>下方的恢复代码并妥善保管。这些代码可用于在您无法访问认证应用程序时提供一次性账户访问权限。它们<b>不会</b>再次显示");
m.put("Please Confirm", "请确认");
@@ -3378,6 +3404,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Remove this file", "删除此文件");
m.put("Remove this image", "删除此图片");
m.put("Remove this reviewer", "移除此审查者");
+ m.put("Rename", "重命名");
m.put("Rename {0}", "重命名 {0}");
m.put("Renew Subscription", "续订订阅");
m.put("Renovate CLI Options", "Renovate CLI 选项");
@@ -3394,6 +3421,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Report format changed. You may re-run this build to generate the report in new format",
"报告格式已更改。您可以重新运行此构建以生成新格式的报告");
m.put("Repository Sync", "仓库同步");
+ m.put("Repository folder containing Markdown wiki pages. Leave empty to inherit from parent (defaults to wiki). Use Home.md for the home page and _Sidebar.md for the sidebar",
+ "包含 Markdown wiki 页面的存储库文件夹。留空以继承父级设置(默认为 wiki)。使用 Home.md 作为主页,使用 _Sidebar.md 作为侧边栏");
m.put("Reprovision workspace", "重新配置工作区");
m.put("Request Body", "请求体");
m.put("Request For Changes", "请求更改");
@@ -3531,6 +3560,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Save Settings & Redistribute Projects", "保存设置并重新分布项目");
m.put("Save Template", "保存模板");
m.put("Save as Mine", "保存为我的");
+ m.put("Save page", "保存页面");
m.put("Saved Queries", "保存的查询");
m.put("Scan Path", "扫描路径");
m.put("Scan Paths", "扫描路径");
@@ -3699,7 +3729,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Show issues not scheduled into current iteration", "显示未安排到当前迭代的工单");
m.put("Show matching agents", "显示匹配的代理");
m.put("Show more", "显示更多");
- m.put("Show more lines", "显示更多行");
+ m.put("Show more lines above", "显示更多上方的行");
+ m.put("Show more lines below", "显示更多下方的行");
m.put("Show next match", "显示下一个匹配");
m.put("Show previous match", "显示上一个匹配");
m.put("Show test cases of this test suite", "显示此测试套件的测试用例");
@@ -3860,6 +3891,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Specify a Docker Image to Test Against", "指定要测试的 Docker 镜像");
m.put("Specify a custom field of Enum type", "指定枚举类型的自定义字段");
m.put("Specify a default query to filter/order fixed issues of specified jobs", "指定用于过滤/排序指定任务修复工单的默认查询");
+ m.put("Specify a folder relative to the repository root. Leave empty to upload to the root folder.",
+ "指定一个相对于存储库根目录的文件夹。留空以上传到根文件夹。");
m.put("Specify a key to identify the user data. Data with same key will be shared across workspaces\neven if project is different",
"指定一个键来标识用户数据。具有相同键的数据将在工作区之间共享\n即使项目不同。");
m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",
@@ -3978,6 +4011,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Specify fields to display in board card", "指定在看板卡片中显示的字段");
m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a> to be published. Use * or ? for pattern match",
"指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 要发布的文件。使用 * 或 ? 进行模式匹配");
+ m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
+ "指定相对于<a href='https://docs.onedev.io/concepts#job-workdir'>任务工作目录</a>的要发布的文件。\n发布的文件应包括 Playwright JSON 报告和所有引用的制品,例如截图和跟踪文件。\n例如,从任务工作目录运行 <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\n,并使用 <code>test-results/**</code> 作为文件模式来一起发布报告和制品。\n使用 * 或 ? 进行模式匹配");
m.put("Specify files under above directory to be published", "指定要发布的目录下的文件");
m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> If <code>index.html</code> is included, it will be served as the site start page; otherwise a listing of published files will be shown",
"指定上述目录下要发布的文件。使用 * 或 ? 进行模式匹配。<b>注意:</b>如果包含 <code>index.html</code>,它将作为站点的起始页面;否则将显示已发布文件的列表");
@@ -4235,6 +4270,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Submitted By", "提交者");
m.put("Submitted manually", "手动构建");
m.put("Submitter", "提交者");
+ m.put("Submodule", "子模块");
m.put("Subscription Key", "订阅密钥");
m.put("Subscription Management", "订阅管理");
m.put("Subscription data", "订阅数据");
@@ -4332,6 +4368,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Test successful: authentication passed with below information retrieved:", "认证成功: 认证通过,已查询到以下信息:");
m.put("Text", "文本");
m.put("The URL of the server endpoint that will receive the webhook POST requests", "接收 Webhook POST 请求的服务器端点 URL");
+ m.put("The branch changed. Copy your edits and reload before saving.", "分支已更改。复制您的编辑并重新加载后再保存。");
+ m.put("The branch changed. Reload before uploading files.", "分支已更改。重新加载后再上传文件。");
m.put("The change contains disallowed file type(s): {0}", "更改包含不允许的文件类型:{0}");
m.put("The first board will be the default board", "第一个看板将成为默认看板");
m.put("The first timesheet will be the default timesheet", "第一个时间表将成为默认时间表");
@@ -4492,6 +4530,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("This user is authenticating via internal database.", "此用户通过内部数据库进行身份验证。");
m.put("This user is currently authenticating via external system. Setting password will switch to use internal database",
"该用户当前通过外部系统进行身份验证。设置密码将切换到使用内部数据库");
+ m.put("This wiki page does not exist at this revision.", "此 wiki 页面在此修订版中不存在。");
m.put("This will deactivate current subscription and all enterprise features will be disabled, do you want to continue?",
"这将停用当前订阅,所有企业功能将被禁用,您确定要继续吗?");
m.put("This will discard all project specific boards, do you want to continue?", "这将丢弃所有项目特定的看板,您确定要继续吗?");
@@ -4540,6 +4579,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Toggle half screen", "切换半屏");
m.put("Toggle matched contents", "切换匹配内容");
m.put("Toggle navigation", "切换导航");
+ m.put("Toggle page outline", "切换页面大纲");
m.put("Toggle work log", "切换工作日志");
m.put("Tokens", "令牌");
m.put("Too many commits to load", "加载的提交太多");
@@ -4699,6 +4739,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Unviewed code comment activity", "未查看的代码评论活动");
m.put("Unvote", "取消投票");
m.put("Unwatched. Click to watch", "未关注。点击关注");
+ m.put("Up", "上");
m.put("Update", "更新");
m.put("Update Dependencies via Renovate", "通过 Renovate 更新依赖");
m.put("Update Source Branch", "更新源分支");
@@ -4714,6 +4755,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Upload a 128x128 transparent png file to be used as logo for light mode", "上传一个 128x128 的透明 PNG 文件,用作亮模式下的标志");
m.put("Upload artifacts", "上传制品");
m.put("Upload avatar", "上传头像");
+ m.put("Upload files", "上传文件");
m.put("Upload should be less than {0} Mb", "上传应该小于 {0} Mb");
m.put("Upload to Project", "上传到项目");
m.put("Uploaded Caches", "上传的缓存");
@@ -4741,6 +4783,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Use Step Template", "使用步骤模板");
m.put("Use curl in System Path", "使用系统路径中的 curl");
m.put("Use default", "使用默认");
+ m.put("Use default sidebar?", "使用默认侧边栏?");
m.put("Use default storage class", "使用默认存储类");
m.put("Use generated branch name", "使用生成的分支名称");
m.put("Use generated title and description", "使用生成的标题和描述");
@@ -4897,6 +4940,7 @@ public class Translation_zh extends TranslationResourceBundle {
"是否禁用内部密码登录表单并仅使用 SSO 登录。\n<b class=\"text-info\">提示:</b>如果您被锁定,可以通过运行 <code>bin/enable-internal-login</code> 从命令\n行重新启用内部登录");
m.put("Whether or not to enable code management for the project", "是否为项目启用代码管理");
m.put("Whether or not to enable issue management for the project", "是否为项目启用工单管理");
+ m.put("Whether or not to enable wiki management for the project", "是否启用项目的 wiki 管理");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project.",
"如果启用此选项,git lfs 命令需要安装在 OneDev 服务器上(即使此步骤在其他节点上运行)");
m.put("Whether or not to fetch LFS objects if pull request is opened from a different project. If this option is enabled, git lfs command needs to be installed on OneDev server",
@@ -4918,6 +4962,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Whether or not to require this dependency to be successful", "是否要求此依赖成功");
m.put("Whether or not to retrieve groups of login user. Make sure to add groups claim via token configuration of the app registered in Entra ID if this option is enabled. The groups claim should return group id (the default option) via various token types in this case",
"是否查询登录用户的组。如果启用此选项,请确保通过在 Entra ID 中注册的应用程序的令牌配置添加组声明。在这种情况下,组声明应通过各种令牌类型返回组 ID(默认选项)");
+ m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
+ "是否检索子模块。请参考\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>本教程</a>\n了解如何配置子模块认证\n");
m.put("Whether or not to retrieve submodules. Refer to <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on how to set up clone credential above to retrieve submodules",
"是否获取子模块。请参阅 <a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>此教程</a>,了解如何设置上述克隆凭据以获取子模块");
m.put("Whether or not to run this step inside container", "是否在容器内运行此步骤");
@@ -4939,6 +4985,12 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("Widget", "小组件");
m.put("Widget Tab", "小组件 Tab");
m.put("Widget Timesheet Setting", "小组件时间表设置");
+ m.put("Wiki", "Wiki");
+ m.put("Wiki Folder", "Wiki 文件夹");
+ m.put("Wiki Management", "Wiki 管理");
+ m.put("Wiki Setting", "Wiki 设置");
+ m.put("Wiki Settings", "Wiki 设置");
+ m.put("Wiki settings updated", "Wiki 设置已更新");
m.put("Will be prompted to set up two-factor authentication upon next login", "下次登录时将提示设置两阶段验证");
m.put("Window", "窗口");
m.put("Window Memory", "窗口内存");
@@ -5217,6 +5269,7 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("week:Tue", "周二");
m.put("week:Wed", "周三");
m.put("widget:Tabs", "标签页");
+ m.put("wiki", "wiki");
m.put("workspaces", "工作区");
m.put("you may show this page later via incompatibilities link in help menu", "您可以稍后通过帮助菜单中的不兼容性链接显示此页面");
m.put("{0} Lines", "{0} 行");
@@ -5255,20 +5308,8 @@ public class Translation_zh extends TranslationResourceBundle {
m.put("{javax.validation.constraints.NotEmpty.message}", "不能为空");
m.put("{javax.validation.constraints.NotNull.message}", "不能为空");
m.put("{javax.validation.constraints.Size.message}", "至少需要指定一个值");
- m.put("All Types", "所有类型");
- m.put("Auto", "自动");
- m.put("Color mode", "颜色模式");
- m.put("Dark", "深色");
- m.put("Light", "浅色");
- m.put("Main Repository", "主仓库");
- m.put("Maximum number of times this AI user can be awakened in a single task. When the limit is reached, the AI user will not run and a system comment will be posted instead",
- "此 AI 用户在单个任务中可以被唤醒的最大次数。当达到限制时,AI 用户将不会运行,而是会发布一条系统评论");
- m.put("Playwright Test Report", "Playwright 测试报告");
- m.put("Specify files to publish relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job working directory</a>.\nPublished files should include the Playwright JSON report and all referenced artifacts, such as screenshots and traces.\nFor example, run <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\nfrom the job working directory, and use <code>test-results/**</code> as the file pattern to publish the report and artifacts together.\nUse * or ? for pattern matching",
- "指定相对于<a href='https://docs.onedev.io/concepts#job-workdir'>任务工作目录</a>的要发布的文件。\n发布的文件应包括 Playwright JSON 报告和所有引用的制品,例如截图和跟踪文件。\n例如,从任务工作目录运行 <code>CI=true PLAYWRIGHT_JSON_OUTPUT_NAME=test-results/report.json npx playwright test --reporter=json --output=test-results</code>\n,并使用 <code>test-results/**</code> 作为文件模式来一起发布报告和制品。\n使用 * 或 ? 进行模式匹配");
- m.put("Submodule", "子模块");
- m.put("Whether or not to retrieve submodules. Refer to\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>this tutorial</a> on\nhow to configure submodule authentication\n",
- "是否检索子模块。请参考\n<a href='https://docs.onedev.io/tutorials/cicd/clone-submodules' target='_blank'>本教程</a>\n了解如何配置子模块认证\n");
+ m.put("Add home page", "添加主页");
+ m.put("Home page not found", "未找到主页");
}
@Override
diff --git a/server-core/src/main/java/io/onedev/server/web/util/DefaultCommitMessage.java b/server-core/src/main/java/io/onedev/server/web/util/DefaultCommitMessage.java
new file mode 100644
index 0000000000..d50a679f9c
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/util/DefaultCommitMessage.java
@@ -0,0 +1,35 @@
+package io.onedev.server.web.util;
+
+import static io.onedev.server.web.translation.Translation._T;
+
+import java.text.MessageFormat;
+
+import org.jspecify.annotations.Nullable;
+
+/** Default messages shared by repository file and wiki page editing. */
+public class DefaultCommitMessage {
+
+ public enum Operation { ADD, EDIT, RENAME, DELETE }
+
+ public static String generate(Operation operation, @Nullable String name,
+ String unnamedAddMessage, boolean conventional) {
+ String message;
+ switch (operation) {
+ case ADD:
+ message = name != null ? MessageFormat.format(_T("Add {0}"), name) : unnamedAddMessage;
+ break;
+ case EDIT:
+ message = MessageFormat.format(_T("Edit {0}"), name);
+ break;
+ case RENAME:
+ message = MessageFormat.format(_T("Rename {0}"), name);
+ break;
+ case DELETE:
+ message = "Delete " + name;
+ break;
+ default:
+ throw new IllegalArgumentException("Unsupported operation: " + operation);
+ }
+ return conventional ? "chore: " + message : message;
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/util/WikiLinkResolver.java b/server-core/src/main/java/io/onedev/server/web/util/WikiLinkResolver.java
new file mode 100644
index 0000000000..f6b1b73497
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/util/WikiLinkResolver.java
@@ -0,0 +1,130 @@
+package io.onedev.server.web.util;
+
+import org.apache.wicket.request.Url;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.eclipse.jgit.lib.FileMode;
+import org.jspecify.annotations.Nullable;
+
+import io.onedev.commons.utils.PathUtils;
+import io.onedev.server.git.BlobIdent;
+import io.onedev.server.model.Project;
+import io.onedev.server.security.SecurityUtils;
+import io.onedev.server.util.UrlUtils;
+import io.onedev.server.web.asset.icon.IconScope;
+import io.onedev.server.web.component.svg.SpriteImage;
+import io.onedev.server.web.page.project.blob.ProjectBlobPage;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext.Mode;
+import io.onedev.server.web.page.project.wiki.ProjectWikiPage;
+import io.onedev.server.web.resource.RawBlobResource;
+import io.onedev.server.web.resource.RawBlobResourceReference;
+
+/** Routes wiki links and permission-gated creation actions; WikiUtils handles syntax and paths. */
+public class WikiLinkResolver {
+
+ private final Project project;
+ private final String revision;
+ private final String folder;
+ private final String currentPath;
+ private final String returnPage;
+
+ public WikiLinkResolver(Project project, @Nullable String revision, String folder,
+ String currentPath, String returnPage) {
+ this.project = project;
+ this.revision = revision;
+ this.folder = folder;
+ this.currentPath = currentPath;
+ this.returnPage = returnPage;
+ }
+
+ /** Resolve wiki references consistently in repository views and editor previews. */
+ public static String resolveWikiLinks(String html, @Nullable BlobRenderContext context) {
+ if (context == null)
+ return html;
+
+ var project = context.getProject();
+ BlobIdent blobIdent = context.getBlobIdent();
+ String path = blobIdent.path;
+ if (context.getMode() == BlobRenderContext.Mode.ADD || context.getMode() == BlobRenderContext.Mode.EDIT)
+ path = context.getNewPath();
+ String folder = project.getWikiFolder();
+ if (path == null || !path.startsWith(folder + "/") || !path.endsWith(".md"))
+ return html;
+
+ String currentPage = path.substring(folder.length() + 1, path.length() - 3);
+ return new WikiLinkResolver(project, blobIdent.revision, folder, path, currentPage).resolvePageLinks(html);
+ }
+
+ /** Wiki views resolve both ordinary Markdown links and wiki-style references. */
+ public String resolve(String html) {
+ html = WikiUtils.resolveRelativeLinks(html, currentPath,
+ path -> fileUrl(path, false), path -> fileUrl(path, true),
+ path -> project.getMode(revision, path) == 0, this::addFileUrl, addIconHref());
+ return resolvePageLinks(html);
+ }
+
+ /** Repository views already resolve ordinary Markdown links through UrlProcessor. */
+ public String resolvePageLinks(String html) {
+ return WikiUtils.resolvePageLinks(html,
+ destination -> WikiUtils.resolvePagePath(currentPath, destination), this::pageUrl,
+ path -> project.getBlob(new BlobIdent(revision, path), false) == null,
+ this::addPageUrl, addIconHref());
+ }
+
+ private String pageName(String path) {
+ return path.substring(folder.length() + 1, path.length() - 3);
+ }
+
+ private String pageUrl(String path) {
+ if (WikiUtils.isUnderFolder(folder, path))
+ return RequestCycle.get().urlFor(ProjectWikiPage.class,
+ ProjectWikiPage.paramsOf(project, revision, pageName(path))).toString();
+ return repositoryUrl(path, false);
+ }
+
+ private String fileUrl(String path, boolean image) {
+ if (!WikiUtils.isUnderFolder(folder, path))
+ return repositoryUrl(path, image);
+ if (!image && path.endsWith(".md"))
+ return pageUrl(path);
+ return RequestCycle.get().urlFor(new RawBlobResourceReference(),
+ RawBlobResource.paramsOf(project, new BlobIdent(revision, path))).toString();
+ }
+
+ private String repositoryUrl(String path, boolean image) {
+ int mode = project.getMode(revision, path);
+ var ident = new BlobIdent(revision, path, mode != 0 ? mode : FileMode.REGULAR_FILE.getBits());
+ var params = ProjectBlobPage.paramsOf(project, ident);
+ if (image)
+ params.add("raw", true);
+ var cycle = RequestCycle.get();
+ String url = cycle.urlFor(ProjectBlobPage.class, params).toString();
+ return UrlUtils.makeRelative(cycle.getUrlRenderer().renderFullUrl(Url.parse(url)));
+ }
+
+ private @Nullable String addPageUrl(String path) {
+ if (!folder.equals(project.getWikiFolder()) || !WikiUtils.isUnderFolder(folder, path)
+ || !SecurityUtils.canEditWikiPage(project, revision, path))
+ return null;
+ String destination = pageName(path);
+ var params = ProjectWikiPage.paramsOf(project, revision, destination);
+ params.add("new", true);
+ params.add("initial-name", destination);
+ params.add("return-page", returnPage);
+ return RequestCycle.get().urlFor(ProjectWikiPage.class, params).toString();
+ }
+
+ private @Nullable String addFileUrl(String path) {
+ if (!SecurityUtils.canModifyFile(project, revision, path))
+ return null;
+ var state = new ProjectBlobPage.State(new BlobIdent(revision, currentPath, FileMode.REGULAR_FILE.getBits()));
+ state.mode = Mode.ADD;
+ int slash = currentPath.lastIndexOf('/');
+ state.initialNewPath = PathUtils.relativize(slash >= 0 ? currentPath.substring(0, slash) : null, path);
+ return RequestCycle.get().urlFor(ProjectBlobPage.class, ProjectBlobPage.paramsOf(project, state)).toString();
+ }
+
+ private String addIconHref() {
+ return SpriteImage.getVersionedHref(IconScope.class, "plus");
+ }
+}
diff --git a/server-core/src/main/java/io/onedev/server/web/util/WikiUtils.java b/server-core/src/main/java/io/onedev/server/web/util/WikiUtils.java
new file mode 100644
index 0000000000..8b70469171
--- /dev/null
+++ b/server-core/src/main/java/io/onedev/server/web/util/WikiUtils.java
@@ -0,0 +1,186 @@
+package io.onedev.server.web.util;
+
+import java.util.ArrayList;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.regex.Pattern;
+
+import org.jsoup.nodes.Element;
+import org.jsoup.nodes.Node;
+import org.jsoup.nodes.TextNode;
+import org.jspecify.annotations.Nullable;
+
+import io.onedev.commons.utils.PathUtils;
+import io.onedev.server.annotation.Path;
+import io.onedev.server.exception.NotAcceptableException;
+import io.onedev.server.git.GitUtils;
+import io.onedev.server.markdown.LinkUtils;
+import io.onedev.server.util.HtmlUtils;
+import io.onedev.server.validation.validator.PathValidator;
+
+public class WikiUtils {
+
+ private static final Pattern REFERENCE = Pattern.compile("\\[\\[([^\\]\\r\\n]+)\\]\\]");
+
+ public static boolean isUnderFolder(String folder, String path) {
+ return path != null && path.startsWith(folder + "/");
+ }
+
+ public static void validatePath(String path) {
+ var error = PathValidator.checkPath(Path.Type.RELATIVE, path);
+ if (error != null)
+ throw new NotAcceptableException(error);
+ }
+
+ public static String pagePath(String folder, String page) {
+ validatePath(folder);
+ validatePath(page);
+ return normalizePath(folder + "/" + page + ".md");
+ }
+
+ /** Use the same path for permission checks and Git writes. */
+ public static String normalizePath(String path) {
+ validatePath(path);
+ String normalized = GitUtils.normalizePath(path);
+ if (normalized == null)
+ throw new NotAcceptableException("Invalid wiki path");
+ return normalized;
+ }
+
+ public static String pageReference(String folder, String currentPath, String path, String text) {
+ if (!path.startsWith(folder + "/") || !path.endsWith(".md"))
+ throw new IllegalArgumentException("Not a wiki page");
+ validatePath(path);
+ int slash = currentPath.lastIndexOf('/');
+ String directory = slash >= 0 ? currentPath.substring(0, slash) : "";
+ String page = PathUtils.relativize(directory, path.substring(0, path.length() - 3)).replace('-', ' ');
+ if ((text == null || text.isBlank()) && page.contains("/"))
+ text = page.substring(page.lastIndexOf('/') + 1);
+ return "[[" + page + (text != null && !text.isBlank() && !text.equals(page) ? "|" + text : "") + "]]";
+ }
+
+ /** Resolve references only in prose, never inside code, HTML attributes or existing links. */
+ public static String linkPages(String html, Function<String, String> urlOf) {
+ return linkPages(html, urlOf, destination -> false);
+ }
+
+ public static String linkPages(String html, Function<String, String> urlOf, Predicate<String> missing) {
+ return linkPages(html, urlOf, missing, reference -> null, null);
+ }
+
+ public static String linkPages(String html, Function<String, String> urlOf, Predicate<String> missing,
+ Function<String, String> addUrlOf, String addIconHref) {
+ return linkPages(html, reference -> {
+ String url = urlOf.apply(reference);
+ if (url == null)
+ return null;
+ boolean isMissing = missing.test(reference);
+ return new ResolvedLink(url, isMissing, isMissing ? addUrlOf.apply(reference) : null);
+ }, addIconHref);
+ }
+
+ private record ResolvedLink(String url, boolean missing, @Nullable String addUrl) {
+ }
+
+ private static String linkPages(String html, Function<String, ResolvedLink> resolve, String addIconHref) {
+ var document = HtmlUtils.parse(html);
+ linkText(document.body(), resolve, addIconHref);
+ document.outputSettings().prettyPrint(false);
+ return document.body().html();
+ }
+
+ /** Resolve wiki names and anchors consistently in both wiki and repository views. */
+ public static String resolvePageLinks(String html, Function<String, String> urlOf,
+ Predicate<String> missing, Function<String, String> addUrlOf, String addIconHref) {
+ return resolvePageLinks(html, Function.identity(), urlOf, missing, addUrlOf, addIconHref);
+ }
+
+ public static String resolvePagePath(String currentPath, String destination) {
+ int slash = currentPath.lastIndexOf('/');
+ String directory = slash >= 0 ? currentPath.substring(0, slash) : "";
+ if (destination.startsWith("/"))
+ throw new IllegalArgumentException("Absolute wiki page path");
+ String path = GitUtils.normalizePath(PathUtils.resolve(directory, destination + ".md"));
+ if (path == null)
+ throw new IllegalArgumentException("Wiki link is outside repository");
+ return path;
+ }
+
+ public static String resolvePageLinks(String html, Function<String, String> pathOf, Function<String, String> urlOf,
+ Predicate<String> missing, Function<String, String> addUrlOf, String addIconHref) {
+ return linkPages(html, reference -> {
+ int hash = reference.indexOf('#');
+ String destination = hash >= 0 ? reference.substring(0, hash) : reference;
+ String anchor = hash >= 0 ? reference.substring(hash) : "";
+ if (destination.isEmpty())
+ return new ResolvedLink(anchor, false, null);
+ destination = destination.replace(' ', '-');
+ try {
+ destination = pathOf.apply(destination);
+ validatePath(destination);
+ String url = urlOf.apply(destination);
+ if (url == null)
+ return null;
+ boolean isMissing = missing.test(destination);
+ return new ResolvedLink(url + anchor, isMissing, isMissing ? addUrlOf.apply(destination) : null);
+ } catch (IllegalArgumentException | NotAcceptableException e) {
+ return null;
+ }
+ }, addIconHref);
+ }
+
+ public static String resolveRelativeLinks(String html, String currentPath,
+ Function<String, String> linkUrlOf, Function<String, String> imageUrlOf) {
+ return resolveRelativeLinks(html, currentPath, linkUrlOf, imageUrlOf,
+ referencedPath -> false, referencedPath -> null, null);
+ }
+
+ public static String resolveRelativeLinks(String html, String currentPath,
+ Function<String, String> linkUrlOf, Function<String, String> imageUrlOf,
+ Predicate<String> missing, Function<String, String> addUrlOf, String addIconHref) {
+ var document = HtmlUtils.parse(html);
+ int slash = currentPath.lastIndexOf('/');
+ String directory = slash >= 0 ? currentPath.substring(0, slash) : null;
+ LinkUtils.resolveRelativeLinks(document, directory,
+ (path, url) -> LinkUtils.appendSuffix(linkUrlOf.apply(path), url),
+ (path, url) -> LinkUtils.appendSuffix(imageUrlOf.apply(path), url),
+ missing, addUrlOf, addIconHref);
+ document.outputSettings().prettyPrint(false);
+ return document.body().html();
+ }
+
+ private static void linkText(Node node, Function<String, ResolvedLink> resolve, String addIconHref) {
+ if (node instanceof Element) {
+ String tag = ((Element) node).tagName();
+ if (tag.equals("code") || tag.equals("pre") || tag.equals("a") || tag.equals("script") || tag.equals("style"))
+ return;
+ }
+ if (node instanceof TextNode) {
+ String text = ((TextNode) node).getWholeText();
+ var matcher = REFERENCE.matcher(text);
+ int end = 0;
+ while (matcher.find()) {
+ String reference = matcher.group(1);
+ int separator = reference.indexOf('|');
+ String destination = separator >= 0 ? reference.substring(0, separator) : reference;
+ String title = separator >= 0 ? reference.substring(separator + 1) : reference;
+ ResolvedLink link = resolve.apply(destination.trim());
+ if (link != null) {
+ node.before(new TextNode(text.substring(end, matcher.start())));
+ Element element = new Element("a").attr("href", link.url()).text(title);
+ node.before(element);
+ if (link.missing())
+ LinkUtils.markMissing(element, link.addUrl(), addIconHref, "Add this page");
+ end = matcher.end();
+ }
+ }
+ if (end != 0) {
+ node.before(new TextNode(text.substring(end)));
+ node.remove();
+ }
+ } else {
+ for (Node child : new ArrayList<>(node.childNodes()))
+ linkText(child, resolve, addIconHref);
+ }
+ }
+}
diff --git a/server-core/src/test/java/io/onedev/server/git/service/DefaultGitServiceCommitTest.java b/server-core/src/test/java/io/onedev/server/git/service/DefaultGitServiceTest.java
similarity index 93%
rename from server-core/src/test/java/io/onedev/server/git/service/DefaultGitServiceCommitTest.java
rename to server-core/src/test/java/io/onedev/server/git/service/DefaultGitServiceTest.java
index 2a1328b24d..2e4371d27d 100644
--- a/server-core/src/test/java/io/onedev/server/git/service/DefaultGitServiceCommitTest.java
+++ b/server-core/src/test/java/io/onedev/server/git/service/DefaultGitServiceTest.java
@@ -47,7 +47,7 @@ import io.onedev.server.persistence.SessionService;
import io.onedev.server.service.ProjectService;
import io.onedev.server.service.SettingService;
-public class DefaultGitServiceCommitTest extends AbstractGitTest {
+public class DefaultGitServiceTest extends AbstractGitTest {
private GitService gitService;
@@ -78,6 +78,27 @@ public class DefaultGitServiceCommitTest extends AbstractGitTest {
clusterService, listenerRegistry);
}
+ @Test
+ public void testInitialWikiCommit() throws IOException {
+ var project = new Project();
+ String path = "docs/wiki/Home.md";
+ var edits = new BlobEdits(Set.of(), Map.of(path,
+ new BlobContent("# Home".getBytes(java.nio.charset.StandardCharsets.UTF_8), FileMode.REGULAR_FILE.getBits())));
+ assertNull(git.getRepository().resolve("refs/heads/main"));
+ ObjectId commitId = gitService.commit(project, edits, "refs/heads/main", ObjectId.zeroId(),
+ ObjectId.zeroId(), user, "Add wiki home page", false);
+ assertEquals(commitId, git.getRepository().resolve("refs/heads/main"));
+ assertEquals("main", gitService.getDefaultBranch(project));
+ assertEquals("# Home", gitService.getBlob(project, commitId, path).getText().getContent());
+ try (var walk = new RevWalk(git.getRepository())) {
+ assertEquals(0, walk.parseCommit(commitId).getParentCount());
+ }
+ var exception = org.junit.Assert.assertThrows(Exception.class, () -> gitService.commit(project, edits,
+ "refs/heads/main", ObjectId.zeroId(), ObjectId.zeroId(), user, "Stale initial wiki save", false));
+ assertNotNull(ExceptionUtils.find(exception, ObsoleteCommitException.class));
+ assertEquals(commitId, git.getRepository().resolve("refs/heads/main"));
+ }
+
@Test
public void testGetUnregisteredGitLink() throws IOException {
addFileAndCommit("README.md", "test", "initial commit");
diff --git a/server-core/src/test/java/io/onedev/server/markdown/LinkUtilsTest.java b/server-core/src/test/java/io/onedev/server/markdown/LinkUtilsTest.java
new file mode 100644
index 0000000000..327c8d2d7d
--- /dev/null
+++ b/server-core/src/test/java/io/onedev/server/markdown/LinkUtilsTest.java
@@ -0,0 +1,50 @@
+package io.onedev.server.markdown;
+
+import static org.junit.Assert.*;
+
+import org.jsoup.Jsoup;
+import org.junit.Test;
+
+public class LinkUtilsTest {
+ @Test
+ public void rendersOutsideWikiImagesWithRawQueryAndOriginalSuffix() {
+ var document = Jsoup.parse("<img src='../images/logo%20dark.png?v=2#preview'>"
+ + "<a href='../downloads/manual.pdf#page=3'>manual</a>");
+ LinkUtils.resolveRelativeLinks(document, "wiki",
+ (path, url) -> LinkUtils.appendSuffix("/project/~files/main/" + path, url),
+ (path, url) -> LinkUtils.appendSuffix("/project/~files/main/" + path + "?raw=true", url),
+ path -> false, path -> null, null);
+ assertEquals("/project/~files/main/images/logo dark.png?raw=true&v=2#preview",
+ document.selectFirst("img").attr("src"));
+ assertEquals("/project/~files/main/downloads/manual.pdf#page=3",
+ document.selectFirst("a").attr("href"));
+ assertEquals("/image?raw=true#preview", LinkUtils.appendSuffix("/image?raw=true", "image#preview"));
+ }
+
+ @Test
+ public void resolvesRepositoryPathsAndPreservesUrlPolicies() {
+ var document = Jsoup.parse("<a href='../Missing%20file.md?q=1#heading'>file</a>"
+ + "<img src='image.png#preview'><a href='locked.md'>locked</a>"
+ + "<a href='#local'>anchor</a><a href='https://example.com'>external</a>");
+ LinkUtils.resolveRelativeLinks(document, "docs/guide",
+ (path, url) -> LinkUtils.appendSuffix("/blob/" + path, url),
+ (path, url) -> LinkUtils.appendSuffix("/raw/" + path, url),
+ path -> true, path -> path.endsWith("locked.md") ? null : "/new/" + path, "/icons#plus");
+ assertEquals("/blob/docs/Missing file.md?q=1#heading", document.selectFirst("a").attr("href"));
+ assertEquals("/raw/docs/guide/image.png#preview", document.selectFirst("img").attr("src"));
+ assertEquals(3, document.select("span.missing").size());
+ assertEquals(1, document.select("a.add-missing").size());
+ assertEquals("/new/docs/Missing file.md", document.selectFirst("a.add-missing").attr("href"));
+ assertEquals(1, document.select("a[href=#local]").size());
+ assertEquals(1, document.select("a[href=https://example.com]").size());
+ }
+
+ @Test
+ public void leavesUnresolvableLinksUntouched() {
+ var document = Jsoup.parse("<a href='../../outside.md'>outside</a><a href='skip.md'>skip</a>");
+ LinkUtils.resolveRelativeLinks(document, "docs", (path, url) -> null,
+ (path, url) -> null, path -> true, path -> "/new/" + path, "/icons#plus");
+ assertEquals("../../outside.md", document.selectFirst("a").attr("href"));
+ assertTrue(document.select("span.missing").isEmpty());
+ }
+}
diff --git a/server-core/src/test/java/io/onedev/server/validation/validator/PathValidatorTest.java b/server-core/src/test/java/io/onedev/server/validation/validator/PathValidatorTest.java
new file mode 100644
index 0000000000..a2f025ed26
--- /dev/null
+++ b/server-core/src/test/java/io/onedev/server/validation/validator/PathValidatorTest.java
@@ -0,0 +1,36 @@
+package io.onedev.server.validation.validator;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+
+import io.onedev.server.annotation.Path;
+
+public class PathValidatorTest {
+
+ @Test
+ public void allowsDotsWithinPathSegments() {
+ for (String path : new String[] {"release..notes", "docs/release..notes", "..notes", "notes..", "..."}) {
+ assertNull(path, PathValidator.checkPath(Path.Type.RELATIVE, path));
+ assertNull(path, PathValidator.checkPath(Path.Type.ABSOLUTE, "/" + path));
+ }
+ }
+
+ @Test
+ public void rejectsParentDirectorySegments() {
+ for (String path : new String[] {"..", "../notes", "docs/../notes", "docs/..", "..\\notes",
+ "docs\\..\\notes", "docs\\..", "docs/..\\notes", "docs\\../notes"}) {
+ assertEquals(path, "'..' is not allowed", PathValidator.checkPath(Path.Type.RELATIVE, path));
+ assertEquals(path, "'..' is not allowed", PathValidator.checkPath(Path.Type.ABSOLUTE, "/" + path));
+ }
+ }
+
+ @Test
+ public void preservesPathTypeValidation() {
+ assertEquals("Relative path is required", PathValidator.checkPath(Path.Type.RELATIVE, "/release..notes"));
+ assertEquals("Relative path is required", PathValidator.checkPath(Path.Type.RELATIVE, "C:\\release..notes"));
+ assertEquals("Absolute path is required", PathValidator.checkPath(Path.Type.ABSOLUTE, "release..notes"));
+ assertNull(PathValidator.checkPath(Path.Type.ABSOLUTE, "C:\\release..notes"));
+ }
+}
diff --git a/server-core/src/test/java/io/onedev/server/web/component/markdown/MarkdownBlobEditorTest.java b/server-core/src/test/java/io/onedev/server/web/component/markdown/MarkdownBlobEditorTest.java
new file mode 100644
index 0000000000..f6e4bf6fa7
--- /dev/null
+++ b/server-core/src/test/java/io/onedev/server/web/component/markdown/MarkdownBlobEditorTest.java
@@ -0,0 +1,65 @@
+package io.onedev.server.web.component.markdown;
+
+import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.*;
+
+import java.nio.charset.StandardCharsets;
+import static org.mockito.Mockito.*;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.junit.Test;
+
+import io.onedev.server.git.BlobIdent;
+import io.onedev.server.model.Project;
+import io.onedev.server.web.page.project.blob.ProjectBlobPage;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
+
+public class MarkdownBlobEditorTest {
+
+ @Test
+ public void repositoryPickerInsertsRelativeLinksWithDefaultAndExplicitLabels() throws Exception {
+ BlobRenderContext context = mock(BlobRenderContext.class);
+ Project project = mock(Project.class);
+ when(context.getProject()).thenReturn(project);
+ when(project.getPath()).thenReturn("project");
+ when(context.getBlobIdent()).thenReturn(new BlobIdent("main", "docs/Guide.md"));
+ when(context.getDirectoryUrl()).thenReturn("/project/~files/main/docs");
+ BlobMarkdownEditor editor = mock(BlobMarkdownEditor.class, CALLS_REAL_METHODS);
+ var contextField = BlobMarkdownEditor.class.getDeclaredField("context");
+ contextField.setAccessible(true);
+ contextField.set(editor, context);
+ doReturn("/project/~files/main/assets/image.png").when(editor)
+ .urlFor(eq(ProjectBlobPage.class), any(PageParameters.class));
+ doNothing().when(editor).insertUrl(any(), anyBoolean(), anyString(), anyString(), isNull());
+ AjaxRequestTarget target = mock(AjaxRequestTarget.class);
+
+ var support = editor.getRepositoryFileSelectionSupport();
+ support.onSelect(target, "assets/image.png", true, null);
+ verify(editor).insertUrl(target, true, "../assets/image.png", "image.png", null);
+ support.onSelect(target, "assets/image.png", false, "Download");
+ verify(editor).insertUrl(target, false, "../assets/image.png", "Download", null);
+ }
+
+ @Test
+ public void conversionPreservesLineEndingsWhitespaceAndUnicode() throws Exception {
+ MarkdownEditor input = mock(MarkdownEditor.class);
+ BlobMarkdownEditor editor = mock(BlobMarkdownEditor.class, CALLS_REAL_METHODS);
+ var field = BlobMarkdownEditor.class.getDeclaredField("input");
+ field.setAccessible(true);
+ field.set(editor, input);
+
+ when(input.getModelObject()).thenReturn("Original\n");
+ when(input.getConvertedInput()).thenReturn(" 文本 \r\n\r\n");
+ editor.convertInput();
+ assertEquals(" 文本 \n\n", new String(editor.getConvertedInput(), StandardCharsets.UTF_8));
+
+ when(input.getModelObject()).thenReturn("Original\r\n");
+ editor.convertInput();
+ assertEquals(" 文本 \r\n\r\n", new String(editor.getConvertedInput(), StandardCharsets.UTF_8));
+
+ when(input.getConvertedInput()).thenReturn(null);
+ editor.convertInput();
+ assertArrayEquals(new byte[0], editor.getConvertedInput());
+ }
+}
diff --git a/server-core/src/test/java/io/onedev/server/web/page/project/wiki/WikiPageBeanTest.java b/server-core/src/test/java/io/onedev/server/web/page/project/wiki/WikiPageBeanTest.java
new file mode 100644
index 0000000000..d11e1ba33e
--- /dev/null
+++ b/server-core/src/test/java/io/onedev/server/web/page/project/wiki/WikiPageBeanTest.java
@@ -0,0 +1,36 @@
+package io.onedev.server.web.page.project.wiki;
+
+import static org.junit.Assert.*;
+
+import javax.validation.Validation;
+
+import org.junit.Test;
+
+import io.onedev.server.web.editable.PropertyDescriptor;
+import io.onedev.server.web.editable.wiki.WikiPageContentEditSupport;
+
+public class WikiPageBeanTest {
+
+ @Test
+ public void validatesPageNamesOnTheirProperty() {
+ try (var factory = Validation.buildDefaultValidatorFactory()) {
+ var validator = factory.getValidator();
+ for (String name : new String[] {null, "", "../outside", "/absolute", "docs/../../outside"}) {
+ var violations = validator.validateValue(WikiPageBean.class, "name", name);
+ assertFalse("Expected invalid name: " + name, violations.isEmpty());
+ assertTrue(violations.stream().allMatch(it -> it.getPropertyPath().toString().equals("name")));
+ }
+ for (String name : new String[] {"Home", "Guides/Setup", "Getting started"})
+ assertTrue(validator.validateValue(WikiPageBean.class, "name", name).isEmpty());
+ assertTrue(validator.validateValue(WikiPageBean.class, "commitMessage", null).isEmpty());
+ }
+ }
+
+ @Test
+ public void usesCustomEditorOnlyForWikiContent() {
+ var support = new WikiPageContentEditSupport();
+ assertNotNull(support.getEditContext(new PropertyDescriptor(WikiPageBean.class, "content")));
+ assertNull(support.getEditContext(new PropertyDescriptor(WikiPageBean.class, "name")));
+ assertNull(support.getEditContext(new PropertyDescriptor(WikiPageBean.class, "commitMessage")));
+ }
+}
diff --git a/server-core/src/test/java/io/onedev/server/web/util/WikiLinkResolverTest.java b/server-core/src/test/java/io/onedev/server/web/util/WikiLinkResolverTest.java
new file mode 100644
index 0000000000..12165c7f36
--- /dev/null
+++ b/server-core/src/test/java/io/onedev/server/web/util/WikiLinkResolverTest.java
@@ -0,0 +1,120 @@
+package io.onedev.server.web.util;
+
+import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.*;
+import static org.mockito.Mockito.*;
+
+import org.apache.wicket.request.Url;
+import org.apache.wicket.request.UrlRenderer;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.eclipse.jgit.lib.FileMode;
+import org.jsoup.Jsoup;
+import org.junit.Test;
+
+import io.onedev.server.model.Project;
+import io.onedev.server.git.BlobIdent;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
+import io.onedev.server.web.page.project.blob.render.BlobRenderContext.Mode;
+import io.onedev.server.security.SecurityUtils;
+import io.onedev.server.web.component.svg.SpriteImage;
+import io.onedev.server.web.page.project.blob.ProjectBlobPage;
+import io.onedev.server.web.page.project.wiki.ProjectWikiPage;
+import io.onedev.server.web.resource.RawBlobResourceReference;
+
+public class WikiLinkResolverTest {
+
+ @Test
+ public void wikiReferencesResolveInViewsAndEditorPreviews() {
+ Project project = mock(Project.class);
+ when(project.getPath()).thenReturn("project");
+ when(project.getWikiFolder()).thenReturn("docs/wiki");
+ BlobRenderContext context = mock(BlobRenderContext.class);
+ when(context.getProject()).thenReturn(project);
+ when(context.getBlobIdent()).thenReturn(new BlobIdent("main", "docs/wiki/Home.md"));
+ when(context.getNewPath()).thenReturn("docs/wiki/Guides/Setup.md");
+ RequestCycle cycle = mock(RequestCycle.class);
+ when(cycle.urlFor(eq(ProjectWikiPage.class), any(PageParameters.class))).thenAnswer(invocation -> {
+ PageParameters params = invocation.getArgument(1);
+ return "/project/~wiki/" + java.util.stream.IntStream.range(0, params.getIndexedCount())
+ .mapToObj(i -> params.get(i).toString()).collect(java.util.stream.Collectors.joining("/"));
+ });
+ try (var requestCycle = mockStatic(RequestCycle.class); var sprite = mockStatic(SpriteImage.class)) {
+ requestCycle.when(RequestCycle::get).thenReturn(cycle);
+ for (Mode mode : new Mode[] {Mode.VIEW, Mode.EDIT, Mode.ADD}) {
+ when(context.getMode()).thenReturn(mode);
+ String html = WikiLinkResolver.resolveWikiLinks(
+ "<p>[[Getting started#install|Start here]]</p><code>[[Untouched]]</code>", context);
+ var document = Jsoup.parseBodyFragment(html);
+ assertEquals("/project/~wiki/main/" + (mode == Mode.VIEW ? "" : "Guides/")
+ + "Getting-started#install", document.selectFirst("p a").attr("href"));
+ assertEquals("Start here", document.selectFirst("p a").text());
+ assertEquals("[[Untouched]]", document.selectFirst("code").text());
+ }
+ }
+ }
+
+ @Test
+ public void previewUsesEditedPathToDetermineWhetherFileIsWiki() {
+ Project project = mock(Project.class);
+ when(project.getWikiFolder()).thenReturn("docs/wiki");
+ BlobRenderContext context = mock(BlobRenderContext.class);
+ when(context.getProject()).thenReturn(project);
+ when(context.getBlobIdent()).thenReturn(new BlobIdent("main", "docs/wiki/Home.md"));
+ when(context.getMode()).thenReturn(Mode.EDIT);
+ when(context.getNewPath()).thenReturn("README.md");
+ String html = "<p>[[Getting started]]</p>";
+ assertEquals(html, WikiLinkResolver.resolveWikiLinks(html, context));
+ when(context.getMode()).thenReturn(Mode.ADD);
+ when(context.getNewPath()).thenReturn(null);
+ assertEquals(html, WikiLinkResolver.resolveWikiLinks(html, context));
+ assertEquals(html, WikiLinkResolver.resolveWikiLinks(html, null));
+ }
+
+ @Test
+ public void routesOrdinaryLinksImagesAndWikiReferencesConsistently() {
+ Project project = mock(Project.class);
+ when(project.getPath()).thenReturn("project");
+ when(project.getWikiFolder()).thenReturn("wiki");
+ when(project.getMode(eq("main"), anyString())).thenReturn(FileMode.REGULAR_FILE.getBits());
+ RequestCycle cycle = mock(RequestCycle.class);
+ UrlRenderer renderer = mock(UrlRenderer.class);
+ when(cycle.getUrlRenderer()).thenReturn(renderer);
+ when(renderer.renderFullUrl(any(Url.class))).thenAnswer(it -> "http://localhost" + it.getArgument(0));
+ when(cycle.urlFor(eq(ProjectWikiPage.class), any(PageParameters.class)))
+ .thenAnswer(it -> url("~wiki", it.getArgument(1)));
+ when(cycle.urlFor(eq(ProjectBlobPage.class), any(PageParameters.class)))
+ .thenAnswer(it -> url("~files", it.getArgument(1)));
+ when(cycle.urlFor(any(RawBlobResourceReference.class), any(PageParameters.class)))
+ .thenAnswer(it -> url("~raw", it.getArgument(1)));
+ try (var requestCycle = mockStatic(RequestCycle.class);
+ var sprite = mockStatic(SpriteImage.class); var security = mockStatic(SecurityUtils.class)) {
+ requestCycle.when(RequestCycle::get).thenReturn(cycle);
+ var resolver = new WikiLinkResolver(project, "main", "wiki", "wiki/guide/Page.md", "guide/Page");
+ String html = "<p>[[Sibling|Read this]] [[../../README|Readme]] [[Missing]]</p>"
+ + "<a href='Sibling.md#intro'>ordinary</a><a href='../manual.pdf'>manual</a>"
+ + "<img src='../logo.png'><img src='../../logo.png?v=2#preview'>"
+ + "<a href='../../manual.pdf#page=3'>outside</a>";
+ var document = Jsoup.parseBodyFragment(resolver.resolve(html));
+ assertEquals("/project/~wiki/main/guide/Sibling", document.selectFirst("p a").attr("href"));
+ assertEquals("Read this", document.selectFirst("p a").text());
+ assertEquals(1, document.select("a[href=/project/~files/main/README.md]").size());
+ assertEquals(1, document.select("a[href=/project/~wiki/main/guide/Sibling#intro]").size());
+ assertEquals(1, document.select("a[href=/project/~raw/main/wiki/manual.pdf]").size());
+ assertEquals("/project/~raw/main/wiki/logo.png", document.select("img").get(0).attr("src"));
+ assertEquals("/project/~files/main/logo.png?raw=true&v=2#preview", document.select("img").get(1).attr("src"));
+ assertEquals(1, document.select("a[href=/project/~files/main/manual.pdf#page=3]").size());
+ assertEquals(3, document.select("span.missing").size());
+ assertTrue(document.select("a.add-missing").isEmpty());
+ var preview = Jsoup.parseBodyFragment(resolver.resolvePageLinks(html));
+ assertEquals(document.selectFirst("p a").attr("href"), preview.selectFirst("p a").attr("href"));
+ assertEquals("../logo.png", preview.selectFirst("img").attr("src"));
+ }
+ }
+
+ private static String url(String route, PageParameters params) {
+ String path = java.util.stream.IntStream.range(0, params.getIndexedCount())
+ .mapToObj(i -> params.get(i).toString()).collect(java.util.stream.Collectors.joining("/"));
+ return "/project/" + route + "/" + path + (params.get("raw").toBoolean(false) ? "?raw=true" : "");
+ }
+}
diff --git a/server-core/src/test/java/io/onedev/server/web/util/WikiUtilsTest.java b/server-core/src/test/java/io/onedev/server/web/util/WikiUtilsTest.java
new file mode 100644
index 0000000000..c1daebe66a
--- /dev/null
+++ b/server-core/src/test/java/io/onedev/server/web/util/WikiUtilsTest.java
@@ -0,0 +1,214 @@
+package io.onedev.server.web.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.jsoup.Jsoup;
+import org.junit.Test;
+
+import io.onedev.server.model.Project;
+import io.onedev.server.model.Role;
+import io.onedev.server.model.support.WikiSetting;
+import io.onedev.server.model.support.role.CodePrivilege;
+import io.onedev.server.security.permission.ReadCode;
+import io.onedev.server.security.SecurityUtils;
+import io.onedev.server.security.permission.AccessProject;
+import io.onedev.server.security.permission.ProjectPermission;
+import io.onedev.server.security.permission.WriteCode;
+
+public class WikiUtilsTest {
+
+ @Test
+ public void insertsWikiReferencesRelativeToCurrentPage() {
+ assertEquals("[[../Home|Home]]", WikiUtils.pageReference("wiki", "wiki/Guides/Page.md", "wiki/Home.md", null));
+ assertEquals("[[../Home|Home]]", WikiUtils.pageReference("wiki", "wiki/Guides/Page.md", "wiki/Home.md", ""));
+ assertEquals("[[Setup]]", WikiUtils.pageReference("wiki", "wiki/Guides/Page.md", "wiki/Guides/Setup.md", null));
+ assertEquals("[[../Home|Home]]", WikiUtils.pageReference("wiki", "wiki/Guides/Page.md", "wiki/Home.md", "Home"));
+ }
+
+ @Test
+ public void insertsReadableNamesInWikiReferences() {
+ assertEquals("[[Installation Guide]]", WikiUtils.pageReference(
+ "wiki", "wiki/Home.md", "wiki/Installation-Guide.md", null));
+ assertEquals("[[folder/Installation Guide|Installation Guide]]", WikiUtils.pageReference(
+ "wiki", "wiki/Home.md", "wiki/folder/Installation-Guide.md", null));
+ assertEquals("[[../Installation Guide|Installation Guide]]", WikiUtils.pageReference(
+ "wiki", "wiki/folder/Home.md", "wiki/Installation-Guide.md", ""));
+ assertEquals("[[folder/Installation Guide|Read-this guide]]", WikiUtils.pageReference(
+ "wiki", "wiki/Home.md", "wiki/folder/Installation-Guide.md", "Read-this guide"));
+ }
+
+ @Test
+ public void resolvesRelativeWikiReferencesWithinRepository() {
+ String html = WikiUtils.resolvePageLinks(
+ "<p>[[../Sibling#intro|Up]] [[../../README]] [[./Child]] [[Home]] [[../../../outside]]</p>",
+ destination -> WikiUtils.resolvePagePath("wiki/guide/Page.md", destination),
+ path -> "/files/" + path, path -> path.equals("wiki/Sibling.md"),
+ path -> "/add/" + path, "/icons#plus");
+ var document = Jsoup.parseBodyFragment(html);
+ assertEquals("/files/wiki/Sibling.md#intro", document.selectFirst("a").attr("href"));
+ assertEquals("/add/wiki/Sibling.md", document.selectFirst("a.add-missing").attr("href"));
+ assertEquals(1, document.select("a[href=/files/README.md]").size());
+ assertEquals(1, document.select("a[href=/files/wiki/guide/Child.md]").size());
+ assertEquals(1, document.select("a[href=/files/wiki/guide/Home.md]").size());
+ assertTrue(document.text().contains("[[../../../outside]]"));
+ }
+
+ @Test
+ public void resolvesPageNamesAnchorsAndMissingCreationLinks() {
+ String html = WikiUtils.resolvePageLinks(
+ "<p>[[Missing page#heading|Title]] [[#local]] [[../invalid]] [[Existing]]</p>",
+ page -> "/wiki/" + page, page -> page.equals("Missing-page"),
+ page -> "/new/" + page, "/icons.svg#plus");
+ var document = org.jsoup.Jsoup.parse(html);
+ assertEquals("/wiki/Missing-page#heading", document.selectFirst("a").attr("href"));
+ assertEquals("/new/Missing-page", document.selectFirst("a.add-missing").attr("href"));
+ assertEquals(1, document.select("span.missing").size());
+ assertEquals(1, document.select("a[href=#local]").size());
+ assertEquals(1, document.select("a[href=/wiki/Existing]").size());
+ assertTrue(document.text().contains("[[../invalid]]"));
+ }
+
+ @Test
+ public void selectedPagesUseWikiReferences() {
+ assertEquals("[[Home]]", WikiUtils.pageReference("wiki", "wiki/Home.md", "wiki/Home.md", null));
+ assertEquals("[[Guides/Setup|Setup]]", WikiUtils.pageReference("docs/wiki", "docs/wiki/Home.md", "docs/wiki/Guides/Setup.md", null));
+ assertEquals("[[Guides/Setup|Read this]]", WikiUtils.pageReference("wiki", "wiki/Home.md", "wiki/Guides/Setup.md", "Read this"));
+ assertThrows(IllegalArgumentException.class, () -> WikiUtils.pageReference("wiki", "wiki/Home.md", "other/Home.md", null));
+ assertThrows(IllegalArgumentException.class, () -> WikiUtils.pageReference("wiki", "wiki/Home.md", "wiki/image.png", null));
+ }
+
+ @Test
+ public void marksMissingPagesWithoutTouchingCodeOrExistingLinks() {
+ String html = WikiUtils.linkPages("<p>[[Home]] [[Missing#heading|Title]]</p><code>[[Missing]]</code><a href='/existing'>[[Missing]]</a>",
+ page -> "/wiki/" + page, page -> page.startsWith("Missing"),
+ page -> "/wiki/add/" + page, "/icons.svg#plus");
+ var document = org.jsoup.Jsoup.parse(html);
+ assertEquals(1, document.select("span.missing").size());
+ assertEquals("!!missing!!", document.selectFirst("span.missing").text());
+ assertEquals("Title", document.selectFirst("span.missing").previousElementSibling().text());
+ assertEquals("/wiki/Missing#heading", document.selectFirst("span.missing").previousElementSibling().attr("href"));
+ assertEquals("/wiki/add/Missing#heading", document.selectFirst("a.add-missing").attr("href"));
+ assertEquals("Add this page", document.selectFirst("a.add-missing").attr("title"));
+ assertEquals(1, document.select("a.add-missing svg.icon use").size());
+ assertEquals("[[Missing]]", document.selectFirst("code").text());
+ assertEquals("[[Missing]]", document.selectFirst("a[href=/existing]").text());
+ }
+
+ @Test
+ public void confinesPagesToWikiFolder() {
+ assertEquals("docs/wiki/Getting-started.md", WikiUtils.pagePath("docs/wiki", "Getting-started"));
+ for (String invalid : new String[] {"../secret", "/secret", "a/../../secret"}) {
+ assertThrows(invalid, io.onedev.server.exception.NotAcceptableException.class,
+ () -> WikiUtils.pagePath("wiki", invalid));
+ }
+ }
+
+ @Test
+ public void inheritsNearestConfiguredFolder() {
+ Project parent = new Project();
+ Project child = new Project();
+ child.setParent(parent);
+ assertEquals("wiki", child.getWikiFolder());
+ parent.getWikiSetting().setFolder("documentation");
+ assertEquals("documentation", child.getWikiFolder());
+ child.getWikiSetting().setFolder("docs/wiki");
+ assertEquals("docs/wiki", child.getWikiFolder());
+ child.getWikiSetting().setFolder(null);
+ assertEquals("documentation", child.getWikiFolder());
+ }
+
+ @Test
+ public void projectAccessDoesNotGrantCodeRead() {
+ assertTrue(new ReadCode().implies(new AccessProject()));
+ assertTrue(new WriteCode().implies(new AccessProject()));
+ assertFalse(new AccessProject().implies(new ReadCode()));
+ assertFalse(new AccessProject().implies(new WriteCode()));
+ Role role = new Role();
+ role.setEditableIssueFields(new io.onedev.server.model.support.role.NoneIssueFields());
+ assertTrue(role.implies(new AccessProject()));
+ assertFalse(role.implies(new ReadCode()));
+ role.setCodePrivilege(CodePrivilege.READ);
+ assertTrue(role.implies(new AccessProject()));
+ }
+
+ @Test
+ public void projectAccessReadsOnlyEnabledWikiFiles() {
+ var project = mock(Project.class);
+ when(project.isWikiManagement()).thenReturn(true);
+ when(project.getWikiFolder()).thenReturn("docs/wiki");
+ var subject = mock(org.apache.shiro.subject.Subject.class);
+ when(subject.isPermitted(any(ProjectPermission.class))).thenAnswer(invocation ->
+ ((ProjectPermission) invocation.getArgument(0)).getPrivilege() instanceof AccessProject);
+
+ assertTrue(SecurityUtils.canReadFile(subject, project, "docs/wiki/Home.md"));
+ assertTrue(SecurityUtils.canReadFile(subject, project, "docs/wiki/image.png"));
+ assertFalse(SecurityUtils.canReadFile(subject, project, "private.txt"));
+ assertFalse(SecurityUtils.canReadFile(subject, project, "docs/wiki-other/Home.md"));
+ assertFalse(SecurityUtils.canReadFile(subject, project, null));
+ when(project.isWikiManagement()).thenReturn(false);
+ assertFalse(SecurityUtils.canReadFile(subject, project, "docs/wiki/Home.md"));
+ when(project.isWikiManagement()).thenReturn(true);
+ when(subject.isPermitted(any(ProjectPermission.class))).thenReturn(false);
+ assertFalse(SecurityUtils.canReadFile(subject, project, "docs/wiki/Home.md"));
+ when(subject.isPermitted(any(ProjectPermission.class))).thenAnswer(invocation ->
+ ((ProjectPermission) invocation.getArgument(0)).getPrivilege() instanceof ReadCode);
+ assertTrue(SecurityUtils.canReadFile(subject, project, "private.txt"));
+ }
+
+ @Test
+ public void linksProseButPreservesCodeAndExistingLinks() {
+ String html = WikiUtils.linkPages("<p>[[Page]] and [[Other|Label]]</p><pre>[[Code]]</pre><code>[[Inline]]</code><a href='/x'>[[Link]]</a>", s -> "/wiki/" + s);
+ assertTrue(html.contains("<a href=\"/wiki/Page\">Page</a>"));
+ assertTrue(html.contains("<a href=\"/wiki/Other\">Label</a>"));
+ assertTrue(html.contains("<pre>[[Code]]</pre>"));
+ assertTrue(html.contains("<code>[[Inline]]</code>"));
+ assertTrue(html.contains("<a href=\"/x\">[[Link]]</a>"));
+ assertTrue(WikiUtils.linkPages("<p>[[Page|&lt;script&gt;]]</p>", s -> "/wiki/" + s).contains("&lt;script&gt;"));
+ }
+
+ @Test
+ public void resolvesOrdinaryRelativeLinksFromWikiPagePath() {
+ String html = WikiUtils.resolveRelativeLinks(
+ "<p><a href='../Missing.md#linux'>Missing</a><img src='./images/missing.png?size=2'></p>",
+ "docs/wiki/Guides/Home.md", path -> "/link/" + path, path -> "/raw/" + path,
+ path -> true, path -> "/add/" + path, "/icons.svg#plus");
+ var document = org.jsoup.Jsoup.parse(html);
+ assertEquals("/link/docs/wiki/Missing.md#linux", document.selectFirst("a").attr("href"));
+ assertEquals("/raw/docs/wiki/Guides/images/missing.png?size=2", document.selectFirst("img").attr("src"));
+ assertEquals(2, document.select("span.missing").size());
+ assertEquals("/add/docs/wiki/Missing.md", document.selectFirst("a.add-missing").attr("href"));
+ assertEquals("Add this file", document.selectFirst("a.add-missing").attr("title"));
+ assertEquals(1, document.select("a.add-missing svg.icon use").size());
+ }
+
+ @Test
+ public void identifiesFilesContainedByWikiFolder() {
+ assertTrue(WikiUtils.isUnderFolder("docs/wiki", "docs/wiki/image.png"));
+ assertFalse(WikiUtils.isUnderFolder("docs/wiki", "docs/wiki-other/image.png"));
+ assertFalse(WikiUtils.isUnderFolder("docs/wiki", "docs/image.png"));
+ }
+
+ @Test
+ public void validatesFolderAsRelativePath() {
+ try (var factory = javax.validation.Validation.buildDefaultValidatorFactory()) {
+ var setting = new WikiSetting();
+ setting.setFolder("../outside");
+ var violations = factory.getValidator().validate(setting);
+ assertEquals(1, violations.size());
+ assertEquals("folder", violations.iterator().next().getPropertyPath().toString());
+ setting.setFolder("/absolute");
+ assertEquals(1, factory.getValidator().validate(setting).size());
+ setting.setFolder("docs/wiki");
+ assertTrue(factory.getValidator().validate(setting).isEmpty());
+ setting.setFolder(null);
+ assertTrue(factory.getValidator().validate(setting).isEmpty());
+ }
+ }
+
+}
diff --git a/server-ee b/server-ee
index 42cb820c30..bf86cdec59 160000
--- a/server-ee
+++ b/server-ee
@@ -1 +1 @@
-Subproject commit 42cb820c30fd56ec40ce96ba7389d418ecc008ac
+Subproject commit bf86cdec59b69e25fe15e37542b43cb191ba36b8