Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Dec 27, 2024
1 parent 23a713a commit 6bc74b1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 44 deletions.
4 changes: 2 additions & 2 deletions backend/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func server(jobsystem JobSystem, config ConfigRoot) {
dbs = req.Form["database[]"]
mode = req.FormValue("mode")
email = req.FormValue("email")
iterativesearch = req.FormValue("iterativesearch") == "true"
iterativesearch = req.FormValue("iterativesearch") == "true"
taxfilter = req.FormValue("taxfilter")
} else {
err := req.ParseForm()
Expand All @@ -298,7 +298,7 @@ func server(jobsystem JobSystem, config ConfigRoot) {
dbs = req.Form["database[]"]
mode = req.FormValue("mode")
email = req.FormValue("email")
iterativesearch = req.FormValue("iterativesearch") == "true"
iterativesearch = req.FormValue("iterativesearch") == "true"
taxfilter = req.FormValue("taxfilter")
}

Expand Down
20 changes: 10 additions & 10 deletions backend/structuresearchjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ import (
)

type StructureSearchJob struct {
Size int `json:"size" validate:"required"`
Database []string `json:"database" validate:"required"`
Mode string `json:"mode" validate:"oneof=3di tmalign 3diaa"`
IterativeSearch bool `json:"iterativesearch"`
TaxFilter string `json:"taxfilter"
query string
Size int `json:"size" validate:"required"`
Database []string `json:"database" validate:"required"`
Mode string `json:"mode" validate:"oneof=3di tmalign 3diaa"`
IterativeSearch bool `json:"iterativesearch"`
TaxFilter string `json:"taxfilter"`
query string
}

func (r StructureSearchJob) Hash() Id {
h := sha256.New224()
h.Write(([]byte)(JobStructureSearch))
h.Write([]byte(r.query))
h.Write([]byte(r.Mode))
if r.IterativeSearch {
h.Write([]byte("Iterative"))
}
if r.IterativeSearch {
h.Write([]byte("iterative"))
}
if r.TaxFilter != "" {
h.Write([]byte(r.TaxFilter))
}
Expand Down Expand Up @@ -57,7 +57,7 @@ func NewStructureSearchJobRequest(query string, dbs []string, validDbs []Params,
max(strings.Count(query, "HEADER"), 1),
dbs,
mode,
iterativeSearch,
iterativeSearch,
taxfilter,
query,
}
Expand Down
4 changes: 2 additions & 2 deletions backend/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ mv -f -- "${BASE}/query.lookup_tmp" "${BASE}/query.lookup"
}

if job.IterativeSearch {
parameters = append(parameters, "--num-iterations")
parameters = append(parameters, "3")
parameters = append(parameters, "--num-iterations")
parameters = append(parameters, "3")
}
cmd, done, err := execCommand(config.Verbose, parameters...)
if err != nil {
Expand Down
50 changes: 20 additions & 30 deletions frontend/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,16 @@
<template v-else>
DBs
</template>
&amp; search settings
</template>
<div slot="content">
<databases
:selected="database"
:all-databases="databases"
@update:selected="database = $event"
@update:all-databases="databases = $event"
:hideEmail="hideEmail"
></databases>
</div>
</panel>
<panel collapsible collapsed render-collapsed>
<template slot="header">
<template v-if="!$vuetify.breakpoint.smAndDown">
Search Parameters
</template>
<template v-else>
Params
</template>
</template>
<div slot="content">
:selected="database"
:all-databases="databases"
@update:selected="database = $event"
@update:all-databases="databases = $event"
:hideEmail="hideEmail"
></databases>
<v-radio-group v-model="mode">
<v-tooltip open-delay="300" top>
<template v-slot:activator="{ on }">
Expand All @@ -93,20 +82,19 @@

<TaxonomyAutocomplete v-model="taxFilter"></TaxonomyAutocomplete>

<v-radio-group v-model="iterativeSearch">
<v-tooltip open-delay="300" top>
<template v-slot:activator="{ on }">
<label v-on="on">
<v-tooltip open-delay="300" top>
<template v-slot:activator="{ on }">
<v-checkbox>
<template slot="label">
<label v-on="on">
Iterative search
<v-icon color="#FFFFFFB3" style="margin-top:-3px" small v-on="on">{{ $MDI.HelpCircleOutline }}</v-icon>
</label>
</template>
<span>Improve sensitivity of search by performing an iterative search (--num-iterations 3).</span>
</v-tooltip>

<v-radio label="On" :value="true"></v-radio>
<v-radio label="Off" :value="false"></v-radio>
</v-radio-group>
</template>
</v-checkbox>
</template>
<span>Improve sensitivity of search by performing an iterative search (--num-iterations 3).</span>
</v-tooltip>

<v-tooltip v-if="!$ELECTRON && !hideEmail" open-delay="300" top>
<template v-slot:activator="{ on }">
Expand Down Expand Up @@ -141,10 +129,12 @@
<template v-else>
databases
</template>
<template v-if="database.length > 0">
({{
databases.filter(db => database.includes(db.path)).map(db => db.name).sort().join(", ")
}})
</template> with {{ $STRINGS.APP_NAME }} in <strong>{{ modes[mode] }}</strong> mode<span v-if="iterativeSearch"><strong> iterative</strong></span>.
</template>
</template> with {{ $STRINGS.APP_NAME }} in <template v-if="iterativeSearch">iterative</template> <strong>{{ modes[mode] }}</strong> mode.
<div v-if="errorMessage != ''" class="v-alert v-alert--outlined warning--text mt-2">
<span>{{ errorMessage }}</span>
</div>
Expand Down

0 comments on commit 6bc74b1

Please sign in to comment.