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(){
try{
var d = crypto.randomUUID();
var lst = d.split('-');
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;
}
var d = crypto.randomUUID();
var lst = d.split('-');
return lst.join('');
}
bricks.deviceid = function(appname){
@ -533,11 +522,6 @@ bricks.App = class extends bricks.Layout {
this.video_devices = null
this.vpos = null;
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() {
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%';
super(opts);
this.logid = null;
this.img = new bricks.Icon({
rate:2,
tip:this.opts.model,
url:this.icon||bricks_resource('imgs/llm.png')
});
this.img = new bricks.Icon({rate:2,url:this.icon||bricks_resource('imgs/llm.png')});
this.run = new bricks.BaseRunning({target:this});
this.add_widget(this.img);
this.add_widget(this.run);
@ -167,10 +163,7 @@ bricks.LlmModel = class extends bricks.JsWidget {
render_title(){
var w = new bricks.HBox({});
w.bind('click', this.show_setup_panel.bind(this))
var img = new bricks.Icon({
rate:2,
url:this.opts.icon||bricks_resource('imgs/llm.png')
});
var img = new bricks.Icon({rate:2,url:this.opts.icon||bricks_resource('imgs/llm.png')});
var txt = new bricks.Text({text:this.opts.model});
w.add_widget(img);
w.add_widget(txt);
@ -206,8 +199,7 @@ bricks.LlmModel = class extends bricks.JsWidget {
var mout = new bricks.ModelOutput({
textvoice:this.textvoice,
tts_url:this.tts_url,
icon:this.opts.icon,
model:this.opts.model,
icon:this.opts.icon,
estimate_url:this.llmio.estimate_url,
output_view:this.opts.output_view});
this.llmio.o_w.add_widget(mout);
@ -294,25 +286,20 @@ bricks.LlmIO = class extends bricks.VBox {
constructor(opts){
super(opts);
this.llmmodels = [];
this.title_w = new bricks.HBox({cheight:3});
var bottom_box = new bricks.HBox({cheight:3});
this.title_w = new bricks.HBox({cheight:2});
this.i_w = new bricks.Icon({
rate:2,
url:bricks_resource('imgs/input.png'),
margin:'14px',
tip:'input data',
css:'clickable'
});
this.nm_w = new bricks.Icon({
rate:2,
url:bricks_resource('imgs/add.png'),
margin:'14px',
tip:'add new model',
css:'clickable'
});
bottom_box.add_widget(this.i_w);
bottom_box.add_widget(this.nm_w);
this.title_w.add_widget(this.nm_w);
this.nm_w.bind('click', this.open_search_models.bind(this));
this.i_w.bind('click', this.open_input_widget.bind(this));
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){
this.textvoice = true;
}
this.add_widget(bottom_box);
this.add_widget(this.i_w);
this.models.forEach( m =>{
this.show_added_model(m);
});