-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
289 additions
and
5 deletions.
There are no files selected for viewing
Submodule scratch
updated
11 files
+532 −565 | editor.html | |
+531 −564 | fullscreen.html | |
+531 −564 | index.html | |
+14 −14 | js/editor.js | |
+1 −1 | js/editor.js.map | |
+14 −14 | js/embed.js | |
+1 −1 | js/embed.js.map | |
+14 −14 | js/fullscreen.js | |
+1 −1 | js/fullscreen.js.map | |
+14 −14 | js/player.js | |
+1 −1 | js/player.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<template> | ||
<v-container class="pa-md-12"> | ||
<div class="d-flex justify-space-between"> | ||
<h1 class="text-h4">Fork <span v-text="project.title"></span></h1> | ||
|
||
|
||
</div><br /> | ||
<v-card> | ||
<template v-slot:title> | ||
{{project.title}} | ||
</template> | ||
|
||
<template v-slot:subtitle> | ||
作者{{ project.author_display_name }},发布于:{{ project.time }},{{ project.view_count }}次浏览 | ||
</template> | ||
|
||
<template v-slot:text> | ||
{{project.description}} | ||
</template> | ||
|
||
</v-card><br/> | ||
<v-card> | ||
<template v-slot:title> | ||
你正在分叉一个项目 | ||
</template> | ||
|
||
<template v-slot:subtitle> | ||
等等,确认点事 </template> | ||
|
||
<template v-slot:text> | ||
你正在分叉 <span v-text="project.title"></span> ,这将会从此项目的生产环境创建一个一模一样的项目,新的项目将拥有一样的名称,简介与源代码内容。分叉是一个技术概念,不代表作者对你有任何授权。 | ||
<br />改编设立的目的是为了让社区中的作品得到更好的发展,请不要滥用改编,更不能直接抄袭。 | ||
</template> | ||
<v-card-actions> | ||
<v-checkbox label="我已了解并确认" v-model="checkknow"></v-checkbox> | ||
</v-card-actions> | ||
</v-card> | ||
<br /><v-card> | ||
<template v-slot:title> | ||
{{ project.license }} | ||
</template> | ||
|
||
<template v-slot:subtitle> | ||
你需要遵守:{{ project.license }}许可证。 | ||
</template> | ||
|
||
<template v-slot:text> <v-btn :href="'https://choosealicense.com/licenses/' + project.license" target="_blank" | ||
variant="outlined">了解此许可证</v-btn> | ||
<br /><br /> | ||
开源许可证授予你合理的权利,但前提是你必须遵守许可证的条款。如果没有许可证(显示为NULL),则默认受专有版权保护,在你分发(开源作品)前,你需要尝试联系作者获得授权。<br /> | ||
避风港原则,许可证不限制ZeroCatNext分发您的作品。 | ||
</template> | ||
<v-card-actions> | ||
<v-checkbox label="我已了解并确认" v-model="checklicense"></v-checkbox> | ||
|
||
</v-card-actions> | ||
</v-card><br /> <v-text>如果您已了解以上内容,请在下方的输入框中输入</v-text> | ||
<br /><br /> | ||
<v-text-field hint="请准确输入上方的话" label="我保证会好好对待改编的作品" type="input" v-model="checktext" :rules="textRules" required | ||
variant="outlined" clearable></v-text-field> | ||
<br /> | ||
<v-btn class="text-none" color="primary" rounded="xl" text="Fork" variant="flat" size="large" | ||
@click="forkproject(project.id)" append-icon="mdi-arrow-right" | ||
:disabled="!checkknow || !checklicense || !checktext"></v-btn> <!-- login button --> | ||
|
||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import openEditor from "../../../stores/openEdit"; | ||
import request from '../../../axios/axios' | ||
import '@waline/client/style'; | ||
import { localuser } from "@/stores/user"; | ||
export default { | ||
data() { | ||
return { | ||
project: {}, | ||
openEditor: openEditor, | ||
localuser: localuser, | ||
checktext: '', | ||
checkknow: false, checklicense: false, | ||
textRules: [ | ||
value => { | ||
if (value) return true | ||
return '记得输入内容哦~' | ||
}, | ||
value => { | ||
if (value != '我保证会好好对待改编的作品') { | ||
return '输的不太对~' | ||
} | ||
}, | ||
], | ||
} | ||
}, | ||
async created() { | ||
await this.getproject() | ||
}, | ||
methods: { | ||
async getproject() { | ||
this.project = await request({ | ||
url: '/api/projectinfo?id=' + this.$route.params.id, | ||
method: 'get', | ||
}) | ||
console.log(this.project) | ||
}, | ||
async forkproject(id) { | ||
await request({ | ||
url: '/project/' + id + '/fork', | ||
method: 'post', | ||
}).then(res => { | ||
console.log(res) | ||
this.$toast.add({ | ||
severity: 'success', | ||
summary: '成功', | ||
detail: '分叉成功', | ||
life: 3000, | ||
}) | ||
if (res.id){ | ||
this.$router.push('/projects/' + res.id) | ||
} | ||
}).catch(err => { | ||
console.log(err) | ||
this.$toast.add({ | ||
severity: 'error', | ||
summary: '错误', | ||
detail: err, | ||
life: 3000, | ||
} | ||
) | ||
}) | ||
} | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<template> | ||
<v-container class="pa-md-12"> | ||
<div class="d-flex justify-space-between"> | ||
<h1 class="text-h4">推送 <span v-text="project.title"></span></h1> | ||
|
||
|
||
</div><br /> | ||
<v-card> | ||
<template v-slot:title> | ||
{{ project.title }} | ||
</template> | ||
|
||
<template v-slot:subtitle> | ||
发布于:{{ project.time }},{{ project.view_count }}次浏览 | ||
</template> | ||
|
||
<template v-slot:text> | ||
{{ project.description }} | ||
</template> | ||
|
||
</v-card><br /> | ||
<v-card> | ||
<template v-slot:title> | ||
你正在推送你的项目 | ||
</template> | ||
|
||
<template v-slot:subtitle> | ||
等等,确认点事 </template> | ||
|
||
<template v-slot:text> | ||
你正在推送 <span v-text="project.title"></span> ,这将会从项目开发分支代码复制到生产分支,并创建一份历史记录,您的用户将会看到新的作品。 | ||
</template> | ||
|
||
</v-card> | ||
<br /><v-card> | ||
<template v-slot:title> | ||
您可以执行推送 | ||
</template> | ||
|
||
<template v-slot:subtitle> | ||
分支保护 | ||
</template> | ||
|
||
<template v-slot:text> 没有有关的分支保护 | ||
</template> | ||
<v-card-actions> | ||
<v-checkbox label="我已了解并确认" v-model="checkprotect"></v-checkbox> | ||
|
||
</v-card-actions> | ||
</v-card><br /> | ||
<br /><br /> | ||
|
||
<br /> | ||
<v-btn class="text-none" color="primary" rounded="xl" text="Push" variant="flat" size="large" | ||
@click="pushproject(project.id)" append-icon="mdi-arrow-right" :disabled="!checkprotect"></v-btn> | ||
<!-- login button --> | ||
|
||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import request from '../../../axios/axios' | ||
import '@waline/client/style'; | ||
import { localuser } from "@/stores/user"; | ||
export default { | ||
data() { | ||
return { | ||
project: {}, | ||
localuser: localuser, | ||
checkprotect: true, | ||
} | ||
}, | ||
async created() { | ||
await this.getproject() | ||
if (!this.localuser.user && this.project.authorid != this.localuser.user.id) { | ||
this.$toast.add({ | ||
severity: 'error', | ||
summary: '错误', | ||
detail: '您不是项目所有者或您未登录', | ||
life: 3000, | ||
}) | ||
this.$router.push('/') | ||
} | ||
}, | ||
methods: { | ||
async getproject() { | ||
this.project = await request({ | ||
url: '/api/projectinfo?id=' + this.$route.params.id, | ||
method: 'get', | ||
}) | ||
console.log(this.project) | ||
}, | ||
async pushproject(id) { | ||
await request({ | ||
url: '/project/' + id + '/push', | ||
method: 'post', | ||
}).then(res => { | ||
console.log(res) | ||
this.$toast.add({ | ||
severity: 'success', | ||
summary: '成功', | ||
detail: '推送成功', | ||
life: 3000, | ||
}) | ||
if (res.status=='1') { | ||
this.$router.push('/projects/' + this.project.id) | ||
} | ||
}).catch(err => { | ||
console.log(err) | ||
this.$toast.add({ | ||
severity: 'error', | ||
summary: '错误', | ||
detail: err, | ||
life: 3000, | ||
} | ||
) | ||
}) | ||
} | ||
}, | ||
} | ||
</script> |