Jelly

πŸ₯ [πŸ‘¨πŸ»β€πŸ’»β›”] Not yet implemented...

Build Status All Download Release License

Index

1. Getting Started

1-1. How to use

  1. Load library and new instance

     <!-- Library - SJJS -->
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/crossman/dist/js/crossman.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/storageman/dist/js/storageman.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/keyman/dist/js/keyman.js"></script> 
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/boxman/dist/js/boxman.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/popman/dist/js/popman.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/menuman/dist/js/menuman.js"></script>  
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/variableman/dist/js/variableman.js"></script>
     <!-- Library - SJJS-Jelly -->
     <link href="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/css/jelly.css" rel="stylesheet" type="text/css"/>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-model.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-icon.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-runner-key.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-runner-speech.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-runner-schedule.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-stats.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-icon-manager.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-icon-manager-inputer.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-alarm-manager.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-db-manager.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-xhr-manager.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-command-search-test.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-word-chain.js"></script> 
     <script>
          var jelly = new Jelly();
     </script>
    

    OR in ES6+

     const Jelly = require('@sj-js/jelly');
     const jelly = new Jelly();
    
  2. addMenu

     //TODO: κ°œλ…μ •λ¦¬μ€‘
     var jelly = new JellySpeaker({modeNeedsToCallName: true, validTimeToCommand: 4000, storagePath: '/jelly/icon'})
         .addPlugin([
             new JellySpeaker.PluginStats(),
             new JellySpeaker.PluginCommandSearchTest('search', '검색'),
             new JellySpeaker.PluginWordChain(),
             new JellySpeaker.PluginAlarmManager(),
             new JellySpeaker.PluginDBManager(),
             new JellySpeaker.PluginXHRManager(),
             new JellySpeaker.PluginIconManager(),
             new JellySpeaker.PluginIconManagerInputer().setLoadData(function(){
                 return { hi: {id:'test', type:'click'},  hello: {id:'test2', type:'click'}, };
             }),
         ])
         .setupSystemIcon([
             new JellySpeaker.Icon('search').setCommand(function(parameter){
                 searchWithParameterURL(parameter.keyword); //μ—†μœΌλ©΄ μžλ™μœΌλ‘œ Input의 Value 채취
             }),
             new JellySpeaker.Icon('search-on-naver').setCommand(function(parameter){
                 window.open("https://search.naver.com/search.naver?ie=UTF-8&query=" +parameter, "_blank");
             }),
             new JellySpeaker.Icon('search-on-google').setCommand(function(parameter){
                 window.open("https://www.google.com/search?q=" +parameter, "_blank");
             }),
             new JellySpeaker.Icon('show').setCommand(function(parameter){
                 // run('show', parameter);
             }),
             new JellySpeaker.Icon('open').setCommand(function(parameter){
                 window.open('https://naver.com', '_blank');
             }),
             new JellySpeaker.Icon('move-to-home').setCommand(function(parameter){
                 location.href = SEARCHER.URL_TO_HOME;
             }),
             new JellySpeaker.Icon('open-user-manager').setCommand(function(parameter){
                 openUserManager();
             }),
             new JellySpeaker.Icon().setCommand('search').setRunner([
                 new JellySpeaker.SpeechRunner('${parameter.except(이라고).except(라고)} 검색'),
                 new JellySpeaker.SpeechRunner(new RegExp('\\w+ 검색')),
             ]),
             new JellySpeaker.Icon().setCommand('search-on-naver').setRunner([
                 new JellySpeaker.SpeechRunner('${parameter.except(이라고).except(라고)} λ„€μ΄λ²„μ—μ„œ 검색'),
                 new JellySpeaker.SpeechRunner(new RegExp('.+ 검색')),
             ]),
         ])
         .setupUserIcon([
             /** 데이터 보쑰 **/
             new JellySpeaker.Icon('user-manager').setTitle('μ‚¬μš©μž κ΄€λ¦¬μž').setHTML('🧍').setCommand('open-user-manager').setRunner([
                 new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N2]),
             ]),
             new JellySpeaker.Icon('team-manager').setTitle('μ†Œμ† κ΄€λ¦¬μž').setHTML('πŸ‘¨β€πŸ‘©β€πŸ‘§ ').setCommand('open-team-manager').setRunner([
                 new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N9]),
             ]),
             new JellySpeaker.Icon('category-manager').setTitle('μΉ΄ν…Œκ³ λ¦¬ κ΄€λ¦¬μž').setHTML('πŸ—‚οΈ').setCommand('open-category-manager').setRunner([
                 new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N3]),
             ]),
             new JellySpeaker.Icon('product-manager').setTitle('μƒν’ˆ κ΄€λ¦¬μž').setHTML('πŸ“¦').setCommand('open-product-manager').setRunner([
                 new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N4]),
             ]),
             new JellySpeaker.Icon('index-manager').setTitle('인덱슀 κ΄€λ¦¬μž').setHTML('πŸ•΅οΈβ€β™‚οΈ').setCommand('open-index-manager').setRunner([
                 new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N6]),
             ]),
    
             /** κ΄€μ œ **/
             new JellySpeaker.Icon('page-gitlab').setTitle('GitLab').setHTML('🦊').setURL('http://192.168.0.18'),
             new JellySpeaker.Icon('page-jelly').setTitle('Jelly').setHTML('Jelly').setURL('http://192.168.0.18:8080/jelly'),
             new JellySpeaker.Icon('page-ealsticsearch').setTitle('ElasticSearch').setHTML('ES').setURL('http://192.168.0.18:9200'),
             new JellySpeaker.Icon('page-kibana').setTitle('Kibana').setHTML('Kibana').setURL('http://192.168.0.18:5601'),
             new JellySpeaker.Icon('page-logstash').setTitle('Logstash').setHTML('Logstash').setURL('http://192.168.0.18:9600'),
             // new JellySpeaker.Icon('page-tibero').setTitle('Tibero').setHTML('Tibero').setURL('jdbc:tibero:thin:@192.168.0.18:8629:tibero').setData({username:'nia', password:'nia'}),
             new JellySpeaker.Icon('page-postgres').setTitle('Postgres').setHTML('Postgres').setURL('jdbc:postgresql://192.168.0.18:5432/postgres').setData({username:'postgres', password:'postgres'}),
    
             /** κΈ°λŠ₯λ“€ **/
             new JellySpeaker.Icon('schedule-001').setTitle('주기적으둜 Data Count 가져와').setHTML('πŸ”’').setCommand(function(){ loadCount() }).setRunner([
                 new JellySpeaker.ScheduleRunner(30 * 1000)
             ]),
             // new JellySpeaker.Icon('testing').setTitle('testing').setHTML('πŸ”’').setCommand(function(){ console.error(new Date().getTime()) }).setRunner([
             //     new JellySpeaker.ScheduleRunner('{dayOfWeek(일), cycle(23:45, 23:46, 23:50, 23:55, 00:37, 00:42)}, {dayOfWeek(μ›”,ν™”), cycle(2m)}')
             // ]),
             new JellySpeaker.Icon('button-002').setTitle('ν•™μŠ΅ν•΄λ΄!').setHTML('πŸ‘©β€πŸŽ“').setCommand(function(){ testLearn() }).setRunner([
                 new JellySpeaker.SpeechRunner('ν•™μŠ΅ ν•΄ 봐'),
             ]),
             new JellySpeaker.Icon('toggle-memory-watcher').setTitle('λ©”λͺ¨λ¦¬ κ°μ‹œμž').setHTML('πŸ“‰').setClass(JellySpeaker.PluginIconManager.CLASS_ICON_TOGGLE)
                 .setCommand(function(parameter, resolve){
                     parameter.status ? stopMemoryWatcher(resolve) : startMemoryWatcher(resolve);
                 })
                 .setModeStatusCheck(true, function(resolve){
                     checkMemoryWatcher(function(result){ resolve(result); });
                 }),
         ])
         .loadIcon()
         .detect()
         .start();
    

1-2 Simple Example

Sample A