mirror of
https://github.com/zoriya/Aeris.git
synced 2026-05-26 00:08:27 +00:00
Aeris : readme_buf - Adding final translations for LoginPage for front
This commit is contained in:
@@ -21,3 +21,5 @@ SPOTIFY_SECRET=
|
||||
ANILIST_SECRET=
|
||||
ANILIST_CLIENT_ID=
|
||||
BACK_URL=
|
||||
REDDIT_CLIENT_ID=
|
||||
REDDIT_SECRET=
|
||||
|
||||
@@ -34,5 +34,13 @@
|
||||
"switch_to_english": "English",
|
||||
"pipeline_error_prefix": "Error: ",
|
||||
"pipeline_layout_pipeline_section_title": "My pipelines",
|
||||
"pipeline_layout_disable_pipeline_section_title": "Disabled pipelines"
|
||||
"pipeline_layout_disable_pipeline_section_title": "Disabled pipelines",
|
||||
"pipeline_edit_params_info_text": "You can use the residuals variables from previous reactions by typing {PARAM_NAME@REACTION_ID}.",
|
||||
"pipeline_edit_area_service_disconnected_info_part_1": "You must be connected to the ",
|
||||
"pipeline_edit_area_service_disconnected_info_part_2": " service to use its ",
|
||||
"pipeline_missing_service_account_part_1": "You aren't connected to a ",
|
||||
"pipeline_missing_service_account_part_2": " account and you're using actions/reactions from this service in this pipeline",
|
||||
"pipeline_no_last_trigger": "Not triggered yet",
|
||||
"loginWithServices": "You can sign in with this services:",
|
||||
"signUpWithServices": "You can sign up with this services:"
|
||||
}
|
||||
@@ -34,5 +34,13 @@
|
||||
"switch_to_english": "Anglais",
|
||||
"pipeline_error_prefix": "Erreur: ",
|
||||
"pipeline_layout_pipeline_section_title": "Mes pipelines",
|
||||
"pipeline_layout_disable_pipeline_section_title": "Pipelines désativées"
|
||||
"pipeline_layout_disable_pipeline_section_title": "Pipelines désativées",
|
||||
"pipeline_edit_params_info_text": "Vous pouvez utiliser les résidus des actions et réactions passées en utilisant la synthaxe suivante {NOM_DU_PARAM@ID_RÉACTION}.",
|
||||
"pipeline_edit_area_service_disconnected_info_part_1": "Vous devez être connecté au service ",
|
||||
"pipeline_edit_area_service_disconnected_info_part_2": " pour profiter de ses ",
|
||||
"pipeline_missing_service_account_part_1": "Vous n'êtes pas connecté à un compte ",
|
||||
"pipeline_missing_service_account_part_2": " et vous utilisez des actions/réactions de ce service dans cette pipeline",
|
||||
"pipeline_no_last_trigger": "Jamais déclenchée",
|
||||
"loginWithServices": "Vous pouvez vous connecter avec ces services:",
|
||||
"signUpWithServices": "Vous pouvez vous enregistrer avec ces services:"
|
||||
}
|
||||
@@ -253,6 +253,27 @@ export default function AuthComponent() {
|
||||
{authData.authMode === "login" ? t('signUp') : t('connectToAeris')}
|
||||
</Button>
|
||||
</CardActions>
|
||||
<Divider variant="middle" sx={{ m: 1 }}/>
|
||||
<Typography variant="body2" sx={{ mb: 1}}>
|
||||
{authData.authMode === 'login' ? t('loginWithServices') : t('signUpWithServices')}
|
||||
</Typography>
|
||||
<CardActions>
|
||||
{servicesData.map((elem, index) => {
|
||||
if (elem.uid === "utils")
|
||||
return (<div/>);
|
||||
return (
|
||||
<Button
|
||||
onClick={() => {
|
||||
authData.authMode === 'login' ? (window.location.href = elem.signinUrl) : (window.location.href = elem.signupUrl);
|
||||
}}
|
||||
variant="text"
|
||||
style={{ borderRadius: "20px", width: "20px", height: "20px" }}
|
||||
>
|
||||
<img loading="lazy" width="20px" height="20px" src={elem.logo.imageSrc} alt={elem.logo.altText} />
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
</CardActions>
|
||||
</Card>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
import { Pipeline, PipelineEnv, PipelineType, ReactionType, ServiceType } from "../models/pipeline";
|
||||
import { action, BaseService, reaction, service } from "../models/base-service";
|
||||
import { Client, GuildMember, Intents, Message, TextChannel } from "discord.js";
|
||||
import { filter, fromEvent, map, Observable } from "rxjs";
|
||||
import snoowrap, {Submission, Subreddit} from 'snoowrap';
|
||||
|
||||
@service(ServiceType.Reddit)
|
||||
export class Reddit extends BaseService {
|
||||
private _pipeline: Pipeline;
|
||||
private _client: snoowrap;
|
||||
|
||||
constructor(pipeline: Pipeline) {
|
||||
super();
|
||||
this._client = new snoowrap({
|
||||
userAgent: "Aeris",
|
||||
accessToken: this._pipeline.userData["Reddit"].accessToken
|
||||
});
|
||||
}
|
||||
|
||||
@reaction(ReactionType.JoinSubreddit, ['sub_id'])
|
||||
async joinSubreddit(params: any): Promise<PipelineEnv> {
|
||||
return this._client.getSubreddit(params['sub_id']).subscribe().then((response) => {
|
||||
return {
|
||||
SUB_NAME: response.name,
|
||||
SUB_ID: response.id
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@reaction(ReactionType.LeaveSubreddit, ['sub_id'])
|
||||
async leaveSubreddit(params: any): Promise<PipelineEnv> {
|
||||
return this._client.getSubreddit(params['sub_id']).unsubscribe().then((response) => {
|
||||
return {
|
||||
SUB_NAME: response.name,
|
||||
SUB_ID: response.id
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@reaction(ReactionType.PostInSubreddit, ['sub_id', 'title', 'body'])
|
||||
async postInSubreddit(params: any): Promise<PipelineEnv> {
|
||||
return this._client.getSubreddit(params['sub_id']).submitSelfpost({
|
||||
subredditName: params['sub_id'],
|
||||
title: params['title'],
|
||||
text: params['body']
|
||||
}).then((response) => {
|
||||
return {
|
||||
SUB_NAME: response.subreddit.name,
|
||||
SUB_ID: response.subreddit.id,
|
||||
POST_ID: response.id
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@reaction(ReactionType.ReplyToPost, ['post_id', 'reply_body'])
|
||||
async commentPost(params: any): Promise<PipelineEnv> {
|
||||
let fetchedSubmission: Submission = this._client.getSubmission(params['post_id']);
|
||||
|
||||
return fetchedSubmission.reply(params['reply_body']).then((res) => {
|
||||
return {
|
||||
SUB_NAME: fetchedSubmission.subreddit.name,
|
||||
SUB_ID: fetchedSubmission.subreddit.id,
|
||||
POST_ID: params['post_id'],
|
||||
REPLY_ID: res.id
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@reaction(ReactionType.Upvote, ['post_id'])
|
||||
async upvotePost(params: any): Promise<PipelineEnv> {
|
||||
return this._client.getSubmission(params['post_id']).upvote().then((res) => {
|
||||
return {
|
||||
SUB_NAME: res.subreddit.name,
|
||||
SUB_ID: res.subreddit.id,
|
||||
POST_ID: params['post_id'],
|
||||
UPVOTE_COUNT: res.ups
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@reaction(ReactionType.Downvote, ['post_id'])
|
||||
async downvotePost(params: any): Promise<PipelineEnv> {
|
||||
return this._client.getSubmission(params['post_id']).downvote().then((res) => {
|
||||
return {
|
||||
SUB_NAME: res.subreddit.name,
|
||||
SUB_ID: res.subreddit.id,
|
||||
POST_ID: res.id,
|
||||
DOWNVOTE_COUNT: res.downs
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user