mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-21 06:38:34 +00:00
Backport JS dependency updates (#4189)
This commit is contained in:
parent
1b1bf27951
commit
b1e5103ee5
20 changed files with 3355 additions and 3484 deletions
|
@ -14,19 +14,19 @@
|
||||||
"write-heading-ids": "docusaurus write-heading-ids"
|
"write-heading-ids": "docusaurus write-heading-ids"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "^3.1.0",
|
"@docusaurus/core": "^3.5.2",
|
||||||
"@docusaurus/plugin-content-blog": "^3.1.0",
|
"@docusaurus/plugin-content-blog": "^3.5.2",
|
||||||
"@docusaurus/preset-classic": "^3.1.0",
|
"@docusaurus/preset-classic": "^3.5.2",
|
||||||
"@easyops-cn/docusaurus-search-local": "^0.44.0",
|
"@easyops-cn/docusaurus-search-local": "^0.44.5",
|
||||||
"@mdx-js/react": "^3.0.0",
|
"@mdx-js/react": "^3.0.1",
|
||||||
"@svgr/webpack": "^8.1.0",
|
"@svgr/webpack": "^8.1.0",
|
||||||
"clsx": "^2.1.0",
|
"clsx": "^2.1.1",
|
||||||
"esbuild-loader": "^4.1.0",
|
"esbuild-loader": "^4.2.2",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"prism-react-renderer": "^2.3.1",
|
"prism-react-renderer": "^2.4.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.3.1",
|
||||||
"redocusaurus": "^2.0.2",
|
"redocusaurus": "^2.1.2",
|
||||||
"url-loader": "^4.1.1"
|
"url-loader": "^4.1.1"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
|
@ -42,18 +42,20 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@docusaurus/module-type-aliases": "^3.1.0",
|
"@docusaurus/module-type-aliases": "^3.5.2",
|
||||||
"@docusaurus/tsconfig": "3.4.0",
|
"@docusaurus/tsconfig": "3.5.2",
|
||||||
"@docusaurus/types": "^3.1.0",
|
"@docusaurus/types": "^3.5.2",
|
||||||
"@types/node": "^20.11.30",
|
"@types/node": "^20.16.10",
|
||||||
"@types/react": "^18.2.67",
|
"@types/react": "^18.3.11",
|
||||||
"@types/react-helmet": "^6.1.11",
|
"@types/react-helmet": "^6.1.11",
|
||||||
"@types/react-router-dom": "^5.3.3",
|
"@types/react-router-dom": "^5.3.3",
|
||||||
"typescript": "^5.4.3"
|
"typescript": "^5.6.2"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"got": "^14.0.0"
|
"got": "^14.0.0",
|
||||||
|
"path-to-regexp": "^3.3.0",
|
||||||
|
"cookie": "^0.7.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4481
docs/pnpm-lock.yaml
4481
docs/pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -4,6 +4,7 @@
|
||||||
import antfu from '@antfu/eslint-config';
|
import antfu from '@antfu/eslint-config';
|
||||||
import js from '@eslint/js';
|
import js from '@eslint/js';
|
||||||
import vueI18n from '@intlify/eslint-plugin-vue-i18n';
|
import vueI18n from '@intlify/eslint-plugin-vue-i18n';
|
||||||
|
import eslintPromise from 'eslint-plugin-promise';
|
||||||
import eslintPluginVueScopedCSS from 'eslint-plugin-vue-scoped-css';
|
import eslintPluginVueScopedCSS from 'eslint-plugin-vue-scoped-css';
|
||||||
|
|
||||||
export default antfu(
|
export default antfu(
|
||||||
|
@ -20,23 +21,54 @@ export default antfu(
|
||||||
},
|
},
|
||||||
|
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
// eslintPromise.configs.recommended,
|
eslintPromise.configs['flat/recommended'],
|
||||||
|
...eslintPluginVueScopedCSS.configs['flat/recommended'],
|
||||||
// TypeScript
|
...vueI18n.configs['flat/recommended'],
|
||||||
//...tseslint.configs.recommended,
|
|
||||||
//...tseslint.configs.recommendedTypeChecked,
|
|
||||||
//...tseslint.configs.strictTypeChecked,
|
|
||||||
//...tseslint.configs.stylisticTypeChecked,
|
|
||||||
|
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
'import/order': 'off',
|
'import/order': 'off',
|
||||||
'sort-imports': 'off',
|
'sort-imports': 'off',
|
||||||
|
'perfectionist/sort-imports': 'off',
|
||||||
|
'perfectionist/sort-named-imports': 'off',
|
||||||
|
'promise/prefer-await-to-callbacks': 'error',
|
||||||
|
|
||||||
|
// Vue I18n
|
||||||
|
'@intlify/vue-i18n/no-raw-text': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
attributes: {
|
||||||
|
'/.+/': ['label'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@intlify/vue-i18n/key-format-style': ['error', 'snake_case'],
|
||||||
|
'@intlify/vue-i18n/no-duplicate-keys-in-locale': 'error',
|
||||||
|
'@intlify/vue-i18n/no-dynamic-keys': 'error',
|
||||||
|
'@intlify/vue-i18n/no-deprecated-i18n-component': 'error',
|
||||||
|
'@intlify/vue-i18n/no-deprecated-tc': 'error',
|
||||||
|
'@intlify/vue-i18n/no-i18n-t-path-prop': 'error',
|
||||||
|
'@intlify/vue-i18n/no-missing-keys-in-other-locales': 'off',
|
||||||
|
'@intlify/vue-i18n/valid-message-syntax': 'error',
|
||||||
|
'@intlify/vue-i18n/no-missing-keys': 'error',
|
||||||
|
'@intlify/vue-i18n/no-unknown-locale': 'error',
|
||||||
|
'@intlify/vue-i18n/no-unused-keys': ['error', { extensions: ['.ts', '.vue'] }],
|
||||||
|
'@intlify/vue-i18n/prefer-sfc-lang-attr': 'error',
|
||||||
|
'@intlify/vue-i18n/no-html-messages': 'error',
|
||||||
|
'@intlify/vue-i18n/prefer-linked-key-with-paren': 'error',
|
||||||
|
'@intlify/vue-i18n/sfc-locale-attr': 'error',
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
// Vue I18n
|
||||||
|
'vue-i18n': {
|
||||||
|
localeDir: './src/assets/locales/en.json',
|
||||||
|
// Specify the version of `vue-i18n` you are using.
|
||||||
|
// If not specified, the message will be parsed twice.
|
||||||
|
messageSyntaxVersion: '^9.0.0',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
...eslintPluginVueScopedCSS.configs['flat/recommended'],
|
|
||||||
|
|
||||||
// Vue
|
// Vue
|
||||||
{
|
{
|
||||||
files: ['**/*.vue'],
|
files: ['**/*.vue'],
|
||||||
|
@ -64,44 +96,6 @@ export default antfu(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Vue I18n
|
|
||||||
...vueI18n.configs['flat/recommended'],
|
|
||||||
{
|
|
||||||
rules: {
|
|
||||||
'@intlify/vue-i18n/no-raw-text': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
attributes: {
|
|
||||||
'/.+/': ['label'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'@intlify/vue-i18n/key-format-style': ['error', 'snake_case'],
|
|
||||||
'@intlify/vue-i18n/no-duplicate-keys-in-locale': 'error',
|
|
||||||
'@intlify/vue-i18n/no-dynamic-keys': 'error',
|
|
||||||
'@intlify/vue-i18n/no-deprecated-i18n-component': 'error',
|
|
||||||
'@intlify/vue-i18n/no-deprecated-tc': 'error',
|
|
||||||
'@intlify/vue-i18n/no-i18n-t-path-prop': 'error',
|
|
||||||
'@intlify/vue-i18n/no-missing-keys-in-other-locales': 'off',
|
|
||||||
'@intlify/vue-i18n/valid-message-syntax': 'error',
|
|
||||||
'@intlify/vue-i18n/no-missing-keys': 'error',
|
|
||||||
'@intlify/vue-i18n/no-unknown-locale': 'error',
|
|
||||||
'@intlify/vue-i18n/no-unused-keys': ['error', { extensions: ['.ts', '.vue'] }],
|
|
||||||
'@intlify/vue-i18n/prefer-sfc-lang-attr': 'error',
|
|
||||||
'@intlify/vue-i18n/no-html-messages': 'error',
|
|
||||||
'@intlify/vue-i18n/prefer-linked-key-with-paren': 'error',
|
|
||||||
'@intlify/vue-i18n/sfc-locale-attr': 'error',
|
|
||||||
},
|
|
||||||
settings: {
|
|
||||||
'vue-i18n': {
|
|
||||||
localeDir: './src/assets/locales/en.json',
|
|
||||||
// Specify the version of `vue-i18n` you are using.
|
|
||||||
// If not specified, the message will be parsed twice.
|
|
||||||
messageSyntaxVersion: '^9.0.0',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// Ignore list
|
// Ignore list
|
||||||
{
|
{
|
||||||
ignores: [
|
ignores: [
|
||||||
|
|
|
@ -18,53 +18,52 @@
|
||||||
"test": "vitest"
|
"test": "vitest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
"@intlify/unplugin-vue-i18n": "^5.0.0",
|
||||||
"@kyvg/vue3-notification": "^3.2.1",
|
"@kyvg/vue3-notification": "^3.2.1",
|
||||||
"@mdi/js": "^7.4.47",
|
"@mdi/js": "^7.4.47",
|
||||||
"@vueuse/core": "^10.10.0",
|
"@vueuse/core": "^11.0.0",
|
||||||
"ansi_up": "^6.0.2",
|
"ansi_up": "^6.0.2",
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.12",
|
||||||
"fuse.js": "^7.0.0",
|
"fuse.js": "^7.0.0",
|
||||||
"js-base64": "^3.7.7",
|
"js-base64": "^3.7.7",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"node-emoji": "^2.1.3",
|
"node-emoji": "^2.1.3",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.2.1",
|
||||||
"prismjs": "^1.29.0",
|
"prismjs": "^1.29.0",
|
||||||
"semver": "^7.6.2",
|
"semver": "^7.6.3",
|
||||||
"simple-icons": "^12.3.0",
|
"simple-icons": "^13.5.0",
|
||||||
"vue": "^3.4.27",
|
"vue": "^3.4.38",
|
||||||
"vue-i18n": "^9.13.1",
|
"vue-i18n": "^9.13.1",
|
||||||
"vue-router": "^4.3.2"
|
"vue-router": "^4.4.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^2.20.0",
|
"@antfu/eslint-config": "^3.3.2",
|
||||||
"@eslint/js": "^9.4.0",
|
"@eslint/js": "^9.9.0",
|
||||||
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
|
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
|
||||||
"@intlify/eslint-plugin-vue-i18n": "3.0.0",
|
"@intlify/eslint-plugin-vue-i18n": "3.0.0",
|
||||||
"@types/eslint__js": "^8.42.3",
|
"@types/eslint__js": "^8.42.3",
|
||||||
"@types/lodash": "^4.17.4",
|
"@types/lodash": "^4.17.7",
|
||||||
"@types/node": "^20.14.2",
|
"@types/node": "^20.14.15",
|
||||||
"@types/prismjs": "^1.26.4",
|
"@types/prismjs": "^1.26.4",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"@types/tinycolor2": "^1.4.6",
|
"@types/tinycolor2": "^1.4.6",
|
||||||
"@vitejs/plugin-vue": "^5.0.5",
|
"@vitejs/plugin-vue": "^5.1.2",
|
||||||
"@vue/compiler-sfc": "^3.4.27",
|
"@vue/compiler-sfc": "^3.4.38",
|
||||||
"@vue/test-utils": "^2.4.6",
|
"@vue/test-utils": "^2.4.6",
|
||||||
"eslint": "^9.4.0",
|
"eslint": "^9.9.0",
|
||||||
"eslint-plugin-promise": "^6.2.0",
|
"eslint-plugin-promise": "^7.1.0",
|
||||||
"eslint-plugin-vue-scoped-css": "^2.8.0",
|
"eslint-plugin-vue-scoped-css": "^2.8.1",
|
||||||
"jsdom": "^24.1.0",
|
"jsdom": "^25.0.0",
|
||||||
"prettier": "^3.3.0",
|
"prettier": "^3.3.3",
|
||||||
"replace-in-file": "^8.0.0",
|
"replace-in-file": "^8.1.0",
|
||||||
"tinycolor2": "^1.6.0",
|
"tinycolor2": "^1.6.0",
|
||||||
"typescript": "5.5.3",
|
"typescript": "5.5.4",
|
||||||
"typescript-eslint": "^7.12.0",
|
"vite": "^5.4.1",
|
||||||
"vite": "^5.2.12",
|
|
||||||
"vite-plugin-prismjs": "^0.0.11",
|
"vite-plugin-prismjs": "^0.0.11",
|
||||||
"vite-plugin-windicss": "^1.9.3",
|
"vite-plugin-windicss": "^1.9.3",
|
||||||
"vite-svg-loader": "^5.1.0",
|
"vite-svg-loader": "^5.1.0",
|
||||||
"vitest": "^2.0.0",
|
"vitest": "^2.0.5",
|
||||||
"vue-tsc": "^2.0.19",
|
"vue-tsc": "^2.0.29",
|
||||||
"windicss": "^3.5.6"
|
"windicss": "^3.5.6"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
|
|
2070
web/pnpm-lock.yaml
2070
web/pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -31,7 +31,7 @@ const apiClient = useApiClient();
|
||||||
const { notify } = useNotifications();
|
const { notify } = useNotifications();
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
|
|
||||||
// TODO reenable with eslint-plugin-promise eslint-disable-next-line promise/prefer-await-to-callbacks
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||||
apiClient.setErrorHandler((err) => {
|
apiClient.setErrorHandler((err) => {
|
||||||
if (err.status === 404) {
|
if (err.status === 404) {
|
||||||
notify({ title: i18n.t('errors.not_found'), type: 'error' });
|
notify({ title: i18n.t('errors.not_found'), type: 'error' });
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import '~/style/prism.css';
|
|
||||||
|
|
||||||
import Prism from 'prismjs';
|
import Prism from 'prismjs';
|
||||||
import { computed, defineComponent, h, toRef, type VNode } from 'vue';
|
import { computed, defineComponent, h, toRef, type VNode } from 'vue';
|
||||||
|
|
||||||
|
import '~/style/prism.css';
|
||||||
|
|
||||||
declare type Data = Record<string, unknown>;
|
declare type Data = Record<string, unknown>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|
|
@ -106,8 +106,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import '~/style/console.css';
|
|
||||||
|
|
||||||
import { useStorage } from '@vueuse/core';
|
import { useStorage } from '@vueuse/core';
|
||||||
import { AnsiUp } from 'ansi_up';
|
import { AnsiUp } from 'ansi_up';
|
||||||
import { decode } from 'js-base64';
|
import { decode } from 'js-base64';
|
||||||
|
@ -123,6 +121,8 @@ import useNotifications from '~/compositions/useNotifications';
|
||||||
import type { Pipeline, Repo, RepoPermissions } from '~/lib/api/types';
|
import type { Pipeline, Repo, RepoPermissions } from '~/lib/api/types';
|
||||||
import { findStep, isStepFinished, isStepRunning } from '~/utils/helpers';
|
import { findStep, isStepFinished, isStepRunning } from '~/utils/helpers';
|
||||||
|
|
||||||
|
import '~/style/console.css';
|
||||||
|
|
||||||
interface LogLine {
|
interface LogLine {
|
||||||
index: number;
|
index: number;
|
||||||
number: number;
|
number: number;
|
||||||
|
|
|
@ -12,19 +12,24 @@ dayjs.extend(advancedFormat);
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
dayjs.extend(duration);
|
dayjs.extend(duration);
|
||||||
|
|
||||||
|
function toLocaleString(date: Date) {
|
||||||
|
return dayjs(date).format(useI18n().t('time.template'));
|
||||||
|
}
|
||||||
|
|
||||||
|
function timeAgo(date: Date | string | number) {
|
||||||
|
return dayjs().to(dayjs(date));
|
||||||
|
}
|
||||||
|
|
||||||
|
function prettyDuration(durationMs: number) {
|
||||||
|
return dayjs.duration(durationMs).humanize();
|
||||||
|
}
|
||||||
|
|
||||||
|
function durationAsNumber(durationMs: number): string {
|
||||||
|
const dur = dayjs.duration(durationMs);
|
||||||
|
return dur.format(dur.hours() > 1 ? 'HH:mm:ss' : 'mm:ss');
|
||||||
|
}
|
||||||
|
|
||||||
export function useDate() {
|
export function useDate() {
|
||||||
function toLocaleString(date: Date) {
|
|
||||||
return dayjs(date).format(useI18n().t('time.template'));
|
|
||||||
}
|
|
||||||
|
|
||||||
function timeAgo(date: Date | string | number) {
|
|
||||||
return dayjs().to(dayjs(date));
|
|
||||||
}
|
|
||||||
|
|
||||||
function prettyDuration(durationMs: number) {
|
|
||||||
return dayjs.duration(durationMs).humanize();
|
|
||||||
}
|
|
||||||
|
|
||||||
const addedLocales = ['en'];
|
const addedLocales = ['en'];
|
||||||
|
|
||||||
async function setDayjsLocale(locale: string) {
|
async function setDayjsLocale(locale: string) {
|
||||||
|
@ -36,11 +41,6 @@ export function useDate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function durationAsNumber(durationMs: number): string {
|
|
||||||
const dur = dayjs.duration(durationMs);
|
|
||||||
return dur.format(dur.hours() > 1 ? 'HH:mm:ss' : 'mm:ss');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
toLocaleString,
|
toLocaleString,
|
||||||
timeAgo,
|
timeAgo,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { InjectionKey, Ref } from 'vue';
|
|
||||||
import { inject as vueInject, provide as vueProvide } from 'vue';
|
import { inject as vueInject, provide as vueProvide } from 'vue';
|
||||||
|
import type { InjectionKey, Ref } from 'vue';
|
||||||
|
|
||||||
import type { Org, OrgPermissions, Repo } from '~/lib/api/types';
|
import type { Org, OrgPermissions, Repo } from '~/lib/api/types';
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,11 @@ async function waitForState<T>(ref: Ref<T>, expected: T): Promise<void> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO enable again with eslint-plugin-promise eslint-disable-next-line promise/prefer-await-to-callbacks
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||||
export const mountComposition = (cb: () => void) => {
|
export const mountComposition = (cb: () => void) => {
|
||||||
const wrapper = shallowMount({
|
const wrapper = shallowMount({
|
||||||
setup() {
|
setup() {
|
||||||
// TODO enable again with eslint-plugin-promise eslint-disable-next-line promise/prefer-await-to-callbacks
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||||
cb();
|
cb();
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
@ -48,6 +48,7 @@ describe('usePaginate', () => {
|
||||||
usePaginationComposition = usePagination<{ name: string }>(
|
usePaginationComposition = usePagination<{ name: string }>(
|
||||||
async (page) => repoSecrets[page - 1],
|
async (page) => repoSecrets[page - 1],
|
||||||
() => true,
|
() => true,
|
||||||
|
{ pageSize: 3 },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await waitForState(usePaginationComposition.loading, true);
|
await waitForState(usePaginationComposition.loading, true);
|
||||||
|
@ -63,6 +64,7 @@ describe('usePaginate', () => {
|
||||||
usePaginationComposition = usePagination<{ name: string }>(
|
usePaginationComposition = usePagination<{ name: string }>(
|
||||||
async (page) => repoSecrets[page - 1],
|
async (page) => repoSecrets[page - 1],
|
||||||
() => true,
|
() => true,
|
||||||
|
{ pageSize: 3 },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await waitForState(usePaginationComposition.loading, true);
|
await waitForState(usePaginationComposition.loading, true);
|
||||||
|
@ -86,7 +88,7 @@ describe('usePaginate', () => {
|
||||||
return orgSecrets[page - 1];
|
return orgSecrets[page - 1];
|
||||||
},
|
},
|
||||||
() => true,
|
() => true,
|
||||||
{ each: ['repo', 'org'] },
|
{ each: ['repo', 'org'], pageSize: 3 },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await waitForState(usePaginationComposition.loading, true);
|
await waitForState(usePaginationComposition.loading, true);
|
||||||
|
@ -111,6 +113,7 @@ describe('usePaginate', () => {
|
||||||
usePaginationComposition = usePagination<{ name: string }>(
|
usePaginationComposition = usePagination<{ name: string }>(
|
||||||
async (page) => repoSecrets[page - 1],
|
async (page) => repoSecrets[page - 1],
|
||||||
() => true,
|
() => true,
|
||||||
|
{ pageSize: 3 },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await waitForState(usePaginationComposition.loading, true);
|
await waitForState(usePaginationComposition.loading, true);
|
||||||
|
@ -132,6 +135,7 @@ describe('usePaginate', () => {
|
||||||
usePaginationComposition = usePagination<{ name: string }>(
|
usePaginationComposition = usePagination<{ name: string }>(
|
||||||
async (page) => repoSecrets[page - 1],
|
async (page) => repoSecrets[page - 1],
|
||||||
() => true,
|
() => true,
|
||||||
|
{ pageSize: 3 },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await waitForState(usePaginationComposition.loading, true);
|
await waitForState(usePaginationComposition.loading, true);
|
||||||
|
|
|
@ -7,20 +7,20 @@ import useAuthentication from './useAuthentication';
|
||||||
|
|
||||||
const userConfig = useUserConfig();
|
const userConfig = useUserConfig();
|
||||||
|
|
||||||
|
function toggle() {
|
||||||
|
userConfig.setUserConfig('isPipelineFeedOpen', !userConfig.userConfig.value.isPipelineFeedOpen);
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
userConfig.setUserConfig('isPipelineFeedOpen', false);
|
||||||
|
}
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const pipelineStore = usePipelineStore();
|
const pipelineStore = usePipelineStore();
|
||||||
const { isAuthenticated } = useAuthentication();
|
const { isAuthenticated } = useAuthentication();
|
||||||
|
|
||||||
const isOpen = computed(() => userConfig.userConfig.value.isPipelineFeedOpen && !!isAuthenticated);
|
const isOpen = computed(() => userConfig.userConfig.value.isPipelineFeedOpen && !!isAuthenticated);
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
userConfig.setUserConfig('isPipelineFeedOpen', !userConfig.userConfig.value.isPipelineFeedOpen);
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
userConfig.setUserConfig('isPipelineFeedOpen', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const sortedPipelines = toRef(pipelineStore, 'pipelineFeed');
|
const sortedPipelines = toRef(pipelineStore, 'pipelineFeed');
|
||||||
const activePipelines = toRef(pipelineStore, 'activePipelines');
|
const activePipelines = toRef(pipelineStore, 'activePipelines');
|
||||||
|
|
||||||
|
|
|
@ -52,14 +52,19 @@ export default class ApiClient {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
|
let message = res.statusText;
|
||||||
|
const resText = await res.text();
|
||||||
|
if (resText) {
|
||||||
|
message = `${res.statusText}: ${resText}`;
|
||||||
|
}
|
||||||
const error: ApiError = {
|
const error: ApiError = {
|
||||||
status: res.status,
|
status: res.status,
|
||||||
message: res.statusText,
|
message,
|
||||||
};
|
};
|
||||||
if (this.onerror) {
|
if (this.onerror) {
|
||||||
this.onerror(error);
|
this.onerror(error);
|
||||||
}
|
}
|
||||||
throw new Error(res.statusText);
|
throw new Error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
const contentType = res.headers.get('Content-Type');
|
const contentType = res.headers.get('Content-Type');
|
||||||
|
@ -96,7 +101,7 @@ export default class ApiClient {
|
||||||
const events = new EventSource(_path);
|
const events = new EventSource(_path);
|
||||||
events.onmessage = (event) => {
|
events.onmessage = (event) => {
|
||||||
const data = JSON.parse(event.data as string) as T;
|
const data = JSON.parse(event.data as string) as T;
|
||||||
// TODO enable again with eslint-plugin-promise eslint-disable-next-line promise/prefer-await-to-callbacks
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||||
callback(data);
|
callback(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,7 @@ export default class WoodpeckerClient extends ApiClient {
|
||||||
return this._post(`/api/repos/repair`);
|
return this._post(`/api/repos/repair`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO enable again with eslint-plugin-promise eslint-disable-next-line promise/prefer-await-to-callbacks
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||||
on(callback: (data: { pipeline?: Pipeline; repo?: Repo }) => void): EventSource {
|
on(callback: (data: { pipeline?: Pipeline; repo?: Repo }) => void): EventSource {
|
||||||
return this._subscribe('/api/stream/events', callback, {
|
return this._subscribe('/api/stream/events', callback, {
|
||||||
reconnect: true,
|
reconnect: true,
|
||||||
|
@ -409,7 +409,7 @@ export default class WoodpeckerClient extends ApiClient {
|
||||||
repoId: number,
|
repoId: number,
|
||||||
pipeline: number,
|
pipeline: number,
|
||||||
step: number,
|
step: number,
|
||||||
// TODO enable again with eslint-plugin-promise eslint-disable-next-line promise/prefer-await-to-callbacks
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||||
callback: (data: PipelineLog) => void,
|
callback: (data: PipelineLog) => void,
|
||||||
): EventSource {
|
): EventSource {
|
||||||
return this._subscribe(`/api/stream/logs/${repoId}/${pipeline}/${step}`, callback, {
|
return this._subscribe(`/api/stream/logs/${repoId}/${pipeline}/${step}`, callback, {
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
import 'windi.css';
|
|
||||||
import '~/compositions/useFavicon';
|
|
||||||
import '~/style.css';
|
|
||||||
|
|
||||||
import { createPinia } from 'pinia';
|
import { createPinia } from 'pinia';
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|
||||||
|
@ -11,6 +7,10 @@ import { i18n } from '~/compositions/useI18n';
|
||||||
import { notifications } from '~/compositions/useNotifications';
|
import { notifications } from '~/compositions/useNotifications';
|
||||||
import router from '~/router';
|
import router from '~/router';
|
||||||
|
|
||||||
|
import '~/compositions/useFavicon';
|
||||||
|
import '~/style.css';
|
||||||
|
import 'windi.css';
|
||||||
|
|
||||||
// eslint-disable-next-line ts/no-unsafe-argument
|
// eslint-disable-next-line ts/no-unsafe-argument
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ const routes: RouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':repoOwner/:repoName/:pathMatch(.*)*',
|
path: ':repoOwner/:repoName/:pathMatch(.*)*',
|
||||||
component: async () => import('~/views/repo/RepoDeprecatedRedirect.vue'),
|
component: (): Component => import('~/views/repo/RepoDeprecatedRedirect.vue'),
|
||||||
props: true,
|
props: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -161,7 +161,7 @@ const routes: RouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: `${rootPath}/cli/auth`,
|
path: `${rootPath}/cli/auth`,
|
||||||
component: async () => import('~/views/cli/Auth.vue'),
|
component: (): Component => import('~/views/cli/Auth.vue'),
|
||||||
meta: { authentication: 'required' },
|
meta: { authentication: 'required' },
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ const routes: RouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: `${rootPath}/:repoOwner/:repoName/:pathMatch(.*)*`,
|
path: `${rootPath}/:repoOwner/:repoName/:pathMatch(.*)*`,
|
||||||
component: async () => import('~/views/repo/RepoDeprecatedRedirect.vue'),
|
component: (): Component => import('~/views/repo/RepoDeprecatedRedirect.vue'),
|
||||||
props: true,
|
props: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Scaffold v-if="org && orgPermissions && $route.meta.orgHeader">
|
<Scaffold v-if="org && orgPermissions && route.meta.orgHeader">
|
||||||
<template #title>
|
<template #title>
|
||||||
{{ org.name }}
|
{{ org.name }}
|
||||||
</template>
|
</template>
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, ref, watch } from 'vue';
|
import { computed, onMounted, ref, watch } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import IconButton from '~/components/atomic/IconButton.vue';
|
import IconButton from '~/components/atomic/IconButton.vue';
|
||||||
import Scaffold from '~/components/layout/scaffold/Scaffold.vue';
|
import Scaffold from '~/components/layout/scaffold/Scaffold.vue';
|
||||||
|
@ -33,6 +34,7 @@ const props = defineProps<{
|
||||||
|
|
||||||
const orgId = computed(() => Number.parseInt(props.orgId, 10));
|
const orgId = computed(() => Number.parseInt(props.orgId, 10));
|
||||||
const apiClient = useApiClient();
|
const apiClient = useApiClient();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const org = ref<Org>();
|
const org = ref<Org>();
|
||||||
const orgPermissions = ref<OrgPermissions>();
|
const orgPermissions = ref<OrgPermissions>();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Scaffold
|
<Scaffold
|
||||||
v-if="repo && repoPermissions && $route.meta.repoHeader"
|
v-if="repo && repoPermissions && route.meta.repoHeader"
|
||||||
v-model:activeTab="activeTab"
|
v-model:active-tab="activeTab"
|
||||||
enable-tabs
|
enable-tabs
|
||||||
disable-tab-url-hash-mode
|
disable-tab-url-hash-mode
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Scaffold
|
<Scaffold
|
||||||
v-if="pipeline && repo"
|
v-if="pipeline && repo"
|
||||||
v-model:activeTab="activeTab"
|
v-model:active-tab="activeTab"
|
||||||
enable-tabs
|
enable-tabs
|
||||||
disable-tab-url-hash-mode
|
disable-tab-url-hash-mode
|
||||||
:go-back="goBack"
|
:go-back="goBack"
|
||||||
|
|
|
@ -78,7 +78,7 @@ export default defineConfig({
|
||||||
copyFile(
|
copyFile(
|
||||||
`node_modules/dayjs/esm/locale/${langName}.js`,
|
`node_modules/dayjs/esm/locale/${langName}.js`,
|
||||||
`src/assets/dayjsLocales/${name}.js`,
|
`src/assets/dayjsLocales/${name}.js`,
|
||||||
// TODO enable with eslint-plugin-promise eslint-disable-next-line promise/prefer-await-to-callbacks
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||||
(err) => {
|
(err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
|
|
Loading…
Reference in a new issue