simplified the process of adding more search sites
This commit is contained in:
@@ -43,7 +43,12 @@
|
||||
></uploadFile>
|
||||
</div>
|
||||
</div>
|
||||
<searchInput v-else @search="search" @optionSelected="optionCallback"></searchInput>
|
||||
<searchInput
|
||||
v-else
|
||||
@search="search"
|
||||
@optionSelected="optionCallback"
|
||||
:selectOptions="searchOptions"
|
||||
></searchInput>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
@@ -55,6 +60,7 @@ import uploadFile from "./uploadFile";
|
||||
import { translate as t } from "@nextcloud/l10n";
|
||||
|
||||
export default {
|
||||
inject: ["settings", "search_sites"],
|
||||
data() {
|
||||
return {
|
||||
checkedValue: false,
|
||||
@@ -64,6 +70,7 @@ export default {
|
||||
downloadType: "aria2",
|
||||
placeholder: t("ncdownloader", "Paste your http/magnet link here"),
|
||||
searchLabel: t("ncdownloader", "Search Torrents"),
|
||||
searchOptions: this.search_sites ? this.search_sites : this.noOptions(),
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -72,6 +79,7 @@ export default {
|
||||
searchInput,
|
||||
uploadFile,
|
||||
},
|
||||
created() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
whichType(type, event) {
|
||||
@@ -105,10 +113,13 @@ export default {
|
||||
optionCallback(option) {
|
||||
if (option.label.toLowerCase() == "music") {
|
||||
this.searchLabel = t("ncdownloader", "Search Music");
|
||||
}else{
|
||||
} else {
|
||||
this.searchLabel = t("ncdownloader", "Search Torrents");
|
||||
}
|
||||
},
|
||||
noOptions() {
|
||||
return [{ name: "nooptions", label: "No Options" }];
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
name: "mainForm",
|
||||
|
||||
@@ -29,11 +29,6 @@ export default {
|
||||
return {
|
||||
placeholder: t("ncdownloader", "Enter keyword to search"),
|
||||
selected: "TPB",
|
||||
selectOptions: [
|
||||
{ name: "TPB", label: "THEPIRATEBAY" },
|
||||
{ name: "bitSearch", label: "BITSEARCH" },
|
||||
{ name: "sliderkz", label: "MUSIC" },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -53,7 +48,9 @@ export default {
|
||||
},
|
||||
},
|
||||
name: "searchInput",
|
||||
props: [],
|
||||
props: {
|
||||
selectOptions: Object,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user