Compare commits

..

No commits in common. "8462fdfe8d1e92df6656f3820d1434a477455028" and "4b46f2ff00a68ff6dc83f422ae8f499bff93cf4f" have entirely different histories.

5 changed files with 9 additions and 38 deletions

View File

@ -48,20 +48,9 @@ params:
*/ */
bricks.uuid = function(){ bricks.uuid = function(){
try{ var d = crypto.randomUUID();
var d = crypto.randomUUID(); var lst = d.split('-');
var lst = d.split('-'); return lst.join('');
return lst.join('');
} catch(e) {
const vv = '1234567890qwertyuiopasdfghjklzxcvbnm';
var ret = '';
for (var i=0;i<30;i++){
var j = parseInt(Math.random() * vv.length);
ret = ret + vv[j];
}
console.log('uuid() return', ret);
return ret;
}
} }
bricks.deviceid = function(appname){ bricks.deviceid = function(appname){
@ -533,11 +522,6 @@ bricks.App = class extends bricks.Layout {
this.video_devices = null this.video_devices = null
this.vpos = null; this.vpos = null;
document.addEventListener('keydown', this.key_down_action.bind(this)); document.addEventListener('keydown', this.key_down_action.bind(this));
this.screen_orient = window.screen.orientation.type;
window.screen.orientation.addEventListener('change', () => {
this.screen_orient = window.screen.orientation.type;
this.bind('orient_changed', this.screen_orient);
});
} }
async getCameras() { async getCameras() {
try { try {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -55,11 +55,7 @@ bricks.ModelOutput = class extends bricks.HBox {
opts.width = '100%'; opts.width = '100%';
super(opts); super(opts);
this.logid = null; this.logid = null;
this.img = new bricks.Icon({ this.img = new bricks.Icon({rate:2,url:this.icon||bricks_resource('imgs/llm.png')});
rate:2,
tip:this.opts.model,
url:this.icon||bricks_resource('imgs/llm.png')
});
this.run = new bricks.BaseRunning({target:this}); this.run = new bricks.BaseRunning({target:this});
this.add_widget(this.img); this.add_widget(this.img);
this.add_widget(this.run); this.add_widget(this.run);
@ -167,10 +163,7 @@ bricks.LlmModel = class extends bricks.JsWidget {
render_title(){ render_title(){
var w = new bricks.HBox({}); var w = new bricks.HBox({});
w.bind('click', this.show_setup_panel.bind(this)) w.bind('click', this.show_setup_panel.bind(this))
var img = new bricks.Icon({ var img = new bricks.Icon({rate:2,url:this.opts.icon||bricks_resource('imgs/llm.png')});
rate:2,
url:this.opts.icon||bricks_resource('imgs/llm.png')
});
var txt = new bricks.Text({text:this.opts.model}); var txt = new bricks.Text({text:this.opts.model});
w.add_widget(img); w.add_widget(img);
w.add_widget(txt); w.add_widget(txt);
@ -206,8 +199,7 @@ bricks.LlmModel = class extends bricks.JsWidget {
var mout = new bricks.ModelOutput({ var mout = new bricks.ModelOutput({
textvoice:this.textvoice, textvoice:this.textvoice,
tts_url:this.tts_url, tts_url:this.tts_url,
icon:this.opts.icon, icon:this.opts.icon,
model:this.opts.model,
estimate_url:this.llmio.estimate_url, estimate_url:this.llmio.estimate_url,
output_view:this.opts.output_view}); output_view:this.opts.output_view});
this.llmio.o_w.add_widget(mout); this.llmio.o_w.add_widget(mout);
@ -294,25 +286,20 @@ bricks.LlmIO = class extends bricks.VBox {
constructor(opts){ constructor(opts){
super(opts); super(opts);
this.llmmodels = []; this.llmmodels = [];
this.title_w = new bricks.HBox({cheight:3}); this.title_w = new bricks.HBox({cheight:2});
var bottom_box = new bricks.HBox({cheight:3});
this.i_w = new bricks.Icon({ this.i_w = new bricks.Icon({
rate:2, rate:2,
url:bricks_resource('imgs/input.png'), url:bricks_resource('imgs/input.png'),
margin:'14px',
tip:'input data', tip:'input data',
css:'clickable' css:'clickable'
}); });
this.nm_w = new bricks.Icon({ this.nm_w = new bricks.Icon({
rate:2, rate:2,
url:bricks_resource('imgs/add.png'), url:bricks_resource('imgs/add.png'),
margin:'14px',
tip:'add new model', tip:'add new model',
css:'clickable' css:'clickable'
}); });
bottom_box.add_widget(this.i_w); this.title_w.add_widget(this.nm_w);
bottom_box.add_widget(this.nm_w);
this.nm_w.bind('click', this.open_search_models.bind(this)); this.nm_w.bind('click', this.open_search_models.bind(this));
this.i_w.bind('click', this.open_input_widget.bind(this)); this.i_w.bind('click', this.open_input_widget.bind(this));
this.o_w = new bricks.Filler({overflow:'auto'}); this.o_w = new bricks.Filler({overflow:'auto'});
@ -321,7 +308,7 @@ bricks.LlmIO = class extends bricks.VBox {
if (this.models.length < 2 && this.tts_url){ if (this.models.length < 2 && this.tts_url){
this.textvoice = true; this.textvoice = true;
} }
this.add_widget(bottom_box); this.add_widget(this.i_w);
this.models.forEach( m =>{ this.models.forEach( m =>{
this.show_added_model(m); this.show_added_model(m);
}); });