- {#each commits as commit, i}
- {#if i < commitPerPlugin}
-
(i < commitPerPlugin ? (open = true) : "")}
- >
-
-
![{commit.author.login}]({commit.author.avatar_url})
-
-
-
-
- {emoji.replace_colons(commit.commit.message)}
+ {#if commits[0]}
+ {#each commits as commit, i}
+ {#if i < commitPerPlugin}
+
(i < commitPerPlugin ? (open = true) : "")}
+ >
+
+
-
- {commit.author.login}
-
- {commit.date}
+
+
+
+ {emoji.replace_colons(commit.title)}
+
+
- {commit.author_name}
+
+ {commit.date}
+
-
- {/if}
- {/each}
+ {/if}
+ {/each}
+ {:else}
+
+ {/if}
{/if}
diff --git a/app/frontend/components/StandalonePlugins/Git/git.scss b/app/frontend/components/StandalonePlugins/Git/git.scss
index da144e3..a83389a 100644
--- a/app/frontend/components/StandalonePlugins/Git/git.scss
+++ b/app/frontend/components/StandalonePlugins/Git/git.scss
@@ -1,11 +1,14 @@
@import "../../../scss/variables.scss";
.notFound {
- background: $color_5;
+ border: 2px solid $color_5;
+ color: $color_5;
font-size: 20px;
text-align: center;
- padding: 20px;
+ padding: 30px 40px;
border-radius: 10px;
+ width: fit-content;
+ margin: 0 auto;
}
.close {
@@ -131,10 +134,10 @@
.author {
position: relative;
- width: 20%;
+ width: fit-content;
.propic {
- height: 100%;
+ height: 150px;
border-right: 5px solid $color_7;
}
}
@@ -142,24 +145,26 @@
.message {
width: 80%;
font-size: 20px;
- margin-left: 20px;
padding: 20px;
overflow-y: scroll;
position: relative;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ margin: 10px;
.text {
border-bottom: 3px dashed $color_7;
margin-bottom: 10px;
overflow-x: scroll;
+ width: 100%;
}
- .name {
- margin-top: 10px;
- }
+ .name,
.date {
- position: absolute;
- bottom: 10px;
- right: 10px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
}
diff --git a/app/frontend/components/Updater/Updater.svelte b/app/frontend/components/Updater/Updater.svelte
index de344e7..83d7a74 100644
--- a/app/frontend/components/Updater/Updater.svelte
+++ b/app/frontend/components/Updater/Updater.svelte
@@ -66,15 +66,6 @@
{/if}
-
diff --git a/app/frontend/scss/animations.scss b/app/frontend/scss/animations.scss
index 99885ce..7c8c29a 100644
--- a/app/frontend/scss/animations.scss
+++ b/app/frontend/scss/animations.scss
@@ -6,3 +6,29 @@
transform: rotate(360deg);
}
}
+
+@-webkit-keyframes sk-cubeGridScaleDelay {
+ 0%,
+ 70%,
+ 100% {
+ -webkit-transform: scale3D(1, 1, 1);
+ transform: scale3D(1, 1, 1);
+ }
+ 35% {
+ -webkit-transform: scale3D(0, 0, 1);
+ transform: scale3D(0, 0, 1);
+ }
+}
+
+@keyframes sk-cubeGridScaleDelay {
+ 0%,
+ 70%,
+ 100% {
+ -webkit-transform: scale3D(1, 1, 1);
+ transform: scale3D(1, 1, 1);
+ }
+ 35% {
+ -webkit-transform: scale3D(0, 0, 1);
+ transform: scale3D(0, 0, 1);
+ }
+}
diff --git a/app/frontend/scss/index.scss b/app/frontend/scss/index.scss
index 0ca56d9..a5bb54a 100644
--- a/app/frontend/scss/index.scss
+++ b/app/frontend/scss/index.scss
@@ -1 +1,10 @@
@import "../scss/variables.scss";
+
+.footer {
+ position: fixed;
+ left: 30px;
+ bottom: 30px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
diff --git a/app/frontend/scss/variables.scss b/app/frontend/scss/variables.scss
index df1212a..5b98157 100644
--- a/app/frontend/scss/variables.scss
+++ b/app/frontend/scss/variables.scss
@@ -1,8 +1,8 @@
@import "./animations.scss";
// Varibles
-$color_1: #06090f; // $color_1: #1b2128;
-$color_2: #0d1117; // $color_2: #212931;
+$color_1: #1b2128; // $color_1: #1b2128;
+$color_2: #212931; // $color_2: #212931;
$color_3: #dd83a0;
$color_4: #63aec0;
$color_5: #e25987;
@@ -11,7 +11,7 @@ $color_7: #b877b4;
$color_8: #fec262;
$color_9: #e5e5e5;
-:global(*) {
+* {
&::-webkit-scrollbar {
width: 10px;
}
diff --git a/app/frontend/services/pluginService.ts b/app/frontend/services/pluginService.ts
index 307f4ac..56d57b1 100644
--- a/app/frontend/services/pluginService.ts
+++ b/app/frontend/services/pluginService.ts
@@ -9,78 +9,4 @@ export module pluginService {
.catch((error) => reject(error));
});
}
-
- export async function getGitInfo(addr: string) {
- const addrArray = addr.split("/");
- const flavour = addrArray[2].split(".")[0];
- let owner = null;
- let repo = null;
- let readme = null;
- let description = null;
-
- if (flavour == "github") {
- owner = addrArray[3];
- repo = addrArray[4].split(".")[0];
-
- if (owner && repo) {
- try {
- const readmeData: any = await axios.get(
- `https://raw.githubusercontent.com/${owner}/${repo}/master/README.md`
- );
- readme = readmeData.data;
- } catch (error) {
- console.log(error);
- }
-
- const { data } = await axios.get(
- `https://api.github.com/repos/${owner}/${repo}`
- );
- description = data.description;
- }
- }
-
- return { readme, description };
- }
-
- export async function getGitBranches(addr: string) {
- const addrArray = addr.split("/");
- const flavour = addrArray[2].split(".")[0];
- let owner = null;
- let repo = null;
- let branches = null;
-
- if (flavour == "github") {
- owner = addrArray[3];
- repo = addrArray[4].split(".")[0];
-
- if (owner && repo) {
- const branchesData: any = await axios.get(
- `https://api.github.com/repos/${owner}/${repo}/branches`
- );
- branches = branchesData.data;
- }
- return branches;
- }
- }
-
- export async function getGitCommitsByBranch(branch: string, addr: string) {
- const addrArray = addr.split("/");
- const flavour = addrArray[2].split(".")[0];
- let owner = null;
- let repo = null;
- let branches = null;
- if (flavour == "github") {
- owner = addrArray[3];
- repo = addrArray[4].split(".")[0];
-
- if (owner && repo) {
- const { data } = await axios.get(
- `https://api.github.com/repos/${owner}/${repo}/commits\?sha\=${branch}`
- );
- branches = data;
- }
- }
-
- return branches;
- }
}
diff --git a/app/frontend/services/pluginServices/gitService.ts b/app/frontend/services/pluginServices/gitService.ts
new file mode 100644
index 0000000..ad8c1ea
--- /dev/null
+++ b/app/frontend/services/pluginServices/gitService.ts
@@ -0,0 +1,248 @@
+import axios from "axios";
+
+const privateToken = "
";
+
+export module gitService {
+ export async function getGitInfo(addr: string, flavour: string, id: string) {
+ const addrArray = addr.split("/");
+ let readme = null;
+ let repoName = null;
+ let repoDescription = null;
+
+ switch (flavour) {
+ case "gitlab":
+ const giturl = addrArray[0] + "//" + addrArray[2];
+
+ try {
+ const { data }: any = await axios.get(
+ `${giturl}/api/v4/projects/${id}/repository/files/README.md/raw?ref=master`,
+ {
+ headers: {
+ "PRIVATE-TOKEN": privateToken,
+ },
+ }
+ );
+
+ readme = data;
+ } catch (error) {
+ console.error(error);
+ }
+
+ try {
+ const { data } = await axios.get(`${giturl}/api/v4/projects/${id}`, {
+ headers: {
+ "PRIVATE-TOKEN": privateToken,
+ },
+ });
+
+ repoDescription = data.description;
+ repoName = data.name;
+ } catch (error) {
+ console.error(error);
+ }
+ break;
+ case "github":
+ const owner = addrArray[3];
+ const repo = addrArray[4].split(".")[0];
+
+ if (owner && repo) {
+ try {
+ const readmeData: any = await axios.get(
+ `https://raw.githubusercontent.com/${owner}/${repo}/master/README.md`
+ );
+ readme = readmeData.data;
+ } catch (error) {
+ console.log(error);
+ }
+
+ const { data } = await axios.get(
+ `https://api.github.com/repos/${owner}/${repo}`
+ );
+
+ repoName = data.name;
+ repoDescription = data.description;
+ }
+ break;
+
+ default:
+ console.error("Unsupported git flavour");
+ break;
+ }
+
+ return { readme, repoName, repoDescription };
+ }
+
+ export async function getGitBranches(
+ addr: string,
+ flavour: string,
+ id: string
+ ) {
+ const addrArray = addr.split("/");
+ let branches = null;
+
+ switch (flavour) {
+ case "gitlab":
+ let giturl = addrArray[0] + "//" + addrArray[2];
+
+ const branchesData = await axios.get(
+ `${giturl}/api/v4/projects/${id}/repository/branches`,
+ {
+ headers: {
+ "PRIVATE-TOKEN": privateToken,
+ },
+ }
+ );
+
+ branches = branchesData.data;
+ break;
+ case "github":
+ let owner = addrArray[3];
+ let repo = addrArray[4].split(".")[0];
+
+ if (owner && repo) {
+ const branchesData: any = await axios.get(
+ `https://api.github.com/repos/${owner}/${repo}/branches`,
+ {
+ headers: {
+ "PRIVATE-TOKEN": privateToken,
+ },
+ }
+ );
+
+ branches = branchesData.data;
+ }
+ break;
+
+ default:
+ console.error("Unsupported git flavour");
+ break;
+ }
+
+ return branches;
+ }
+
+ export async function getGitCommitsByBranch(
+ branchID: string,
+ addr: string,
+ id: string,
+ flavour: string
+ ) {
+ const addrArray = addr.split("/");
+ let commits = null;
+ let giturl;
+
+ switch (flavour) {
+ case "gitlab":
+ giturl = addrArray[0] + "//" + addrArray[2];
+
+ const { data } = await axios.get(
+ `${giturl}/api/v4/projects/${id}/repository/commits`,
+ {
+ params: {
+ ref_name: branchID,
+ },
+ headers: {
+ "PRIVATE-TOKEN": privateToken,
+ },
+ }
+ );
+
+ commits = data;
+ break;
+
+ case "github":
+ let owner = addrArray[3];
+ let repo = addrArray[4].split(".")[0];
+
+ if (owner && repo) {
+ const { data } = await axios.get(
+ `https://api.github.com/repos/${owner}/${repo}/commits`,
+ {
+ params: {
+ sha: branchID,
+ },
+ }
+ );
+
+ commits = data;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ const formattedCommits = await formatCommits(commits, flavour, addr);
+ return formattedCommits;
+ }
+}
+
+async function formatCommits(commits: any, flavour: string, addr: string) {
+ const addrArray = addr.split("/");
+ let rawDate: Date;
+ let date: string;
+ let formattedCommits: any = [];
+
+ switch (flavour) {
+ case "gitlab":
+ formattedCommits = await Promise.all(
+ commits.map(async (commit, i) => {
+ let formattedCommit = {};
+ let giturl = addrArray[0] + "//" + addrArray[2];
+ rawDate = new Date(commit.committed_date);
+ date =
+ rawDate.getDate() +
+ "/" +
+ (rawDate.getMonth() + 1) +
+ "/" +
+ rawDate.getFullYear();
+
+ const avatar = await axios.get(`${giturl}/api/v4/avatar`, {
+ headers: {
+ "PRIVATE-TOKEN": privateToken,
+ },
+ params: {
+ size: "64",
+ email: commit.committer_email,
+ },
+ });
+
+ formattedCommit = {
+ date,
+ title: commit.title,
+ author_name: commit.author_name,
+ author_avatar: avatar.data.avatar_url,
+ };
+
+ return formattedCommit;
+ })
+ );
+ break;
+
+ case "github":
+ formattedCommits = commits.map((commit, i) => {
+ rawDate = new Date(commit.commit.author.date);
+ date =
+ rawDate.getDate() +
+ "/" +
+ (rawDate.getMonth() + 1) +
+ "/" +
+ rawDate.getFullYear();
+ commit = {
+ date,
+ title: commit.commit.message,
+ author_name: commit.author.login,
+ author_avatar: commit.author.avatar_url,
+ };
+
+ return commit;
+ });
+ break;
+
+ default:
+ console.error(`Unsupported git flavour`);
+ break;
+ }
+
+ return formattedCommits;
+}
diff --git a/app/frontend/stores.ts b/app/frontend/stores.ts
index ac98292..8f27871 100644
--- a/app/frontend/stores.ts
+++ b/app/frontend/stores.ts
@@ -11,3 +11,5 @@ export const newProjectStore: Writable = writable({
});
export const projectsStore: Writable = writable([]);
+
+export const searchProjectsStore: Writable = writable("");
diff --git a/package.json b/package.json
index 8848938..843f2b5 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,7 @@
"package-all": "npm run build && electron-builder build -mwl",
"package-linux": "npm run build && electron-builder build --linux",
"package-win": "npm run build && electron-builder build --win --x64",
- "release": "cross-env MODE=prod electron-builder -p always"
+ "release": "cross-env MODE=prod electron-builder -p always -wl"
},
"build": {
"productName": "ProjectsBT",