mirror of https://github.com/halo-dev/halo-admin
Merge branch 'main' into refactor/comment-related-query
commit
a16481a817
|
@ -129,13 +129,18 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Install a plugin by uploading a Jar file.
|
* Install a plugin by uploading a Jar file.
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
installPlugin: async (file: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
installPlugin: async (
|
||||||
// verify required parameter 'file' is not null or undefined
|
file?: File,
|
||||||
assertParamExists('installPlugin', 'file', file)
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
|
options: AxiosRequestConfig = {},
|
||||||
|
): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/install`
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/install`
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
|
||||||
|
@ -161,6 +166,14 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarFormParams.append('file', file as any)
|
localVarFormParams.append('file', file as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (source !== undefined) {
|
||||||
|
localVarFormParams.append('source', source as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (presetName !== undefined) {
|
||||||
|
localVarFormParams.append('presetName', presetName as any)
|
||||||
|
}
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
|
@ -173,15 +186,50 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listPluginPresets: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugin-presets`
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
|
||||||
|
let baseOptions
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }
|
||||||
|
const localVarHeaderParameter = {} as any
|
||||||
|
const localVarQueryParameter = {} as any
|
||||||
|
|
||||||
|
// authentication BasicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication BearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}
|
||||||
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* List plugins using query criteria and sort params
|
* List plugins using query criteria and sort params
|
||||||
* @param {Array<string>} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp
|
* @param {Array<string>} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp
|
||||||
* @param {string} [keyword] Keyword of plugin name or description
|
* @param {string} [keyword] Keyword of plugin name or description
|
||||||
* @param {boolean} [enabled] Whether the plugin is enabled
|
* @param {boolean} [enabled] Whether the plugin is enabled
|
||||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||||
* @param {number} [page] The page number. Zero indicates no page.
|
|
||||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||||
|
* @param {number} [page] The page number. Zero indicates no page.
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
|
@ -190,9 +238,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
keyword?: string,
|
keyword?: string,
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
size?: number,
|
size?: number,
|
||||||
page?: number,
|
|
||||||
labelSelector?: Array<string>,
|
labelSelector?: Array<string>,
|
||||||
fieldSelector?: Array<string>,
|
fieldSelector?: Array<string>,
|
||||||
|
page?: number,
|
||||||
options: AxiosRequestConfig = {},
|
options: AxiosRequestConfig = {},
|
||||||
): Promise<RequestArgs> => {
|
): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins`
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins`
|
||||||
|
@ -231,10 +279,6 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarQueryParameter['size'] = size
|
localVarQueryParameter['size'] = size
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page !== undefined) {
|
|
||||||
localVarQueryParameter['page'] = page
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labelSelector) {
|
if (labelSelector) {
|
||||||
localVarQueryParameter['labelSelector'] = labelSelector
|
localVarQueryParameter['labelSelector'] = labelSelector
|
||||||
}
|
}
|
||||||
|
@ -243,6 +287,10 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarQueryParameter['fieldSelector'] = fieldSelector
|
localVarQueryParameter['fieldSelector'] = fieldSelector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (page !== undefined) {
|
||||||
|
localVarQueryParameter['page'] = page
|
||||||
|
}
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}
|
||||||
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }
|
||||||
|
@ -347,15 +395,21 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
/**
|
/**
|
||||||
* Upgrade a plugin by uploading a Jar file
|
* Upgrade a plugin by uploading a Jar file
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
upgradePlugin: async (name: string, file: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
upgradePlugin: async (
|
||||||
|
name: string,
|
||||||
|
file?: File,
|
||||||
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
|
options: AxiosRequestConfig = {},
|
||||||
|
): Promise<RequestArgs> => {
|
||||||
// verify required parameter 'name' is not null or undefined
|
// verify required parameter 'name' is not null or undefined
|
||||||
assertParamExists('upgradePlugin', 'name', name)
|
assertParamExists('upgradePlugin', 'name', name)
|
||||||
// verify required parameter 'file' is not null or undefined
|
|
||||||
assertParamExists('upgradePlugin', 'file', file)
|
|
||||||
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/{name}/upgrade`.replace(
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/{name}/upgrade`.replace(
|
||||||
`{${'name'}}`,
|
`{${'name'}}`,
|
||||||
encodeURIComponent(String(name)),
|
encodeURIComponent(String(name)),
|
||||||
|
@ -384,6 +438,14 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarFormParams.append('file', file as any)
|
localVarFormParams.append('file', file as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (source !== undefined) {
|
||||||
|
localVarFormParams.append('source', source as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (presetName !== undefined) {
|
||||||
|
localVarFormParams.append('presetName', presetName as any)
|
||||||
|
}
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
|
@ -434,15 +496,30 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Install a plugin by uploading a Jar file.
|
* Install a plugin by uploading a Jar file.
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async installPlugin(
|
async installPlugin(
|
||||||
file: File,
|
file?: File,
|
||||||
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>> {
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.installPlugin(file, options)
|
const localVarAxiosArgs = await localVarAxiosParamCreator.installPlugin(file, source, presetName, options)
|
||||||
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async listPluginPresets(
|
||||||
|
options?: AxiosRequestConfig,
|
||||||
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Plugin>>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listPluginPresets(options)
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -451,9 +528,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
* @param {string} [keyword] Keyword of plugin name or description
|
* @param {string} [keyword] Keyword of plugin name or description
|
||||||
* @param {boolean} [enabled] Whether the plugin is enabled
|
* @param {boolean} [enabled] Whether the plugin is enabled
|
||||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||||
* @param {number} [page] The page number. Zero indicates no page.
|
|
||||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||||
|
* @param {number} [page] The page number. Zero indicates no page.
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
|
@ -462,9 +539,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
keyword?: string,
|
keyword?: string,
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
size?: number,
|
size?: number,
|
||||||
page?: number,
|
|
||||||
labelSelector?: Array<string>,
|
labelSelector?: Array<string>,
|
||||||
fieldSelector?: Array<string>,
|
fieldSelector?: Array<string>,
|
||||||
|
page?: number,
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PluginList>> {
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PluginList>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.listPlugins(
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listPlugins(
|
||||||
|
@ -472,9 +549,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
keyword,
|
keyword,
|
||||||
enabled,
|
enabled,
|
||||||
size,
|
size,
|
||||||
page,
|
|
||||||
labelSelector,
|
labelSelector,
|
||||||
fieldSelector,
|
fieldSelector,
|
||||||
|
page,
|
||||||
options,
|
options,
|
||||||
)
|
)
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
|
@ -510,16 +587,20 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
/**
|
/**
|
||||||
* Upgrade a plugin by uploading a Jar file
|
* Upgrade a plugin by uploading a Jar file
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async upgradePlugin(
|
async upgradePlugin(
|
||||||
name: string,
|
name: string,
|
||||||
file: File,
|
file?: File,
|
||||||
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.upgradePlugin(name, file, options)
|
const localVarAxiosArgs = await localVarAxiosParamCreator.upgradePlugin(name, file, source, presetName, options)
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -567,10 +648,20 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFactory = function (
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
installPlugin(
|
installPlugin(
|
||||||
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest,
|
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest = {},
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): AxiosPromise<Plugin> {
|
): AxiosPromise<Plugin> {
|
||||||
return localVarFp.installPlugin(requestParameters.file, options).then((request) => request(axios, basePath))
|
return localVarFp
|
||||||
|
.installPlugin(requestParameters.file, requestParameters.source, requestParameters.presetName, options)
|
||||||
|
.then((request) => request(axios, basePath))
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listPluginPresets(options?: AxiosRequestConfig): AxiosPromise<Array<Plugin>> {
|
||||||
|
return localVarFp.listPluginPresets(options).then((request) => request(axios, basePath))
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* List plugins using query criteria and sort params
|
* List plugins using query criteria and sort params
|
||||||
|
@ -588,9 +679,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFactory = function (
|
||||||
requestParameters.keyword,
|
requestParameters.keyword,
|
||||||
requestParameters.enabled,
|
requestParameters.enabled,
|
||||||
requestParameters.size,
|
requestParameters.size,
|
||||||
requestParameters.page,
|
|
||||||
requestParameters.labelSelector,
|
requestParameters.labelSelector,
|
||||||
requestParameters.fieldSelector,
|
requestParameters.fieldSelector,
|
||||||
|
requestParameters.page,
|
||||||
options,
|
options,
|
||||||
)
|
)
|
||||||
.then((request) => request(axios, basePath))
|
.then((request) => request(axios, basePath))
|
||||||
|
@ -632,7 +723,13 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFactory = function (
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): AxiosPromise<void> {
|
): AxiosPromise<void> {
|
||||||
return localVarFp
|
return localVarFp
|
||||||
.upgradePlugin(requestParameters.name, requestParameters.file, options)
|
.upgradePlugin(
|
||||||
|
requestParameters.name,
|
||||||
|
requestParameters.file,
|
||||||
|
requestParameters.source,
|
||||||
|
requestParameters.presetName,
|
||||||
|
options,
|
||||||
|
)
|
||||||
.then((request) => request(axios, basePath))
|
.then((request) => request(axios, basePath))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -677,7 +774,21 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest {
|
||||||
* @type {File}
|
* @type {File}
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
||||||
*/
|
*/
|
||||||
readonly file: File
|
readonly file?: File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Install source. Default is file.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
||||||
|
*/
|
||||||
|
readonly source?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin preset name. We will find the plugin from plugin presets
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
||||||
|
*/
|
||||||
|
readonly presetName?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -714,13 +825,6 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest {
|
||||||
*/
|
*/
|
||||||
readonly size?: number
|
readonly size?: number
|
||||||
|
|
||||||
/**
|
|
||||||
* The page number. Zero indicates no page.
|
|
||||||
* @type {number}
|
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
|
||||||
*/
|
|
||||||
readonly page?: number
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Label selector for filtering.
|
* Label selector for filtering.
|
||||||
* @type {Array<string>}
|
* @type {Array<string>}
|
||||||
|
@ -734,6 +838,13 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest {
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
||||||
*/
|
*/
|
||||||
readonly fieldSelector?: Array<string>
|
readonly fieldSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The page number. Zero indicates no page.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
||||||
|
*/
|
||||||
|
readonly page?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -789,7 +900,21 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest {
|
||||||
* @type {File}
|
* @type {File}
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
||||||
*/
|
*/
|
||||||
readonly file: File
|
readonly file?: File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Install source. Default is file.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
||||||
|
*/
|
||||||
|
readonly source?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin preset name. We will find the plugin from plugin presets
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
||||||
|
*/
|
||||||
|
readonly presetName?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -839,11 +964,23 @@ export class ApiConsoleHaloRunV1alpha1PluginApi extends BaseAPI {
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApi
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApi
|
||||||
*/
|
*/
|
||||||
public installPlugin(
|
public installPlugin(
|
||||||
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest,
|
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest = {},
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
) {
|
) {
|
||||||
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
||||||
.installPlugin(requestParameters.file, options)
|
.installPlugin(requestParameters.file, requestParameters.source, requestParameters.presetName, options)
|
||||||
|
.then((request) => request(this.axios, this.basePath))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApi
|
||||||
|
*/
|
||||||
|
public listPluginPresets(options?: AxiosRequestConfig) {
|
||||||
|
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
||||||
|
.listPluginPresets(options)
|
||||||
.then((request) => request(this.axios, this.basePath))
|
.then((request) => request(this.axios, this.basePath))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -864,9 +1001,9 @@ export class ApiConsoleHaloRunV1alpha1PluginApi extends BaseAPI {
|
||||||
requestParameters.keyword,
|
requestParameters.keyword,
|
||||||
requestParameters.enabled,
|
requestParameters.enabled,
|
||||||
requestParameters.size,
|
requestParameters.size,
|
||||||
requestParameters.page,
|
|
||||||
requestParameters.labelSelector,
|
requestParameters.labelSelector,
|
||||||
requestParameters.fieldSelector,
|
requestParameters.fieldSelector,
|
||||||
|
requestParameters.page,
|
||||||
options,
|
options,
|
||||||
)
|
)
|
||||||
.then((request) => request(this.axios, this.basePath))
|
.then((request) => request(this.axios, this.basePath))
|
||||||
|
@ -916,7 +1053,13 @@ export class ApiConsoleHaloRunV1alpha1PluginApi extends BaseAPI {
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
) {
|
) {
|
||||||
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
||||||
.upgradePlugin(requestParameters.name, requestParameters.file, options)
|
.upgradePlugin(
|
||||||
|
requestParameters.name,
|
||||||
|
requestParameters.file,
|
||||||
|
requestParameters.source,
|
||||||
|
requestParameters.presetName,
|
||||||
|
options,
|
||||||
|
)
|
||||||
.then((request) => request(this.axios, this.basePath))
|
.then((request) => request(this.axios, this.basePath))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import type { Configuration } from './configuration'
|
||||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'
|
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'
|
||||||
import globalAxios from 'axios'
|
import globalAxios from 'axios'
|
||||||
|
|
||||||
export const BASE_PATH = 'http://localhost:8090'.replace(/\/+$/, '')
|
export const BASE_PATH = 'http://127.0.0.1:8090'.replace(/\/+$/, '')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -58,6 +58,12 @@ export interface PluginStatus {
|
||||||
* @memberof PluginStatus
|
* @memberof PluginStatus
|
||||||
*/
|
*/
|
||||||
logo?: string
|
logo?: string
|
||||||
|
/**
|
||||||
|
* Load location of the plugin, often a path.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof PluginStatus
|
||||||
|
*/
|
||||||
|
loadLocation?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PluginStatusPhaseEnum = {
|
export const PluginStatusPhaseEnum = {
|
||||||
|
|
|
@ -135,7 +135,7 @@ function handleClearFilters() {
|
||||||
|
|
||||||
const keyword = ref<string>("");
|
const keyword = ref<string>("");
|
||||||
const page = ref<number>(1);
|
const page = ref<number>(1);
|
||||||
const size = ref<number>(20);
|
const size = ref<number>(60);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
attachments,
|
attachments,
|
||||||
|
|
|
@ -314,11 +314,7 @@ export function useAttachmentSelect(
|
||||||
})
|
})
|
||||||
.filter(Boolean) as Content[];
|
.filter(Boolean) as Content[];
|
||||||
|
|
||||||
editor.value
|
editor.value?.chain().focus().insertContent(contents).run();
|
||||||
?.chain()
|
|
||||||
.focus()
|
|
||||||
.insertContent([...contents, { type: "paragraph", content: "" }])
|
|
||||||
.run();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import { inject, ref, watch } from "vue";
|
import { inject, ref, watch } from "vue";
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import { VButton } from "@halo-dev/components";
|
import { Toast, VButton } from "@halo-dev/components";
|
||||||
|
|
||||||
// types
|
// types
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
|
@ -63,6 +63,8 @@ const handleSaveConfigMap = async () => {
|
||||||
configMap: configMapToUpdate,
|
configMap: configMapToUpdate,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Toast.success("保存成功");
|
||||||
|
|
||||||
await handleFetchSettings();
|
await handleFetchSettings();
|
||||||
configMap.value = newConfigMap;
|
configMap.value = newConfigMap;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import {
|
||||||
IconPhone,
|
IconPhone,
|
||||||
IconTablet,
|
IconTablet,
|
||||||
IconRefreshLine,
|
IconRefreshLine,
|
||||||
|
Toast,
|
||||||
} from "@halo-dev/components";
|
} from "@halo-dev/components";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { computed, markRaw, ref, watch } from "vue";
|
import { computed, markRaw, ref, watch } from "vue";
|
||||||
|
@ -163,6 +164,8 @@ const handleSaveConfigMap = async () => {
|
||||||
configMap: configMapToUpdate,
|
configMap: configMapToUpdate,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Toast.success("保存成功");
|
||||||
|
|
||||||
await handleFetchSettings();
|
await handleFetchSettings();
|
||||||
configMap.value = newConfigMap;
|
configMap.value = newConfigMap;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { useSettingFormConvert } from "@/composables/use-setting-form";
|
||||||
import { apiClient } from "@/utils/api-client";
|
import { apiClient } from "@/utils/api-client";
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import { VButton } from "@halo-dev/components";
|
import { Toast, VButton } from "@halo-dev/components";
|
||||||
|
|
||||||
// types
|
// types
|
||||||
import type { ConfigMap, Plugin, Setting } from "@halo-dev/api-client";
|
import type { ConfigMap, Plugin, Setting } from "@halo-dev/api-client";
|
||||||
|
@ -55,6 +55,8 @@ const handleSaveConfigMap = async () => {
|
||||||
configMap: configMapToUpdate,
|
configMap: configMapToUpdate,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Toast.success("保存成功");
|
||||||
|
|
||||||
await handleFetchSettings();
|
await handleFetchSettings();
|
||||||
configMap.value = newConfigMap;
|
configMap.value = newConfigMap;
|
||||||
saving.value = false;
|
saving.value = false;
|
||||||
|
|
|
@ -17,10 +17,14 @@ export function useUserFetch(options?: {
|
||||||
const users = ref<User[]>([] as User[]);
|
const users = ref<User[]>([] as User[]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
|
const ANONYMOUSUSER_NAME = "anonymousUser";
|
||||||
|
|
||||||
const handleFetchUsers = async () => {
|
const handleFetchUsers = async () => {
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const { data } = await apiClient.extension.user.listv1alpha1User();
|
const { data } = await apiClient.extension.user.listv1alpha1User({
|
||||||
|
fieldSelector: [`name!=${ANONYMOUSUSER_NAME}`],
|
||||||
|
});
|
||||||
users.value = data.items;
|
users.value = data.items;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to fetch users", e);
|
console.error("Failed to fetch users", e);
|
||||||
|
|
|
@ -14,11 +14,13 @@ import menu from "./setup-data/menu.json";
|
||||||
import menuItems from "./setup-data/menu-items.json";
|
import menuItems from "./setup-data/menu-items.json";
|
||||||
import type {
|
import type {
|
||||||
Category,
|
Category,
|
||||||
|
Plugin,
|
||||||
PostRequest,
|
PostRequest,
|
||||||
SinglePageRequest,
|
SinglePageRequest,
|
||||||
Tag,
|
Tag,
|
||||||
} from "@halo-dev/api-client";
|
} from "@halo-dev/api-client";
|
||||||
import { useThemeStore } from "@/stores/theme";
|
import { useThemeStore } from "@/stores/theme";
|
||||||
|
import { useMutation } from "@tanstack/vue-query";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
@ -32,6 +34,24 @@ const {
|
||||||
const siteTitle = ref("");
|
const siteTitle = ref("");
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
|
const { mutate: pluginStartMutate } = useMutation({
|
||||||
|
mutationKey: ["plugin-start"],
|
||||||
|
mutationFn: async (plugin: Plugin) => {
|
||||||
|
const { data: pluginToUpdate } =
|
||||||
|
await apiClient.extension.plugin.getpluginHaloRunV1alpha1Plugin({
|
||||||
|
name: plugin.metadata.name,
|
||||||
|
});
|
||||||
|
|
||||||
|
pluginToUpdate.spec.enabled = true;
|
||||||
|
|
||||||
|
return apiClient.extension.plugin.updatepluginHaloRunV1alpha1Plugin({
|
||||||
|
name: plugin.metadata.name,
|
||||||
|
plugin: pluginToUpdate,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
retry: 3,
|
||||||
|
});
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
@ -52,12 +72,7 @@ const handleSubmit = async () => {
|
||||||
const { data: postData } = await apiClient.post.draftPost({
|
const { data: postData } = await apiClient.post.draftPost({
|
||||||
postRequest: post as PostRequest,
|
postRequest: post as PostRequest,
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
|
||||||
await apiClient.post.publishPost({ name: postData.metadata.name });
|
await apiClient.post.publishPost({ name: postData.metadata.name });
|
||||||
} catch (e) {
|
|
||||||
console.error("Publish post failed", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create singlePage
|
// Create singlePage
|
||||||
const { data: singlePageData } = await apiClient.singlePage.draftSinglePage(
|
const { data: singlePageData } = await apiClient.singlePage.draftSinglePage(
|
||||||
|
@ -66,13 +81,9 @@ const handleSubmit = async () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
|
||||||
await apiClient.singlePage.publishSinglePage({
|
await apiClient.singlePage.publishSinglePage({
|
||||||
name: singlePageData.metadata.name,
|
name: singlePageData.metadata.name,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
console.error("Publish single page failed", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create menu and menu items
|
// Create menu and menu items
|
||||||
const menuItemPromises = menuItems.map((item) => {
|
const menuItemPromises = menuItems.map((item) => {
|
||||||
|
@ -83,6 +94,26 @@ const handleSubmit = async () => {
|
||||||
await Promise.all(menuItemPromises);
|
await Promise.all(menuItemPromises);
|
||||||
await apiClient.extension.menu.createv1alpha1Menu({ menu: menu });
|
await apiClient.extension.menu.createv1alpha1Menu({ menu: menu });
|
||||||
|
|
||||||
|
// Install preset plugins
|
||||||
|
const { data: presetPlugins } = await apiClient.plugin.listPluginPresets();
|
||||||
|
|
||||||
|
const installPluginResponses = await Promise.all(
|
||||||
|
presetPlugins.map((plugin) => {
|
||||||
|
return apiClient.plugin.installPlugin({
|
||||||
|
source: "PRESET",
|
||||||
|
presetName: plugin.metadata.name as string,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
for (let i = 0; i < installPluginResponses.length; i++) {
|
||||||
|
const response = installPluginResponses[i];
|
||||||
|
pluginStartMutate(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to initialize preset data", error);
|
||||||
|
}
|
||||||
|
|
||||||
// Create system-states ConfigMap
|
// Create system-states ConfigMap
|
||||||
await apiClient.extension.configMap.createv1alpha1ConfigMap({
|
await apiClient.extension.configMap.createv1alpha1ConfigMap({
|
||||||
configMap: {
|
configMap: {
|
||||||
|
@ -102,14 +133,11 @@ const handleSubmit = async () => {
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
await themeStore.fetchActivatedTheme();
|
await themeStore.fetchActivatedTheme();
|
||||||
|
|
||||||
|
loading.value = false;
|
||||||
|
|
||||||
router.push({ name: "Dashboard" });
|
router.push({ name: "Dashboard" });
|
||||||
|
|
||||||
Toast.success("初始化成功");
|
Toast.success("初始化成功");
|
||||||
} catch (error) {
|
|
||||||
console.error("Failed to setup", error);
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
Loading…
Reference in New Issue