mirror of
https://github.com/owncast/owncast.git
synced 2025-11-02 20:23:29 +08:00
a fix for https://github.com/owncast/owncast/issues/691 (and some linting)
This commit is contained in:
@ -177,19 +177,9 @@ export const DEFAULT_SOCIAL_HANDLE: SocialHandle = {
|
|||||||
|
|
||||||
export const OTHER_SOCIAL_HANDLE_OPTION = 'OTHER_SOCIAL_HANDLE_OPTION';
|
export const OTHER_SOCIAL_HANDLE_OPTION = 'OTHER_SOCIAL_HANDLE_OPTION';
|
||||||
|
|
||||||
|
|
||||||
export const TEXTFIELD_PROPS_S3_COMMON = {
|
export const TEXTFIELD_PROPS_S3_COMMON = {
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// export const FIELD_PROPS_CUSTOM_CONTENT = {
|
|
||||||
// apiPath: API_CUSTOM_CONTENT,
|
|
||||||
// configPath: 'instanceDetails',
|
|
||||||
// placeholder: '',
|
|
||||||
// label: 'Extra page content',
|
|
||||||
// tip: 'Custom markup about yourself',
|
|
||||||
// };
|
|
||||||
|
|
||||||
export const S3_TEXT_FIELDS_INFO = {
|
export const S3_TEXT_FIELDS_INFO = {
|
||||||
accessKey: {
|
accessKey: {
|
||||||
@ -239,6 +229,7 @@ export const S3_TEXT_FIELDS_INFO = {
|
|||||||
label: 'Serving Endpoint',
|
label: 'Serving Endpoint',
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
placeholder: 'http://cdn.ss3.provider.endpoint.com',
|
placeholder: 'http://cdn.ss3.provider.endpoint.com',
|
||||||
tip: 'Optional URL that content should be accessed from instead of the default. Used with CDNs and specific storage providers. Generally not required.'
|
tip:
|
||||||
|
'Optional URL that content should be accessed from instead of the default. Used with CDNs and specific storage providers. Generally not required.',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -65,8 +65,7 @@ export const SOCIAL_PLATFORMS_LIST = `${NEXT_PUBLIC_API_HOST}api/socialplatforms
|
|||||||
|
|
||||||
export const TEMP_UPDATER_API = LOGS_ALL;
|
export const TEMP_UPDATER_API = LOGS_ALL;
|
||||||
|
|
||||||
|
const GITHUB_RELEASE_URL = 'https://api.github.com/repos/owncast/owncast/releases/latest';
|
||||||
const GITHUB_RELEASE_URL = "https://api.github.com/repos/owncast/owncast/releases/latest";
|
|
||||||
|
|
||||||
interface FetchOptions {
|
interface FetchOptions {
|
||||||
data?: any;
|
data?: any;
|
||||||
@ -86,14 +85,14 @@ export async function fetchData(url: string, options?: FetchOptions) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
requestOptions.body = JSON.stringify(data)
|
requestOptions.body = JSON.stringify(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auth && ADMIN_USERNAME && ADMIN_STREAMKEY) {
|
if (auth && ADMIN_USERNAME && ADMIN_STREAMKEY) {
|
||||||
const encoded = btoa(`${ADMIN_USERNAME}:${ADMIN_STREAMKEY}`);
|
const encoded = btoa(`${ADMIN_USERNAME}:${ADMIN_STREAMKEY}`);
|
||||||
requestOptions.headers = {
|
requestOptions.headers = {
|
||||||
'Authorization': `Basic ${encoded}`
|
Authorization: `Basic ${encoded}`,
|
||||||
}
|
};
|
||||||
requestOptions.mode = 'cors';
|
requestOptions.mode = 'cors';
|
||||||
requestOptions.credentials = 'include';
|
requestOptions.credentials = 'include';
|
||||||
}
|
}
|
||||||
@ -107,8 +106,9 @@ export async function fetchData(url: string, options?: FetchOptions) {
|
|||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
return json;
|
return json;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
return error;
|
||||||
throw new Error(error)
|
// console.log(error)
|
||||||
|
// throw new Error(error)
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user