Kaynağa Gözat

Rename view-browser.html to index.html

Lutz Roeder 6 yıl önce
ebeveyn
işleme
0d042f4df1
8 değiştirilmiş dosya ile 8 ekleme ve 11 silme
  1. 1 4
      Makefile
  2. 1 1
      setup.py
  3. 2 2
      src/app.js
  4. 1 1
      src/electron.html
  5. 0 0
      src/electron.js
  6. 1 1
      src/index.html
  7. 1 1
      src/index.js
  8. 1 1
      src/server.py

+ 1 - 4
Makefile

@@ -75,10 +75,7 @@ publish_github_pages:
 	git clone [email protected]:lutzroeder/netron.git ./build/gh-pages --branch gh-pages
 	rm -rf ./build/gh-pages/*
 	cp -R ./build/lib/netron/* ./build/gh-pages/
-	rm -rf ./build/gh-pages/*.py
-	rm -rf ./build/gh-pages/*.pyc
-	rm -rf ./build/gh-pages/netron
-	mv ./build/gh-pages/view-browser.html ./build/gh-pages/index.html
+	rm -rf ./build/gh-pages/*.py*
 	@export PACKAGE_VERSION=`node -pe "require('./package.json').version"`; \
 	sed -i -e "s/<!-- meta -->/<meta name='version' content='$$PACKAGE_VERSION' \/>/g" ./build/gh-pages/index.html
 	git -C ./build/gh-pages add --all

+ 1 - 1
setup.py

@@ -103,7 +103,7 @@ setuptools.setup(
             'tflite.js', 'tflite-metadata.json', 'tflite-schema.js', 
             'torch.js', 'torch-metadata.json',
             'torchscript.js', 'torchscript-metadata.json',
-            'view-browser.html', 'view-browser.js',
+            'index.html', 'index.js',
             'view-grapher.css', 'view-grapher.js',
             'view-sidebar.css', 'view-sidebar.js',
             'view.js', 'view.css',

+ 2 - 2
src/app.js

@@ -621,7 +621,7 @@ class View {
             }
         });
         var location = url.format({
-            pathname: path.join(__dirname, 'view-electron.html'),
+            pathname: path.join(__dirname, 'electron.html'),
             protocol: 'file:',
             slashes: true
         });
@@ -646,7 +646,7 @@ class View {
                 this._window.webContents.send("open", { file: file });
             });
             var location = url.format({
-                pathname: path.join(__dirname, 'view-electron.html'),
+                pathname: path.join(__dirname, 'electron.html'),
                 protocol: 'file:',
                 slashes: true
             });

+ 1 - 1
src/view-electron.html → src/electron.html

@@ -112,6 +112,6 @@
     <div id="sidebar-content" class="sidebar-content">
     </div>
 </div>
-<script type="text/javascript">require('./view-electron');</script>
+<script type="text/javascript">require('./electron');</script>
 </body>
 </html>

+ 0 - 0
src/view-electron.js → src/electron.js


+ 1 - 1
src/view-browser.html → src/index.html

@@ -136,6 +136,6 @@
 <script type="text/javascript" src="view-grapher.js"></script>
 <script type="text/javascript" src="view-sidebar.js"></script>
 <script type="text/javascript" src="view.js"></script>
-<script type="text/javascript" src="view-browser.js"></script>
+<script type="text/javascript" src="index.js"></script>
 </body>
 </html>

+ 1 - 1
src/view-browser.js → src/index.js

@@ -3,7 +3,7 @@
 /* eslint "no-global-assign": ["error", {"exceptions": [ "TextDecoder", "TextEncoder" ] } ] */
 /* global view */
 
-var host = host || {};
+var host = {};
 
 host.BrowserHost = class {
 

+ 1 - 1
src/server.py

@@ -56,7 +56,7 @@ class HTTPRequestHandler(BaseHTTPRequestHandler):
                     meta.append("<meta name='version' content='" + __version__ + "' />")
                 if self.file:
                     meta.append("<meta name='file' content='/data/" + self.file + "' />")
-                with codecs.open(location + 'view-browser.html', mode="r", encoding="utf-8") as open_file:
+                with codecs.open(location + 'index.html', mode="r", encoding="utf-8") as open_file:
                     buffer = open_file.read()
                 buffer = buffer.replace('<!-- meta -->', '\n'.join(meta))
                 buffer = buffer.encode('utf-8')