添加项目仓库跳转和程序下载
This commit is contained in:
@@ -3,6 +3,30 @@
|
||||
<div class="text-center mb-8">
|
||||
<h1 class="text-3xl font-bold text-gray-800">物流系统 v5.0</h1>
|
||||
<p class="text-gray-600">任务配置创建工具</p>
|
||||
|
||||
<!-- 新增:项目信息和下载区域 -->
|
||||
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4 mt-4 max-w-2xl mx-auto">
|
||||
<div class="flex flex-col sm:flex-row justify-between items-center gap-4">
|
||||
<div class="text-left w-30">
|
||||
<h3 class="font-semibold text-blue-800 mb-1">项目信息</h3>
|
||||
<a href="http://git.liulikeji.cn/xingluo/CCTweaked-utils/src/branch/main/Logistics/V5"
|
||||
target="_blank"
|
||||
class="text-blue-600 hover:text-blue-800 underline text-sm">
|
||||
📁项目仓库
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<code class="bg-gray-800 text-green-200 px-3 py-1 rounded text-sm">wget http://git.liulikeji.cn/xingluo/CCTweaked-utils/raw/branch/main/Logistics/V5/startup.lua</code>
|
||||
<button @click="copyDownloadCommand" class="btn btn-sm btn-primary">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3" />
|
||||
</svg>
|
||||
复制
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-lg p-6 mb-8">
|
||||
@@ -297,7 +321,8 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
copySuccess: false
|
||||
copySuccess: false,
|
||||
copyDownloadSuccess: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -380,6 +405,10 @@ export default {
|
||||
|
||||
commandString() {
|
||||
return `add ${this.compressedJson}`;
|
||||
},
|
||||
|
||||
downloadCommand() {
|
||||
return 'wget http://git.liulikeji.cn/xingluo/CCTweaked-utils/raw/branch/main/Logistics/V5/startup.lua';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -392,11 +421,13 @@ export default {
|
||||
blacklist: [{ name: '' }]
|
||||
});
|
||||
},
|
||||
|
||||
removeInputContainer(index) {
|
||||
if (this.task.input.length > 1) {
|
||||
this.task.input.splice(index, 1);
|
||||
}
|
||||
},
|
||||
|
||||
addOutputContainer() {
|
||||
this.task.output.push({
|
||||
containerName: '',
|
||||
@@ -407,27 +438,33 @@ export default {
|
||||
blacklist: [{ name: '' }]
|
||||
});
|
||||
},
|
||||
|
||||
removeOutputContainer(index) {
|
||||
if (this.task.output.length > 1) {
|
||||
this.task.output.splice(index, 1);
|
||||
}
|
||||
},
|
||||
|
||||
addWhitelistItem(list) {
|
||||
list.push(this.task.type === 'item' ? { name: '', count: null } : { name: '' });
|
||||
},
|
||||
|
||||
removeWhitelistItem(list, index) {
|
||||
if (list.length > 1) {
|
||||
list.splice(index, 1);
|
||||
}
|
||||
},
|
||||
|
||||
addBlacklistItem(list) {
|
||||
list.push({ name: '' });
|
||||
},
|
||||
|
||||
removeBlacklistItem(list, index) {
|
||||
if (list.length > 1) {
|
||||
list.splice(index, 1);
|
||||
}
|
||||
},
|
||||
|
||||
copyToClipboard() {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = this.commandString;
|
||||
@@ -441,6 +478,21 @@ export default {
|
||||
this.copySuccess = false;
|
||||
}, 3000);
|
||||
},
|
||||
|
||||
copyDownloadCommand() {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = this.downloadCommand;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(textarea);
|
||||
|
||||
this.copyDownloadSuccess = true;
|
||||
setTimeout(() => {
|
||||
this.copyDownloadSuccess = false;
|
||||
}, 3000);
|
||||
},
|
||||
|
||||
resetForm() {
|
||||
this.task = {
|
||||
type: 'item',
|
||||
|
||||
Reference in New Issue
Block a user