Always show copy button

This commit is contained in:
lights0123 2020-11-22 13:29:51 -05:00
parent d4a4930d94
commit a405c79186
No known key found for this signature in database
GPG key ID: 28F315322E37972F
2 changed files with 25 additions and 8 deletions

View file

@ -36,10 +36,6 @@
</button>
<input v-if="nativeUpload" ref="upload" type="file" class="hidden" :accept="info.os_extension"
@change="uploadNative"/>
<button class="mt-4 button gray-button"
@click="copyLogs">
Copy logs
</button>
</div>
</template>
@ -77,10 +73,6 @@ export default class FileView extends Vue {
const file = e.target.files?.[0];
if (file) this.$devices.uploadOsFile(this.dev, file);
}
copyLogs() {
navigator.clipboard.writeText(this.$devices.devices[this.dev].log).catch(alert);
}
}
</script>

View file

@ -39,6 +39,11 @@
>
</label>
</div>
<div v-if="calculator">
<button class="mt-4 button gray-button" @click="copyLogs">
Copy logs
</button>
</div>
<div v-if="!(calculator && !calculator.info)" class="flex-grow" />
<div class="mt-4 select-text">
<p>
@ -169,6 +174,10 @@ export default class Home extends Vue {
installDrivers() {
open('https://lights0123.com/n-link/#windows');
}
copyLogs() {
navigator.clipboard.writeText(this.calculator?.log).catch(alert);
}
}
</script>
@ -200,4 +209,20 @@ export default class Home extends Vue {
transform: rotate(360deg);
}
}
.button {
@apply bg-blue-500 text-white rounded px-6 py-2.5 font-bold;
&:disabled {
cursor: not-allowed;
opacity: 0.75;
}
&:focus {
outline: none;
}
}
.gray-button {
@apply bg-gray-400 text-gray-800;
}
</style>