chore: Upgrade buefy to newest version

This commit is contained in:
Pitu 2019-10-12 15:47:25 +09:00
parent 459ab5433b
commit 391ee68e4a
15 changed files with 43 additions and 39 deletions

View File

@ -35,7 +35,7 @@
"adm-zip": "^0.4.13",
"bcrypt": "^3.0.4",
"body-parser": "^1.18.3",
"buefy": "0.6.3",
"buefy": "0.8.5",
"busboy": "^0.2.14",
"chalk": "^2.4.1",
"compression": "^1.7.2",

View File

@ -26,4 +26,4 @@ exports.seed = async db => {
} catch (error) {
console.error(error);
}
}
};

View File

@ -33,7 +33,6 @@ class filesGET extends Route {
For each file, create the public link to be able to display the file
*/
for (let file of files) {
console.log(file);
file = Util.constructFilePublicLink(file);
}

View File

@ -14,7 +14,7 @@ $size-normal: 1rem;
html {
// font-size: 100%;
font-size: 14px;
background-color: $background;
background-color: $backgroundLight1;
}
h4 {
@ -42,6 +42,11 @@ h4 {
.text-center {
text-align: center;
}
hr {
background-color: #c7c7c7;
height: 1px;
}
// Bulma color changes.
.tooltip.is-top.is-primary:before { border-top: 5px solid #20222b; }
.tooltip.is-primary:after { background: #20222b; }

View File

@ -191,7 +191,7 @@ export default {
console.log('> Search result data', data);
},
deleteFile(file, index) {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
title: 'Deleting file',
message: 'Are you sure you want to <b>delete</b> this file?',
confirmText: 'Delete File',
@ -204,7 +204,7 @@ export default {
this.$nextTick(() => {
this.showWaterfall = true;
});
return this.$toast.open(response.message);
return this.buefy.$toast.open(response.message);
}
});
}

View File

@ -5,7 +5,7 @@
box-shadow: none;
.navbar-brand {
width: 100%;
width: calc(100% - 2em);
align-items: flex-start;
padding: 1em;

View File

@ -24,7 +24,7 @@ export default {
alert() {
if (!this.alert) return;
this.$toast.open({
this.$buefy.toast.open({
duration: 3500,
message: this.alert.text,
position: 'is-bottom',

View File

@ -132,10 +132,10 @@ export default {
password: this.user.password,
newPassword: this.user.newPassword
});
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
},
promptNewAPIKey() {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
type: 'is-danger',
message: 'Are you sure you want to regenerate your API key? Previously generated API keys will stop working. Make sure to write the new key down as this is the only time it will be displayed to you.',
onConfirm: () => this.requestNewAPIKey()
@ -145,7 +145,7 @@ export default {
const response = await this.$axios.$post(`user/apikey/change`);
this.user.apiKey = response.apiKey;
this.$forceUpdate();
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
}
}
};

View File

@ -107,7 +107,7 @@ export default {
albumId: id,
fileId: this.showingModalForFile.id
});
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
this.getFiles();
},
async getAlbums() {

View File

@ -295,7 +295,7 @@ export default {
},
methods: {
promptDeleteAlbum(id) {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
message: 'Are you sure you want to delete this album?',
onConfirm: () => this.deleteAlbum(id)
});
@ -303,17 +303,17 @@ export default {
async deleteAlbum(id) {
const response = await this.$axios.$delete(`album/${id}`);
this.getAlbums();
return this.$toast.open(response.message);
return this.$buefy.toast.open(response.message);
},
promptDeleteAlbumLink(identifier) {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
message: 'Are you sure you want to delete this album link?',
onConfirm: () => this.deleteAlbumLink(identifier)
});
},
async deleteAlbumLink(identifier) {
const response = await this.$axios.$delete(`album/link/delete/${identifier}`);
return this.$toast.open(response.message);
return this.$buefy.toast.open(response.message);
},
async linkOptionsChanged(link) {
const response = await this.$axios.$post(`album/link/edit`,
@ -322,7 +322,7 @@ export default {
enableDownload: link.enableDownload,
enabled: link.enabled
});
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
},
async createLink(album) {
album.isCreatingLink = true;
@ -330,7 +330,7 @@ export default {
try {
const response = await this.$axios.$post(`album/link/new`,
{ albumId: album.id });
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
album.links.push({
identifier: response.identifier,
views: 0,
@ -349,7 +349,7 @@ export default {
const response = await this.$axios.$post(`album/new`,
{ name: this.newAlbumName });
this.newAlbumName = null;
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
this.getAlbums();
},
async getAlbums() {

View File

@ -98,7 +98,7 @@ export default {
albumId: id,
fileId: this.showingModalForFile.id
});
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
// Not the prettiest solution to refetch on each click but it'll do for now
this.getFiles();

View File

@ -147,14 +147,14 @@ export default {
this.options = response.config;
},
promptRestartService() {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
message: 'Keep in mind that restarting only works if you have PM2 or something similar set up. Continue?',
onConfirm: () => this.restartService()
});
},
async restartService() {
const response = await this.$axios.$post(`service/restart`);
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
}
}
};

View File

@ -234,13 +234,13 @@ export default {
},
methods: {
promptDeleteTag(id) {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
message: 'Are you sure you want to delete this tag?',
onConfirm: () => this.promptPurgeTag(id)
});
},
promptPurgeTag(id) {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
message: 'Would you like to delete every file associated with this tag?',
cancelText: 'No',
confirmText: 'Yes',
@ -251,14 +251,14 @@ export default {
async deleteTag(id, purge) {
const response = await this.$axios.$delete(`tags/${id}/${purge ? 'purge' : ''}`);
this.getTags();
return this.$toast.open(response.message);
return this.$buefy.toast.open(response.message);
},
async createTag() {
if (!this.newTagName || this.newTagName === '') return;
const response = await this.$axios.$post(`tag/new`,
{ name: this.newTagName });
this.newTagName = null;
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
this.getTags();
},
async getTags() {

View File

@ -233,16 +233,16 @@ export default {
const response = await this.$axios.$post(`admin/users/${row.enabled ? 'enable' : 'disable'}`, {
id: row.id
});
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
},
async changeIsAdmin(row) {
const response = await this.$axios.$post(`admin/users/${row.isAdmin ? 'promote' : 'demote'}`, {
id: row.id
});
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
},
promptPurgeFiles(row) {
this.$dialog.confirm({
this.$buefy.dialog.confirm({
message: 'Are you sure you want to delete this user\'s files?',
onConfirm: () => this.purgeFiles(row)
});
@ -251,7 +251,7 @@ export default {
const response = await this.$axios.$post(`admin/users/purge`, {
id: row.id
});
this.$toast.open(response.message);
this.$buefy.toast.open(response.message);
}
}
};

View File

@ -1737,12 +1737,12 @@ browserslist@^4.0.0, browserslist@^4.3.4, browserslist@^4.3.5, browserslist@^4.4
electron-to-chromium "^1.3.103"
node-releases "^1.1.3"
buefy@0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/buefy/-/buefy-0.6.3.tgz#9e9e4f4fd0193aaba42aab2af6da29513ac80b70"
integrity sha512-ApYZo6USz1SjHyziSaZc2osxWYUkCLwfgzVDo7hTtFvqBAjin1xfzoHd7yb/7BTLqAZYwJuHqe44SnLhrU+9fg==
buefy@0.8.5:
version "0.8.5"
resolved "https://registry.yarnpkg.com/buefy/-/buefy-0.8.5.tgz#a91291cd86355df06ea35174000f948dad2bd212"
integrity sha512-yGQUhIsZWTodCx1rpfDTA32v5OjILpDIDAP+X6KoE6du3F3EZwJ/k5aT8D6Ba6AxNzVdDa2M7f0hzMddLbm38A==
dependencies:
bulma "^0.6.2"
bulma "0.7.5"
buffer-alloc-unsafe@^1.1.0:
version "1.1.0"
@ -1796,10 +1796,10 @@ builtin-status-codes@^3.0.0:
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=
bulma@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/bulma/-/bulma-0.6.2.tgz#f4b1d11d5acc51a79644eb0a2b0b10649d3d71f5"
integrity sha1-9LHRHVrMUaeWROsKKwsQZJ09cfU=
bulma@0.7.5:
version "0.7.5"
resolved "https://registry.yarnpkg.com/bulma/-/bulma-0.7.5.tgz#35066c37f82c088b68f94450be758fc00a967208"
integrity sha512-cX98TIn0I6sKba/DhW0FBjtaDpxTelU166pf7ICXpCCuplHWyu6C9LYZmL5PEsnePIeJaiorsTEzzNk3Tsm1hw==
busboy@^0.2.11, busboy@^0.2.14:
version "0.2.14"