Skip to content

Commit

Permalink
disks category.
Browse files Browse the repository at this point in the history
  • Loading branch information
schwarzlichtbezirk committed Mar 23, 2021
1 parent 89874bb commit 66c9dab
Show file tree
Hide file tree
Showing 30 changed files with 129 additions and 104 deletions.
4 changes: 2 additions & 2 deletions cmd/hms.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/schwarzlichtbezirk/hms"
)

const buildvers = "0.7.2"
const builddate = "2021.03.22"
const buildvers = "0.7.3"
const builddate = "2021.03.23"

var log = hms.Log

Expand Down
3 changes: 1 addition & 2 deletions conf/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ webserver: # See https://golang.org/pkg/net/http/#Server for details.
port-tls:
- :443
- :4804
# Maximum duration for reading the entire request, including the body,
# in seconds.
# Maximum duration for reading the entire request, including the body.
read-timeout: 15s
# Amount of time allowed to read request headers.
read-header-timeout: 15s
Expand Down
8 changes: 4 additions & 4 deletions fileprop.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (
FGimage = 3
FGbooks = 4
FGtexts = 5
FGstore = 6
FGdisks = 6
FGdir = 7
)

Expand Down Expand Up @@ -86,9 +86,9 @@ var typetogroup = map[int]int{
FTscr: FGtexts,
FTcfg: FGtexts,
FTlog: FGtexts,
FTarch: FGstore,
FTdisk: FGstore,
FTpack: FGstore,
FTarch: FGdisks,
FTdisk: FGdisks,
FTpack: FGdisks,
}

var extset = map[string]int{
Expand Down
Binary file modified frontend/assets/iconfont/MaterialIcons-Regular.woff2
Binary file not shown.
80 changes: 42 additions & 38 deletions frontend/build/main.bundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions frontend/build/main.bundle.js.map

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions frontend/build/stat.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions frontend/build/stat.bundle.js.map

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions frontend/devmode/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Vue.component('file-card-tag', {
sortmode: sortmode.byalpha,
listmode: "smicon",
thumbmode: true,
audio: true, video: true, image: true, books: true, texts: true, other: false,
audio: true, video: true, image: true, books: true, texts: true, disks: true, other: false,
audioonly: false,
viewer: null, // file viewers

Expand Down Expand Up @@ -370,9 +370,12 @@ Vue.component('file-card-tag', {
showtexts() {
return !!this.list.find(file => FTtoFG[file.type] === FG.texts);
},
showdisks() {
return !!this.list.find(file => FTtoFG[file.type] === FG.disks);
},
showother() {
return !!this.list.find(file => !file.type
|| FTtoFG[file.type] === FG.store
|| FTtoFG[file.type] === FG.disks
|| FTtoFG[file.type] === FG.other);
},

Expand All @@ -397,6 +400,9 @@ Vue.component('file-card-tag', {
clstexts() {
return { active: this.texts };
},
clsdisks() {
return { active: this.disks };
},
clsother() {
return { active: this.other };
},
Expand Down Expand Up @@ -440,6 +446,8 @@ Vue.component('file-card-tag', {
return this.books;
case FG.texts:
return this.texts;
case FG.disks:
return this.disks;
default:
return this.other;
}
Expand Down Expand Up @@ -517,6 +525,9 @@ Vue.component('file-card-tag', {
ontexts() {
this.texts = !this.texts;
},
ondisks() {
this.disks = !this.disks;
},
onother() {
this.other = !this.other;
},
Expand Down Expand Up @@ -562,8 +573,8 @@ Vue.component('file-card-tag', {
this.closeviewer();
this.$refs.slider.popup(file);
break;
case FG.store:
if (file.type === FT.disk) {
case FG.disks:
if (pathext(file.name) === ".iso") {
this.$emit('open', file);
}
break;
Expand Down
2 changes: 2 additions & 0 deletions frontend/devmode/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const pathjoin = (...args) => {
}).filter(x => x.length).join('/');
};

const pathext = fname => fname.substr(fname.lastIndexOf('.')).toLowerCase();

const fmtfilesize = (size) => {
if (size < 1536) {
return size + " bytes";
Expand Down
4 changes: 2 additions & 2 deletions frontend/devmode/devmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// This file is included only for developer mode linkage

const buildvers = "0.7.2";
const builddate = "2021.03.22";
const buildvers = "0.7.3";
const builddate = "2021.03.23";
console.info("version: %s, builton: %s", buildvers, builddate);
console.info("starts in developer mode");

Expand Down
10 changes: 5 additions & 5 deletions frontend/devmode/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
<script src="/plug/sha256.min.js?0.9.0"></script>

<!-- common functionality used in all components -->
<script src="/devm/devmode.js?0.7.1"></script>
<script src="/devm/common.js?0.4.4"></script>
<script src="/devm/devmode.js?0.7.3"></script>
<script src="/devm/common.js?0.7.3"></script>
<script src="/devm/request.js?0.5.6"></script>
<!-- register Vue.js components -->
<script src="/devm/fileitem.js?0.6.9"></script>
<script src="/devm/cards.js?0.7.0"></script>
<script src="/devm/mp3player.js?0.7.1"></script>
<script src="/devm/cards.js?0.7.3"></script>
<script src="/devm/mp3player.js?0.7.3"></script>
<script src="/devm/slider.js?0.6.9"></script>
<!-- load application script -->
<script src="/devm/mainpage.js?0.7.0"></script>
<script src="/devm/mainpage.js?0.7.3"></script>
</body>
</html>
12 changes: 6 additions & 6 deletions frontend/devmode/mainpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const FG = {
image: 3,
books: 4,
texts: 5,
store: 6,
disks: 6,
dir: 7
};

Expand Down Expand Up @@ -107,9 +107,9 @@ const FTtoFG = {
[FT.scr]: FG.texts,
[FT.cfg]: FG.texts,
[FT.log]: FG.texts,
[FT.arch]: FG.store,
[FT.disk]: FG.store,
[FT.pack]: FG.store
[FT.arch]: FG.disks,
[FT.disk]: FG.disks,
[FT.pack]: FG.disks
};

// File viewers
Expand Down Expand Up @@ -200,8 +200,8 @@ const geticonpath = (file, im, shr) => {
return { org: org.folder.books, alt: alt.folder.books };
} else if (fg[FG.texts] / fnum > 0.5) {
return { org: org.folder.texts, alt: alt.folder.texts };
} else if (fg[FG.store] / fnum > 0.5) {
return { org: org.folder.store, alt: alt.folder.store };
} else if (fg[FG.disks] / fnum > 0.5) {
return { org: org.folder.disks, alt: alt.folder.disks };
} else if (fg[FG.dir] / fnum > 0.5) {
return { org: org.folder.dir, alt: alt.folder.dir };
} else if ((fg[FG.audio] + fg[FG.video] + fg[FG.image]) / fnum > 0.5) {
Expand Down
29 changes: 17 additions & 12 deletions frontend/devmode/mp3player.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Vue.component('mp3-player-tag', {
seeking: false,
media: null,
isplay: false, // this.media && !this.media.paused
isflowing: false,
autoplay: false,
ready: false,
timecur: 0,
timebuf: 0,
Expand Down Expand Up @@ -124,26 +124,26 @@ Vue.component('mp3-player-tag', {
this.media.volume = this.volval / 100;
this.media.playbackRate = this.ratevals[this.ratval];
this.media.loop = this.repeatmode === 1;
this.media.autoplay = this.autoplay;

// disable UI for not ready media
this.ready = false;

// media interface responders
this.media.addEventListener('loadedmetadata', () => {
this.timecur = this.media.currentTime;
this.timebuf = 0;
this.timeend = this.media.duration;

this.updateprogress();
});
this.media.addEventListener('canplay', () => {
const cur = this.media.currentTime;
const len = this.media.duration;
this.timecur = cur;
this.timebuf = 0;
this.timeend = len;

// enable UI
this.ready = true;

if (this.isflowing && this.media.paused) {
// load to player
if (!this.media.autoplay) {
this.media.play();
this.media.pause();
}
});
this.media.addEventListener('timeupdate', () => this.updateprogress());
Expand All @@ -152,17 +152,24 @@ Vue.component('mp3-player-tag', {
this.media.addEventListener('durationchange', () => this.updateprogress());
this.media.addEventListener('play', () => {
this.isplay = true;
this.autoplay = true;
this.$emit('playback', this.selfile);
});
this.media.addEventListener('pause', () => {
this.isplay = false;
this.autoplay = false;
this.$emit('playback', null);
});
this.media.addEventListener('ended', () => {
this.autoplay = true;
this.onnext();
});
this.media.addEventListener('error', e => {
console.error("Error " + e.code + "; details: " + e.message);
if (e.message) {
console.error("Error " + e.code + "; details: " + e.message);
} else {
console.error(e);
}
});
this.media.addEventListener('volumechange', () => {
this.volval = this.media.volume * 100;
Expand Down Expand Up @@ -194,10 +201,8 @@ Vue.component('mp3-player-tag', {
if (!this.media) return;
if (this.media.paused) {
this.media.play();
this.isflowing = true;
} else {
this.media.pause();
this.isflowing = false;
}
},

Expand Down
4 changes: 2 additions & 2 deletions frontend/devmode/relmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// This file is included for release mode linkage

const buildvers = "0.7.2";
const builddate = "2021.03.22";
const buildvers = "0.7.3";
const builddate = "2021.03.23";
const devmode = false;

const traceajax = () => undefined;
Expand Down
4 changes: 2 additions & 2 deletions frontend/devmode/stat.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<script src="/plug/vue.js?2.6.12"></script>

<!-- common functionality used in all components -->
<script src="/devm/devmode.js?0.6.9"></script>
<script src="/devm/common.js?0.4.4"></script>
<script src="/devm/devmode.js?0.7.3"></script>
<script src="/devm/common.js?0.7.3"></script>
<script src="/devm/request.js?0.5.6"></script>
<!-- load application script -->
<script src="/devm/statpage.js?0.6.1"></script>
Expand Down
2 changes: 1 addition & 1 deletion frontend/icon/chakram.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"image": "/data/icon/chakram/folder-image",
"books": "/data/icon/chakram/folder-books",
"texts": "/data/icon/chakram/folder-texts",
"store": "/data/icon/chakram/folder-data",
"disks": "/data/icon/chakram/folder-data",
"dir": "/data/icon/chakram/folder",
"media": "/data/icon/chakram/folder-media",
"open": "/data/icon/chakram/folder",
Expand Down
4 changes: 2 additions & 2 deletions frontend/icon/delta.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"image": "/data/icon/delta/folder-image",
"books": "/data/icon/delta/folder-briefcase",
"texts": "/data/icon/delta/folder-briefcase",
"store": "/data/icon/delta/folder-briefcase",
"disks": "/data/icon/delta/folder-briefcase",
"dir": "/data/icon/delta/folder-open",
"media": "/data/icon/delta/folder-doc",
"open": "/data/icon/delta/folder-open",
Expand Down Expand Up @@ -120,7 +120,7 @@
"image": "/data/icon/delta/folder-image-pub",
"books": "/data/icon/delta/folder-briefcase-pub",
"texts": "/data/icon/delta/folder-briefcase-pub",
"store": "/data/icon/delta/folder-briefcase-pub",
"disks": "/data/icon/delta/folder-briefcase-pub",
"dir": "/data/icon/delta/folder-open-pub",
"media": "/data/icon/delta/folder-doc-pub",
"open": "/data/icon/delta/folder-open-pub",
Expand Down
4 changes: 2 additions & 2 deletions frontend/icon/junior.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"image": "/data/icon/junior/folder-photo",
"books": "/data/icon/junior/folder-doc",
"texts": "/data/icon/junior/folder-doc",
"store": "/data/icon/junior/folder-open",
"disks": "/data/icon/junior/folder-open",
"dir": "/data/icon/junior/folder-dir",
"media": "/data/icon/junior/folder-media",
"open": "/data/icon/junior/folder-open",
Expand Down Expand Up @@ -120,7 +120,7 @@
"image": "/data/icon/junior/folder-photo-pub",
"books": "/data/icon/junior/folder-doc-pub",
"texts": "/data/icon/junior/folder-doc-pub",
"store": "/data/icon/junior/folder-open-pub",
"disks": "/data/icon/junior/folder-open-pub",
"dir": "/data/icon/junior/folder-dir-pub",
"media": "/data/icon/junior/folder-media-pub",
"open": "/data/icon/junior/folder-open-pub",
Expand Down
2 changes: 1 addition & 1 deletion frontend/icon/oxygen.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"image": "/data/icon/oxygen/folder-image",
"books": "/data/icon/oxygen/folder-html",
"texts": "/data/icon/oxygen/folder-texts",
"store": "/data/icon/oxygen/folder-store",
"disks": "/data/icon/oxygen/folder-store",
"dir": "/data/icon/oxygen/folder-doc",
"media": "/data/icon/oxygen/folder-media",
"open": "/data/icon/oxygen/folder-open",
Expand Down
Loading

0 comments on commit 66c9dab

Please sign in to comment.