Skip to content

Commit

Permalink
Merge pull request #36 from rule110-io/v0.2.1-beta
Browse files Browse the repository at this point in the history
V0.2.1 beta
  • Loading branch information
WizardOfCodez authored Dec 15, 2020
2 parents 9ab74fb + 5363d8d commit 60e7854
Show file tree
Hide file tree
Showing 56 changed files with 16,454 additions and 729 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.2.1-beta",
"configurations": [
{
"name": "Wails: build debug",
"type": "go",
"request": "launch",
"mode": "exec",
"program": "${workspaceFolder}/build/surge",
"preLaunchTask": "wails_debug_build",
"env": {},
"args": []
}
]
}
10 changes: 10 additions & 0 deletions .vscode/task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "wails_debug_build",
"type": "shell",
"command": "wails build -d"
}
]
}
15,530 changes: 15,362 additions & 168 deletions frontend/package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "surge",
"author": "Christian Busch<[email protected]>",
"private": true,
"version": "0.2.0-beta",
"version": "0.2.1-beta",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
Expand All @@ -25,6 +25,7 @@
"vue-chartjs": "^3.5.0",
"vue-clamp": "^0.3.1",
"vue-clickaway": "^2.2.2",
"vue-clipboard2": "^0.3.1",
"vue-feather": "^1.0.1",
"vue-filter-pretty-bytes": "^0.1.5",
"vue-lodash": "^2.1.2",
Expand All @@ -41,9 +42,9 @@
"eslint": "^6.8.0",
"eslint-plugin-vue": "^6.2.1",
"eventsource-polyfill": "^0.9.6",
"node-sass": "^4.14.1",
"node-sass": "^5.0.0",
"prerender-spa-plugin": "^3.4.0",
"sass-loader": "^7.1.0",
"sass-loader": "^10.1.0",
"vue-svg-loader": "^0.16.0",
"vue-template-compiler": "^2.6.11",
"webpack-hot-middleware": "^2.25.0"
Expand Down
27 changes: 26 additions & 1 deletion frontend/src/assets/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,35 @@ b {
font-weight: normal;
display: table-cell;
padding: 0 $padding-small $padding-micro $padding-small;
vertical-align: middle;
font-weight: 500;
font-size: $fz-md;
font-family: "Roboto";
transition: $transition-1;

&-action {
position: absolute;
top: 6px;
height: 15px;
width: 15px;
transition: $transition-1;
margin-left: $padding-xs;

&_asc {
transform: scaleY(-1);
}
}

&_active {
color: $primary !important;
}

&_sortable {
cursor: pointer;

&:hover {
color: $primary !important;
}
}

@include dark-theme {
color: color(dark, text-light);
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/File/FileAvatar/FileAvatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

&_small {
canvas {
position: absolute;
left: -4px;
top: -4px;
height: 35px;
width: 35px;
}
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/components/File/FileAvatar/FileAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
},
scale: {
type: Number,
default: 5,
default: 15,
},
type: {
type: String,
Expand All @@ -44,8 +44,6 @@ export default {
const avatar = createIcon({
// All options are optional
seed: this.seeder, // seed used to generate icon data, default: random
bgcolor: "#fff", // choose a different background color, default: white
color: "#02d2b3",
size: this.size, // width/height of the icon in blocks, default: 10
scale: this.scale, // width/height of each block in pixels, default: 5
});
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/File/FileChunks/FileChunks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
display: flex;
flex-direction: column;
justify-content: space-between;
width: 156px;

&__title {
text-align: center;
margin-bottom: $padding-micro;
}

&__progress {
width: 156px;
width: 100%;
height: 12px;
position: relative;
display: flex;
align-items: center;
margin: 0 auto;
margin-top: $padding-micro;
}
}
9 changes: 8 additions & 1 deletion frontend/src/components/File/FileChunks/FileChunks.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<template>
<div class="file-chunks">
<div class="file-chunks__title text_wrap_none">
<template v-if="file.IsMissing">
Missing
</template>
<template v-else-if="file.IsHashing">
Hashing
</template>
<template
v-if="!file.IsDownloading && !file.IsUploading && !file.IsPaused"
v-else-if="!file.IsDownloading && !file.IsUploading && !file.IsPaused"
>
Finished
</template>
Expand All @@ -15,6 +21,7 @@
<template v-else> Downloading: {{ progress.toFixed(2) }}% </template>
</div>
<canvas
v-if="file.IsDownloading || file.IsPaused"
class="file-chunks__progress"
ref="canvas"
width="156"
Expand Down
54 changes: 53 additions & 1 deletion frontend/src/components/File/FileHash/FileHash.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
.file-hash {
width: 205px;
width: 160px;
cursor: pointer;
position: relative;
display: flex;
align-items: center;

&:after {
position: absolute;
top: -2px;
left: 0;
display: inline-block;
color: $primary;
white-space: nowrap;
text-align: center;
transform: translate3d(-50%, 0, 0);
-webkit-backface-visibility: hidden;
opacity: 0.001;
content: attr(data-label);
font-size: $fz-sm;
}

&_active {
&:after {
animation: floatup 0.5s ease-in-out;
}
}

&:hover & {
&__icon {
color: $primary;
}
}

&__icon {
height: 14px;
width: 14px;
position: relative;
transition: $transition-1;
margin-right: $padding-micro;
}

&__text {
flex: 1;
}
}

@keyframes floatup {
20% {
opacity: 0.999;
}
100% {
transform: translate3d(-50%, -17px, 0);
}
}
21 changes: 18 additions & 3 deletions frontend/src/components/File/FileHash/FileHash.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<template>
<div
class="file-hash text_wrap_none"
class="file-hash"
:class="copied ? 'file-hash_active' : null"
data-label="Copied"
v-tooltip="{
content: hash,
content: 'Click to copy to clipboard',
placement: 'bottom-start',
offset: 5,
}"
v-clipboard:copy="hash"
v-clipboard:success="onCopy"
>
{{ hash }}
<feather class="file-hash__icon" type="copy"></feather>
<div class="file-hash__text text_wrap_none">{{ hash }}</div>
</div>
</template>

Expand All @@ -24,5 +29,15 @@ export default {
default: "",
},
},
data: () => {
return {
copied: false,
};
},
methods: {
onCopy() {
this.copied = !this.copied;
},
},
};
</script>
20 changes: 20 additions & 0 deletions frontend/src/components/File/FileInfo/FileInfo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@
color: $primary !important;
cursor: default;
}

&_error {
color: $error !important;
cursor: default;
}

&_alert {
color: white !important;
cursor: default;
animation: spinner 2.5s linear infinite;

@keyframes spinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
}
}

&__icon {
Expand Down
48 changes: 35 additions & 13 deletions frontend/src/components/File/FileInfo/FileInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,44 @@
<div class="file-info">
<template v-if="icon">
<feather
v-if="!file.IsPaused && file.IsDownloading"
class="file-info__control"
type="pause-circle"
@click.native="pause(file.FileHash)"
v-if="file.IsMissing"
class="file-info__control file-info__control_error"
type="alert-circle"
v-tooltip="{
content: 'Not found on disk!',
placement: 'bottom-start',
offset: 5,
}"
></feather>
<feather
v-if="file.IsPaused"
class="file-info__control"
type="play-circle"
@click.native="continueDownload(file.FileHash)"
></feather>
<feather
v-if="!file.IsPaused && !file.IsDownloading"
class="file-info__control file-info__control_active"
type="check-circle"
v-else-if="file.IsHashing"
class="file-info__control file-info__control_alert"
type="loader"
v-tooltip="{
content: 'Getting ready for sharing, please wait!',
placement: 'bottom-start',
offset: 5,
}"
></feather>
<template v-else>
<feather
v-if="!file.IsPaused && file.IsDownloading"
class="file-info__control"
type="pause-circle"
@click.native="pause(file.FileHash)"
></feather>
<feather
v-if="file.IsPaused"
class="file-info__control"
type="play-circle"
@click.native="continueDownload(file.FileHash)"
></feather>
<feather
v-if="!file.IsPaused && !file.IsDownloading"
class="file-info__control file-info__control_active"
type="check-circle"
></feather>
</template>
</template>
<div class="file-info__size text_wrap_none">
{{ file.FileSize | prettyBytes(1) }}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/File/FileSeeders/FileSeeders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
offset: 0,
}"
>
<FileAvatar :seeder="seeder" />
<FileAvatar :seeder="seeder" type="small" />
</div>
<div
v-if="seedsLeft > 0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
</template>

<script>
import { mapState } from "vuex";
import Button from "@/components/Button/Button";
import Checkbox from "@/components/Controls/Checkbox/Checkbox.vue";
Expand All @@ -53,6 +55,7 @@ export default {
};
},
computed: {
...mapState("files", ["localFilesConfig"]),
isOpen() {
return this.open;
},
Expand All @@ -66,6 +69,10 @@ export default {
},
removeFile() {
window.backend.removeFile(this.file.FileHash, this.fromDisk).then(() => {
let newConfig = Object.assign({}, this.localFilesConfig);
newConfig.skip = 0;
this.$store.commit("files/setLocalFilesConfig", newConfig);
this.$store.dispatch("files/fetchLocalFiles");
this.closeModal();
});
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/NetworkStats/NetworkStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
window.backend.seedFile().then(() => {
this.$store.dispatch("files/fetchLocalFiles");
this.$store.dispatch("files/fetchRemoteFiles");
this.$router.replace("/download");
});
},
},
Expand Down
Loading

0 comments on commit 60e7854

Please sign in to comment.