Skip to content

Commit

Permalink
save session in database & disable files more dropdown when no files …
Browse files Browse the repository at this point in the history
…selected
  • Loading branch information
topi314 committed Oct 6, 2023
1 parent 14bf53d commit 2447c10
Show file tree
Hide file tree
Showing 18 changed files with 262 additions and 200 deletions.
21 changes: 16 additions & 5 deletions assets/css/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,33 @@ progress::-moz-progress-bar {
z-index: 1;
}

.dropdown:disabled {
.dropdown > div {
cursor: pointer;
}

.dropdown.disabled > div {
filter: opacity(0.5);
cursor: not-allowed;
}

.dropdown:hover:not(:disabled) ul,
.dropdown:focus-within:not(:disabled) ul {
.dropdown:hover:not(.disabled) ul,
.dropdown:focus-within:not(.disabled) ul {
display: block;
background-color: var(--bg-secondary);
}

.dropdown:hover:not(.disabled) > div {
filter: opacity(0.7);
}

.dropdown ul li:first-child {
border-radius: 0.5rem 0.5rem 0 0;
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
}

.dropdown ul li:last-child {
border-radius: 0 0 0.5rem 0.5rem;
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
}

.dropdown ul li:hover {
Expand Down
6 changes: 5 additions & 1 deletion assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ main {
gap: 1rem;
}

#files-more > div {
margin-top: 0.05rem;
}

#theme {
display: none;
}
Expand All @@ -107,5 +111,5 @@ main {
}

.loading {
background-image: url(../icons/loading.gif) !important;
background-image: url(../images/loading.gif) !important;
}
6 changes: 3 additions & 3 deletions assets/css/upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
background-color: var(--bg-primary);
}

#upload-icon:after {
#upload-icon:before {
content: '\f0ee';
width: 4rem;
height: 4rem;
font-size: 400%;
width: 7rem;
padding: 1rem;
}

Expand Down
File renamed without changes
5 changes: 3 additions & 2 deletions assets/js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const selectedFiles = [];
export function getSelectedFiles() {
const files = selectedFiles.slice();
selectedFiles.splice(0, selectedFiles.length);
document.querySelector("#files-more").classList.toggle("disabled", true);
return files;
}

Expand All @@ -22,7 +23,7 @@ export function onFilesSelect(e) {
fileSelect.checked = true;
selectedFiles.push(fileSelect.dataset.name);
}
document.querySelector("#files-more").disabled = selectedFiles.length === 0
document.querySelector("#files-more").classList.toggle("disabled", selectedFiles.length === 0);
}

export function onFileSelect(e) {
Expand All @@ -35,7 +36,7 @@ export function onFileSelect(e) {
selectedFiles.splice(selectedFiles.indexOf(e.target.dataset.name), 1);
document.querySelector("#files-select").checked = false;
}
document.querySelector("#files-more").disabled = selectedFiles.length === 0
document.querySelector("#files-more").classList.toggle("disabled", selectedFiles.length === 0);
}

export function onDownloadFiles(e) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function onFilesChange(e) {
<div class="upload-file-content">
<label>Name:</label><input name="name-${i}" value="${file.name}"/>
<label>Description:</label><textarea name="description-${i}"></textarea>
<label>Overwrite:</label><span><input id="overwrite-${i}" class="checkbox" type="checkbox" name="overwrite-${i}" value="true" checked/><label for="overwrite-${i}"></label></span>
<label>Overwrite:</label><span><input id="overwrite-${i}" class="checkbox" type="checkbox" name="overwrite-${i}" value="true" checked/><label for="overwrite-${i}" class="icon"></label></span>
</div>
<div class="upload-file-icon">
<div class="icon-btn icon-remove" role="button" onclick="window.onUploadFileDelete(${i})"></div>
Expand Down
28 changes: 16 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ require (
github.com/go-chi/chi/v5 v5.0.10
github.com/jackc/pgx/v5 v5.4.3
github.com/jmoiron/sqlx v1.3.5
github.com/karrick/godirwalk v1.17.0
github.com/minio/minio-go/v7 v7.0.63
github.com/mitchellh/mapstructure v1.5.0
github.com/prometheus/client_golang v1.17.0
github.com/riandyrn/otelchi v0.5.1
github.com/spf13/viper v1.16.0
github.com/spf13/viper v1.17.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0
Expand All @@ -24,8 +25,8 @@ require (
go.opentelemetry.io/otel/sdk v1.19.0
go.opentelemetry.io/otel/sdk/metric v1.19.0
go.opentelemetry.io/otel/trace v1.19.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/oauth2 v0.12.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/oauth2 v0.13.0
modernc.org/sqlite v1.26.0
)

Expand Down Expand Up @@ -56,29 +57,32 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.opentelemetry.io/contrib v1.20.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.16.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading

0 comments on commit 2447c10

Please sign in to comment.